📄 comparepackets.hh
字号:
// -*- c-basic-offset: 4 -*-#ifndef CLICK_COMPAREPACKETS_HH#define CLICK_COMPAREPACKETS_HH#include <click/element.hh>#include <click/notifier.hh>CLICK_DECLS/*=cComparePackets([I<keywords> TIMESTAMP])=s testcompare packets in pairs=dComparePackets compares packets pulled from the first input with packetspulled from the second input. Packets are considered different if they havedifferent length, data, header offsets, or timestamp annotations.Keyword arguments are:=over 8=item TIMESTAMPBoolean. If true, then ComparePackets will check packet timestampannotations. Default is true.=back=h diffs read-onlyReturns the number of different packet pairs seen.=h diff_details read-onlyReturns a text file showing how many different packet pairs ComparePackets hasseen, subdivided by type of difference.=h all_same read-onlyReturns "true" iff all packet pairs seen so far have been identical.=aPacketTest */class ComparePackets : public Element { public: ComparePackets(); ~ComparePackets(); const char *class_name() const { return "ComparePackets"; } const char *processing() const { return PULL; } int configure(Vector<String> &, ErrorHandler *); int initialize(ErrorHandler *); void cleanup(CleanupStage); void add_handlers(); Packet *pull(int); private: Packet *_p[2]; bool _available[2]; NotifierSignal _signal[2]; bool _timestamp : 1; uint32_t _ndiff; enum { D_LEN, D_DATA, D_TIMESTAMP, D_NETOFF, D_NETLEN, D_NETHDR, D_MORE_PACKETS_0, D_MORE_PACKETS_1, D_LAST }; uint32_t _diff_details[D_LAST]; void check(Packet *, Packet *); static String read_handler(Element *, void *);};CLICK_ENDDECLS#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -