KENSv3
KAIST Educational Network System
Public Member Functions | List of all members
E::RoutingInfoInterface Class Reference

This class provides routing info interface for HostModules. More...

#include <E_RoutingInfo.hpp>

Inheritance diagram for E::RoutingInfoInterface:
E::Ethernet E::PWOSPFAssignment E::RIPAssignment E::TCPAssignment

Public Member Functions

 RoutingInfoInterface (Host &host)
 
void setIPAddr (const ipv4_t &ip, int port)
 
void setMACAddr (const mac_t &mac, int port)
 
void setARPTable (const mac_t &mac, const ipv4_t &ipv4)
 Add (MAC,IP) entry to its ARP table. More...
 
void setRoutingTable (const ipv4_t &mask, int prefix, int port)
 
std::optional< ipv4_t > getIPAddr (int port)
 
std::optional< mac_t > getMACAddr (int port)
 
std::optional< mac_t > getARPTable (const ipv4_t &ipv4)
 
int getRoutingTable (const ipv4_t &ip_addr)
 

Detailed Description

This class provides routing info interface for HostModules.

Member Function Documentation

◆ getARPTable()

std::optional< mac_t > E::RoutingInfoInterface::getARPTable ( const ipv4_t &  ipv4)
Parameters
ipv4IP address to find its corresponding MAC address.
Returns
MAC address if successful.
Note
You cannot override this function.

◆ getIPAddr()

std::optional< ipv4_t > E::RoutingInfoInterface::getIPAddr ( int  port)
Parameters
portInterface index to retrieve its IP address.
Returns
IP address if successful.
Note
You cannot override this function.

◆ getMACAddr()

std::optional< mac_t > E::RoutingInfoInterface::getMACAddr ( int  port)
Parameters
portInterface index to retrieve its MAC address.
Returns
MAC address if successful.
Note
You cannot override this function.

◆ getRoutingTable()

int E::RoutingInfoInterface::getRoutingTable ( const ipv4_t &  ip_addr)
Parameters
ip_bufferIP address to find its destination.
Returns
Interface index to this packet should go to.
Note
You cannot override this function.

◆ setARPTable()

void E::RoutingInfoInterface::setARPTable ( const mac_t &  mac,
const ipv4_t &  ipv4 
)

Add (MAC,IP) entry to its ARP table.

Parameters
macMAC address.
ipIP address.
Note
You cannot override this function.

◆ setIPAddr()

void E::RoutingInfoInterface::setIPAddr ( const ipv4_t &  ip,
int  port 
)
Parameters
ipIP address.
portInterface index to bind the given IP address.
Note
You cannot override this function.

◆ setMACAddr()

void E::RoutingInfoInterface::setMACAddr ( const mac_t &  mac,
int  port 
)
Parameters
macMAC address.
portInterface index to bind the given MAC address.
Note
You cannot override this function.

◆ setRoutingTable()

void E::RoutingInfoInterface::setRoutingTable ( const ipv4_t &  mask,
int  prefix,
int  port 
)
Parameters
maskIP address mask.
prefixPrefix length for routing.
portInterface index to bind the given routing entry.
Note
You cannot override this function.

The documentation for this class was generated from the following files: