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 #include <ns3/ipv6-address.h>
29 
30 #include <list>
31 
32 namespace ns3 {
33 
34 
35 
41 class EpcTft : public SimpleRefCount<EpcTft>
42 {
43 
44 public:
45 
46 
52  static Ptr<EpcTft> Default ();
53 
57  enum Direction {DOWNLINK = 1,
58  UPLINK = 2,
60 
74  struct PacketFilter
75  {
76  PacketFilter ();
77 
90  bool Matches (Direction d,
91  Ipv4Address ra,
92  Ipv4Address la,
93  uint16_t rp,
94  uint16_t lp,
95  uint8_t tos);
96 
109  bool Matches (Direction d,
110  Ipv6Address ra,
111  Ipv6Address la,
112  uint16_t rp,
113  uint16_t lp,
114  uint8_t tos);
115 
116 
117 
118  uint8_t precedence;
134  uint16_t remotePortStart;
135  uint16_t remotePortEnd;
136  uint16_t localPortStart;
137  uint16_t localPortEnd;
139  uint8_t typeOfService;
141  };
142 
143  EpcTft ();
144 
145 
153  uint8_t Add (PacketFilter f);
154 
155 
168  bool Matches (Direction direction,
169  Ipv4Address remoteAddress,
170  Ipv4Address localAddress,
171  uint16_t remotePort,
172  uint16_t localPort,
173  uint8_t typeOfService);
174 
187  bool Matches (Direction direction,
188  Ipv6Address remoteAddress,
189  Ipv6Address localAddress,
190  uint16_t remotePort,
191  uint16_t localPort,
192  uint8_t typeOfService);
193 
194 
195 private:
196 
197  std::list<PacketFilter> m_filters;
198  uint8_t m_numFilters;
199 
200 };
201 
202 
203 std::ostream& operator<< (std::ostream& os, EpcTft::Direction& d);
204 
205 
206 } // namespace ns3
207 
208 #endif /* EPC_TFT_H */
209 
210 
Direction
Indicates the direction of the traffic that is to be classified.
Definition: epc-tft.h:57
std::list< PacketFilter > m_filters
packet filter list
Definition: epc-tft.h:197
uint8_t Add(PacketFilter f)
add a PacketFilter to the Traffic Flow Template
Definition: epc-tft.cc:224
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:124
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:208
uint16_t localPortEnd
end of the port number range of the UE
Definition: epc-tft.h:137
Ipv6Address localAddress6
IPv6 address of the UE.
Definition: epc-tft.h:131
bool Matches(Direction d, Ipv4Address ra, Ipv4Address la, uint16_t rp, uint16_t lp, uint8_t tos)
Definition: epc-tft.cc:99
Ipv4Mask localMask
IPv4 address mask of the UE.
Definition: epc-tft.h:132
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:127
double f(double x, void *params)
Definition: 80211b.c:70
uint16_t remotePortEnd
end of the port number range of the remote host
Definition: epc-tft.h:135
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t typeOfService
type of service field
Definition: epc-tft.h:139
Ipv4Address localAddress
IPv4 address of the UE.
Definition: epc-tft.h:130
Describes an IPv6 address.
Definition: ipv6-address.h:49
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:41
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:118
Ipv6Address remoteAddress6
IPv6 address of the remote host.
Definition: epc-tft.h:128
Ipv4Mask remoteMask
IPv4 address mask of the remote host.
Definition: epc-tft.h:129
uint8_t typeOfServiceMask
type of service field mask
Definition: epc-tft.h:140
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:241
uint16_t remotePortStart
start of the port number range of the remote host
Definition: epc-tft.h:134
uint8_t m_numFilters
number of packet filters applied to this TFT
Definition: epc-tft.h:198
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Definition: epc-tft.h:74
uint16_t localPortStart
start of the port number range of the UE
Definition: epc-tft.h:136