54 QMap<IPAddress, MACAddress>
hostTable()
const;
68 QMap<MACAddress, Router *>
cables()
const;
153 QMap<Port, Process> m_processTable{};
156 QMap<IPAddress, MACAddress> m_hostTable{};
159 QMap<QString, IPAddress> m_domainTable{};
163 QMap<MACAddress, Router *> m_cables{};
166 NetworkCard m_networkCard{};
169 PackageTableModel *m_packages{
nullptr};
Represents a network host that can communicate through routers.
Definition host.h:32
void setPackages(PackageTableModel *packages)
Set the packages for this host.
Definition host.cpp:19
void addMACAddress(const MACAddress &macAddress, Router *router)
Adds a MAC address to router pointer to the cables table.
Definition host.cpp:69
Process & getProcessByName(const QString &name)
Retrieves a process by its name.
Definition host.cpp:23
PackageTableModel * packages() const
Get all the packages associated with this host.
Definition host.cpp:17
Router * getRouterByMACAddress(const MACAddress &destinationAddress)
Retrieves the router by its MAC address.
Definition host.cpp:47
void setHostOfProcesses(Host *host)
Set the host for all processes.
Definition host.cpp:33
void addDomain(const QString &domain, const IPAddress &ipAddress)
Adds a domain to IP address resolution to the DNS table.
Definition host.cpp:73
QMap< MACAddress, Router * > cables() const
Retrieve the cables table.
Definition host.cpp:13
void addIPAddress(const IPAddress &ipAddress, const MACAddress &macAddress)
Adds an IP address to MAC address resolution to the ARP table.
Definition host.cpp:64
void addProcess(const Process &process)
Adds a process to the process table.
Definition host.cpp:60
Host()=default
The default constructor.
void sendPackage(Package &data, const MACAddress &destinationAddress)
Send a package to a destination MAC address.
Definition host.cpp:56
QMap< IPAddress, MACAddress > hostTable() const
Retrieve the host table.
Definition host.cpp:9
QMap< Port, Process > processTable() const
Retrieve the process table.
Definition host.cpp:7
NetworkCard networkCard() const
Retrieve the network card.
Definition host.cpp:15
virtual void receivePackage(Package data)=0
Pure virtual function to receive a package. Must be implemented in derived classes.
QMap< QString, IPAddress > domainTable() const
Retrieve the domain table.
Definition host.cpp:11
Represents an IPv4 address.
Definition ipaddress.h:27
Represents a Media Access Control (MAC) address.
Definition macaddress.h:26
Represents a virtual network card with network and physical address capabilities.
Definition networkcard.h:27
Represents a network package.
Definition package.h:28
Custom table model to represent a list of Package objects.
Definition packagetablemodel.h:25
Represents a network process.
Definition process.h:28
Represents a virtual router with capability to forward packages.
Definition router.h:32
Contains the IPAddress class definition.
Contains the MACAddress class definition.
Contains the Network Card class definition.
Contains the PackageTableModel class definition.
Contains the Process class definition.