📄 timefilter.hh
字号:
// -*- mode: c++; c-basic-offset: 4 -*-#ifndef CLICK_TIMEFILTER_HH#define CLICK_TIMEFILTER_HH#include <click/element.hh>CLICK_DECLSclass HandlerCall;/*=cTimeFilter(I<keywords START, START_AFTER, START_DELAY, END, END_AFTER, END_DELAY, INTERVAL, STOP, END_CALL>)=s analysisfilter packets by timestamp=dTimeFilter passes packets through only if they lie within a timestamp range.You can specify that range absolutely or relative to the first timestampTimeFilter sees.Keyword arguments are:=over 8=item STARTI<T> is absolute time in seconds since the epoch. Output packets withtimestamps at least I<T>.=item START_AFTERI<T> is relative time in seconds (or use suffixes like `ms', `hr'). Outputpackets with timestamps at least I<T> seconds after the first packet seen.=item START_DELAYI<T> is relative time. Output packets with timestamps at least I<T> secondsafter initialize time.=item ENDI<T> is absolute time. Output packets with timestamps up to I<T>.=item END_AFTERI<T> is relative time. Output packets with timestamps up to I<T> seconds afterthe first packet seen.=item END_DELAYI<T> is relative time. Output packets with timestamps up to I<T> seconds afterinitialize time.=item INTERVALI<T> is relative time. Output packets for I<T> seconds after the start time,as specified by START or START_AFTER.=item STOPBoolean. If true, stop the driver once the end time is exceeded. Default isfalse.=item END_CALLSpecifies a write handler to call when the first packet after END is seen.STOP and END_CALL are mutually exclusive.=backSupply at most one of START, START_AFTER, and START_DELAY, and at most one ofEND, END_AFTER, END_DELAY, and INTERVAL.=aSetTimestamp */class TimeFilter : public Element { public: TimeFilter(); ~TimeFilter(); const char *class_name() const { return "TimeFilter"; } const char *processing() const { return "a/ah"; } void notify_noutputs(int); int configure(Vector<String> &, ErrorHandler *); int initialize(ErrorHandler *); void add_handlers(); Packet *simple_action(Packet *); private: Timestamp _first; Timestamp _last; bool _ready : 1; bool _first_relative : 1; bool _first_init_relative : 1; bool _last_relative : 1; bool _last_init_relative : 1; bool _last_interval : 1; bool _last_h_ready : 1; HandlerCall *_last_h; void first_packet(const Timestamp&); Packet *kill(Packet *); static int write_handler(const String &, Element *, void*, ErrorHandler *);};CLICK_ENDDECLS#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -