NetSim 1.0.0
An educational network simulation software for students
Loading...
Searching...
No Matches
natentry.h
Go to the documentation of this file.
1#ifndef NATENTRY_H
2#define NATENTRY_H
3
5#include "src/models/port.h"
6
10
11namespace NetSim {
12
16
27class NATEntry {
28public:
34 NATEntry(const IPAddress &address, const Port &port);
35
37 NATEntry() = default;
38
40 Port port() const;
41
43 IPAddress address() const;
44
51 bool operator<(const NATEntry &entry) const;
52
53private:
55 Port m_port{};
57 IPAddress m_address{};
58};
59} // namespace NetSim
60
61#endif // NATENTRY_H
Represents an IPv4 address.
Definition ipaddress.h:27
Represents an entry in the NAT table with an IP address and associated port.
Definition natentry.h:27
NATEntry()=default
Default constructor.
Port port() const
Retrieves the port associated with this NAT entry.
Definition natentry.cpp:16
IPAddress address() const
Retrieves the IP address associated with this NAT entry.
Definition natentry.cpp:10
bool operator<(const NATEntry &entry) const
Compares two NAT entries based on their port numbers.
Definition natentry.cpp:12
Represents a network port.
Definition port.h:24
Contains the IPAddress class definition.
Definition logger.h:12
Contains the Port class definition.