5G-LENA nr-v3.3-159-ga6832aa7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-epc-tft.h
1// Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4//
5// Author: Nicola Baldo <nbaldo@cttc.es>
6
7#ifndef NR_EPC_TFT_H
8#define NR_EPC_TFT_H
9
10#include "ns3/ipv4-address.h"
11#include "ns3/ipv6-address.h"
12#include "ns3/simple-ref-count.h"
13
14#include <list>
15
16namespace ns3
17{
18
24class NrEpcTft : public SimpleRefCount<NrEpcTft>
25{
26 public:
32 static Ptr<NrEpcTft> Default();
33
38 {
39 DOWNLINK = 1,
40 UPLINK = 2,
41 BIDIRECTIONAL = 3
42 };
43
58 {
60
73 bool Matches(Direction d,
74 Ipv4Address ra,
75 Ipv4Address la,
76 uint16_t rp,
77 uint16_t lp,
78 uint8_t tos);
79
92 bool Matches(Direction d,
93 Ipv6Address ra,
94 Ipv6Address la,
95 uint16_t rp,
96 uint16_t lp,
97 uint8_t tos);
98
101 uint8_t precedence;
102
105
106 Ipv4Address remoteAddress;
107 Ipv4Mask remoteMask;
108 Ipv4Address localAddress;
109 Ipv4Mask localMask;
110
111 Ipv6Address remoteIpv6Address;
112 Ipv6Prefix remoteIpv6Prefix;
113 Ipv6Address localIpv6Address;
114 Ipv6Prefix localIpv6Prefix;
115
117 uint16_t remotePortEnd;
118 uint16_t localPortStart;
119 uint16_t localPortEnd;
120
123 };
124
125 NrEpcTft();
126
135 uint8_t Add(PacketFilter f);
136
149 bool Matches(Direction direction,
150 Ipv4Address remoteAddress,
151 Ipv4Address localAddress,
152 uint16_t remotePort,
153 uint16_t localPort,
154 uint8_t typeOfService);
155
168 bool Matches(Direction direction,
169 Ipv6Address remoteAddress,
170 Ipv6Address localAddress,
171 uint16_t remotePort,
172 uint16_t localPort,
173 uint8_t typeOfService);
174
179 std::list<PacketFilter> GetPacketFilters() const;
180
181 private:
182 std::list<PacketFilter> m_filters;
183 uint8_t m_numFilters;
184};
185
186std::ostream& operator<<(std::ostream& os, const NrEpcTft::Direction& d);
187
188} // namespace ns3
189
190#endif /* NR_EPC_TFT_H */
static Ptr< NrEpcTft > Default()
std::list< PacketFilter > GetPacketFilters() const
uint8_t Add(PacketFilter f)
bool Matches(Direction direction, Ipv4Address remoteAddress, Ipv4Address localAddress, uint16_t remotePort, uint16_t localPort, uint8_t typeOfService)
Direction direction
Whether the filter needs to be applied to uplink / downlink only, or in both cases.
Definition nr-epc-tft.h:104
Ipv6Prefix remoteIpv6Prefix
IPv6 address prefix of the remote host.
Definition nr-epc-tft.h:112
Ipv6Address remoteIpv6Address
IPv6 address of the remote host.
Definition nr-epc-tft.h:111
bool Matches(Direction d, Ipv4Address ra, Ipv4Address la, uint16_t rp, uint16_t lp, uint8_t tos)
Definition nr-epc-tft.cc:80
uint16_t remotePortEnd
end of the port number range of the remote host
Definition nr-epc-tft.h:117
uint16_t localPortStart
start of the port number range of the UE
Definition nr-epc-tft.h:118
Ipv4Mask localMask
IPv4 address mask of the UE.
Definition nr-epc-tft.h:109
Ipv4Address remoteAddress
IPv4 address of the remote host.
Definition nr-epc-tft.h:106
Ipv6Address localIpv6Address
IPv6 address of the UE.
Definition nr-epc-tft.h:113
Ipv4Address localAddress
IPv4 address of the UE.
Definition nr-epc-tft.h:108
uint8_t typeOfServiceMask
type of service field mask
Definition nr-epc-tft.h:122
Ipv6Prefix localIpv6Prefix
IPv6 address prefix of the UE.
Definition nr-epc-tft.h:114
uint16_t remotePortStart
start of the port number range of the remote host
Definition nr-epc-tft.h:116
Ipv4Mask remoteMask
IPv4 address mask of the remote host.
Definition nr-epc-tft.h:107
uint8_t typeOfService
type of service field
Definition nr-epc-tft.h:121
uint16_t localPortEnd
end of the port number range of the UE
Definition nr-epc-tft.h:119