NetSim 1.0.0
An educational network simulation software for students
|
Represents a network process. More...
#include <process.h>
Public Member Functions | |
Process ()=default | |
Default constructor. | |
Process (const Port &destinationPort, const QString &name) | |
Constructor initializing a process with a destination port and a name. | |
Socket & | socket () |
Retrieves an editable associated socket reference. | |
Socket | socket () const |
Retrieve the associated socket. | |
Package | generateHTTPRequestPackage (const QString &uri, const IPAddress &destination) |
Generates an HTTP request package. | |
Package | generateHTTPResponsePackage (const IPAddress &destination, const Port &destPort, const int &messageCode) |
Generates an HTTP response package. | |
Package | generateHandShakePackage (const IPAddress &address, bool initiate, bool client) |
Generates a TCP handshake package. | |
Package | generateCloseConnectionPackage (const IPAddress &address, bool initiate, bool client) |
Generates a TCP connection close package. | |
Package | generateDNSRequestPackage (const QString &domain) |
Generates a DNS request package. | |
Package | generateDNSResponsePackage (const IPAddress &destination, const QString &domain, const Port &destPort) |
Generates a DNS response package. | |
QString | name () const |
Retrieves the process's name. | |
void | setHost (Host *host) |
Sets the associated host. | |
QString | toString () const |
Retrieves a string representation of the process. | |
Represents a network process.
This class provides functionalities related to different types of network processes such as HTTP, DNS, and TCP. It allows generating network packages for different protocols and interacting with the associated host's network card.
|
default |
Default constructor.
Process::Process | ( | const Port & | destinationPort, |
const QString & | name | ||
) |
Constructor initializing a process with a destination port and a name.
Package Process::generateCloseConnectionPackage | ( | const IPAddress & | address, |
bool | initiate, | ||
bool | client | ||
) |
Generates a TCP connection close package.
Package Process::generateDNSRequestPackage | ( | const QString & | domain | ) |
Generates a DNS request package.
Package Process::generateDNSResponsePackage | ( | const IPAddress & | destination, |
const QString & | domain, | ||
const Port & | destPort | ||
) |
Generates a DNS response package.
Generates a TCP handshake package.
Generates an HTTP request package.
Package Process::generateHTTPResponsePackage | ( | const IPAddress & | destination, |
const Port & | destPort, | ||
const int & | messageCode | ||
) |
Generates an HTTP response package.
QString Process::name | ( | ) | const |
Retrieves the process's name.
void Process::setHost | ( | Host * | host | ) |
Sets the associated host.
Socket & Process::socket | ( | ) |
Retrieves an editable associated socket reference.
Socket Process::socket | ( | ) | const |
Retrieve the associated socket.
QString Process::toString | ( | ) | const |
Retrieves a string representation of the process.