📄 checktcpheader.hh
字号:
#ifndef CLICK_CHECKTCPHEADER_HH#define CLICK_CHECKTCPHEADER_HH#include <click/element.hh>#include <click/atomic.hh>CLICK_DECLS/*=cCheckTCPHeader([I<KEYWORDS>])=s TCP, checkingchecks TCP header on TCP/IP packets=dExpects TCP/IP packets as input. Checks that the TCP header length andchecksum fields are valid. Pushes invalid packets out on output 1, unlessoutput 1 was unused; if so, drops invalid packets.Prints a message to the console the first time it encounters an incorrectpacket (but see VERBOSE below).Keyword arguments are:=over 5=item VERBOSEBoolean. If it is true, then a message will be printed for every erroneouspacket, rather than just the first. False by default.=item DETAILSBoolean. If it is true, then CheckTCPHeader will maintain detailed counts ofhow many packets were dropped for each possible reason, accessible through theC<drop_details> handler. False by default.=back=h drops read-onlyReturns the number of incorrect packets CheckTCPHeader has seen.=h drop_details read-onlyReturns a text file showing how many erroneous packets CheckTCPHeader hasseen, subdivided by error. Only available if the DETAILS keyword argument wastrue.=a CheckIPHeader, CheckUDPHeader, CheckICMPHeader, MarkIPHeader */class CheckTCPHeader : public Element { public: CheckTCPHeader(); ~CheckTCPHeader(); const char *class_name() const { return "CheckTCPHeader"; } const char *processing() const { return "a/ah"; } void notify_noutputs(int); int configure(Vector<String> &, ErrorHandler *); void add_handlers(); Packet *simple_action(Packet *); /* inline Packet *smaction(Packet *); void push(int, Packet *p); Packet *pull(int); */ private: bool _verbose : 1; atomic_uint32_t _drops; atomic_uint32_t *_reason_drops; enum Reason { NOT_TCP, BAD_LENGTH, BAD_CHECKSUM, NREASONS }; static const char *reason_texts[NREASONS]; Packet *drop(Reason, Packet *); static String read_handler(Element *, void *); };CLICK_ENDDECLS#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -