|
Sponge
CS144's user-space TCP library
|
Go to the documentation of this file.
16 template <
typename... Targs>
24 : _ethernet_address(ethernet_address), _ip_address(ip_address) {
26 << ip_address.
ip() <<
"\n";
std::optional< InternetDatagram > recv_frame(const EthernetFrame &frame)
Receives an Ethernet frame and responds appropriately.
void DUMMY_CODE(Targs &&...)
EthernetAddress _ethernet_address
Ethernet (known as hardware, network-access-layer, or link-layer) address of the interface.
Wrapper around IPv4 addresses and DNS operations.
void send_datagram(const InternetDatagram &dgram, const Address &next_hop)
Sends an IPv4 datagram, encapsulated in an Ethernet frame (if it knows the Ethernet destination addre...
uint32_t ipv4_numeric() const
Numeric IP address as an integer (i.e., in host byte order).
void tick(const size_t ms_since_last_tick)
Called periodically when time elapses.
NetworkInterface(const EthernetAddress ðernet_address, const Address &ip_address)
Construct a network interface with given Ethernet (network-access-layer) and IP (internet-layer) addr...
std::string ip() const
Dotted-quad IP address string ("18.243.0.1").