A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wimax-tlv.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 INRIA, UDcast
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
7 *
8 */
9
10#include "wimax-tlv.h"
11
12namespace ns3
13{
14
16
17// NS_OBJECT_ENSURE_REGISTERED ("Tlv");
18
19/* static */
20TypeId
22{
23 static TypeId tid =
24 TypeId("ns3::Tlv").SetParent<Header>().SetGroupName("Wimax").AddConstructor<Tlv>();
25 return tid;
26}
27
30{
31 return GetTypeId();
32}
33
34void
35Tlv::Print(std::ostream& os) const
36{
37 os << "TLV type = " << (uint32_t)m_type << " TLV Length = " << (uint64_t)m_length;
38}
39
40Tlv::Tlv(uint8_t type, uint64_t length, const TlvValue& value)
41{
42 m_type = type;
43 m_length = length;
44 m_value = value.Copy();
45}
46
48{
49 m_type = 0;
50 m_length = 0;
51 m_value = nullptr;
52}
53
55{
56 if (m_value != nullptr)
57 {
58 delete m_value;
59 m_value = nullptr;
60 }
61}
62
65{
66 return m_value->Copy();
67}
68
69Tlv::Tlv(const Tlv& tlv)
70{
71 m_type = tlv.GetType();
72 m_length = tlv.GetLength();
73 m_value = tlv.CopyValue();
74}
75
76Tlv&
78{
79 if (m_value != nullptr)
80 {
81 delete m_value;
82 }
83 m_type = o.GetType();
84 m_length = o.GetLength();
85 m_value = o.CopyValue();
86
87 return *this;
88}
89
92{
93 return 1 + GetSizeOfLen() + m_value->GetSerializedSize();
94}
95
96uint8_t
98{
99 uint8_t sizeOfLen = 1;
100
101 if (m_length > 127)
102 {
103 sizeOfLen = 2;
104 uint64_t testValue = 0xFF;
105 while (m_length > testValue)
106 {
107 sizeOfLen++;
108 testValue *= 0xFF;
109 }
110 }
111 return sizeOfLen;
112}
113
114void
116{
117 i.WriteU8(m_type);
118 uint8_t lenSize = GetSizeOfLen();
119 if (lenSize == 1)
120 {
121 i.WriteU8(m_length);
122 }
123 else
124 {
125 i.WriteU8((lenSize - 1) | WIMAX_TLV_EXTENDED_LENGTH_MASK);
126 for (int j = 0; j < lenSize - 1; j++)
127 {
128 i.WriteU8((uint8_t)(m_length >> ((lenSize - 1 - 1 - j) * 8)));
129 }
130 }
131 m_value->Serialize(i);
132}
133
136{
137 // read the type of tlv
138 m_type = i.ReadU8();
139
140 // read the length
141 uint8_t lenSize = i.ReadU8();
142 uint32_t serializedSize = 2;
143 if (lenSize < 127)
144 {
145 m_length = lenSize;
146 }
147 else
148 {
149 lenSize &= ~WIMAX_TLV_EXTENDED_LENGTH_MASK;
150 for (int j = 0; j < lenSize; j++)
151 {
152 m_length <<= 8;
153 m_length |= i.ReadU8();
154 serializedSize++;
155 }
156 }
157 switch (m_type)
158 {
159 case HMAC_TUPLE:
160 /// \todo implement Deserialize HMAC_TUPLE
161 NS_FATAL_ERROR("Not implemented-- please implement and contribute a patch");
162 break;
164 /// \todo implement Deserialize MAC_VERSION_ENCODING
165 NS_FATAL_ERROR("Not implemented-- please implement and contribute a patch");
166 break;
168 /// \todo implement Deserialize CURRENT_TRANSMIT_POWER
169 NS_FATAL_ERROR("Not implemented-- please implement and contribute a patch");
170 break;
173 serializedSize += val.Deserialize(i, m_length);
174 m_value = val.Copy();
175 break;
176 }
177 case UPLINK_SERVICE_FLOW: {
179 serializedSize += val.Deserialize(i, m_length);
180 m_value = val.Copy();
181 break;
182 }
184 /// \todo implement Deserialize VENDOR_ID_EMCODING
185 NS_FATAL_ERROR("Not implemented-- please implement and contribute a patch");
186 break;
188 /// \todo implement Deserialize VENDOR_SPECIFIC_INFORMATION
189 NS_FATAL_ERROR("Not implemented-- please implement and contribute a patch");
190 break;
191 default:
192 NS_ASSERT_MSG(false, "Unknown tlv type.");
193 break;
194 }
195
196 return serializedSize;
197}
198
199uint8_t
201{
202 return m_type;
203}
204
205uint64_t
207{
208 return m_length;
209}
210
213{
214 return m_value;
215}
216
217Tlv*
219{
220 return new Tlv(m_type, m_length, *m_value);
221}
222
223// ==============================================================================
225{
226 m_tlvList = new std::vector<Tlv*>;
227}
228
230{
231 for (auto iter = m_tlvList->begin(); iter != m_tlvList->end(); ++iter)
232 {
233 delete (*iter);
234 }
235 m_tlvList->clear();
236 delete m_tlvList;
237}
238
241{
242 uint32_t size = 0;
243 for (auto iter = m_tlvList->begin(); iter != m_tlvList->end(); ++iter)
244 {
245 size += (*iter)->GetSerializedSize();
246 }
247 return size;
248}
249
250void
252{
253 for (auto iter = m_tlvList->begin(); iter != m_tlvList->end(); ++iter)
254 {
255 (*iter)->Serialize(i);
256 i.Next((*iter)->GetSerializedSize());
257 }
258}
259
262{
263 return m_tlvList->begin();
264}
265
268{
269 return m_tlvList->end();
270}
271
272void
274{
275 m_tlvList->push_back(val.Copy());
276}
277
278// ==============================================================================
282
285{
286 auto tmp = new SfVectorTlvValue();
287 for (auto iter = Begin(); iter != End(); ++iter)
288 {
289 tmp->Add(Tlv((*iter)->GetType(), (*iter)->GetLength(), *(*iter)->PeekValue()));
290 }
291 return tmp;
292}
293
296{
297 uint64_t serializedSize = 0;
298 while (serializedSize < valueLen)
299 {
300 uint8_t type = i.ReadU8();
301 // read the length
302 uint8_t lenSize = i.ReadU8();
303 serializedSize += 2;
304 uint64_t length = 0;
305 if (lenSize < 127)
306 {
307 length = lenSize;
308 }
309 else
310 {
311 lenSize &= ~WIMAX_TLV_EXTENDED_LENGTH_MASK;
312 for (int j = 0; j < lenSize; j++)
313 {
314 length <<= 8;
315 length |= i.ReadU8();
316 serializedSize++;
317 }
318 }
319 switch (type)
320 {
321 case SFID: {
322 U32TlvValue val;
323 serializedSize += val.Deserialize(i);
324 Add(Tlv(SFID, 4, val));
325 break;
326 }
327 case CID: {
328 U16TlvValue val;
329 serializedSize += val.Deserialize(i);
330 Add(Tlv(CID, 2, val));
331 break;
332 }
334 NS_FATAL_ERROR("Not implemented-- please implement and contribute a patch");
335 break;
336 case reserved1:
337 // NOTHING
338 break;
340 U8TlvValue val;
341 serializedSize += val.Deserialize(i);
343 break;
344 }
345 case Traffic_Priority: {
346 U8TlvValue val;
347 serializedSize += val.Deserialize(i);
348 Add(Tlv(Traffic_Priority, 1, val));
349 break;
350 }
352 U32TlvValue val;
353 serializedSize += val.Deserialize(i);
355 break;
356 }
358 U32TlvValue val;
359 serializedSize += val.Deserialize(i);
360 Add(Tlv(Maximum_Traffic_Burst, 4, val));
361 break;
362 }
364 U32TlvValue val;
365 serializedSize += val.Deserialize(i);
367 break;
368 }
370 U32TlvValue val;
371 serializedSize += val.Deserialize(i);
373 break;
374 }
376 U8TlvValue val;
377 serializedSize += val.Deserialize(i);
379 break;
380 }
382 U32TlvValue val;
383 serializedSize += val.Deserialize(i);
385 break;
386 }
387 case Tolerated_Jitter: {
388 U32TlvValue val;
389 serializedSize += val.Deserialize(i);
390 Add(Tlv(Tolerated_Jitter, 4, val));
391 break;
392 }
393 case Maximum_Latency: {
394 U32TlvValue val;
395 serializedSize += val.Deserialize(i);
396 Add(Tlv(Maximum_Latency, 4, val));
397 break;
398 }
400 U8TlvValue val;
401 serializedSize += val.Deserialize(i);
403 break;
404 }
405 case SDU_Size: {
406 U8TlvValue val;
407 serializedSize += val.Deserialize(i);
408 Add(Tlv(SDU_Size, 1, val));
409 break;
410 }
411 case Target_SAID: {
412 U16TlvValue val;
413 serializedSize += val.Deserialize(i);
414 Add(Tlv(Target_SAID, 2, val));
415 break;
416 }
417 case ARQ_Enable: {
418 U8TlvValue val;
419 serializedSize += val.Deserialize(i);
420 Add(Tlv(ARQ_Enable, 1, val));
421 break;
422 }
423 case ARQ_WINDOW_SIZE: {
424 U16TlvValue val;
425 serializedSize += val.Deserialize(i);
426 Add(Tlv(ARQ_WINDOW_SIZE, 2, val));
427 break;
428 }
432 case ARQ_SYNC_LOSS:
435 case ARQ_BLOCK_SIZE:
436 case reserved2:
437 break;
438 case CS_Specification: {
439 U8TlvValue val;
440 serializedSize += val.Deserialize(i);
441 Add(Tlv(CS_Specification, 1, val));
442 break;
443 }
444 case IPV4_CS_Parameters: {
446 uint32_t size = val.Deserialize(i, length);
447 serializedSize += size;
448 Add(Tlv(IPV4_CS_Parameters, size, val));
449 break;
450 }
451 default:
452 NS_ASSERT_MSG(false, "Unknown tlv type.");
453 break;
454 }
455 i.Next(length);
456 }
457 return serializedSize;
458}
459
460// ==============================================================================
461
463{
464 m_value = value;
465}
466
468{
469 m_value = 0;
470}
471
475
478{
479 return 1;
480}
481
482void
487
490{
491 return Deserialize(i);
492}
493
496{
497 m_value = i.ReadU8();
498 return 1;
499}
500
501uint8_t
503{
504 return m_value;
505}
506
509{
510 auto tmp = new U8TlvValue(m_value);
511 return tmp;
512}
513
514// ==============================================================================
516{
517 m_value = value;
518}
519
524
528
531{
532 return 2;
533}
534
535void
540
543{
544 return Deserialize(i);
545}
546
549{
550 m_value = i.ReadNtohU16();
551 return 2;
552}
553
554uint16_t
556{
557 return m_value;
558}
559
562{
563 auto tmp = new U16TlvValue(m_value);
564 return tmp;
565}
566
567// ==============================================================================
569{
570 m_value = value;
571}
572
577
581
584{
585 return 4;
586}
587
588void
593
596{
597 return Deserialize(i);
598}
599
602{
603 m_value = i.ReadNtohU32();
604 return 4;
605}
606
609{
610 return m_value;
611}
612
615{
616 auto tmp = new U32TlvValue(m_value);
617 return tmp;
618}
619
620// ==============================================================================
623{
624 uint64_t serializedSize = 0;
625 uint8_t lenSize = 0;
626 uint8_t type = 0;
627 while (serializedSize < valueLength)
628 {
629 type = i.ReadU8();
630 // read the length
631 lenSize = i.ReadU8();
632 serializedSize += 2;
633 uint64_t length = 0;
634 if (lenSize < 127)
635 {
636 length = lenSize;
637 }
638 else
639 {
640 lenSize &= ~WIMAX_TLV_EXTENDED_LENGTH_MASK;
641 for (int j = 0; j < lenSize; j++)
642 {
643 length <<= 8;
644 length |= i.ReadU8();
645 serializedSize++;
646 }
647 }
648 switch (type)
649 {
651 U8TlvValue val;
652 serializedSize += val.Deserialize(i);
653 Add(Tlv(Classifier_DSC_Action, 1, val));
654 break;
655 }
658 serializedSize += val.Deserialize(i, length);
660 break;
661 }
662 }
663 i.Next(length);
664 }
665 return serializedSize;
666}
667
671
674{
675 auto tmp = new CsParamVectorTlvValue();
676 for (auto iter = Begin(); iter != End(); ++iter)
677 {
678 tmp->Add(Tlv((*iter)->GetType(), (*iter)->GetLength(), *(*iter)->PeekValue()));
679 }
680 return tmp;
681}
682
683// ==============================================================================
684
688
691{
692 auto tmp = new ClassificationRuleVectorTlvValue();
693 for (auto iter = Begin(); iter != End(); ++iter)
694 {
695 tmp->Add(Tlv((*iter)->GetType(), (*iter)->GetLength(), *(*iter)->PeekValue()));
696 }
697 return tmp;
698}
699
702{
703 uint64_t serializedSize = 0;
704 uint8_t lenSize = 0;
705 uint8_t type = 0;
706 while (serializedSize < valueLength)
707 {
708 type = i.ReadU8();
709 // read the length
710 lenSize = i.ReadU8();
711 serializedSize += 2;
712 uint64_t length = 0;
713 if (lenSize < 127)
714 {
715 length = lenSize;
716 }
717 else
718 {
719 lenSize &= ~WIMAX_TLV_EXTENDED_LENGTH_MASK;
720 for (int j = 0; j < lenSize; j++)
721 {
722 length <<= 8;
723 length |= i.ReadU8();
724 serializedSize++;
725 }
726 }
727 switch (type)
728 {
729 case Priority: {
730 U8TlvValue val;
731 serializedSize += val.Deserialize(i);
732 Add(Tlv(Priority, 1, val));
733 break;
734 }
735 case ToS: {
736 TosTlvValue val;
737 serializedSize += val.Deserialize(i, length);
738 Add(Tlv(ToS, val.GetSerializedSize(), val));
739 break;
740 }
741 case Protocol: {
743 serializedSize += val.Deserialize(i, length);
744 Add(Tlv(Protocol, val.GetSerializedSize(), val));
745 break;
746 }
747 case IP_src: {
749 serializedSize += val.Deserialize(i, length);
750 Add(Tlv(IP_src, val.GetSerializedSize(), val));
751 break;
752 }
753 case IP_dst: {
755 serializedSize += val.Deserialize(i, length);
756 Add(Tlv(IP_dst, val.GetSerializedSize(), val));
757 break;
758 }
759 case Port_src: {
761 serializedSize += val.Deserialize(i, length);
762 Add(Tlv(Port_src, val.GetSerializedSize(), val));
763 break;
764 }
765 case Port_dst: {
767 serializedSize += val.Deserialize(i, length);
768 Add(Tlv(Port_dst, val.GetSerializedSize(), val));
769 break;
770 }
771 case Index: {
772 U16TlvValue val;
773 serializedSize += val.Deserialize(i);
774 Add(Tlv(Index, 2, val));
775 break;
776 }
777 }
778 i.Next(length);
779 }
780 return serializedSize;
781}
782
783// ==============================================================================
785{
786 m_low = 0;
787 m_high = 0;
788 m_mask = 0;
789}
790
791TosTlvValue::TosTlvValue(uint8_t low, uint8_t high, uint8_t mask)
792{
793 m_low = low;
794 m_high = high;
795 m_mask = mask;
796}
797
801
804{
805 return 3;
806}
807
808void
815
818{
819 m_low = i.ReadU8();
820 m_high = i.ReadU8();
821 m_mask = i.ReadU8();
822 return 3;
823}
824
825uint8_t
827{
828 return m_low;
829}
830
831uint8_t
833{
834 return m_high;
835}
836
837uint8_t
839{
840 return m_mask;
841}
842
845{
846 return new TosTlvValue(m_low, m_high, m_mask);
847}
848
849// ==============================================================================
851{
852 m_portRange = new std::vector<PortRange>;
853}
854
860
863{
864 return m_portRange->size() * 4; // a port range is defined by 2 ports, each using 2 bytes
865}
866
867void
869{
870 for (auto iter = m_portRange->begin(); iter != m_portRange->end(); ++iter)
871 {
872 i.WriteHtonU16((*iter).PortLow);
873 i.WriteHtonU16((*iter).PortHigh);
874 }
875}
876
879{
880 uint64_t len = 0;
881 while (len < valueLength)
882 {
883 uint16_t low = i.ReadNtohU16();
884 uint16_t high = i.ReadNtohU16();
885 Add(low, high);
886 len += 4;
887 }
888 return len;
889}
890
891void
892PortRangeTlvValue::Add(uint16_t portLow, uint16_t portHigh)
893{
894 PortRange tmp;
895 tmp.PortLow = portLow;
896 tmp.PortHigh = portHigh;
897 m_portRange->push_back(tmp);
898}
899
902{
903 return m_portRange->begin();
904}
905
908{
909 return m_portRange->end();
910}
911
914{
915 auto tmp = new PortRangeTlvValue();
916 for (auto iter = m_portRange->begin(); iter != m_portRange->end(); ++iter)
917 {
918 tmp->Add((*iter).PortLow, (*iter).PortHigh);
919 }
920 return tmp;
921}
922
923// ==============================================================================
924
926{
927 m_protocol = new std::vector<uint8_t>;
928}
929
931{
932 if (m_protocol != nullptr)
933 {
934 m_protocol->clear();
935 delete m_protocol;
936 m_protocol = nullptr;
937 }
938}
939
942{
943 return m_protocol->size();
944}
945
946void
948{
949 for (auto iter = m_protocol->begin(); iter != m_protocol->end(); ++iter)
950 {
951 i.WriteU8(*iter);
952 }
953}
954
957{
958 uint64_t len = 0;
959 while (len < valueLength)
960 {
961 Add(i.ReadU8());
962 len++;
963 }
964 return len;
965}
966
967void
968ProtocolTlvValue::Add(uint8_t protocol)
969{
970 m_protocol->push_back(protocol);
971}
972
975{
976 return m_protocol->begin();
977}
978
981{
982 return m_protocol->end();
983}
984
987{
988 auto tmp = new ProtocolTlvValue();
989 for (auto iter = m_protocol->begin(); iter != m_protocol->end(); ++iter)
990 {
991 tmp->Add(*iter);
992 }
993 return tmp;
994}
995
996// ==============================================================================
997
999{
1000 m_ipv4Addr = new std::vector<Ipv4Addr>;
1001}
1002
1004{
1005 if (m_ipv4Addr != nullptr)
1006 {
1007 m_ipv4Addr->clear();
1008 delete m_ipv4Addr;
1009 m_ipv4Addr = nullptr;
1010 }
1011}
1012
1015{
1016 return m_ipv4Addr->size() * 8; // IPv4 address and mask are 4 bytes each
1017}
1018
1019void
1021{
1022 for (auto iter = m_ipv4Addr->begin(); iter != m_ipv4Addr->end(); ++iter)
1023 {
1024 i.WriteHtonU32((*iter).Address.Get());
1025 i.WriteHtonU32((*iter).Mask.Get());
1026 }
1027}
1028
1031{
1032 uint64_t len = 0;
1033 while (len < valueLength)
1034 {
1035 uint32_t addr = i.ReadNtohU32();
1036 uint32_t mask = i.ReadNtohU32();
1037 Add(Ipv4Address(addr), Ipv4Mask(mask));
1038 len += 8;
1039 }
1040 return len;
1041}
1042
1043void
1045{
1046 m_ipv4Addr->push_back({address, mask});
1047}
1048
1051{
1052 return m_ipv4Addr->begin();
1053}
1054
1057{
1058 return m_ipv4Addr->end();
1059}
1060
1063{
1064 auto tmp = new Ipv4AddressTlvValue();
1065 for (auto iter = m_ipv4Addr->begin(); iter != m_ipv4Addr->end(); ++iter)
1066 {
1067 tmp->Add((*iter).Address, (*iter).Mask);
1068 }
1069 return tmp;
1070}
1071
1072} // namespace ns3
iterator in a Buffer instance
Definition buffer.h:89
void WriteU8(uint8_t data)
Definition buffer.h:870
void WriteHtonU16(uint16_t data)
Definition buffer.h:904
uint32_t ReadNtohU32()
Definition buffer.h:967
void WriteHtonU32(uint32_t data)
Definition buffer.h:922
uint16_t ReadNtohU16()
Definition buffer.h:943
void Next()
go forward by one byte
Definition buffer.h:842
this class implements the classifier descriptor as a tlv vector
Definition wimax-tlv.h:397
ClassificationRuleVectorTlvValue * Copy() const override
Copy.
Definition wimax-tlv.cc:690
uint32_t Deserialize(Buffer::Iterator start, uint64_t valueLength) override
Deserialize from a buffer.
Definition wimax-tlv.cc:701
this class implements the convergence sub-layer descriptor as a tlv vector
Definition wimax-tlv.h:374
CsParamVectorTlvValue * Copy() const override
Copy.
Definition wimax-tlv.cc:673
uint32_t Deserialize(Buffer::Iterator start, uint64_t valueLength) override
Deserialize from a buffer.
Definition wimax-tlv.cc:622
Protocol header serialization and deserialization.
Definition header.h:33
Ipv4 addresses are stored in host order in this class.
Ipv4AddressTlvValue class.
Definition wimax-tlv.h:562
Iterator End() const
End iterator.
std::vector< Ipv4Addr >::const_iterator Iterator
IPv4 address vector iterator typedef.
Definition wimax-tlv.h:572
void Serialize(Buffer::Iterator start) const override
Serialize to a buffer.
void Add(Ipv4Address address, Ipv4Mask mask)
Add IPv4 address and mask.
std::vector< Ipv4Addr > * m_ipv4Addr
ipv4 addr
Definition wimax-tlv.h:597
Ipv4AddressTlvValue * Copy() const override
Copy function.
uint32_t GetSerializedSize() const override
Get serialized size in bytes.
Iterator Begin() const
Begin iterator.
~Ipv4AddressTlvValue() override
uint32_t Deserialize(Buffer::Iterator start, uint64_t valueLength) override
Deserialize from a buffer.
a class to represent an Ipv4 address mask
PortRangeTlvValue class.
Definition wimax-tlv.h:473
uint32_t GetSerializedSize() const override
Get serialized size in bytes.
Definition wimax-tlv.cc:862
uint32_t Deserialize(Buffer::Iterator start, uint64_t valueLength) override
Deserialize from a buffer.
Definition wimax-tlv.cc:878
std::vector< PortRange > * m_portRange
port range
Definition wimax-tlv.h:512
std::vector< PortRange >::const_iterator Iterator
PortRange vector iterator typedef.
Definition wimax-tlv.h:483
Iterator End() const
End iterator.
Definition wimax-tlv.cc:907
void Serialize(Buffer::Iterator start) const override
Serialize to a buffer.
Definition wimax-tlv.cc:868
~PortRangeTlvValue() override
Definition wimax-tlv.cc:855
Iterator Begin() const
Begin iterator.
Definition wimax-tlv.cc:901
void Add(uint16_t portLow, uint16_t portHigh)
Add a range.
Definition wimax-tlv.cc:892
PortRangeTlvValue * Copy() const override
Copy.
Definition wimax-tlv.cc:913
ProtocolTlvValue class.
Definition wimax-tlv.h:521
~ProtocolTlvValue() override
Definition wimax-tlv.cc:930
std::vector< uint8_t > * m_protocol
protocol
Definition wimax-tlv.h:552
void Add(uint8_t protocol)
Add protocol number.
Definition wimax-tlv.cc:968
Iterator Begin() const
Begin iterator.
Definition wimax-tlv.cc:974
uint32_t GetSerializedSize() const override
Get serialized size in bytes.
Definition wimax-tlv.cc:941
ProtocolTlvValue * Copy() const override
Copy.
Definition wimax-tlv.cc:986
std::vector< uint8_t >::const_iterator Iterator
Iterator typedef.
Definition wimax-tlv.h:526
Iterator End() const
End iterator.
Definition wimax-tlv.cc:980
uint32_t Deserialize(Buffer::Iterator start, uint64_t valueLength) override
Deserialize from a buffer.
Definition wimax-tlv.cc:956
void Serialize(Buffer::Iterator start) const override
Serialize to a buffer.
Definition wimax-tlv.cc:947
SfVectorTlvValue class.
Definition wimax-tlv.h:326
uint32_t Deserialize(Buffer::Iterator start, uint64_t valueLength) override
Deserialize from a buffer.
Definition wimax-tlv.cc:295
@ Fixed_length_versus_Variable_length_SDU_Indicator
Definition wimax-tlv.h:345
SfVectorTlvValue * Copy() const override
Copy.
Definition wimax-tlv.cc:284
This class implements the Type-Len-Value structure channel encodings as described by "IEEEStandard fo...
Definition wimax-tlv.h:76
uint8_t m_type
type
Definition wimax-tlv.h:153
TlvValue * CopyValue() const
Copy TlvValue.
Definition wimax-tlv.cc:64
~Tlv() override
Definition wimax-tlv.cc:54
uint64_t m_length
length
Definition wimax-tlv.h:154
Tlv * Copy() const
Copy TLV.
Definition wimax-tlv.cc:218
uint8_t GetType() const
Get type value.
Definition wimax-tlv.cc:200
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition wimax-tlv.cc:29
Tlv & operator=(const Tlv &o)
assignment operator
Definition wimax-tlv.cc:77
TlvValue * PeekValue()
Peek value.
Definition wimax-tlv.cc:212
static TypeId GetTypeId()
Register this type.
Definition wimax-tlv.cc:21
uint64_t GetLength() const
Get length value.
Definition wimax-tlv.cc:206
@ UPLINK_SERVICE_FLOW
Definition wimax-tlv.h:85
@ VENDOR_ID_EMCODING
Definition wimax-tlv.h:86
@ DOWNLINK_SERVICE_FLOW
Definition wimax-tlv.h:84
@ CURRENT_TRANSMIT_POWER
Definition wimax-tlv.h:83
@ HMAC_TUPLE
Definition wimax-tlv.h:81
@ MAC_VERSION_ENCODING
Definition wimax-tlv.h:82
@ VENDOR_SPECIFIC_INFORMATION
Definition wimax-tlv.h:87
uint8_t GetSizeOfLen() const
Get size of length field.
Definition wimax-tlv.cc:97
void Print(std::ostream &os) const override
Definition wimax-tlv.cc:35
TlvValue * m_value
value
Definition wimax-tlv.h:155
uint32_t GetSerializedSize() const override
Definition wimax-tlv.cc:91
void Serialize(Buffer::Iterator start) const override
Definition wimax-tlv.cc:115
uint32_t Deserialize(Buffer::Iterator start) override
Definition wimax-tlv.cc:135
The value field of a tlv can take different values (uint8_t, uint16, vector, ...).
Definition wimax-tlv.h:34
virtual uint32_t GetSerializedSize() const =0
Get serialized size in bytes.
virtual TlvValue * Copy() const =0
Copy function.
virtual void Serialize(Buffer::Iterator start) const =0
Serialize to a buffer.
TosTlvValue class.
Definition wimax-tlv.h:425
void Serialize(Buffer::Iterator start) const override
Serialize to a buffer.
Definition wimax-tlv.cc:809
uint8_t m_high
high
Definition wimax-tlv.h:463
uint8_t GetHigh() const
Get high part.
Definition wimax-tlv.cc:832
uint32_t GetSerializedSize() const override
Get serialized size in bytes.
Definition wimax-tlv.cc:803
~TosTlvValue() override
Definition wimax-tlv.cc:798
uint8_t GetLow() const
Get low part.
Definition wimax-tlv.cc:826
uint8_t GetMask() const
Get the mask.
Definition wimax-tlv.cc:838
uint32_t Deserialize(Buffer::Iterator start, uint64_t valueLength) override
Deserialize from a buffer.
Definition wimax-tlv.cc:817
TosTlvValue * Copy() const override
Copy.
Definition wimax-tlv.cc:844
uint8_t m_mask
mask
Definition wimax-tlv.h:464
uint8_t m_low
low
Definition wimax-tlv.h:462
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
U16TlvValue class.
Definition wimax-tlv.h:204
void Serialize(Buffer::Iterator start) const override
Serialize to a buffer.
Definition wimax-tlv.cc:536
U16TlvValue * Copy() const override
Copy.
Definition wimax-tlv.cc:561
uint16_t m_value
value
Definition wimax-tlv.h:235
uint32_t GetSerializedSize() const override
Get serialized size in bytes.
Definition wimax-tlv.cc:530
uint32_t Deserialize(Buffer::Iterator start, uint64_t valueLen) override
Deserialize from a buffer.
Definition wimax-tlv.cc:542
uint16_t GetValue() const
Get value.
Definition wimax-tlv.cc:555
~U16TlvValue() override
Definition wimax-tlv.cc:525
U32TlvValue class.
Definition wimax-tlv.h:244
uint32_t GetValue() const
Get value.
Definition wimax-tlv.cc:608
uint32_t GetSerializedSize() const override
Get serialized size in bytes.
Definition wimax-tlv.cc:583
~U32TlvValue() override
Definition wimax-tlv.cc:578
void Serialize(Buffer::Iterator start) const override
Serialize to a buffer.
Definition wimax-tlv.cc:589
U32TlvValue * Copy() const override
Copy.
Definition wimax-tlv.cc:614
uint32_t Deserialize(Buffer::Iterator start, uint64_t valueLen) override
Deserialize from a buffer.
Definition wimax-tlv.cc:595
uint32_t m_value
value
Definition wimax-tlv.h:276
U8TlvValue class.
Definition wimax-tlv.h:164
~U8TlvValue() override
Definition wimax-tlv.cc:472
uint32_t Deserialize(Buffer::Iterator start, uint64_t valueLen) override
Deserialize from a buffer.
Definition wimax-tlv.cc:489
uint8_t GetValue() const
Get value.
Definition wimax-tlv.cc:502
uint8_t m_value
value
Definition wimax-tlv.h:195
uint32_t GetSerializedSize() const override
Get serialized size in bytes.
Definition wimax-tlv.cc:477
void Serialize(Buffer::Iterator start) const override
Serialize to a buffer.
Definition wimax-tlv.cc:483
U8TlvValue * Copy() const override
Copy.
Definition wimax-tlv.cc:508
uint32_t GetSerializedSize() const override
Get serialized size in bytes.
Definition wimax-tlv.cc:240
~VectorTlvValue() override
Definition wimax-tlv.cc:229
std::vector< Tlv * >::const_iterator Iterator
TLV vector iterator typedef.
Definition wimax-tlv.h:289
void Serialize(Buffer::Iterator start) const override
Serialize to a buffer.
Definition wimax-tlv.cc:251
Iterator End() const
End iterator.
Definition wimax-tlv.cc:267
Iterator Begin() const
Begin iterator.
Definition wimax-tlv.cc:261
void Add(const Tlv &val)
Add a TLV.
Definition wimax-tlv.cc:273
std::vector< Tlv * > * m_tlvList
tlv list
Definition wimax-tlv.h:317
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition assert.h:75
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
Every class exported by the ns3 library is enclosed in the ns3 namespace.
#define WIMAX_TLV_EXTENDED_LENGTH_MASK
Definition wimax-tlv.h:13