KENSv3
KAIST Educational Network System
Public Member Functions | Protected Member Functions | List of all members
E::RIPAssignment Class Reference
Inheritance diagram for E::RIPAssignment:
E::HostModule E::RoutingInfoInterface E::TimerModule

Public Member Functions

 RIPAssignment (Host &host)
 
Size ripQuery (const ipv4_t &ipv4)
 Query cost for a host. More...
 
Size linkCost (int port_num)
 Get cost for local port (link) More...
 
virtual void initialize ()
 This function is automatically called by Host just before the simulation begins. You can override this function if needed.
 
virtual void finalize ()
 This function is automatically called by Host just after the simulation ends. You can override this function if needed.
 
- Public Member Functions inherited from E::HostModule
 HostModule (std::string name, Host &host)
 Create a HostModule. It is automatically registered to the Host. Module is registered to a System when it is created. More...
 
virtual std::string getHostModuleName () final
 

Protected Member Functions

virtual std::any diagnose (std::any param) final
 Host module control function.
 
virtual void packetArrived (std::string fromModule, Packet &&packet) final
 This function is automatically called by Host when this module receives a Packet. You must override this function to handle Packet events. When a Packet is received, you must FREE IT OR PASS IT TO OTHER HOSTMODULE. More...
 
- Protected Member Functions inherited from E::HostModule
virtual void sendPacket (std::string toModule, Packet &&packet) final
 This function transfers Packets among HostModules in the Host. Unlike Module::Message, we use fire-and-forget policy with Packets. Once you send a Packet using sendPacket, you DO NOT HAVE TO FREE THAT PACKET. More...
 
void sendPacket (std::string toModule, const Packet &packet)
 
Time getCurrentTime ()
 
Size getWireSpeed (int port_num)
 Get cost for local port (link) More...
 
size_t getPortCount ()
 Get the number of ports. More...
 
void print_log (uint64_t level, const char *format,...)
 Prints log with specified log level and format. NetworkLog::print_log prints logs specified in log level parameter. For example, if log level is set to TCP_LOG, it only prints TCP_LOG logs. If you want to print multiple log levels in NetworkLog, you can set log level with OR operation (i.e. SYSCALL_ERROR | MODULE_ERROR). More...
 
- Protected Member Functions inherited from E::TimerModule
 TimerModule (std::string name, Host &host)
 
virtual std::string getTimerModuleName () final
 
virtual UUID addTimer (std::any payload, Time timeAfter) final
 Request an alarm that rings after specified time. More...
 
virtual void cancelTimer (UUID key) final
 Cancel the timer request. More...
 

Member Function Documentation

◆ linkCost()

Size E::RIPAssignment::linkCost ( int  port_num)
inline

Get cost for local port (link)

Parameters
port_numquerying port's number
Returns
local link cost

◆ packetArrived()

void E::RIPAssignment::packetArrived ( std::string  fromModule,
Packet &&  packet 
)
finalprotectedvirtual

This function is automatically called by Host when this module receives a Packet. You must override this function to handle Packet events. When a Packet is received, you must FREE IT OR PASS IT TO OTHER HOSTMODULE.

Parameters
fromModuleName of the HostModule who sent this packet.
packetReceived packet.

Implements E::HostModule.

◆ ripQuery()

Size E::RIPAssignment::ripQuery ( const ipv4_t &  ipv4)

Query cost for a host.

Parameters
ipv4querying host's IP address
Returns
cost or -1 for no found host

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