A wrapper for NetworkInterface that makes the host-side interface asynchronous: instead of returning received datagrams immediately (from the recv_frame
method), it stores them for later retrieval. Otherwise, behaves identically to the underlying implementation of NetworkInterface.
More...
#include <router.hh>
A wrapper for NetworkInterface that makes the host-side interface asynchronous: instead of returning received datagrams immediately (from the recv_frame
method), it stores them for later retrieval. Otherwise, behaves identically to the underlying implementation of NetworkInterface.
Definition at line 14 of file router.hh.
◆ AsyncNetworkInterface()
◆ datagrams_out()
Access queue of Internet datagrams that have been received.
Definition at line 38 of file router.hh.
◆ NetworkInterface()
NetworkInterface::NetworkInterface |
Construct a network interface with given Ethernet (network-access-layer) and IP (internet-layer) addresses.
- Parameters
-
[in] | ethernet_address | Ethernet (what ARP calls "hardware") address of the interface |
[in] | ip_address | IP (what ARP calls "protocol") address of the interface |
Definition at line 23 of file network_interface.cc.
◆ recv_frame()
void AsyncNetworkInterface::recv_frame |
( |
const EthernetFrame & |
frame | ) |
|
|
inline |
Receives and Ethernet frame and responds appropriately.
- If type is IPv4, pushes to the
datagrams_out
queue for later retrieval by the owner.
- If type is ARP request, learn a mapping from the "sender" fields, and send an ARP reply.
- If type is ARP reply, learn a mapping from the "target" fields.
- Parameters
-
[in] | frame | the incoming Ethernet frame |
Definition at line 30 of file router.hh.
◆ _datagrams_out
The documentation for this class was generated from the following file: