![]() |
KENSv3
KAIST Educational Network System
|
This class abstract a single host machine. More...
#include <E_Host.hpp>
Classes | |
class | PacketPass |
class | Return |
class | Syscall |
class | Timer |
Public Types | |
using | Domain = int |
using | Protocol = int |
using | Namespace = std::pair< Domain, Protocol > |
![]() | |
using | Message = std::unique_ptr< MessageBase > |
![]() | |
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 |
![]() | |
NetworkModule (System &system) | |
int | connectWire (const ModuleID moduleID) |
size_t | getPortCount () |
![]() | |
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 () |
![]() | |
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... | |
![]() | |
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 ¶m) |
void | SystemCallApplication::finalizeApplication (int returnValue) |
UUID | TimerModule::addTimer (std::any payload, Time timeAfter) |
void | TimerModule::cancelTimer (UUID key) |
Additional Inherited Members | |
![]() | |
static uint64_t | defaultLevel |
Default log level. More... | |
![]() | |
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... | |
![]() | |
std::vector< ModuleID > | ports |
This class abstract a single host machine.