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

📄 infinitesource.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_INFINITESOURCE_HH#define CLICK_INFINITESOURCE_HH#include <click/element.hh>#include <click/task.hh>#include <click/notifier.hh>CLICK_DECLS/*=cInfiniteSource([DATA, LIMIT, BURST, ACTIVE, I<KEYWORDS>])=s basicsourcesgenerates packets whenever scheduled=dCreates packets consisting of DATA. Pushes BURST such packets out its singleoutput every time it is scheduled (which will be often). Stops sending afterLIMIT packets are generated; but if LIMIT is negative, sends packets forever.Will send packets only if ACTIVE is true. (ACTIVE is true by default.) DefaultDATA is at least 64 bytes long. Default LIMIT is -1 (send packets forever).Default BURST is 1.Keyword arguments are:=over 8=item DATAString. Same as the DATA argument.=item LENGTHInteger. If set, the outgoing packet will have this length.=item LIMITInteger. Same as the LIMIT argument.=item BURSTInteger. Same as the BURST argument.=item ACTIVEBoolean. Same as the ACTIVE argument.=item STOPBoolean. If true, then stop the driver once LIMIT packets are sent. Default isfalse.=backTo generate a particular traffic pattern, use this element and RatedSourcein conjunction with PokeHandlers.=e  InfiniteSource(\<0800>) -> Queue -> ...=nUseful for profiling and experiments.  Packets' timestamp annotations are setto the current time.InfiniteSource listens for downstream full notification.=h count read-onlyReturns the total number of packets that have been generated.=h reset write-onlyResets the number of generated packets to 0. The InfiniteSource will thengenerate another LIMIT packets (if it is active).=h data read/writeReturns or sets the DATA parameter.=h length read/writeReturns or sets the LENGTH parameter.=h limit read/writeReturns or sets the LIMIT parameter.=h burst read/writeReturns or sets the BURST parameter.=h active read/writeMakes the element active or inactive.=aRatedSource, PokeHandlers */class InfiniteSource : public Element, public ActiveNotifier { public:  InfiniteSource();  ~InfiniteSource();  const char *class_name() const		{ return "InfiniteSource"; }  void *cast(const char *);  const char *port_count() const		{ return PORTS_0_1; }  const char *processing() const		{ return AGNOSTIC; }  const char *flags() const			{ return "S1"; }  void add_handlers();  int configure(Vector<String> &, ErrorHandler *);  int initialize(ErrorHandler *);  bool can_live_reconfigure() const		{ return true; }  void cleanup(CleanupStage);  bool run_task(Task *);  Packet *pull(int); protected:  void setup_packet();  Packet *_packet;  int _burstsize;  int _limit;  int _count;  int _datasize;  bool _active;  bool _stop;  Task _task;  String _data;  NotifierSignal _nonfull_signal;  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 + -