#ifndef CLICK_AGGREGATEFIRST_HH #define CLICK_AGGREGATEFIRST_HH #include #include "aggregatenotifier.hh" CLICK_DECLS /* =c AggregateFirst([I]) =s aggregates lets through first packet per aggregate annotation =d AggregateFirst forwards only the first packet with a given aggregate annotation value. Second and subsequent packets with that aggregate annotation are emitted on the second output, if it exists, or dropped if it does not. Keyword arguments are: =over 8 =item NOTIFIER The name of an AggregateNotifier element, like AggregateIPFlows. If given, then AggregateFirst will prune information about old aggregates. This can save significant memory on long traces. =back =n AggregateLast forwards the last packet with a given aggregate annotation value, and additionally annotates the packet with the observed packet and byte counts. It takes significantly more memory, however. Only available in user-level processes. =a AggregateLast, AggregateIP, AggregateIPFlows, AggregateCounter, AggregateFilter */ class AggregateFirst : public Element, public AggregateListener { public: AggregateFirst(); ~AggregateFirst(); const char *class_name() const { return "AggregateFirst"; } const char *port_count() const { return "1/1-2"; } const char *processing() const { return "a/ah"; } int configure(Vector &, ErrorHandler *); int initialize(ErrorHandler *); void cleanup(CleanupStage); inline Packet *smaction(Packet *); void push(int, Packet *); Packet *pull(int); void aggregate_notify(uint32_t, AggregateEvent, const Packet *); private: enum { ROW_BITS = 10, ROW_SHIFT = 0, NROW = 1<> PLANE_SHIFT) & PLANE_MASK]) if (uint32_t *c = p[(agg >> COL_SHIFT) & COL_MASK]) return c; return create_row(agg); } CLICK_ENDDECLS #endif