aggregatefilter.hh
来自「COPE the first practical network coding 」· HH 代码 · 共 86 行
HH
86 行
#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 + =
减小字号Ctrl + -
显示快捷键?