discard.hh

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

HH
67
字号
#ifndef CLICK_DISCARD_HH#define CLICK_DISCARD_HH#include <click/element.hh>#include <click/task.hh>#include <click/notifier.hh>CLICK_DECLS/*=cDiscard=s basicsourcesdrops all packets=dDiscards all packets received on its single input. If used in a pull context,it initiates pulls whenever packets are available, and listens for activitynotification, such as that available from Queue.=h count read-onlyReturns the number of packets discarded.=h reset_counts write-onlyResets "count" to 0.=a Queue */class Discard : public Element { public:  Discard();  ~Discard();  const char *class_name() const		{ return "Discard"; }  const char *port_count() const		{ return PORTS_1_0; }  const char *processing() const		{ return AGNOSTIC; }  int initialize(ErrorHandler *);  void add_handlers();  void push(int, Packet *);  bool run_task(Task *); protected:  Task _task;  NotifierSignal _signal;#if HAVE_INT64_TYPES    typedef uint64_t counter_t;#else    typedef uint32_t counter_t;#endif    counter_t _count;    static String read_handler(Element *, void *);    static int write_handler(const String &, Element *, void *, ErrorHandler *);};CLICK_ENDDECLS#endif

⌨️ 快捷键说明

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