NetSim 1.0.0
An educational network simulation software for students
Loading...
Searching...
No Matches
Public Member Functions | List of all members
NetSim::Process Class Reference

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.
 
Socketsocket ()
 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Process() [1/2]

NetSim::Process::Process ( )
default

Default constructor.

◆ Process() [2/2]

Process::Process ( const Port destinationPort,
const QString &  name 
)

Constructor initializing a process with a destination port and a name.

Member Function Documentation

◆ generateCloseConnectionPackage()

Package Process::generateCloseConnectionPackage ( const IPAddress address,
bool  initiate,
bool  client 
)

Generates a TCP connection close package.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateDNSRequestPackage()

Package Process::generateDNSRequestPackage ( const QString &  domain)

Generates a DNS request package.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateDNSResponsePackage()

Package Process::generateDNSResponsePackage ( const IPAddress destination,
const QString &  domain,
const Port destPort 
)

Generates a DNS response package.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateHandShakePackage()

Package Process::generateHandShakePackage ( const IPAddress address,
bool  initiate,
bool  client 
)

Generates a TCP handshake package.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateHTTPRequestPackage()

Package Process::generateHTTPRequestPackage ( const QString &  uri,
const IPAddress destination 
)

Generates an HTTP request package.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateHTTPResponsePackage()

Package Process::generateHTTPResponsePackage ( const IPAddress destination,
const Port destPort,
const int &  messageCode 
)

Generates an HTTP response package.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ name()

QString Process::name ( ) const

Retrieves the process's name.

◆ setHost()

void Process::setHost ( Host host)

Sets the associated host.

◆ socket() [1/2]

Socket & Process::socket ( )

Retrieves an editable associated socket reference.

Here is the caller graph for this function:

◆ socket() [2/2]

Socket Process::socket ( ) const

Retrieve the associated socket.

◆ toString()

QString Process::toString ( ) const

Retrieves a string representation of the process.

Here is the call graph for this function:

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