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