"Fossies" - the Fresh Open Source Software Archive

Member "tcpflow-1.6.1/src/netviz/address_histogram.h" (19 Feb 2021, 940 Bytes) of package /linux/misc/tcpflow-1.6.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "address_histogram.h" see the Fossies "Dox" file reference documentation.

    1 /**
    2  * address histogram class.
    3  *
    4  * This source file is public domain, as it is not based on the original tcpflow.
    5  *
    6  * Author: Michael Shick <mike@shick.in>
    7  *
    8  */
    9 
   10 #ifndef ADDRESS_HISTOGRAM_H
   11 #define ADDRESS_HISTOGRAM_H
   12 
   13 #include "iptree.h"
   14 
   15 class address_histogram {
   16 public:
   17     address_histogram(const iptree &tree);
   18 
   19     class iptree_node_comparator {
   20     public:
   21         bool operator()(const iptree::addr_elem &a, const iptree::addr_elem &b);
   22     };
   23 
   24     static const size_t bucket_count;
   25 
   26     const iptree::addr_elem &at(size_t index) const;
   27     size_t size() const;
   28     uint64_t ingest_count() const;
   29 
   30     typedef std::vector<iptree::addr_elem> ipt_addrs;
   31 
   32     ipt_addrs::const_iterator begin() const;
   33     ipt_addrs::const_iterator end() const;
   34     ipt_addrs::const_reverse_iterator rbegin() const;
   35     ipt_addrs::const_reverse_iterator rend() const;
   36 
   37 private:
   38     ipt_addrs buckets;
   39     uint64_t datagrams_ingested;
   40 };
   41 
   42 #endif