NetSim 1.0.0
An educational network simulation software for students
Loading...
Searching...
No Matches
networkcard.h
Go to the documentation of this file.
1#ifndef NETWORKCARD_H
2#define NETWORKCARD_H
3
7
11
12namespace NetSim {
13
16
28public:
30 NetworkCard() = default;
31
39 explicit NetworkCard(const IPAddress &networkAddress,
41
49 void addIPHeader(Package &data, quint8 protocol,
50 const IPAddress &destinationAddress);
51
60 void addMACHeader(Package &data, MACAddress destinationMACAddress,
61 quint16 etherType);
62
65
68
69private:
71 IPAddress m_networkAddress{};
72
74 MACAddress m_physicalAddress{};
75};
76} // namespace NetSim
77
78#endif // NETWORKCARD_H
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
void addIPHeader(Package &data, quint8 protocol, const IPAddress &destinationAddress)
Adds an IP header to the provided data package.
Definition networkcard.cpp:11
NetworkCard()=default
Default constructor.
void addMACHeader(Package &data, MACAddress destinationMACAddress, quint16 etherType)
Adds a MAC header to the provided data package.
Definition networkcard.cpp:19
MACAddress physicalAddress() const
Returns the physical (MAC) address of the network card.
Definition networkcard.cpp:27
IPAddress networkAddress() const
Returns the network (IP) address of the network card.
Definition networkcard.cpp:25
Represents a network package.
Definition package.h:28
Contains the IPAddress class definition.
Contains the MACAddress class definition.
Definition logger.h:12
Contains the Package class definition.