![]() |
KENSv3
KAIST Educational Network System
|
Public Member Functions | |
TCPAssignment (Host &host) | |
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. | |
![]() | |
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 |
virtual std::any | diagnose (std::any param) |
Host module control function. | |
Protected Member Functions | |
virtual void | systemCallback (UUID syscallUUID, int pid, const SystemCallParameter ¶m) final |
When a system call is invoked by an application, this callback function is automatically called. To handle system call events, override this function. More... | |
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... | |
![]() | |
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... | |
![]() | |
SystemCallInterface (int domain, int protocol, Host &host) | |
Multiple SystemCallInterface may be installed to a Host. They are distinguished by their Domain and Protocol. The interface is automatically registered to the Host when created. More... | |
virtual void | returnSystemCall (UUID syscallUUID, int val) final |
Unblocks a blocked system call with return value. More... | |
virtual int | createFileDescriptor (int processID) final |
Create a file descriptor for a certain process. The created file descriptor is automatically bound to the domain and protocol of this module. Proper system call request using this file descriptor will be passed to the SystemCallInterface which created the file descriptor. More... | |
virtual void | removeFileDescriptor (int processID, int fd) final |
Close a file descriptor. Closed file descriptor becomes invalid and loses connection between this SystemCallInterface. Any system call request on invalid file descriptor will fail. More... | |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
enum | SystemCall { SOCKET , CLOSE , READ , WRITE , CONNECT , LISTEN , ACCEPT , BIND , GETSOCKNAME , GETPEERNAME , NSLEEP , GETTIMEOFDAY } |
![]() | |
static constexpr int | AF_INET = 2 |
static constexpr int | IPPROTO_TCP = 6 |
static constexpr int | IPPROTO_UDP = 17 |
static constexpr int | max_param = 3 |
|
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.
fromModule | Name of the HostModule who sent this packet. |
packet | Received packet. |
Implements E::HostModule.
|
finalprotectedvirtual |
When a system call is invoked by an application, this callback function is automatically called. To handle system call events, override this function.
syscallUUID | Unique ID for this system call request. |
pid | Process who raised this system call request. |
param | Parameters given this system call. |
Implements E::SystemCallInterface.