25 #include "ns3/abort.h"
37 case EpcTft::DOWNLINK:
44 os <<
"BIDIRECTIONAL";
51 std::ostream&
operator<< (std::ostream& os, EpcTft::PacketFilter& f)
53 os <<
" direction: " << f.direction
54 <<
" remoteAddress: " << f.remoteAddress
55 <<
" remoteMask: " << f.remoteMask
56 <<
" localAddress: " << f.localAddress
57 <<
" localMask: " << f.localMask
58 <<
" remotePortStart: " << f.remotePortStart
59 <<
" remotePortEnd: " << f.remotePortEnd
60 <<
" localPortStart: " << f.localPortStart
61 <<
" localPortEnd: " << f.localPortEnd
62 <<
" typeOfService: 0x" << std::hex << (uint16_t) f.typeOfService << std::dec
63 <<
" typeOfServiceMask: 0x" << std::hex << (uint16_t) f.typeOfServiceMask << std::dec;
67 EpcTft::PacketFilter::PacketFilter ()
69 direction (BIDIRECTIONAL),
70 remoteMask (
"0.0.0.0"),
71 localMask (
"0.0.0.0"),
73 remotePortEnd (65535),
134 NS_LOG_LOGIC (
"d doesn't match: d=0x" << std::hex << d <<
" f.d=0x" << std::hex << direction << std::dec);
145 tft->Add (defaultPacketFilter);
162 std::list<PacketFilter>::iterator it;
163 for (it = m_filters.begin ();
164 (it != m_filters.end ()) && (it->precedence <= f.
precedence);
168 m_filters.insert (it, f);
170 return (m_numFilters - 1);
179 uint8_t typeOfService)
181 NS_LOG_FUNCTION (
this << direction << remoteAddress << localAddress << std::dec << remotePort << localPort << (uint16_t) typeOfService);
182 for (std::list<PacketFilter>::iterator it = m_filters.begin ();
183 it != m_filters.end ();
186 if (it->Matches (direction, remoteAddress, localAddress, remotePort, localPort, typeOfService))
uint8_t Add(PacketFilter f)
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
bool IsMatch(Ipv4Address a, Ipv4Address b) const
static Ptr< EpcTft > Default()
#define NS_LOG_COMPONENT_DEFINE(name)
bool Matches(Direction d, Ipv4Address ra, Ipv4Address la, uint16_t rp, uint16_t lp, uint8_t tos)
#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)
Ipv4Address remoteAddress
Ipv4 addresses are stored in host order in this class.
uint8_t typeOfServiceMask
bool Matches(Direction direction, Ipv4Address remoteAddress, Ipv4Address localAddress, uint16_t remotePort, uint16_t localPort, uint8_t typeOfService)