📄 tosimtrace.hh
字号:
#ifndef CLICK_TONSTRACE_HH#define CLICK_TONSTRACE_HH#include <click/element.hh>#include <click/router.hh>#include "simpacketanalyzer.hh"CLICK_DECLS/*=cToSimTrace()=s tracesadds trace entries to an ns2 trace file=ioOne input, one output=dThis element allows you to add trace entries to an ns2 trace file. The eventid is used to set "r" (receive), "f" (forward), "D" (drop), "s" (send) orany other id. The timestamp is set to the current time. The packet lengththat is traced is obtained from packet->length(). Additional info is addedbehind the entry. This is not ns2 default behaviour, but since the packetsare traced as raw at the ns2 level, ToSimTrace traces the packets as rawas well, but to distinguish you can add the packet type in additional info oruse a SimPacketAnalyzer).=aSimPacketAnalyzer*/class ToSimTrace:public Element{public: ToSimTrace(); ~ToSimTrace(); const char* class_name() const { return "ToSimTrace"; } const char* processing() const { return PUSH; } const char* port_count() const { return PORTS_1_1; } int configure(Vector<String> &conf, ErrorHandler *errh); void push(int, Packet *packet);private: String event_; String additional_info_; SimPacketAnalyzer *_packetAnalyzer; String _encap; int _offset; bool _checkPaint;};CLICK_ENDDECLS#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -