X-Git-Url: https://git.llucax.com/z.facultad/75.74/practicos.git/blobdiff_plain/51f24d14e8c4c52776a98c8e2aaacf95f90ad1f4..ac1d74a402f344ad8135f125cbac73ecda46172e:/practicas/pipi/src/ipin.h?ds=sidebyside diff --git a/practicas/pipi/src/ipin.h b/practicas/pipi/src/ipin.h index 5d0d7a8..8a452b2 100644 --- a/practicas/pipi/src/ipin.h +++ b/practicas/pipi/src/ipin.h @@ -19,6 +19,15 @@ struct IPIn /// Dispositivo de red Dev& dev; + /// Cola para forwardear paquetes + Dev& forward_que; + + /// Indica si es un router + bool router; + + /// Indica si hace forwarding + bool forward; + /// Dispositivo de logging std::ostream& log; @@ -39,14 +48,15 @@ struct IPIn buffer_type buffer; /// Constructor - IPIn(const IPAddr& ip, Dev& dev, std::ostream& log = std::cout); + IPIn(const IPAddr& ip, Dev& dev, Dev& forward_que, bool router = false, + bool forward = false, std::ostream& log = std::cout); /// Descarta un paquete void drop(const std::string& msg, const std::string& buf); void drop(const std::string& msg, const IPHeader& iph); /// Recibe un paquete IP - std::string recv(uint8_t proto, IPAddr& src, IPAddr& dst) + std::string recv(uint8_t& proto, IPAddr& src, IPAddr& dst) throw (std::runtime_error); // Nada de andar copiando placas...