LEFT | RIGHT |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 | 107 |
108 uint8_t | 108 uint8_t |
109 EpcMme::AddBearer (uint64_t imsi, Ptr<EpcTft> tft, EpsBearer bearer) | 109 EpcMme::AddBearer (uint64_t imsi, Ptr<EpcTft> tft, EpsBearer bearer) |
110 { | 110 { |
111 NS_LOG_FUNCTION (this << imsi); | 111 NS_LOG_FUNCTION (this << imsi); |
112 std::map<uint64_t, Ptr<UeInfo> >::iterator it = m_ueInfoMap.find (imsi); | 112 std::map<uint64_t, Ptr<UeInfo> >::iterator it = m_ueInfoMap.find (imsi); |
113 NS_ASSERT_MSG (it != m_ueInfoMap.end (), "could not find any UE with IMSI " <<
imsi); | 113 NS_ASSERT_MSG (it != m_ueInfoMap.end (), "could not find any UE with IMSI " <<
imsi); |
114 NS_ASSERT_MSG (it->second->bearerCounter < 11, "too many bearers already! " <<
it->second->bearerCounter); | 114 NS_ASSERT_MSG (it->second->bearerCounter < 11, "too many bearers already! " <<
it->second->bearerCounter); |
115 BearerInfo bearerInfo; | 115 BearerInfo bearerInfo; |
116 bearerInfo.bearerId = static_cast<uint8_t>(++(it->second->bearerCounter)); | 116 bearerInfo.bearerId = static_cast<uint8_t> (++(it->second->bearerCounter)); |
117 bearerInfo.tft = tft; | 117 bearerInfo.tft = tft; |
118 bearerInfo.bearer = bearer;·· | 118 bearerInfo.bearer = bearer;·· |
119 it->second->bearersToBeActivated.push_back (bearerInfo); | 119 it->second->bearersToBeActivated.push_back (bearerInfo); |
120 return bearerInfo.bearerId; | 120 return bearerInfo.bearerId; |
121 } | 121 } |
122 | 122 |
123 | 123 |
124 // S1-AP SAP MME forwarded methods | 124 // S1-AP SAP MME forwarded methods |
125 | 125 |
126 void· | 126 void· |
(...skipping 30 matching lines...) Expand all Loading... |
157 void· | 157 void· |
158 EpcMme::DoPathSwitchRequest (uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t gc
i, std::list<EpcS1apSapMme::ErabSwitchedInDownlinkItem> erabToBeSwitchedInDownli
nkList) | 158 EpcMme::DoPathSwitchRequest (uint64_t enbUeS1Id, uint64_t mmeUeS1Id, uint16_t gc
i, std::list<EpcS1apSapMme::ErabSwitchedInDownlinkItem> erabToBeSwitchedInDownli
nkList) |
159 { | 159 { |
160 NS_LOG_FUNCTION (this << mmeUeS1Id << enbUeS1Id << gci); | 160 NS_LOG_FUNCTION (this << mmeUeS1Id << enbUeS1Id << gci); |
161 | 161 |
162 uint64_t imsi = mmeUeS1Id;· | 162 uint64_t imsi = mmeUeS1Id;· |
163 std::map<uint64_t, Ptr<UeInfo> >::iterator it = m_ueInfoMap.find (imsi); | 163 std::map<uint64_t, Ptr<UeInfo> >::iterator it = m_ueInfoMap.find (imsi); |
164 NS_ASSERT_MSG (it != m_ueInfoMap.end (), "could not find any UE with IMSI " <<
imsi); | 164 NS_ASSERT_MSG (it != m_ueInfoMap.end (), "could not find any UE with IMSI " <<
imsi); |
165 NS_LOG_INFO ("IMSI " << imsi << " old eNB: " << it->second->cellId << ", new e
NB: " << gci); | 165 NS_LOG_INFO ("IMSI " << imsi << " old eNB: " << it->second->cellId << ", new e
NB: " << gci); |
166 it->second->cellId = gci; | 166 it->second->cellId = gci; |
167 it->second->enbUeS1Id = static_cast<uint16_t>(enbUeS1Id); | 167 it->second->enbUeS1Id = static_cast<uint16_t> (enbUeS1Id); |
168 | 168 |
169 EpcS11SapSgw::ModifyBearerRequestMessage msg; | 169 EpcS11SapSgw::ModifyBearerRequestMessage msg; |
170 msg.teid = static_cast<uint32_t>(imsi); // trick to avoid the need for allocat
ing TEIDs on the S11 interface | 170 msg.teid = static_cast<uint32_t> (imsi); // trick to avoid the need for alloca
ting TEIDs on the S11 interface |
171 msg.uli.gci = gci; | 171 msg.uli.gci = gci; |
172 // bearer modification is not supported for now | 172 // bearer modification is not supported for now |
173 m_s11SapSgw->ModifyBearerRequest (msg); | 173 m_s11SapSgw->ModifyBearerRequest (msg); |
174 } | 174 } |
175 | 175 |
176 | 176 |
177 // S11 SAP MME forwarded methods | 177 // S11 SAP MME forwarded methods |
178 | 178 |
179 void· | 179 void· |
180 EpcMme::DoCreateSessionResponse (EpcS11SapMme::CreateSessionResponseMessage msg) | 180 EpcMme::DoCreateSessionResponse (EpcS11SapMme::CreateSessionResponseMessage msg) |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 void | 224 void |
225 EpcMme::DoErabReleaseIndication (uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::li
st<EpcS1apSapMme::ErabToBeReleasedIndication> erabToBeReleaseIndication) | 225 EpcMme::DoErabReleaseIndication (uint64_t mmeUeS1Id, uint16_t enbUeS1Id, std::li
st<EpcS1apSapMme::ErabToBeReleasedIndication> erabToBeReleaseIndication) |
226 { | 226 { |
227 NS_LOG_FUNCTION (this << mmeUeS1Id << enbUeS1Id); | 227 NS_LOG_FUNCTION (this << mmeUeS1Id << enbUeS1Id); |
228 uint64_t imsi = mmeUeS1Id; | 228 uint64_t imsi = mmeUeS1Id; |
229 std::map<uint64_t, Ptr<UeInfo> >::iterator it = m_ueInfoMap.find (imsi); | 229 std::map<uint64_t, Ptr<UeInfo> >::iterator it = m_ueInfoMap.find (imsi); |
230 NS_ASSERT_MSG (it != m_ueInfoMap.end (), "could not find any UE with IMSI " <<
imsi); | 230 NS_ASSERT_MSG (it != m_ueInfoMap.end (), "could not find any UE with IMSI " <<
imsi); |
231 | 231 |
232 EpcS11SapSgw::DeleteBearerCommandMessage msg; | 232 EpcS11SapSgw::DeleteBearerCommandMessage msg; |
233 // trick to avoid the need for allocating TEIDs on the S11 interface | 233 // trick to avoid the need for allocating TEIDs on the S11 interface |
234 msg.teid = static_cast<uint32_t>(imsi); | 234 msg.teid = static_cast<uint32_t> (imsi); |
235 | 235 |
236 for (std::list<EpcS1apSapMme::ErabToBeReleasedIndication>::iterator bit = erab
ToBeReleaseIndication.begin (); bit != erabToBeReleaseIndication.end (); ++bit) | 236 for (std::list<EpcS1apSapMme::ErabToBeReleasedIndication>::iterator bit = erab
ToBeReleaseIndication.begin (); bit != erabToBeReleaseIndication.end (); ++bit) |
237 { | 237 { |
238 EpcS11SapSgw::BearerContextToBeRemoved bearerContext; | 238 EpcS11SapSgw::BearerContextToBeRemoved bearerContext; |
239 bearerContext.epsBearerId = bit->erabId; | 239 bearerContext.epsBearerId = bit->erabId; |
240 msg.bearerContextsToBeRemoved.push_back (bearerContext); | 240 msg.bearerContextsToBeRemoved.push_back (bearerContext); |
241 } | 241 } |
242 //Delete Bearer command towards epc-sgw-pgw-application | 242 //Delete Bearer command towards epc-sgw-pgw-application |
243 m_s11SapSgw->DeleteBearerCommand (msg); | 243 m_s11SapSgw->DeleteBearerCommand (msg); |
244 } | 244 } |
245 | 245 |
246 void | 246 void |
247 EpcMme::DoDeleteBearerRequest (EpcS11SapMme::DeleteBearerRequestMessage msg) | 247 EpcMme::DoDeleteBearerRequest (EpcS11SapMme::DeleteBearerRequestMessage msg) |
248 { | 248 { |
249 NS_LOG_FUNCTION (this); | 249 NS_LOG_FUNCTION (this); |
250 uint64_t imsi = msg.teid; | 250 uint64_t imsi = msg.teid; |
251 std::map<uint64_t, Ptr<UeInfo> >::iterator it = m_ueInfoMap.find (imsi); | 251 std::map<uint64_t, Ptr<UeInfo> >::iterator it = m_ueInfoMap.find (imsi); |
252 NS_ASSERT_MSG (it != m_ueInfoMap.end (), "could not find any UE with IMSI " <<
imsi); | 252 NS_ASSERT_MSG (it != m_ueInfoMap.end (), "could not find any UE with IMSI " <<
imsi); |
253 EpcS11SapSgw::DeleteBearerResponseMessage res; | 253 EpcS11SapSgw::DeleteBearerResponseMessage res; |
254 | 254 |
255 res.teid = static_cast<uint32_t>(imsi); | 255 res.teid = static_cast<uint32_t> (imsi); |
256 | 256 |
257 for (std::list<EpcS11SapMme::BearerContextRemoved>::iterator bit = msg.bearerC
ontextsRemoved.begin (); | 257 for (std::list<EpcS11SapMme::BearerContextRemoved>::iterator bit = msg.bearerC
ontextsRemoved.begin (); |
258 bit != msg.bearerContextsRemoved.end (); | 258 bit != msg.bearerContextsRemoved.end (); |
259 ++bit) | 259 ++bit) |
260 { | 260 { |
261 EpcS11SapSgw::BearerContextRemovedSgwPgw bearerContext; | 261 EpcS11SapSgw::BearerContextRemovedSgwPgw bearerContext; |
262 bearerContext.epsBearerId = bit->epsBearerId; | 262 bearerContext.epsBearerId = bit->epsBearerId; |
263 res.bearerContextsRemoved.push_back (bearerContext); | 263 res.bearerContextsRemoved.push_back (bearerContext); |
264 | 264 |
265 RemoveBearer (it->second, bearerContext.epsBearerId); //schedules function
to erase, context of de-activated bearer | 265 RemoveBearer (it->second, bearerContext.epsBearerId); //schedules function
to erase, context of de-activated bearer |
(...skipping 11 matching lines...) Expand all Loading... |
277 { | 277 { |
278 if (bit->bearerId == epsBearerId) | 278 if (bit->bearerId == epsBearerId) |
279 { | 279 { |
280 ueInfo->bearersToBeActivated.erase (bit); | 280 ueInfo->bearersToBeActivated.erase (bit); |
281 break; | 281 break; |
282 } | 282 } |
283 } | 283 } |
284 } | 284 } |
285 | 285 |
286 } // namespace ns3 | 286 } // namespace ns3 |
LEFT | RIGHT |