38 os <<
"BIDIRECTIONAL";
60 <<
" localPortEnd: " << f.
localPortEnd <<
" typeOfService: 0x" << std::hex
61 << (uint16_t)f.
typeOfService << std::dec <<
" typeOfServiceMask: 0x" << std::hex
68 direction(BIDIRECTIONAL),
69 remoteMask(
"0.0.0.0"),
93 if (remoteMask.IsMatch(remoteAddress, ra))
96 if (localMask.IsMatch(localAddress, la))
99 if (remotePortStart <= rp && rp <= remotePortEnd)
102 if (localPortStart <= lp && lp <= localPortEnd)
105 if ((tos & typeOfServiceMask) == (typeOfService & typeOfServiceMask))
113 << tos <<
" f.tos=" << typeOfService
114 <<
" f.tosmask=" << typeOfServiceMask);
119 NS_LOG_LOGIC(
"lp doesn't match: lp=" << lp <<
" f.lps=" << localPortStart
120 <<
" f.lpe=" << localPortEnd);
125 NS_LOG_LOGIC(
"rp doesn't match: rp=" << rp <<
" f.rps=" << remotePortStart
126 <<
" f.lpe=" << remotePortEnd);
131 NS_LOG_LOGIC(
"la doesn't match: la=" << la <<
" f.la=" << localAddress
132 <<
" f.lmask=" << localMask);
137 NS_LOG_LOGIC(
"ra doesn't match: ra=" << ra <<
" f.ra=" << remoteAddress
138 <<
" f.rmask=" << remoteMask);
143 NS_LOG_LOGIC(
"d doesn't match: d=0x" << std::hex << d <<
" f.d=0x" << std::hex << direction
161 if (remoteIpv6Prefix.IsMatch(remoteIpv6Address, ra))
164 if (localIpv6Prefix.IsMatch(localIpv6Address, la))
167 if (remotePortStart <= rp && rp <= remotePortEnd)
170 if (localPortStart <= lp && lp <= localPortEnd)
173 if ((tos & typeOfServiceMask) == (typeOfService & typeOfServiceMask))
181 << tos <<
" f.tos=" << typeOfService
182 <<
" f.tosmask=" << typeOfServiceMask);
187 NS_LOG_LOGIC(
"lp doesn't match: lp=" << lp <<
" f.lps=" << localPortStart
188 <<
" f.lpe=" << localPortEnd);
193 NS_LOG_LOGIC(
"rp doesn't match: rp=" << rp <<
" f.rps=" << remotePortStart
194 <<
" f.lpe=" << remotePortEnd);
199 NS_LOG_LOGIC(
"la doesn't match: la=" << la <<
" f.la=" << localIpv6Address
200 <<
" f.lprefix=" << localIpv6Prefix);
205 NS_LOG_LOGIC(
"ra doesn't match: ra=" << ra <<
" f.ra=" << remoteIpv6Address
206 <<
" f.rprefix=" << remoteIpv6Prefix);
211 NS_LOG_LOGIC(
"d doesn't match: d=0x" << std::hex << d <<
" f.d=0x" << std::hex << direction
222 tft->Add(defaultPacketFilter);
238 std::list<PacketFilter>::iterator it;
253 uint8_t typeOfService)
255 NS_LOG_FUNCTION(
this << direction << remoteAddress << localAddress << std::dec << remotePort
256 << localPort << (uint16_t)typeOfService);
259 if (it->Matches(direction,
278 uint8_t typeOfService)
280 NS_LOG_FUNCTION(
this << direction << remoteAddress << localAddress << std::dec << remotePort
281 << localPort << (uint16_t)typeOfService);
284 if (it->Matches(direction,
297std::list<EpcTft::PacketFilter>
uint8_t Add(PacketFilter f)
add a PacketFilter to the Traffic Flow Template
bool Matches(Direction direction, Ipv4Address remoteAddress, Ipv4Address localAddress, uint16_t remotePort, uint16_t localPort, uint8_t typeOfService)
static Ptr< EpcTft > Default()
creates a TFT matching any traffic
std::list< PacketFilter > GetPacketFilters() const
Get the packet filters.
Direction
Indicates the direction of the traffic that is to be classified.
std::list< PacketFilter > m_filters
packet filter list
uint8_t m_numFilters
number of packet filters applied to this TFT
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Ipv4Address localAddress
IPv4 address of the UE.
Ipv6Prefix localIpv6Prefix
IPv6 address prefix of the UE.
uint16_t localPortEnd
end of the port number range of the UE
bool Matches(Direction d, Ipv4Address ra, Ipv4Address la, uint16_t rp, uint16_t lp, uint8_t tos)
Ipv4Mask localMask
IPv4 address mask of the UE.
uint16_t remotePortEnd
end of the port number range of the remote host
Ipv6Address remoteIpv6Address
IPv6 address of the remote host.
uint8_t precedence
Used to specify the precedence for the packet filter among all packet filters in the TFT; higher valu...
Direction direction
Whether the filter needs to be applied to uplink / downlink only, or in both cases.
Ipv4Mask remoteMask
IPv4 address mask of the remote host.
uint16_t remotePortStart
start of the port number range of the remote host
Ipv6Address localIpv6Address
IPv6 address of the UE.
uint8_t typeOfService
type of service field
Ipv4Address remoteAddress
IPv4 address of the remote host.
uint8_t typeOfServiceMask
type of service field mask
Ipv6Prefix remoteIpv6Prefix
IPv6 address prefix of the remote host.
uint16_t localPortStart
start of the port number range of the UE