#include "ipaddr.h"
#include "ipheader.h"
#include "dev.h"
-#include <iostream>
+#include <map>
#include <string>
+#include <iostream>
#include <stdexcept>
/// IP de recepción
/// Dispositivo de logging
std::ostream& log;
+ /// Buffers de recepción
+ struct BufferKey
+ {
+ uint16_t id;
+ uint32_t src, dst;
+ uint8_t proto;
+ BufferKey(const IPHeader& h):
+ id(h.id), src(h.src), dst(h.dst), proto(h.proto)
+ {}
+ bool operator< (const BufferKey& b) const
+ { return id < b.id && src < b.src && dst < b.dst && proto < b.proto; }
+ };
+ typedef std::map< uint16_t, std::string > offsetmap_type;
+ typedef std::map< BufferKey, offsetmap_type > buffer_type;
+ buffer_type buffer;
+
/// Constructor
IPIn(const IPAddr& ip, Dev& dev, std::ostream& log = std::cout);