A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
epc-x2-header.cc
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: Manuel Requena <manuel.requena@cttc.es>
19  */
20 
21 #include "ns3/log.h"
22 #include "ns3/epc-x2-header.h"
23 
24 
25 NS_LOG_COMPONENT_DEFINE ("EpcX2Header");
26 
27 namespace ns3 {
28 
29 
30 NS_OBJECT_ENSURE_REGISTERED (EpcX2Header);
31 
32 EpcX2Header::EpcX2Header ()
33  : m_messageType (0xfa),
34  m_procedureCode (0xfa),
35  m_lengthOfIes (0xfa),
36  m_numberOfIes (0xfa)
37 {
38 }
39 
40 EpcX2Header::~EpcX2Header ()
41 {
42  m_messageType = 0xfb;
43  m_procedureCode = 0xfb;
44  m_lengthOfIes = 0xfb;
45  m_numberOfIes = 0xfb;
46 }
47 
48 TypeId
49 EpcX2Header::GetTypeId (void)
50 {
51  static TypeId tid = TypeId ("ns3::EpcX2Header")
52  .SetParent<Header> ()
53  .AddConstructor<EpcX2Header> ()
54  ;
55  return tid;
56 }
57 
58 TypeId
60 {
61  return GetTypeId ();
62 }
63 
64 uint32_t
66 {
67  return 7;
68 }
69 
70 void
72 {
73  Buffer::Iterator i = start;
74 
75  i.WriteU8 (m_messageType);
76  i.WriteU8 (m_procedureCode);
77 
78  i.WriteU8 (0x00); // criticality = REJECT
79  i.WriteU8 (m_lengthOfIes + 3);
80  i.WriteHtonU16 (0);
81  i.WriteU8 (m_numberOfIes);
82 }
83 
84 uint32_t
86 {
87  Buffer::Iterator i = start;
88 
89  m_messageType = i.ReadU8 ();
90  m_procedureCode = i.ReadU8 ();
91 
92  i.ReadU8 ();
93  m_lengthOfIes = i.ReadU8 () - 3;
94  i.ReadNtohU16 ();
95  m_numberOfIes = i.ReadU8 ();
96 
97  return GetSerializedSize ();
98 }
99 
100 void
101 EpcX2Header::Print (std::ostream &os) const
102 {
103  os << "MessageType=" << (uint32_t) m_messageType;
104  os << " ProcedureCode=" << (uint32_t) m_procedureCode;
105  os << " LengthOfIEs=" << (uint32_t) m_lengthOfIes;
106  os << " NumberOfIEs=" << (uint32_t) m_numberOfIes;
107 }
108 
109 uint8_t
110 EpcX2Header::GetMessageType () const
111 {
112  return m_messageType;
113 }
114 
115 void
116 EpcX2Header::SetMessageType (uint8_t messageType)
117 {
118  m_messageType = messageType;
119 }
120 
121 uint8_t
122 EpcX2Header::GetProcedureCode () const
123 {
124  return m_procedureCode;
125 }
126 
127 void
128 EpcX2Header::SetProcedureCode (uint8_t procedureCode)
129 {
130  m_procedureCode = procedureCode;
131 }
132 
133 
134 void
135 EpcX2Header::SetLengthOfIes (uint32_t lengthOfIes)
136 {
137  m_lengthOfIes = lengthOfIes;
138 }
139 
140 void
141 EpcX2Header::SetNumberOfIes (uint32_t numberOfIes)
142 {
143  m_numberOfIes = numberOfIes;
144 }
145 
147 
148 NS_OBJECT_ENSURE_REGISTERED (EpcX2HandoverRequestHeader);
149 
150 EpcX2HandoverRequestHeader::EpcX2HandoverRequestHeader ()
151  : m_numberOfIes (1 + 1 + 1 + 1),
152  m_headerLength (6 + 5 + 12 + (3 + 4 + 8 + 8 + 4)),
153  m_oldEnbUeX2apId (0xfffa),
154  m_cause (0xfffa),
155  m_targetCellId (0xfffa),
156  m_mmeUeS1apId (0xfffffffa)
157 {
158  m_erabsToBeSetupList.clear ();
159 }
160 
161 EpcX2HandoverRequestHeader::~EpcX2HandoverRequestHeader ()
162 {
163  m_numberOfIes = 0;
164  m_headerLength = 0;
165  m_oldEnbUeX2apId = 0xfffb;
166  m_cause = 0xfffb;
167  m_targetCellId = 0xfffb;
168  m_mmeUeS1apId = 0xfffffffb;
169  m_erabsToBeSetupList.clear ();
170 }
171 
172 TypeId
173 EpcX2HandoverRequestHeader::GetTypeId (void)
174 {
175  static TypeId tid = TypeId ("ns3::EpcX2HandoverRequestHeader")
176  .SetParent<Header> ()
177  .AddConstructor<EpcX2HandoverRequestHeader> ()
178  ;
179  return tid;
180 }
181 
182 TypeId
184 {
185  return GetTypeId ();
186 }
187 
188 uint32_t
190 {
191  return m_headerLength;
192 }
193 
194 void
196 {
197  Buffer::Iterator i = start;
198 
199  i.WriteHtonU16 (10); // id = OLD_ENB_UE_X2AP_ID
200  i.WriteU8 (0); // criticality = REJECT
201  i.WriteU8 (2); // length of OLD_ENB_UE_X2AP_ID
202  i.WriteHtonU16 (m_oldEnbUeX2apId);
203 
204  i.WriteHtonU16 (5); // id = CAUSE
205  i.WriteU8 (1 << 6); // criticality = IGNORE
206  i.WriteU8 (1); // length of CAUSE
207  i.WriteU8 (m_cause);
208 
209  i.WriteHtonU16 (11); // id = TARGET_CELLID
210  i.WriteU8 (0); // criticality = REJECT
211  i.WriteU8 (8); // length of TARGET_CELLID
212  i.WriteHtonU32 (0x123456); // fake PLMN
213  i.WriteHtonU32 (m_targetCellId << 4);
214 
215  i.WriteHtonU16 (14); // id = UE_CONTEXT_INFORMATION
216  i.WriteU8 (0); // criticality = REJECT
217 
218  i.WriteHtonU32 (m_mmeUeS1apId);
219  i.WriteHtonU64 (m_ueAggregateMaxBitRateDownlink);
220  i.WriteHtonU64 (m_ueAggregateMaxBitRateUplink);
221 
222  std::vector <EpcX2Sap::ErabToBeSetupItem>::size_type sz = m_erabsToBeSetupList.size ();
223  i.WriteHtonU32 (sz); // number of bearers
224  for (int j = 0; j < (int) sz; j++)
225  {
226  i.WriteHtonU16 (m_erabsToBeSetupList [j].erabId);
227  i.WriteHtonU16 (m_erabsToBeSetupList [j].erabLevelQosParameters.qci);
228  i.WriteHtonU64 (m_erabsToBeSetupList [j].erabLevelQosParameters.gbrQosInfo.gbrDl);
229  i.WriteHtonU64 (m_erabsToBeSetupList [j].erabLevelQosParameters.gbrQosInfo.gbrUl);
230  i.WriteHtonU64 (m_erabsToBeSetupList [j].erabLevelQosParameters.gbrQosInfo.mbrDl);
231  i.WriteHtonU64 (m_erabsToBeSetupList [j].erabLevelQosParameters.gbrQosInfo.mbrUl);
232  i.WriteU8 (m_erabsToBeSetupList [j].erabLevelQosParameters.arp.priorityLevel);
233  i.WriteU8 (m_erabsToBeSetupList [j].erabLevelQosParameters.arp.preemptionCapability);
234  i.WriteU8 (m_erabsToBeSetupList [j].erabLevelQosParameters.arp.preemptionVulnerability);
235  i.WriteU8 (m_erabsToBeSetupList [j].dlForwarding);
236  i.WriteHtonU32 (m_erabsToBeSetupList [j].transportLayerAddress.Get ());
237  i.WriteHtonU32 (m_erabsToBeSetupList [j].gtpTeid);
238  }
239 
240 }
241 
242 uint32_t
244 {
245  Buffer::Iterator i = start;
246 
247  m_headerLength = 0;
248  m_numberOfIes = 0;
249 
250  i.ReadNtohU16 ();
251  i.ReadU8 ();
252  i.ReadU8 ();
253  m_oldEnbUeX2apId = i.ReadNtohU16 ();
254  m_headerLength += 6;
255  m_numberOfIes++;
256 
257  i.ReadNtohU16 ();
258  i.ReadU8 ();
259  i.ReadU8 ();
260  m_cause = i.ReadU8 ();
261  m_headerLength += 5;
262  m_numberOfIes++;
263 
264  i.ReadNtohU16 ();
265  i.ReadU8 ();
266  i.ReadU8 ();
267  i.ReadNtohU32 ();
268  m_targetCellId = i.ReadNtohU32 () >> 4;
269  m_headerLength += 12;
270  m_numberOfIes++;
271 
272  i.ReadNtohU16 ();
273  i.ReadU8 ();
274  m_mmeUeS1apId = i.ReadNtohU32 ();
275  m_ueAggregateMaxBitRateDownlink = i.ReadNtohU64 ();
276  m_ueAggregateMaxBitRateUplink = i.ReadNtohU64 ();
277  int sz = i.ReadNtohU32 ();
278  m_headerLength += 27;
279  m_numberOfIes++;
280 
281  for (int j = 0; j < sz; j++)
282  {
284 
285  erabItem.erabId = i.ReadNtohU16 ();
286 
287  erabItem.erabLevelQosParameters = EpsBearer ((EpsBearer::Qci) i.ReadNtohU16 ());
288  erabItem.erabLevelQosParameters.gbrQosInfo.gbrDl = i.ReadNtohU64 ();
289  erabItem.erabLevelQosParameters.gbrQosInfo.gbrUl = i.ReadNtohU64 ();
290  erabItem.erabLevelQosParameters.gbrQosInfo.mbrDl = i.ReadNtohU64 ();
291  erabItem.erabLevelQosParameters.gbrQosInfo.mbrUl = i.ReadNtohU64 ();
292  erabItem.erabLevelQosParameters.arp.priorityLevel = i.ReadU8 ();
293  erabItem.erabLevelQosParameters.arp.preemptionCapability = i.ReadU8 ();
294  erabItem.erabLevelQosParameters.arp.preemptionVulnerability = i.ReadU8 ();
295 
296  erabItem.dlForwarding = i.ReadU8 ();
297  erabItem.transportLayerAddress = Ipv4Address (i.ReadNtohU32 ());
298  erabItem.gtpTeid = i.ReadNtohU32 ();
299 
300  m_erabsToBeSetupList.push_back (erabItem);
301  m_headerLength += 48;
302  }
303 
304  return GetSerializedSize ();
305 }
306 
307 void
308 EpcX2HandoverRequestHeader::Print (std::ostream &os) const
309 {
310  os << "OldEnbUeX2apId = " << m_oldEnbUeX2apId;
311  os << " Cause = " << m_cause;
312  os << " TargetCellId = " << m_targetCellId;
313  os << " MmeUeS1apId = " << m_mmeUeS1apId;
314  os << " UeAggrMaxBitRateDownlink = " << m_ueAggregateMaxBitRateDownlink;
315  os << " UeAggrMaxBitRateUplink = " << m_ueAggregateMaxBitRateUplink;
316  os << " NumOfBearers = " << m_erabsToBeSetupList.size ();
317 
318  std::vector <EpcX2Sap::ErabToBeSetupItem>::size_type sz = m_erabsToBeSetupList.size ();
319  if (sz > 0)
320  {
321  os << " [";
322  }
323  for (int j = 0; j < (int) sz; j++)
324  {
325  os << m_erabsToBeSetupList[j].erabId;
326  if (j < (int) sz - 1)
327  {
328  os << ", ";
329  }
330  else
331  {
332  os << "]";
333  }
334  }
335 }
336 
337 uint16_t
338 EpcX2HandoverRequestHeader::GetOldEnbUeX2apId () const
339 {
340  return m_oldEnbUeX2apId;
341 }
342 
343 void
344 EpcX2HandoverRequestHeader::SetOldEnbUeX2apId (uint16_t x2apId)
345 {
346  m_oldEnbUeX2apId = x2apId;
347 }
348 
349 uint16_t
350 EpcX2HandoverRequestHeader::GetCause () const
351 {
352  return m_cause;
353 }
354 
355 void
356 EpcX2HandoverRequestHeader::SetCause (uint16_t cause)
357 {
358  m_cause = cause;
359 }
360 
361 uint16_t
362 EpcX2HandoverRequestHeader::GetTargetCellId () const
363 {
364  return m_targetCellId;
365 }
366 
367 void
368 EpcX2HandoverRequestHeader::SetTargetCellId (uint16_t targetCellId)
369 {
370  m_targetCellId = targetCellId;
371 }
372 
373 uint32_t
374 EpcX2HandoverRequestHeader::GetMmeUeS1apId () const
375 {
376  return m_mmeUeS1apId;
377 }
378 
379 void
380 EpcX2HandoverRequestHeader::SetMmeUeS1apId (uint32_t mmeUeS1apId)
381 {
382  m_mmeUeS1apId = mmeUeS1apId;
383 }
384 
385 std::vector <EpcX2Sap::ErabToBeSetupItem>
386 EpcX2HandoverRequestHeader::GetBearers () const
387 {
388  return m_erabsToBeSetupList;
389 }
390 
391 void
392 EpcX2HandoverRequestHeader::SetBearers (std::vector <EpcX2Sap::ErabToBeSetupItem> bearers)
393 {
394  m_headerLength += 48 * bearers.size ();
395  m_erabsToBeSetupList = bearers;
396 }
397 
398 uint64_t
399 EpcX2HandoverRequestHeader::GetUeAggregateMaxBitRateDownlink () const
400 {
401  return m_ueAggregateMaxBitRateDownlink;
402 }
403 
404 void
405 EpcX2HandoverRequestHeader::SetUeAggregateMaxBitRateDownlink (uint64_t bitRate)
406 {
407  m_ueAggregateMaxBitRateDownlink = bitRate;
408 }
409 
410 uint64_t
411 EpcX2HandoverRequestHeader::GetUeAggregateMaxBitRateUplink () const
412 {
413  return m_ueAggregateMaxBitRateUplink;
414 }
415 
416 void
417 EpcX2HandoverRequestHeader::SetUeAggregateMaxBitRateUplink (uint64_t bitRate)
418 {
419  m_ueAggregateMaxBitRateUplink = bitRate;
420 }
421 
422 uint32_t
423 EpcX2HandoverRequestHeader::GetLengthOfIes () const
424 {
425  return m_headerLength;
426 }
427 
428 uint32_t
429 EpcX2HandoverRequestHeader::GetNumberOfIes () const
430 {
431  return m_numberOfIes;
432 }
433 
435 
436 NS_OBJECT_ENSURE_REGISTERED (EpcX2HandoverRequestAckHeader);
437 
438 EpcX2HandoverRequestAckHeader::EpcX2HandoverRequestAckHeader ()
439  : m_numberOfIes (1 + 1 + 1 + 1),
440  m_headerLength (2 + 2 + 4 + 4),
441  m_oldEnbUeX2apId (0xfffa),
442  m_newEnbUeX2apId (0xfffa)
443 {
444 }
445 
446 EpcX2HandoverRequestAckHeader::~EpcX2HandoverRequestAckHeader ()
447 {
448  m_numberOfIes = 0;
449  m_headerLength = 0;
450  m_oldEnbUeX2apId = 0xfffb;
451  m_newEnbUeX2apId = 0xfffb;
452  m_erabsAdmittedList.clear ();
453  m_erabsNotAdmittedList.clear ();
454 }
455 
456 TypeId
457 EpcX2HandoverRequestAckHeader::GetTypeId (void)
458 {
459  static TypeId tid = TypeId ("ns3::EpcX2HandoverRequestAckHeader")
460  .SetParent<Header> ()
461  .AddConstructor<EpcX2HandoverRequestAckHeader> ()
462  ;
463  return tid;
464 }
465 
466 TypeId
468 {
469  return GetTypeId ();
470 }
471 
472 uint32_t
474 {
475  return m_headerLength;
476 }
477 
478 void
480 {
481  Buffer::Iterator i = start;
482 
483  i.WriteHtonU16 (m_oldEnbUeX2apId);
484  i.WriteHtonU16 (m_newEnbUeX2apId);
485 
486  std::vector <EpcX2Sap::ErabAdmittedItem>::size_type sz = m_erabsAdmittedList.size ();
487  i.WriteHtonU32 (sz);
488  for (int j = 0; j < (int) sz; j++)
489  {
490  i.WriteHtonU16 (m_erabsAdmittedList [j].erabId);
491  i.WriteHtonU32 (m_erabsAdmittedList [j].ulGtpTeid);
492  i.WriteHtonU32 (m_erabsAdmittedList [j].dlGtpTeid);
493  }
494 
495  std::vector <EpcX2Sap::ErabNotAdmittedItem>::size_type sz2 = m_erabsNotAdmittedList.size ();
496  i.WriteHtonU32 (sz2);
497  for (int j = 0; j < (int) sz2; j++)
498  {
499  i.WriteHtonU16 (m_erabsNotAdmittedList [j].erabId);
500  i.WriteHtonU16 (m_erabsNotAdmittedList [j].cause);
501  }
502 }
503 
504 uint32_t
506 {
507  Buffer::Iterator i = start;
508 
509  m_headerLength = 0;
510  m_numberOfIes = 0;
511 
512  m_oldEnbUeX2apId = i.ReadNtohU16 ();
513  m_newEnbUeX2apId = i.ReadNtohU16 ();
514  m_headerLength += 4;
515  m_numberOfIes += 2;
516 
517  int sz = i.ReadNtohU32 ();
518  m_headerLength += 4;
519  m_numberOfIes++;
520 
521  for (int j = 0; j < sz; j++)
522  {
524 
525  erabItem.erabId = i.ReadNtohU16 ();
526  erabItem.ulGtpTeid = i.ReadNtohU32 ();
527  erabItem.dlGtpTeid = i.ReadNtohU32 ();
528 
529  m_erabsAdmittedList.push_back (erabItem);
530  m_headerLength += 10;
531  }
532 
533  sz = i.ReadNtohU32 ();
534  m_headerLength += 4;
535  m_numberOfIes++;
536 
537  for (int j = 0; j < sz; j++)
538  {
540 
541  erabItem.erabId = i.ReadNtohU16 ();
542  erabItem.cause = i.ReadNtohU16 ();
543 
544  m_erabsNotAdmittedList.push_back (erabItem);
545  m_headerLength += 4;
546  }
547 
548  return GetSerializedSize ();
549 }
550 
551 void
552 EpcX2HandoverRequestAckHeader::Print (std::ostream &os) const
553 {
554  os << "OldEnbUeX2apId=" << m_oldEnbUeX2apId;
555  os << " NewEnbUeX2apId=" << m_newEnbUeX2apId;
556 
557  os << " AdmittedBearers=" << m_erabsAdmittedList.size ();
558  std::vector <EpcX2Sap::ErabAdmittedItem>::size_type sz = m_erabsAdmittedList.size ();
559  if (sz > 0)
560  {
561  os << " [";
562  }
563  for (int j = 0; j < (int) sz; j++)
564  {
565  os << m_erabsAdmittedList[j].erabId;
566  if (j < (int) sz - 1)
567  {
568  os << ", ";
569  }
570  else
571  {
572  os << "]";
573  }
574  }
575 
576  os << " NotAdmittedBearers=" << m_erabsNotAdmittedList.size ();
577  std::vector <EpcX2Sap::ErabNotAdmittedItem>::size_type sz2 = m_erabsNotAdmittedList.size ();
578  if (sz2 > 0)
579  {
580  os << " [";
581  }
582  for (int j = 0; j < (int) sz2; j++)
583  {
584  os << m_erabsNotAdmittedList[j].erabId;
585  if (j < (int) sz2 - 1)
586  {
587  os << ", ";
588  }
589  else
590  {
591  os << "]";
592  }
593  }
594 
595 }
596 
597 uint16_t
598 EpcX2HandoverRequestAckHeader::GetOldEnbUeX2apId () const
599 {
600  return m_oldEnbUeX2apId;
601 }
602 
603 void
604 EpcX2HandoverRequestAckHeader::SetOldEnbUeX2apId (uint16_t x2apId)
605 {
606  m_oldEnbUeX2apId = x2apId;
607 }
608 
609 uint16_t
610 EpcX2HandoverRequestAckHeader::GetNewEnbUeX2apId () const
611 {
612  return m_newEnbUeX2apId;
613 }
614 
615 void
616 EpcX2HandoverRequestAckHeader::SetNewEnbUeX2apId (uint16_t x2apId)
617 {
618  m_newEnbUeX2apId = x2apId;
619 }
620 
621 std::vector <EpcX2Sap::ErabAdmittedItem>
622 EpcX2HandoverRequestAckHeader::GetAdmittedBearers () const
623 {
624  return m_erabsAdmittedList;
625 }
626 
627 void
628 EpcX2HandoverRequestAckHeader::SetAdmittedBearers (std::vector <EpcX2Sap::ErabAdmittedItem> bearers)
629 {
630  m_headerLength += 10 * bearers.size ();
631  m_erabsAdmittedList = bearers;
632 }
633 
634 std::vector <EpcX2Sap::ErabNotAdmittedItem>
635 EpcX2HandoverRequestAckHeader::GetNotAdmittedBearers () const
636 {
637  return m_erabsNotAdmittedList;
638 }
639 
640 void
641 EpcX2HandoverRequestAckHeader::SetNotAdmittedBearers (std::vector <EpcX2Sap::ErabNotAdmittedItem> bearers)
642 {
643  m_headerLength += 4 * bearers.size ();
644  m_erabsNotAdmittedList = bearers;
645 }
646 
647 uint32_t
648 EpcX2HandoverRequestAckHeader::GetLengthOfIes () const
649 {
650  return m_headerLength;
651 }
652 
653 uint32_t
654 EpcX2HandoverRequestAckHeader::GetNumberOfIes () const
655 {
656  return m_numberOfIes;
657 }
658 
660 
661 NS_OBJECT_ENSURE_REGISTERED (EpcX2HandoverPreparationFailureHeader);
662 
663 EpcX2HandoverPreparationFailureHeader::EpcX2HandoverPreparationFailureHeader ()
664  : m_numberOfIes (1 + 1 + 1),
665  m_headerLength (2 + 2 + 2),
666  m_oldEnbUeX2apId (0xfffa),
667  m_cause (0xfffa),
668  m_criticalityDiagnostics (0xfffa)
669 {
670 }
671 
672 EpcX2HandoverPreparationFailureHeader::~EpcX2HandoverPreparationFailureHeader ()
673 {
674  m_numberOfIes = 0;
675  m_headerLength = 0;
676  m_oldEnbUeX2apId = 0xfffb;
677  m_cause = 0xfffb;
678  m_criticalityDiagnostics = 0xfffb;
679 }
680 
681 TypeId
682 EpcX2HandoverPreparationFailureHeader::GetTypeId (void)
683 {
684  static TypeId tid = TypeId ("ns3::EpcX2HandoverPreparationFailureHeader")
685  .SetParent<Header> ()
686  .AddConstructor<EpcX2HandoverPreparationFailureHeader> ()
687  ;
688  return tid;
689 }
690 
691 TypeId
693 {
694  return GetTypeId ();
695 }
696 
697 uint32_t
699 {
700  return m_headerLength;
701 }
702 
703 void
705 {
706  Buffer::Iterator i = start;
707 
708  i.WriteHtonU16 (m_oldEnbUeX2apId);
709  i.WriteHtonU16 (m_cause);
710  i.WriteHtonU16 (m_criticalityDiagnostics);
711 }
712 
713 uint32_t
715 {
716  Buffer::Iterator i = start;
717 
718  m_oldEnbUeX2apId = i.ReadNtohU16 ();
719  m_cause = i.ReadNtohU16 ();
720  m_criticalityDiagnostics = i.ReadNtohU16 ();
721 
722  m_headerLength = 6;
723  m_numberOfIes = 3;
724 
725  return GetSerializedSize ();
726 }
727 
728 void
730 {
731  os << "OldEnbUeX2apId = " << m_oldEnbUeX2apId;
732  os << " Cause = " << m_cause;
733  os << " CriticalityDiagnostics = " << m_criticalityDiagnostics;
734 }
735 
736 uint16_t
737 EpcX2HandoverPreparationFailureHeader::GetOldEnbUeX2apId () const
738 {
739  return m_oldEnbUeX2apId;
740 }
741 
742 void
743 EpcX2HandoverPreparationFailureHeader::SetOldEnbUeX2apId (uint16_t x2apId)
744 {
745  m_oldEnbUeX2apId = x2apId;
746 }
747 
748 uint16_t
749 EpcX2HandoverPreparationFailureHeader::GetCause () const
750 {
751  return m_cause;
752 }
753 
754 void
755 EpcX2HandoverPreparationFailureHeader::SetCause (uint16_t cause)
756 {
757  m_cause = cause;
758 }
759 
760 uint16_t
761 EpcX2HandoverPreparationFailureHeader::GetCriticalityDiagnostics () const
762 {
763  return m_criticalityDiagnostics;
764 }
765 
766 void
767 EpcX2HandoverPreparationFailureHeader::SetCriticalityDiagnostics (uint16_t criticalityDiagnostics)
768 {
769  m_criticalityDiagnostics = criticalityDiagnostics;
770 }
771 
772 uint32_t
773 EpcX2HandoverPreparationFailureHeader::GetLengthOfIes () const
774 {
775  return m_headerLength;
776 }
777 
778 uint32_t
779 EpcX2HandoverPreparationFailureHeader::GetNumberOfIes () const
780 {
781  return m_numberOfIes;
782 }
783 
785 
786 NS_OBJECT_ENSURE_REGISTERED (EpcX2SnStatusTransferHeader);
787 
788 EpcX2SnStatusTransferHeader::EpcX2SnStatusTransferHeader ()
789  : m_numberOfIes (3),
790  m_headerLength (6),
791  m_oldEnbUeX2apId (0xfffa),
792  m_newEnbUeX2apId (0xfffa)
793 {
794  m_erabsSubjectToStatusTransferList.clear ();
795 }
796 
797 EpcX2SnStatusTransferHeader::~EpcX2SnStatusTransferHeader ()
798 {
799  m_numberOfIes = 0;
800  m_headerLength = 0;
801  m_oldEnbUeX2apId = 0xfffb;
802  m_newEnbUeX2apId = 0xfffb;
803  m_erabsSubjectToStatusTransferList.clear ();
804 }
805 
806 TypeId
807 EpcX2SnStatusTransferHeader::GetTypeId (void)
808 {
809  static TypeId tid = TypeId ("ns3::EpcX2SnStatusTransferHeader")
810  .SetParent<Header> ()
811  .AddConstructor<EpcX2SnStatusTransferHeader> ()
812  ;
813  return tid;
814 }
815 
816 TypeId
818 {
819  return GetTypeId ();
820 }
821 
822 uint32_t
824 {
825  return m_headerLength;
826 }
827 
828 void
830 {
831  Buffer::Iterator i = start;
832 
833  i.WriteHtonU16 (m_oldEnbUeX2apId);
834  i.WriteHtonU16 (m_newEnbUeX2apId);
835 
836  std::vector <EpcX2Sap::ErabsSubjectToStatusTransferItem>::size_type sz = m_erabsSubjectToStatusTransferList.size ();
837  i.WriteHtonU16 (sz); // number of ErabsSubjectToStatusTransferItems
838 
839  for (int j = 0; j < (int) sz; j++)
840  {
841  EpcX2Sap::ErabsSubjectToStatusTransferItem item = m_erabsSubjectToStatusTransferList [j];
842 
843  i.WriteHtonU16 (item.erabId);
844 
845  uint16_t bitsetSize = EpcX2Sap::m_maxPdcpSn / 64;
846  for (int k = 0; k < bitsetSize; k++)
847  {
848  uint64_t statusValue = 0;
849  for (int m = 0; m < 64; m++)
850  {
851  statusValue |= item.receiveStatusOfUlPdcpSdus[64 * k + m] << m;
852  }
853  i.WriteHtonU64 (statusValue);
854  }
855 
856  i.WriteHtonU16 (item.ulPdcpSn);
857  i.WriteHtonU32 (item.ulHfn);
858  i.WriteHtonU16 (item.dlPdcpSn);
859  i.WriteHtonU32 (item.dlHfn);
860  }
861 }
862 
863 uint32_t
865 {
866  Buffer::Iterator i = start;
867 
868  m_oldEnbUeX2apId = i.ReadNtohU16 ();
869  m_newEnbUeX2apId = i.ReadNtohU16 ();
870  int sz = i.ReadNtohU16 ();
871 
872  m_numberOfIes = 3;
873  m_headerLength = 6 + sz * (14 + (EpcX2Sap::m_maxPdcpSn / 64));
874 
875  for (int j = 0; j < sz; j++)
876  {
878  ErabItem.erabId = i.ReadNtohU16 ();
879 
880  uint16_t bitsetSize = EpcX2Sap::m_maxPdcpSn / 64;
881  for (int k = 0; k < bitsetSize; k++)
882  {
883  uint64_t statusValue = i.ReadNtohU64 ();
884  for (int m = 0; m < 64; m++)
885  {
886  ErabItem.receiveStatusOfUlPdcpSdus[64 * k + m] = (statusValue >> m) & 1;
887  }
888  }
889 
890  ErabItem.ulPdcpSn = i.ReadNtohU16 ();
891  ErabItem.ulHfn = i.ReadNtohU32 ();
892  ErabItem.dlPdcpSn = i.ReadNtohU16 ();
893  ErabItem.dlHfn = i.ReadNtohU32 ();
894 
895  m_erabsSubjectToStatusTransferList.push_back (ErabItem);
896  }
897 
898  return GetSerializedSize ();
899 }
900 
901 void
902 EpcX2SnStatusTransferHeader::Print (std::ostream &os) const
903 {
904  os << "OldEnbUeX2apId = " << m_oldEnbUeX2apId;
905  os << " NewEnbUeX2apId = " << m_newEnbUeX2apId;
906  os << " ErabsSubjectToStatusTransferList size = " << m_erabsSubjectToStatusTransferList.size ();
907 
908  std::vector <EpcX2Sap::ErabsSubjectToStatusTransferItem>::size_type sz = m_erabsSubjectToStatusTransferList.size ();
909  if (sz > 0)
910  {
911  os << " [";
912  }
913  for (int j = 0; j < (int) sz; j++)
914  {
915  os << m_erabsSubjectToStatusTransferList[j].erabId;
916  if (j < (int) sz - 1)
917  {
918  os << ", ";
919  }
920  else
921  {
922  os << "]";
923  }
924  }
925 }
926 
927 uint16_t
928 EpcX2SnStatusTransferHeader::GetOldEnbUeX2apId () const
929 {
930  return m_oldEnbUeX2apId;
931 }
932 
933 void
934 EpcX2SnStatusTransferHeader::SetOldEnbUeX2apId (uint16_t x2apId)
935 {
936  m_oldEnbUeX2apId = x2apId;
937 }
938 
939 uint16_t
940 EpcX2SnStatusTransferHeader::GetNewEnbUeX2apId () const
941 {
942  return m_newEnbUeX2apId;
943 }
944 
945 void
946 EpcX2SnStatusTransferHeader::SetNewEnbUeX2apId (uint16_t x2apId)
947 {
948  m_newEnbUeX2apId = x2apId;
949 }
950 
951 std::vector <EpcX2Sap::ErabsSubjectToStatusTransferItem>
952 EpcX2SnStatusTransferHeader::GetErabsSubjectToStatusTransferList () const
953 {
954  return m_erabsSubjectToStatusTransferList;
955 }
956 
957 void
958 EpcX2SnStatusTransferHeader::SetErabsSubjectToStatusTransferList (std::vector <EpcX2Sap::ErabsSubjectToStatusTransferItem> erabs)
959 {
960  m_headerLength += erabs.size () * (14 + (EpcX2Sap::m_maxPdcpSn / 8));
961  m_erabsSubjectToStatusTransferList = erabs;
962 }
963 
964 uint32_t
965 EpcX2SnStatusTransferHeader::GetLengthOfIes () const
966 {
967  return m_headerLength;
968 }
969 
970 uint32_t
971 EpcX2SnStatusTransferHeader::GetNumberOfIes () const
972 {
973  return m_numberOfIes;
974 }
975 
977 
978 NS_OBJECT_ENSURE_REGISTERED (EpcX2UeContextReleaseHeader);
979 
980 EpcX2UeContextReleaseHeader::EpcX2UeContextReleaseHeader ()
981  : m_numberOfIes (1 + 1),
982  m_headerLength (2 + 2),
983  m_oldEnbUeX2apId (0xfffa),
984  m_newEnbUeX2apId (0xfffa)
985 {
986 }
987 
988 EpcX2UeContextReleaseHeader::~EpcX2UeContextReleaseHeader ()
989 {
990  m_numberOfIes = 0;
991  m_headerLength = 0;
992  m_oldEnbUeX2apId = 0xfffb;
993  m_newEnbUeX2apId = 0xfffb;
994 }
995 
996 TypeId
997 EpcX2UeContextReleaseHeader::GetTypeId (void)
998 {
999  static TypeId tid = TypeId ("ns3::EpcX2UeContextReleaseHeader")
1000  .SetParent<Header> ()
1001  .AddConstructor<EpcX2UeContextReleaseHeader> ()
1002  ;
1003  return tid;
1004 }
1005 
1006 TypeId
1008 {
1009  return GetTypeId ();
1010 }
1011 
1012 uint32_t
1014 {
1015  return m_headerLength;
1016 }
1017 
1018 void
1020 {
1021  Buffer::Iterator i = start;
1022 
1023  i.WriteHtonU16 (m_oldEnbUeX2apId);
1024  i.WriteHtonU16 (m_newEnbUeX2apId);
1025 }
1026 
1027 uint32_t
1029 {
1030  Buffer::Iterator i = start;
1031 
1032  m_oldEnbUeX2apId = i.ReadNtohU16 ();
1033  m_newEnbUeX2apId = i.ReadNtohU16 ();
1034  m_numberOfIes = 2;
1035  m_headerLength = 4;
1036 
1037  return GetSerializedSize ();
1038 }
1039 
1040 void
1041 EpcX2UeContextReleaseHeader::Print (std::ostream &os) const
1042 {
1043  os << "OldEnbUeX2apId=" << m_oldEnbUeX2apId;
1044  os << " NewEnbUeX2apId=" << m_newEnbUeX2apId;
1045 }
1046 
1047 uint16_t
1048 EpcX2UeContextReleaseHeader::GetOldEnbUeX2apId () const
1049 {
1050  return m_oldEnbUeX2apId;
1051 }
1052 
1053 void
1054 EpcX2UeContextReleaseHeader::SetOldEnbUeX2apId (uint16_t x2apId)
1055 {
1056  m_oldEnbUeX2apId = x2apId;
1057 }
1058 
1059 uint16_t
1060 EpcX2UeContextReleaseHeader::GetNewEnbUeX2apId () const
1061 {
1062  return m_newEnbUeX2apId;
1063 }
1064 
1065 void
1066 EpcX2UeContextReleaseHeader::SetNewEnbUeX2apId (uint16_t x2apId)
1067 {
1068  m_newEnbUeX2apId = x2apId;
1069 }
1070 
1071 uint32_t
1072 EpcX2UeContextReleaseHeader::GetLengthOfIes () const
1073 {
1074  return m_headerLength;
1075 }
1076 
1077 uint32_t
1078 EpcX2UeContextReleaseHeader::GetNumberOfIes () const
1079 {
1080  return m_numberOfIes;
1081 }
1082 
1084 
1085 NS_OBJECT_ENSURE_REGISTERED (EpcX2LoadInformationHeader);
1086 
1087 EpcX2LoadInformationHeader::EpcX2LoadInformationHeader ()
1088  : m_numberOfIes (1),
1089  m_headerLength (6)
1090 {
1091  m_cellInformationList.clear ();
1092 }
1093 
1094 EpcX2LoadInformationHeader::~EpcX2LoadInformationHeader ()
1095 {
1096  m_numberOfIes = 0;
1097  m_headerLength = 0;
1098  m_cellInformationList.clear ();
1099 }
1100 
1101 TypeId
1102 EpcX2LoadInformationHeader::GetTypeId (void)
1103 {
1104  static TypeId tid = TypeId ("ns3::EpcX2LoadInformationHeader")
1105  .SetParent<Header> ()
1106  .AddConstructor<EpcX2LoadInformationHeader> ()
1107  ;
1108  return tid;
1109 }
1110 
1111 TypeId
1113 {
1114  return GetTypeId ();
1115 }
1116 
1117 uint32_t
1119 {
1120  return m_headerLength;
1121 }
1122 
1123 void
1125 {
1126  Buffer::Iterator i = start;
1127 
1128  i.WriteHtonU16 (6); // id = CELL_INFORMATION
1129  i.WriteU8 (1 << 6); // criticality = IGNORE
1130  i.WriteU8 (4); // length of CELL_INFORMATION_ID
1131 
1132  std::vector <EpcX2Sap::CellInformationItem>::size_type sz = m_cellInformationList.size ();
1133  i.WriteHtonU16 (sz); // number of cellInformationItems
1134 
1135  for (int j = 0; j < (int) sz; j++)
1136  {
1137  i.WriteHtonU16 (m_cellInformationList [j].sourceCellId);
1138 
1139  std::vector <EpcX2Sap::UlInterferenceOverloadIndicationItem>::size_type sz2;
1140  sz2 = m_cellInformationList [j].ulInterferenceOverloadIndicationList.size ();
1141  i.WriteHtonU16 (sz2); // number of UlInterferenceOverloadIndicationItem
1142 
1143  for (int k = 0; k < (int) sz2; k++)
1144  {
1145  i.WriteU8 (m_cellInformationList [j].ulInterferenceOverloadIndicationList [k]);
1146  }
1147 
1148  std::vector <EpcX2Sap::UlHighInterferenceInformationItem>::size_type sz3;
1149  sz3 = m_cellInformationList [j].ulHighInterferenceInformationList.size ();
1150  i.WriteHtonU16 (sz3); // number of UlHighInterferenceInformationItem
1151 
1152  for (int k = 0; k < (int) sz3; k++)
1153  {
1154  i.WriteHtonU16 (m_cellInformationList [j].ulHighInterferenceInformationList [k].targetCellId);
1155 
1156  std::vector <bool>::size_type sz4;
1157  sz4 = m_cellInformationList [j].ulHighInterferenceInformationList [k].ulHighInterferenceIndicationList.size ();
1158  i.WriteHtonU16 (sz4);
1159 
1160  for (int m = 0; m < (int) sz4; m++)
1161  {
1162  i.WriteU8 (m_cellInformationList [j].ulHighInterferenceInformationList [k].ulHighInterferenceIndicationList [m]);
1163  }
1164  }
1165 
1166  std::vector <bool>::size_type sz5;
1167  sz5 = m_cellInformationList [j].relativeNarrowbandTxBand.rntpPerPrbList.size ();
1168  i.WriteHtonU16 (sz5);
1169 
1170  for (int k = 0; k < (int) sz5; k++)
1171  {
1172  i.WriteU8 (m_cellInformationList [j].relativeNarrowbandTxBand.rntpPerPrbList [k]);
1173  }
1174 
1175  i.WriteHtonU16 (m_cellInformationList [j].relativeNarrowbandTxBand.rntpThreshold);
1176  i.WriteHtonU16 (m_cellInformationList [j].relativeNarrowbandTxBand.antennaPorts);
1177  i.WriteHtonU16 (m_cellInformationList [j].relativeNarrowbandTxBand.pB);
1178  i.WriteHtonU16 (m_cellInformationList [j].relativeNarrowbandTxBand.pdcchInterferenceImpact);
1179  }
1180 }
1181 
1182 uint32_t
1184 {
1185  Buffer::Iterator i = start;
1186 
1187  m_headerLength = 0;
1188  m_numberOfIes = 0;
1189 
1190  i.ReadNtohU16 ();
1191  i.ReadU8 ();
1192  i.ReadU8 ();
1193  int sz = i.ReadNtohU16 ();
1194  m_headerLength += 6;
1195  m_numberOfIes++;
1196 
1197  for (int j = 0; j < sz; j++)
1198  {
1199  EpcX2Sap::CellInformationItem cellInfoItem;
1200  cellInfoItem.sourceCellId = i.ReadNtohU16 ();
1201  m_headerLength += 2;
1202 
1203  int sz2 = i.ReadNtohU16 ();
1204  m_headerLength += 2;
1205  for (int k = 0; k < sz2; k++)
1206  {
1208  cellInfoItem.ulInterferenceOverloadIndicationList.push_back (item);
1209  }
1210  m_headerLength += sz2;
1211 
1212  int sz3 = i.ReadNtohU16 ();
1213  m_headerLength += 2;
1214  for (int k = 0; k < sz3; k++)
1215  {
1217  item.targetCellId = i.ReadNtohU16 ();
1218  m_headerLength += 2;
1219 
1220  int sz4 = i.ReadNtohU16 ();
1221  m_headerLength += 2;
1222  for (int m = 0; m < sz4; m++)
1223  {
1224  item.ulHighInterferenceIndicationList.push_back (i.ReadU8 ());
1225  }
1226  m_headerLength += sz4;
1227 
1228  cellInfoItem.ulHighInterferenceInformationList.push_back (item);
1229  }
1230 
1231  int sz5 = i.ReadNtohU16 ();
1232  m_headerLength += 2;
1233  for (int k = 0; k < sz5; k++)
1234  {
1235  cellInfoItem.relativeNarrowbandTxBand.rntpPerPrbList.push_back (i.ReadU8 ());
1236  }
1237  m_headerLength += sz5;
1238 
1239  cellInfoItem.relativeNarrowbandTxBand.rntpThreshold = i.ReadNtohU16 ();
1240  cellInfoItem.relativeNarrowbandTxBand.antennaPorts = i.ReadNtohU16 ();
1241  cellInfoItem.relativeNarrowbandTxBand.pB = i.ReadNtohU16 ();
1242  cellInfoItem.relativeNarrowbandTxBand.pdcchInterferenceImpact = i.ReadNtohU16 ();
1243  m_headerLength += 8;
1244 
1245  m_cellInformationList.push_back (cellInfoItem);
1246  }
1247 
1248  return GetSerializedSize ();
1249 }
1250 
1251 void
1252 EpcX2LoadInformationHeader::Print (std::ostream &os) const
1253 {
1254  os << "NumOfCellInformationItems=" << m_cellInformationList.size ();
1255 }
1256 
1257 std::vector <EpcX2Sap::CellInformationItem>
1258 EpcX2LoadInformationHeader::GetCellInformationList () const
1259 {
1260  return m_cellInformationList;
1261 }
1262 
1263 void
1264 EpcX2LoadInformationHeader::SetCellInformationList (std::vector <EpcX2Sap::CellInformationItem> cellInformationList)
1265 {
1266  m_cellInformationList = cellInformationList;
1267  m_headerLength += 2;
1268 
1269  std::vector <EpcX2Sap::CellInformationItem>::size_type sz = m_cellInformationList.size ();
1270  for (int j = 0; j < (int) sz; j++)
1271  {
1272  m_headerLength += 2;
1273 
1274  std::vector <EpcX2Sap::UlInterferenceOverloadIndicationItem>::size_type sz2;
1275  sz2 = m_cellInformationList [j].ulInterferenceOverloadIndicationList.size ();
1276  m_headerLength += 2 + sz2;
1277 
1278  std::vector <EpcX2Sap::UlHighInterferenceInformationItem>::size_type sz3;
1279  sz3 = m_cellInformationList [j].ulHighInterferenceInformationList.size ();
1280  m_headerLength += 2;
1281 
1282  for (int k = 0; k < (int) sz3; k++)
1283  {
1284  std::vector <bool>::size_type sz4;
1285  sz4 = m_cellInformationList [j].ulHighInterferenceInformationList [k].ulHighInterferenceIndicationList.size ();
1286  m_headerLength += 2 + 2 + sz4;
1287  }
1288 
1289  std::vector <bool>::size_type sz5;
1290  sz5 = m_cellInformationList [j].relativeNarrowbandTxBand.rntpPerPrbList.size ();
1291  m_headerLength += 2 + sz5 + 8;
1292  }
1293 }
1294 
1295 uint32_t
1296 EpcX2LoadInformationHeader::GetLengthOfIes () const
1297 {
1298  return m_headerLength;
1299 }
1300 
1301 uint32_t
1302 EpcX2LoadInformationHeader::GetNumberOfIes () const
1303 {
1304  return m_numberOfIes;
1305 }
1306 
1308 
1309 NS_OBJECT_ENSURE_REGISTERED (EpcX2ResourceStatusUpdateHeader);
1310 
1311 EpcX2ResourceStatusUpdateHeader::EpcX2ResourceStatusUpdateHeader ()
1312  : m_numberOfIes (3),
1313  m_headerLength (6),
1314  m_enb1MeasurementId (0xfffa),
1315  m_enb2MeasurementId (0xfffa)
1316 {
1317  m_cellMeasurementResultList.clear ();
1318 }
1319 
1320 EpcX2ResourceStatusUpdateHeader::~EpcX2ResourceStatusUpdateHeader ()
1321 {
1322  m_numberOfIes = 0;
1323  m_headerLength = 0;
1324  m_enb1MeasurementId = 0xfffb;
1325  m_enb2MeasurementId = 0xfffb;
1326  m_cellMeasurementResultList.clear ();
1327 }
1328 
1329 TypeId
1330 EpcX2ResourceStatusUpdateHeader::GetTypeId (void)
1331 {
1332  static TypeId tid = TypeId ("ns3::EpcX2ResourceStatusUpdateHeader")
1333  .SetParent<Header> ()
1334  .AddConstructor<EpcX2ResourceStatusUpdateHeader> ()
1335  ;
1336  return tid;
1337 }
1338 
1339 TypeId
1341 {
1342  return GetTypeId ();
1343 }
1344 
1345 uint32_t
1347 {
1348  return m_headerLength;
1349 }
1350 
1351 void
1353 {
1354  Buffer::Iterator i = start;
1355 
1356  i.WriteHtonU16 (m_enb1MeasurementId);
1357  i.WriteHtonU16 (m_enb2MeasurementId);
1358 
1359  std::vector <EpcX2Sap::CellMeasurementResultItem>::size_type sz = m_cellMeasurementResultList.size ();
1360  i.WriteHtonU16 (sz); // number of CellMeasurementResultItem
1361 
1362  for (int j = 0; j < (int) sz; j++)
1363  {
1364  EpcX2Sap::CellMeasurementResultItem item = m_cellMeasurementResultList [j];
1365 
1366  i.WriteHtonU16 (item.sourceCellId);
1367  i.WriteU8 (item.dlHardwareLoadIndicator);
1368  i.WriteU8 (item.ulHardwareLoadIndicator);
1369  i.WriteU8 (item.dlS1TnlLoadIndicator);
1370  i.WriteU8 (item.ulS1TnlLoadIndicator);
1371 
1372  i.WriteHtonU16 (item.dlGbrPrbUsage);
1373  i.WriteHtonU16 (item.ulGbrPrbUsage);
1374  i.WriteHtonU16 (item.dlNonGbrPrbUsage);
1375  i.WriteHtonU16 (item.ulNonGbrPrbUsage);
1376  i.WriteHtonU16 (item.dlTotalPrbUsage);
1377  i.WriteHtonU16 (item.ulTotalPrbUsage);
1378 
1379  i.WriteHtonU16 (item.dlCompositeAvailableCapacity.cellCapacityClassValue);
1380  i.WriteHtonU16 (item.dlCompositeAvailableCapacity.capacityValue);
1381  i.WriteHtonU16 (item.ulCompositeAvailableCapacity.cellCapacityClassValue);
1382  i.WriteHtonU16 (item.ulCompositeAvailableCapacity.capacityValue);
1383  }
1384 }
1385 
1386 uint32_t
1388 {
1389  Buffer::Iterator i = start;
1390 
1391  m_enb1MeasurementId = i.ReadNtohU16 ();
1392  m_enb2MeasurementId = i.ReadNtohU16 ();
1393 
1394  int sz = i.ReadNtohU16 ();
1395  for (int j = 0; j < sz; j++)
1396  {
1398 
1399  item.sourceCellId = i.ReadNtohU16 ();
1400  item.dlHardwareLoadIndicator = (EpcX2Sap::LoadIndicator) i.ReadU8 ();
1401  item.ulHardwareLoadIndicator = (EpcX2Sap::LoadIndicator) i.ReadU8 ();
1402  item.dlS1TnlLoadIndicator = (EpcX2Sap::LoadIndicator) i.ReadU8 ();
1403  item.ulS1TnlLoadIndicator = (EpcX2Sap::LoadIndicator) i.ReadU8 ();
1404 
1405  item.dlGbrPrbUsage = i.ReadNtohU16 ();
1406  item.ulGbrPrbUsage = i.ReadNtohU16 ();
1407  item.dlNonGbrPrbUsage = i.ReadNtohU16 ();
1408  item.ulNonGbrPrbUsage = i.ReadNtohU16 ();
1409  item.dlTotalPrbUsage = i.ReadNtohU16 ();
1410  item.ulTotalPrbUsage = i.ReadNtohU16 ();
1411 
1412  item.dlCompositeAvailableCapacity.cellCapacityClassValue = i.ReadNtohU16 ();
1413  item.dlCompositeAvailableCapacity.capacityValue = i.ReadNtohU16 ();
1414  item.ulCompositeAvailableCapacity.cellCapacityClassValue = i.ReadNtohU16 ();
1415  item.ulCompositeAvailableCapacity.capacityValue = i.ReadNtohU16 ();
1416 
1417  m_cellMeasurementResultList.push_back (item);
1418  }
1419 
1420  m_headerLength = 6 + sz * 26;
1421  m_numberOfIes = 3;
1422 
1423  return GetSerializedSize ();
1424 }
1425 
1426 void
1428 {
1429  os << "Enb1MeasurementId = " << m_enb1MeasurementId
1430  << " Enb2MeasurementId = " << m_enb2MeasurementId
1431  << " NumOfCellMeasurementResultItems = " << m_cellMeasurementResultList.size ();
1432 }
1433 
1434 uint16_t
1435 EpcX2ResourceStatusUpdateHeader::GetEnb1MeasurementId () const
1436 {
1437  return m_enb1MeasurementId;
1438 }
1439 
1440 void
1441 EpcX2ResourceStatusUpdateHeader::SetEnb1MeasurementId (uint16_t enb1MeasurementId)
1442 {
1443  m_enb1MeasurementId = enb1MeasurementId;
1444 }
1445 
1446 uint16_t
1447 EpcX2ResourceStatusUpdateHeader::GetEnb2MeasurementId () const
1448 {
1449  return m_enb2MeasurementId;
1450 }
1451 
1452 void
1453 EpcX2ResourceStatusUpdateHeader::SetEnb2MeasurementId (uint16_t enb2MeasurementId)
1454 {
1455  m_enb2MeasurementId = enb2MeasurementId;
1456 }
1457 
1458 std::vector <EpcX2Sap::CellMeasurementResultItem>
1459 EpcX2ResourceStatusUpdateHeader::GetCellMeasurementResultList () const
1460 {
1461  return m_cellMeasurementResultList;
1462 }
1463 
1464 void
1465 EpcX2ResourceStatusUpdateHeader::SetCellMeasurementResultList (std::vector <EpcX2Sap::CellMeasurementResultItem> cellMeasurementResultList)
1466 {
1467  m_cellMeasurementResultList = cellMeasurementResultList;
1468 
1469  std::vector <EpcX2Sap::CellMeasurementResultItem>::size_type sz = m_cellMeasurementResultList.size ();
1470  m_headerLength += sz * 26;
1471 }
1472 
1473 uint32_t
1474 EpcX2ResourceStatusUpdateHeader::GetLengthOfIes () const
1475 {
1476  return m_headerLength;
1477 }
1478 
1479 uint32_t
1480 EpcX2ResourceStatusUpdateHeader::GetNumberOfIes () const
1481 {
1482  return m_numberOfIes;
1483 }
1484 
1485 } // namespace ns3
virtual uint32_t Deserialize(Buffer::Iterator start)
virtual void Print(std::ostream &os) const
void WriteHtonU64(uint64_t data)
Definition: buffer.cc:965
virtual void Serialize(Buffer::Iterator start) const
virtual uint32_t GetSerializedSize(void) const
virtual TypeId GetInstanceTypeId(void) const
uint64_t ReadNtohU64(void)
Definition: buffer.cc:1068
#define NS_LOG_COMPONENT_DEFINE(name)
Definition: log.h:122
virtual void Serialize(Buffer::Iterator start) const
virtual void Print(std::ostream &os) const
virtual uint32_t Deserialize(Buffer::Iterator start)
virtual void Serialize(Buffer::Iterator start) const
virtual void Serialize(Buffer::Iterator start) const
virtual void Serialize(Buffer::Iterator start) const
virtual uint32_t GetSerializedSize(void) const
virtual void Serialize(Buffer::Iterator start) const
uint32_t ReadNtohU32(void)
Definition: buffer.h:791
iterator in a Buffer instance
Definition: buffer.h:98
virtual void Serialize(Buffer::Iterator start) const
virtual TypeId GetInstanceTypeId(void) const
virtual uint32_t GetSerializedSize(void) const
virtual uint32_t GetSerializedSize(void) const
UlInterferenceOverloadIndicationItem
Definition: epc-x2-sap.h:114
virtual void Print(std::ostream &os) const
static const uint16_t m_maxPdcpSn
Definition: epc-x2-sap.h:98
virtual TypeId GetInstanceTypeId(void) const
void WriteHtonU16(uint16_t data)
Definition: buffer.h:726
virtual TypeId GetInstanceTypeId(void) const
virtual TypeId GetInstanceTypeId(void) const
virtual void Print(std::ostream &os) const
virtual uint32_t Deserialize(Buffer::Iterator start)
void WriteHtonU32(uint32_t data)
Definition: buffer.h:745
virtual TypeId GetInstanceTypeId(void) const
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:38
virtual void Print(std::ostream &os) const
virtual void Serialize(Buffer::Iterator start) const
void WriteU8(uint8_t data)
Definition: buffer.h:690
virtual TypeId GetInstanceTypeId(void) const
virtual uint32_t GetSerializedSize(void) const
virtual uint32_t Deserialize(Buffer::Iterator start)
virtual void Print(std::ostream &os) const
uint8_t ReadU8(void)
Definition: buffer.h:819
virtual TypeId GetInstanceTypeId(void) const
virtual uint32_t Deserialize(Buffer::Iterator start)
uint16_t ReadNtohU16(void)
Definition: buffer.h:767
virtual uint32_t GetSerializedSize(void) const
virtual uint32_t GetSerializedSize(void) const
virtual uint32_t Deserialize(Buffer::Iterator start)
virtual uint32_t Deserialize(Buffer::Iterator start)
virtual uint32_t GetSerializedSize(void) const
virtual void Print(std::ostream &os) const
virtual uint32_t Deserialize(Buffer::Iterator start)
virtual void Print(std::ostream &os) const