19 /// Dispositivo de red
22 /// Cola para forwardear paquetes
25 /// Indica si es un router
28 /// Indica si hace forwarding
31 /// Dispositivo de logging
34 /// Buffers de recepción
40 BufferKey(const IPHeader& h):
41 id(h.id), src(h.src), dst(h.dst), proto(h.proto)
43 bool operator< (const BufferKey& b) const
44 { return id < b.id && src < b.src && dst < b.dst && proto < b.proto; }
46 typedef std::map< uint16_t, std::string > offsetmap_type;
47 typedef std::map< BufferKey, offsetmap_type > buffer_type;
51 IPIn(const IPAddr& ip, Dev& dev, Dev& forward_que, bool router = false,
52 bool forward = false, std::ostream& log = std::cout);
54 /// Descarta un paquete
55 void drop(const std::string& msg, const std::string& buf);
56 void drop(const std::string& msg, const IPHeader& iph);
58 /// Recibe un paquete IP
59 std::string recv(uint8_t& proto, IPAddr& src, IPAddr& dst)
60 throw (std::runtime_error);
62 // Nada de andar copiando placas...
65 IPIn& operator=(const IPIn&);
71 // vim: set et sw=4 sts=4 :