25 #include "ns3/abort.h"
45 os <<
"BIDIRECTIONAL";
63 <<
" typeOfService: 0x" << std::hex << (uint16_t) f.
typeOfService << std::dec
64 <<
" typeOfServiceMask: 0x" << std::hex << (uint16_t) f.
typeOfServiceMask << std::dec;
70 direction (BIDIRECTIONAL),
71 remoteMask (
"0.0.0.0"),
72 localMask (
"0.0.0.0"),
74 remotePortEnd (65535),
95 if (remoteMask.IsMatch (remoteAddress, ra))
98 if (localMask.IsMatch (localAddress, la))
101 if (rp >= remotePortStart)
104 if (rp <= remotePortEnd)
107 if (lp >= localPortStart)
110 if (lp <= localPortEnd)
113 if ((tos & typeOfServiceMask) == (typeOfService & typeOfServiceMask))
125 NS_LOG_LOGIC (
"la doesn't match: la=" << la <<
" f.la=" << localAddress <<
" f.lmask=" << localMask);
130 NS_LOG_LOGIC (
"ra doesn't match: ra=" << ra <<
" f.ra=" << remoteAddress <<
" f.rmask=" << remoteMask);
135 NS_LOG_LOGIC (
"d doesn't match: d=0x" << std::hex << d <<
" f.d=0x" << std::hex << direction << std::dec);
146 tft->Add (defaultPacketFilter);
163 std::list<PacketFilter>::iterator it;
180 uint8_t typeOfService)
182 NS_LOG_FUNCTION (
this << direction << remoteAddress << localAddress << std::dec << remotePort << localPort << (uint16_t) typeOfService);
183 for (std::list<PacketFilter>::iterator it =
m_filters.begin ();
187 if (it->Matches (direction, remoteAddress, localAddress, remotePort, localPort, typeOfService))
Direction
Indicates the direction of the traffic that is to be classified.
std::list< PacketFilter > m_filters
uint8_t Add(PacketFilter f)
add a PacketFilter to the Traffic Flow Template
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
Direction direction
whether the filter needs to be applied to uplink / downlink only, or in both cases ...
static Ptr< EpcTft > Default()
creates a TFT matching any traffic
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.
#define NS_LOG_LOGIC(msg)
#define NS_ABORT_IF(cond)
Abnormal program termination if cond is true.
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Ipv4Address remoteAddress
IPv4 address of the remote host.
uint16_t remotePortEnd
end of the port number range of the remote host
uint8_t typeOfService
type of service field
Ipv4Address localAddress
IPv4 address of the UE.
Ipv4 addresses are stored in host order in this class.
uint8_t precedence
used to specify the precedence for the packet filter among all packet filters in the TFT; higher valu...
Ipv4Mask remoteMask
IPv4 address mask of the remote host.
uint8_t typeOfServiceMask
type of service field mask
bool Matches(Direction direction, Ipv4Address remoteAddress, Ipv4Address localAddress, uint16_t remotePort, uint16_t localPort, uint8_t typeOfService)
uint16_t remotePortStart
start of the port number range of the remote host
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
uint16_t localPortStart
start of the port number range of the UE