delayshaper.hh
来自「COPE the first practical network coding 」· HH 代码 · 共 72 行
HH
72 行
// -*- c-basic-offset: 4 -*-#ifndef CLICK_DELAYSHAPER_HH#define CLICK_DELAYSHAPER_HH#include <click/element.hh>#include <click/timer.hh>#include <click/notifier.hh>CLICK_DECLS/*=cDelayShaper(DELAY)=s packet schedulingshapes traffic to meet delay requirements=dPulls packets from the single input port. Delays them for at least DELAYseconds, with microsecond precision. A packet with timestamp T will be emittedno earlier than time (T + DELAY). On output, the packet's timestamp is set tothe current time.Differs from DelayUnqueue in that both its input and output are pull. Packetsbeing delayed are enqueued until the necessary time has passed. At most onepacket is enqueued at a time. DelayUnqueue returns null for every pull requestuntil the enqueued packet is ready.SetTimestamp element can be used to stamp the packet.=h delay read/writeReturns or sets the DELAY parameter.=a BandwidthShaper, DelayUnqueue, SetTimestamp */class DelayShaper : public Element, public ActiveNotifier { public: DelayShaper(); ~DelayShaper(); const char *class_name() const { return "DelayShaper"; } const char *processing() const { return PULL; } void *cast(const char *); int configure(Vector<String> &, ErrorHandler *); int initialize(ErrorHandler *); void cleanup(CleanupStage); void add_handlers(); Packet *pull(int); void run_timer(); // from ActiveNotifier SearchOp notifier_search_op(); private: Packet *_p; Timestamp _delay; Timer _timer; NotifierSignal _upstream_signal; static String read_param(Element *, void *); static int write_param(const String &, Element *, void *, ErrorHandler *); };CLICK_ENDDECLS#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?