📄 aggregatefilter.hh
字号:
#ifndef CLICK_AGGREGATEFILTER_HH#define CLICK_AGGREGATEFILTER_HH#include <click/element.hh>CLICK_DECLS/*=cAggregateFilter(ACTION_1 AGGREGATES, ..., ACTION_N AGGREGATES)=s classification, analysisfilters packets based on aggregate annotation=dFilters packets based on their aggregate annotations. AggregateFilter'sconfiguration string is an arbitrary number of filters, which areACTION-AGGREGATES pairs. Packets are tested against the filters in order andprocessed according to the ACTION in the first filter that matched. A packetmatches a filter if its aggregate annotation is listed in that filter'sAGGREGATES.Each ACTION is either a port number, which specifies that the packet should besent out on that port; 'allow', which is equivalent to '0'; or 'drop' or'deny', which means drop the packet. Packets that match none of the filtersare dropped. AggregateFilter has an arbitrary number of outputs.The AGGREGATES arguments are space-separated lists of aggregate values, whichare unsigned integers. You can also specify ranges like '0-98'. The specialAGGREGATES 'all' and '-' both correspond to all aggregates.AggregateFilter will warn about aggregate filters that match no packets, orAGGREGATES components that were ignored (because of an earlier filter matchingthe same aggregate).=eThis configuration filters out a couple aggregates from the output of AggregateIPFlows. require(aggregates) FromDump(~/work/traces/2x10^5.dmp, STOP true, FORCE_IP true) -> AggregateIPFlows(ICMP true) -> AggregateFilter(allow 1093 3500 972 865 1765 988 1972 1225) -> ...=aIPFilter, Classifier, IPClassifier, AggregateIP, AggregateIPFlows */class AggregateFilter : public Element { public: AggregateFilter(); ~AggregateFilter(); const char *class_name() const { return "AggregateFilter"; } const char *processing() const { return PUSH; } void notify_noutputs(int); int configure(Vector<String> &, ErrorHandler *); void cleanup(CleanupStage); void push(int, Packet *); enum { GROUPSHIFT = 8, GROUPMASK = 0xFFFFFFFFU << GROUPSHIFT, NINGROUP = 1 << GROUPSHIFT, INGROUPMASK = NINGROUP - 1, NBUCKETS = 256 }; private: struct Group { uint32_t groupno; Group *next; uint8_t filters[NINGROUP]; Group(uint32_t); }; Group *_groups[NBUCKETS]; int _default_output; Group *find_group(uint32_t); };#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -