⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ipprint.hh

📁 Click is a modular router toolkit. To use it you ll need to know how to compile and install the sof
💻 HH
字号:
#ifndef CLICK_IPPRINT_HH#define CLICK_IPPRINT_HH#include <click/element.hh>CLICK_DECLS/*=cIPPrint([LABEL, I<KEYWORDS>])=s ippretty-prints IP packets=dExpects IP packets as input.  Should be placed downstream of aCheckIPHeader or equivalent element.Prints out IP packets in a human-readable tcpdump-like format, preceded bythe LABEL text.Keyword arguments are:=over 8=item CONTENTSDetermines whether the packet data is printed. It may be `NONE' (do not printpacket data), `HEX' (print packet data in hexadecimal), or `ASCII' (printpacket data in plaintext). Default is `NONE'.=item PAYLOADLike CONTENTS, but prints only the packet payload, rather than the entirepacket. Specify at most one of CONTENTS and PAYLOAD.=item MAXLENGTHIf CONTENTS or PAYLOAD printing is on, then MAXLENGTH determines the maximumnumber of bytes to print. -1 means print the entire packet or payload. Defaultis 1500.=item IDBoolean. Determines whether to print each packet's IP ID field. Default isfalse.=item TTLBoolean. Determines whether to print each packet's IP TOS field. Default isfalse.=item TOSBoolean. Determines whether to print each packet's IP TOS field. Default isfalse.=item LENGTHBoolean. Determines whether to print each packet's IP length field. Default isfalse.=item TIMESTAMPBoolean. Determines whether to print each packet's timestamp in seconds since1970. Default is true.=item AGGREGATEBoolean. Determines whether to print each packet's aggregate annotation.Default is false.=item PAINTBoolean. Determines whether to print each packet's paint annotation. Default is false.=item SWAPBoolean.  Determines whether to swap bytes before printing the valuesof ICMP sequence and ID numbers.  Default is false.  The RFC does notrequire these two-byte values to be sent in any particular byte order.For example, OpenBSD/i386 writes ping (ICMP echo) sequence numbers innetwork byte order, while Linux/i386 writes them in host byte order(often little-endian).=item OUTFILEString. Only available at user level. PrintV<> information to the file specifiedby OUTFILE instead of standard error.=item ACTIVEBoolean.  If false, then don't print messages.  Default is true.=back=a Print, CheckIPHeader */class IPPrint : public Element { public:  IPPrint();  ~IPPrint();  const char *class_name() const		{ return "IPPrint"; }  const char *port_count() const		{ return PORTS_1_1; }  const char *processing() const		{ return AGNOSTIC; }  int configure(Vector<String> &, ErrorHandler *);  int initialize(ErrorHandler *);  void cleanup(CleanupStage);  void add_handlers();  Packet *simple_action(Packet *); private:  bool _swap;  bool _active;  String _label;  int _bytes;			// Number of bytes to dump  bool _print_id : 1;		// Print IP ID?  bool _print_timestamp : 1;  bool _print_paint : 1;  bool _print_tos : 1;  bool _print_ttl : 1;  bool _print_len : 1;  bool _print_aggregate : 1;  bool _payload : 1;		// '_contents' refers to payload  unsigned _contents : 2;	// Whether to dump packet contents#if CLICK_USERLEVEL  String _outfilename;  FILE *_outfile;#endif  ErrorHandler *_errh;    void tcp_line(StringAccum &, const Packet *, int transport_len) const;    void udp_line(StringAccum &, const Packet *, int transport_len) const;    void icmp_line(StringAccum &, const Packet *, int transport_len) const;};CLICK_ENDDECLS#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -