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

📄 packetlogger.hh

📁 COPE the first practical network coding scheme which is developped on click
💻 HH
字号:
#ifndef CLICK_PACKETLOGGER_HH#define CLICK_PACKETLOGGER_HH#include <click/element.hh>#include <click/glue.hh>#include <click/dequeue.hh>CLICK_DECLS/* * =c *  * PacketLogger(ETHERTYPE ethertype) *  * =s Grid *  * Log packets for later dumping/analysis. *  * =d * expects packets with ethernet headers.  records timestamp, source * MAC address, and the first few bytes of every packet to pass through. * the list of recorded data can be dumped by repeated calls to the * read handler 'packets'. * * this is for logging received experiment packets on the roofnet. * * an NBYTES keyword would be nice. * */class PacketLogger : public Element { public:    PacketLogger();  ~PacketLogger();    const char *class_name() const		{ return "PacketLogger"; }  const char *processing() const		{ return AGNOSTIC; }    int configure(Vector<String> &, ErrorHandler *);  bool can_live_reconfigure() const		{ return true; }  Packet *simple_action(Packet *);  void add_handlers();  static String print_log(Element *, void *);  enum { NBYTES = 8 };  struct log_entry {    Timestamp timestamp;    uint8_t src_mac[6];    uint8_t bytes[NBYTES];  };   private:    unsigned int _et;  unsigned int _nb;    DEQueue<log_entry> _p;};CLICK_ENDDECLS#endif

⌨️ 快捷键说明

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