KENSv3
KAIST Educational Network System
Classes | Public Types | Public Member Functions | Friends | List of all members
E::Host Class Reference

This class abstract a single host machine. More...

#include <E_Host.hpp>

Inheritance diagram for E::Host:
E::NetworkModule E::NetworkLog E::RoutingInfo E::Module

Classes

class  PacketPass
 
class  Return
 
class  Syscall
 
class  Timer
 

Public Types

using Domain = int
 
using Protocol = int
 
using Namespace = std::pair< Domain, Protocol >
 
- Public Types inherited from E::Module
using Message = std::unique_ptr< MessageBase >
 
- Public Types inherited from E::NetworkLog
enum  LOG_LEVEL {
  PACKET_TO_MODULE = 0UL , PACKET_FROM_MODULE , PACKET_TO_HOST , PACKET_FROM_HOST ,
  PACKET_ALLOC , PACKET_CLONE , PACKET_FREE , PACKET_QUEUE ,
  PACKET_DROPPED , SYSCALL_RAISED , SYSCALL_FINISHED , SYSCALL_BLOCKED ,
  SYSCALL_UNBLOCKED , SYSCALL_ERROR , APPLICATION_RETRUN , MODULE_ERROR ,
  PROTOCOL_ERROR , PROTOCOL_WARNING , TCP_LOG , LEVEL_COUNT
}
 Enumerations for log levels.
 

Public Member Functions

 Host (std::string name, NetworkSystem &system)
 
virtual int cleanUp (void) final
 
virtual bool isRunning (void) final
 
template<typename T , typename... Args>
void addHostModule (Args &&...args)
 
template<typename T , typename... Args>
int addApplication (Args &&...args)
 
void initializeHostModule (const char *name)
 
void finalizeHostModule (const char *name)
 
void launchApplication (int pid)
 
std::any diagnoseHostModule (const char *name, std::any param)
 
Size getWireSpeed (int port_num)
 
virtual void sendPacket (size_t portIndex, Packet &&packet) final
 
- Public Member Functions inherited from E::NetworkModule
 NetworkModule (System &system)
 
int connectWire (const ModuleID moduleID)
 
size_t getPortCount ()
 
- Public Member Functions inherited from E::Module
 Module (System &system)
 Module must belong to a System. Module is registered to a System when it is created. More...
 
std::string getModuleName ()
 
std::string getModuleName (const ModuleID moduleID)
 
Time getCurrentTime ()
 
- Public Member Functions inherited from E::NetworkLog
 NetworkLog (System &system)
 Constructs a NetworkLog instance. More...
 
 NetworkLog (System &system, uint64_t level)
 Constructs a NetworkLog instance with log level. More...
 
 ~NetworkLog ()
 Destructs a NetworkLog instance.
 
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...
 
void vprint_log (uint64_t level, const char *format, va_list args)
 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...
 
- Public Member Functions inherited from E::RoutingInfo
virtual void setIPAddr (const ipv4_t &ip, int port) final
 
virtual void setMACAddr (const mac_t &mac, int port) final
 
virtual void setARPTable (const mac_t &mac, const ipv4_t &ipv4) final
 Add (MAC,IP) entry to its ARP table. More...
 
virtual void setRoutingTable (const ipv4_t &mask, int prefix, int port) final
 
virtual std::optional< ipv4_t > getIPAddr (int port) final
 
virtual std::optional< mac_t > getMACAddr (int port) final
 
virtual std::optional< mac_t > getARPTable (const ipv4_t &ipv4) final
 
virtual int getRoutingTable (const ipv4_t &ip_addr) final
 

Friends

void HostModule::sendPacket (std::string toModule, Packet &&packet)
 
void SystemCallInterface::returnSystemCall (UUID syscallUUID, int val)
 
int SystemCallInterface::createFileDescriptor (int processID)
 
void SystemCallInterface::removeFileDescriptor (int processID, int fd)
 
int SystemCallApplication::E_Syscall (const SystemCallInterface::SystemCallParameter &param)
 
void SystemCallApplication::finalizeApplication (int returnValue)
 
UUID TimerModule::addTimer (std::any payload, Time timeAfter)
 
void TimerModule::cancelTimer (UUID key)
 

Additional Inherited Members

- Static Public Attributes inherited from E::NetworkLog
static uint64_t defaultLevel
 Default log level. More...
 
- Protected Member Functions inherited from E::Module
virtual UUID sendMessage (const ModuleID to, Module::Message message, Time timeAfter) final
 Send a Message to other Module. Every message has its own delay before it is actually sent. The System guarantees the total ordering of all delayed messages in the System. More...
 
virtual UUID sendMessageSelf (Module::Message message, Time timeAfter) final
 Send a Message to self Every message has its own delay before it is actually sent. The System guarantees the total ordering of all delayed messages in the System. More...
 
virtual bool cancelMessage (UUID messageID) final
 Cancel the raised Message. If a message is not actually sent yet, you can cancel the message. If the message is already sent, this function has no effect. More...
 
- Protected Attributes inherited from E::NetworkModule
std::vector< ModuleID > ports
 

Detailed Description

This class abstract a single host machine.


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