29 #include "epc-tft-classifier.h"
32 #include "ns3/packet.h"
33 #include "ns3/ipv4-header.h"
34 #include "ns3/udp-header.h"
35 #include "ns3/tcp-header.h"
36 #include "ns3/udp-l4-protocol.h"
37 #include "ns3/tcp-l4-protocol.h"
43 EpcTftClassifier::EpcTftClassifier ()
81 if (direction == EpcTft::UPLINK)
88 NS_ASSERT (direction == EpcTft::DOWNLINK);
95 uint8_t tos = ipv4Header.
GetTos ();
97 uint16_t localPort = 0;
98 uint16_t remotePort = 0;
100 if (protocol == UdpL4Protocol::PROT_NUMBER)
105 if (direction == EpcTft::UPLINK)
116 else if (protocol == TcpL4Protocol::PROT_NUMBER)
120 if (direction == EpcTft::UPLINK)
138 <<
" localAddr=" << localAddress
139 <<
" remoteAddr=" << remoteAddress
140 <<
" localPort=" << localPort
141 <<
" remotePort=" << remotePort
142 <<
" tos=0x" << (uint16_t) tos );
147 std::map <uint32_t, Ptr<EpcTft> >::const_reverse_iterator it;
150 for (it = m_tftMap.rbegin (); it != m_tftMap.rend (); ++it)
155 if (tft->Matches (direction, remoteAddress, localAddress, remotePort, localPort, tos))
uint32_t RemoveHeader(Header &header)
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
void Add(Ptr< EpcTft > tft, uint32_t id)
#define NS_ASSERT(condition)
#define NS_LOG_COMPONENT_DEFINE(name)
uint32_t Classify(Ptr< Packet > p, EpcTft::Direction direction)
#define NS_LOG_LOGIC(msg)
Ptr< Packet > Copy(void) const
Ipv4 addresses are stored in host order in this class.