NetSim 1.0.0
An educational network simulation software for students
Loading...
Searching...
No Matches
process.h
Go to the documentation of this file.
1#ifndef PROCESS_H
2#define PROCESS_H
3
4#include "ipaddress.h"
6#include <QString>
7
11
12namespace NetSim {
13
14class Host;
15
18
28class Process {
29public:
31 Process() = default;
32
34 Process(const Port &destinationPort, const QString &name);
35
37 Socket &socket();
38
40 Socket socket() const;
41
43 Package generateHTTPRequestPackage(const QString &uri,
44 const IPAddress &destination);
45
48 const Port &destPort,
49 const int &messageCode);
50
52 Package generateHandShakePackage(const IPAddress &address, bool initiate,
53 bool client);
54
57 bool initiate, bool client);
58
60 Package generateDNSRequestPackage(const QString &domain);
61
64 const QString &domain,
65 const Port &destPort);
66
68 QString name() const;
69
71 void setHost(Host *host);
72
74 QString toString() const;
75
76private:
77 QString m_name{};
78 Socket m_socket{};
79 Host *m_host{nullptr};
80};
81} // namespace NetSim
82
83#endif // PROCESS_H
Represents a network host that can communicate through routers.
Definition host.h:32
Represents an IPv4 address.
Definition ipaddress.h:27
Represents a network package.
Definition package.h:28
Represents a network port.
Definition port.h:24
Represents a network process.
Definition process.h:28
Package generateHandShakePackage(const IPAddress &address, bool initiate, bool client)
Generates a TCP handshake package.
Definition process.cpp:34
Process()=default
Default constructor.
QString name() const
Retrieves the process's name.
Definition process.cpp:192
Package generateDNSResponsePackage(const IPAddress &destination, const QString &domain, const Port &destPort)
Generates a DNS response package.
Definition process.cpp:164
Package generateDNSRequestPackage(const QString &domain)
Generates a DNS request package.
Definition process.cpp:148
QString toString() const
Retrieves a string representation of the process.
Definition process.cpp:196
Socket & socket()
Retrieves an editable associated socket reference.
Definition process.cpp:202
Package generateCloseConnectionPackage(const IPAddress &address, bool initiate, bool client)
Generates a TCP connection close package.
Definition process.cpp:107
Package generateHTTPResponsePackage(const IPAddress &destination, const Port &destPort, const int &messageCode)
Generates an HTTP response package.
Definition process.cpp:75
void setHost(Host *host)
Sets the associated host.
Definition process.cpp:194
Package generateHTTPRequestPackage(const QString &uri, const IPAddress &destination)
Generates an HTTP request package.
Definition process.cpp:13
Represents a networking socket for transmitting and receiving data.
Definition socket.h:27
Contains the IPAddress class definition.
Definition logger.h:12
Contains the Socket class definition.