A Discrete-Event Network Simulator
API
epc-tft.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Nicola Baldo <nbaldo@cttc.es>
19  */
20 
21 
22 #ifndef EPC_TFT_H
23 #define EPC_TFT_H
24 
25 
26 #include <ns3/simple-ref-count.h>
27 #include <ns3/ipv4-address.h>
28 
29 #include <list>
30 
31 namespace ns3 {
32 
33 
34 
40 class EpcTft : public SimpleRefCount<EpcTft>
41 {
42 
43 public:
44 
45 
51  static Ptr<EpcTft> Default ();
52 
56  enum Direction {DOWNLINK = 1,
57  UPLINK = 2,
59 
73  struct PacketFilter
74  {
75  PacketFilter ();
76 
89  bool Matches (Direction d,
90  Ipv4Address ra,
91  Ipv4Address la,
92  uint16_t rp,
93  uint16_t lp,
94  uint8_t tos);
95 
96 
97 
98  uint8_t precedence;
112  uint16_t remotePortStart;
113  uint16_t remotePortEnd;
114  uint16_t localPortStart;
115  uint16_t localPortEnd;
117  uint8_t typeOfService;
119  };
120 
121  EpcTft ();
122 
123 
131  uint8_t Add (PacketFilter f);
132 
133 
146  bool Matches (Direction direction,
147  Ipv4Address remoteAddress,
148  Ipv4Address localAddress,
149  uint16_t remotePort,
150  uint16_t localPort,
151  uint8_t typeOfService);
152 
153 
154 private:
155 
156  std::list<PacketFilter> m_filters;
157  uint8_t m_numFilters;
158 
159 };
160 
161 
162 std::ostream& operator<< (std::ostream& os, EpcTft::Direction& d);
163 
164 
165 } // namespace ns3
166 
167 #endif /* EPC_TFT_H */
168 
169 
Direction
Indicates the direction of the traffic that is to be classified.
Definition: epc-tft.h:56
std::list< PacketFilter > m_filters
packet filter list
Definition: epc-tft.h:156
uint8_t Add(PacketFilter f)
add a PacketFilter to the Traffic Flow Template
Definition: epc-tft.cc:171
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
Direction direction
whether the filter needs to be applied to uplink / downlink only, or in both cases ...
Definition: epc-tft.h:104
a class to represent an Ipv4 address mask
Definition: ipv4-address.h:258
static Ptr< EpcTft > Default()
creates a TFT matching any traffic
Definition: epc-tft.cc:155
uint16_t localPortEnd
end of the port number range of the UE
Definition: epc-tft.h:115
bool Matches(Direction d, Ipv4Address ra, Ipv4Address la, uint16_t rp, uint16_t lp, uint8_t tos)
Definition: epc-tft.cc:97
Ipv4Mask localMask
IPv4 address mask of the UE.
Definition: epc-tft.h:110
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
Ipv4Address remoteAddress
IPv4 address of the remote host.
Definition: epc-tft.h:107
double f(double x, void *params)
Definition: 80211b.c:72
uint16_t remotePortEnd
end of the port number range of the remote host
Definition: epc-tft.h:113
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t typeOfService
type of service field
Definition: epc-tft.h:117
Ipv4Address localAddress
IPv4 address of the UE.
Definition: epc-tft.h:109
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:40
This class implements the EPS bearer Traffic Flow Template (TFT), which is the set of all packet filt...
Definition: epc-tft.h:40
uint8_t precedence
used to specify the precedence for the packet filter among all packet filters in the TFT; higher valu...
Definition: epc-tft.h:98
Ipv4Mask remoteMask
IPv4 address mask of the remote host.
Definition: epc-tft.h:108
uint8_t typeOfServiceMask
type of service field mask
Definition: epc-tft.h:118
A template-based reference counting class.
bool Matches(Direction direction, Ipv4Address remoteAddress, Ipv4Address localAddress, uint16_t remotePort, uint16_t localPort, uint8_t typeOfService)
Definition: epc-tft.cc:188
uint16_t remotePortStart
start of the port number range of the remote host
Definition: epc-tft.h:112
uint8_t m_numFilters
number of packet filters applied to this TFT
Definition: epc-tft.h:157
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Definition: epc-tft.h:73
uint16_t localPortStart
start of the port number range of the UE
Definition: epc-tft.h:114