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

📄 timedsource.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_TIMEDSOURCE_HH#define CLICK_TIMEDSOURCE_HH#include <click/element.hh>#include <click/timer.hh>CLICK_DECLS/*=cTimedSource([INTERVAL, DATA, I<KEYWORDS>])=s basicsourcesperiodically generates a packet=dCreates packets consisting of DATA. Pushes such a packet out its single outputabout once every INTERVAL seconds. DefaultINTERVAL is 500 milliseconds; default DATA is at least 64 bytes long.Keyword arguments are:=over 8=item DATAString. Same as the DATA argument.=item INTERVALTime. Same as the INTERVAL argument.=item LIMITInteger. Stops sending after LIMIT packets are generated; but if LIMIT isnegative, sends packets forever.=item HEADROOMUnsigned integer. Sets the amount of headroom on generated packets. Default isthe default packet headroom.=item STOPBoolean. If true, then stop the driver once LIMIT packets are sent. Default isfalse.=back=e  TimedSource(INTERVAL 0.333) -> ...=h data read/writeReturns or sets the DATA parameter.=h interval read/writeReturns or sets the INTERVAL parameter.=a InfiniteSource */class TimedSource : public Element { public:  TimedSource();  ~TimedSource();  const char *class_name() const		{ return "TimedSource"; }  const char *port_count() const		{ return PORTS_0_1; }  const char *processing() const		{ return PUSH; }  int configure(Vector<String> &, ErrorHandler *);  int initialize(ErrorHandler *);  void cleanup(CleanupStage);  void add_handlers();  void run_timer(Timer *); private:    Packet *_packet;    Timestamp _interval;    int _limit;    int _count;    bool _active;    bool _stop;    Timer _timer;    String _data;    uint32_t _headroom;    enum { h_data, h_interval, h_active, h_reset, h_headroom };    static String read_param(Element *, void *);    static int change_param(const String &, Element *, void *, ErrorHandler *);};CLICK_ENDDECLS#endif

⌨️ 快捷键说明

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