A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
epc-ue-nas.h
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2012 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 #ifndef EPC_UE_NAS_H
22 #define EPC_UE_NAS_H
23 
24 
25 #include <ns3/object.h>
26 #include <ns3/lte-as-sap.h>
27 #include <ns3/epc-tft-classifier.h>
28 
29 namespace ns3 {
30 
31 
32 class EpcHelper;
33 
34 class EpcUeNas : public Object
35 {
36  friend class MemberLteAsSapUser<EpcUeNas>;
37 public:
38 
42  EpcUeNas ();
43 
47  virtual ~EpcUeNas ();
48 
49  // inherited from Object
50  virtual void DoDispose (void);
51  static TypeId GetTypeId (void);
52 
53 
58  void SetDevice (Ptr<NetDevice> dev);
59 
65  void SetImsi (uint64_t imsi);
66 
73 
80 
86  void SetForwardUpCallback (Callback <void, Ptr<Packet> > cb);
87 
96  void Connect (uint16_t cellId, uint16_t earfcn);
97 
102  void Disconnect ();
103 
104 
111  void ActivateEpsBearer (EpsBearer bearer, Ptr<EpcTft> tft);
112 
120  bool Send (Ptr<Packet> p);
121 
122 
128  enum State
129  {
130  OFF = 0,
131  ATTACHING,
132  IDLE_REGISTERED,
133  CONNECTING_TO_EPC,
134  ACTIVE,
135  NUM_STATES
136  };
137 
138 
139 private:
140 
141  // LTE AS SAP methods
142  void DoNotifyConnectionSuccessful ();
143  void DoNotifyConnectionFailed ();
144  void DoNotifyConnectionReleased ();
145  void DoRecvData (Ptr<Packet> packet);
146 
147  // internal methods
148  void DoActivateEpsBearer (EpsBearer bearer, Ptr<EpcTft> tft);
149  void SwitchToState (State s);
150 
151  State m_state;
152 
153  TracedCallback<State, State> m_stateTransitionCallback;
154 
155  Ptr<NetDevice> m_device;
156 
157  uint64_t m_imsi;
158 
159  LteAsSapProvider* m_asSapProvider;
160  LteAsSapUser* m_asSapUser;
161 
162  uint8_t m_bidCounter;
163  EpcTftClassifier m_tftClassifier;
164 
165  Callback <void, Ptr<Packet> > m_forwardUpCallback;
166 
168  {
169  EpsBearer bearer;
170  Ptr<EpcTft> tft;
171  };
172 
173  std::list<BearerToBeActivated> m_bearersToBeActivatedList;
174 
175 };
176 
177 
178 } // namespace ns3
179 
180 #endif // EPC_UE_NAS_H
void ActivateEpsBearer(EpsBearer bearer, Ptr< EpcTft > tft)
Definition: epc-ue-nas.cc:146
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
Callback template class.
Definition: callback.h:369
classifies IP packets accoding to Traffic Flow Templates (TFTs)
LteAsSapUser * GetAsSapUser()
Definition: epc-ue-nas.cc:111
void SetDevice(Ptr< NetDevice > dev)
Definition: epc-ue-nas.cc:93
void Connect(uint16_t cellId, uint16_t earfcn)
Definition: epc-ue-nas.cc:123
bool Send(Ptr< Packet > p)
Definition: epc-ue-nas.cc:165
void Disconnect()
Definition: epc-ue-nas.cc:137
virtual ~EpcUeNas()
Definition: epc-ue-nas.cc:67
void SetForwardUpCallback(Callback< void, Ptr< Packet > > cb)
Definition: epc-ue-nas.cc:117
void SetAsSapProvider(LteAsSapProvider *s)
Definition: epc-ue-nas.cc:105
a base class which provides memory management and object aggregation
Definition: object.h:63
void SetImsi(uint64_t imsi)
Definition: epc-ue-nas.cc:99
a unique identifier for an interface.
Definition: type-id.h:44
virtual void DoDispose(void)
Definition: epc-ue-nas.cc:73