11#include "port_l4virtio.h"
38 std::vector<Port_iface *> _ports;
39 Port_iface *_monitor =
nullptr;
46 static constexpr unsigned Tx_burst = 128;
57 template<
typename REQ>
58 void handle_tx_request(Port_iface *port, REQ
const &request);
60 template<
typename PORT>
61 void handle_tx_requests(PORT *port,
unsigned &num_reqs_handled);
64 void all_rx_notify_emit_and_enable()
66 for (
auto *port : _ports)
67 port->rx_notify_emit_and_enable();
70 void all_rx_notify_disable_and_remember()
72 for (
auto *port: _ports)
73 port->rx_notify_disable_and_remember();
135 bool handle_ixl_port_tx(Ixl_port *port);
149 return _monitor == 0;
151 return _ports.size() < _max_ports;
A Port on the Virtio Net Switch.
Mac_table manages a 1:n association between ports and MAC addresses.
bool port_available(bool monitor)
Is there still a free port on this switch available?
void check_ports()
Check validity of ports.
Virtio_switch(unsigned max_ports)
Create a switch with n ports.
bool add_monitor_port(Port_iface *port)
Add a monitor port to the switch.
bool handle_l4virtio_port_tx(L4virtio_port *port)
Handle TX queue of the given port.
bool add_port(Port_iface *port)
Add a port to the switch.