]> git.tdb.fi Git - netvis.git/blobdiff - source/port.h
Handle ICMP packets
[netvis.git] / source / port.h
index 4ce9427fc6df5b6913afd0743e8a8fb38dbe9a22..7fdd87e9a3b49cc70ec95101bea9197d835ce8e1 100644 (file)
@@ -11,6 +11,7 @@ Distributed unter the GPL
 #include <string>
 #include <msp/gl/color.h>
 #include <msp/gl/mesh.h>
+#include "activity.h"
 
 class NetVis;
 
@@ -23,15 +24,22 @@ private:
        std::string name;
        Msp::GL::Color color;
        Msp::GL::Mesh mesh;
+       Activity activity;
 
 public:
        Port(NetVis &, unsigned);
 
        unsigned get_number() const { return number; }
        bool is_registered() const { return registered; }
+       void set_name(const std::string &);
        const std::string &get_name() const { return name; }
        const Msp::GL::Color &get_color() const { return color; }
 
+       void add_activity(unsigned);
+       float get_activity() const { return activity.get_average(); }
+
+       void tick(const Msp::Time::TimeDelta &);
+
        void render() const;
 };