📄 checkicmpheader.hh
字号:
#ifndef CLICK_CHECKICMPHEADER_HH#define CLICK_CHECKICMPHEADER_HH#include <click/element.hh>#include <click/atomic.hh>CLICK_DECLS/*=cCheckICMPHeader([I<KEYWORDS>])=s ICMP, checkingchecks ICMP header on ICMP packets=dExpects ICMP packets as input. Checks that the packet's length is sensibleand that its checksum field is valid. Pushes invalid packets out on output1, unless output 1 was unused; if so, drops invalid packets.Prints a message to the console the first time it encounters an incorrect IPpacket (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 CheckICMPHeader 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 CheckICMPHeader has seen.=h drop_details read-onlyReturns a text file showing how many erroneous packets CheckICMPHeader has seen,subdivided by error. Only available if the DETAILS keyword argument was true.=a CheckIPHeader, CheckTCPHeader, CheckUDPHeader, MarkIPHeader */class CheckICMPHeader : public Element { public: CheckICMPHeader(); ~CheckICMPHeader(); const char *class_name() const { return "CheckICMPHeader"; } const char *processing() const { return "a/ah"; } void notify_noutputs(int); int configure(Vector<String> &, ErrorHandler *); void add_handlers(); Packet *simple_action(Packet *); private: bool _verbose : 1; atomic_uint32_t _drops; atomic_uint32_t *_reason_drops; enum Reason { NOT_ICMP, 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 + -