print.hh

来自「Click is a modular router toolkit. To us」· HH 代码 · 共 101 行

HH
101
字号
#ifndef CLICK_PRINT_HH#define CLICK_PRINT_HH#include <click/element.hh>#include <click/string.hh>CLICK_DECLS/*=cPrint([LABEL, MAXLENGTH, I<keywords>])=s debuggingprints packet contents=dPrints up to MAXLENGTH bytes of data from each packet, in hex, preceded by theLABEL text. Default MAXLENGTH is 24.Keyword arguments are:=over 8=item MAXLENGTHMaximum number of content bytes to print. If negative, print entirepacket. Default is 24.=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 `HEX'.=item TIMESTAMPBoolean. Determines whether to print each packet's timestamp in seconds since1970. Default is false.=item PRINTANNOBoolean. Determines whether to print each packet's user annotation bytes.  Default is false.=item CPUBoolean; available only in the Linux kernel module. Determines whether toprint the current CPU ID for every packet. Default is false.=item HEADROOMBoolean.  Determines whether to print each packet's headroom and tailroom, inthe format "(h[headroom] t[tailroom])".  Defaut is false.=item ACTIVEBoolean. If false, don't print messages. Default is true.=back=h active read/writeReturns or sets the ACTIVE parameter.=aIPPrint */class Print : public Element { public:    Print();    ~Print();    const char *class_name() const		{ return "Print"; }    const char *port_count() const		{ return PORTS_1_1; }    const char *processing() const		{ return AGNOSTIC; }    int configure(Vector<String> &, ErrorHandler *);    bool can_live_reconfigure() const		{ return true; }    void add_handlers();    Packet *simple_action(Packet *); private:    String _label;    int _bytes;		// How many bytes of a packet to print    bool _active;    bool _timestamp : 1;    bool _headroom : 1;#ifdef CLICK_LINUXMODULE    bool _cpu : 1;#endif    bool _print_anno;    uint8_t _contents;};CLICK_ENDDECLS#endif

⌨️ 快捷键说明

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