A Discrete-Event Network Simulator
API
sixlowpan-header.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Universita' di Firenze, Italy
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
18  * Michele Muccio <michelemuccio@virgilio.it>
19  */
20 
21 #ifndef SIXLOWPANHEADER_H_
22 #define SIXLOWPANHEADER_H_
23 
24 #include "ns3/header.h"
25 #include "ns3/ipv6-address.h"
26 
27 namespace ns3
28 {
29 
46 {
47  public:
77  {
78  LOWPAN_NALP = 0x0,
79  LOWPAN_NALP_N = 0x3F,
80  LOWPAN_IPv6 = 0x41,
81  LOWPAN_HC1 = 0x42,
82  LOWPAN_BC0 = 0x50,
83  LOWPAN_IPHC = 0x60,
84  LOWPAN_IPHC_N = 0x7F,
85  LOWPAN_MESH = 0x80,
86  LOWPAN_MESH_N = 0xBF,
87  LOWPAN_FRAG1 = 0xC0,
89  LOWPAN_FRAGN = 0xE0,
91  LOWPAN_UNSUPPORTED = 0xFF
92  };
93 
101  {
102  LOWPAN_NHC = 0xE0,
103  LOWPAN_NHC_N = 0xEF,
106  LOWPAN_NHCUNSUPPORTED = 0xFF
107  };
108 
110 
116  static Dispatch_e GetDispatchType(uint8_t dispatch);
117 
123  static NhcDispatch_e GetNhcDispatchType(uint8_t dispatch);
124 };
125 
130 class SixLowPanHc1 : public Header
131 {
132  public:
141  {
142  HC1_PIII = 0x00,
143  HC1_PIIC = 0x01,
144  HC1_PCII = 0x02,
145  HC1_PCIC = 0x03
146  };
147 
155  {
156  HC1_NC = 0x00,
157  HC1_UDP = 0x01,
158  HC1_ICMP = 0x02,
159  HC1_TCP = 0x03
160  };
161 
162  SixLowPanHc1();
163 
168  static TypeId GetTypeId();
169 
175  TypeId GetInstanceTypeId() const override;
176 
177  void Print(std::ostream& os) const override;
178 
183  uint32_t GetSerializedSize() const override;
184 
189  void Serialize(Buffer::Iterator start) const override;
190 
196  uint32_t Deserialize(Buffer::Iterator start) override;
197 
202  void SetHopLimit(uint8_t limit);
203 
208  uint8_t GetHopLimit() const;
209 
215 
220  const uint8_t* GetDstInterface() const;
221 
226  const uint8_t* GetDstPrefix() const;
227 
232  uint32_t GetFlowLabel() const;
233 
238  uint8_t GetNextHeader() const;
239 
245 
250  const uint8_t* GetSrcInterface() const;
251 
256  const uint8_t* GetSrcPrefix() const;
257 
262  uint8_t GetTrafficClass() const;
263 
268  bool IsTcflCompression() const;
269 
274  bool IsHc2HeaderPresent() const;
275 
280  void SetDstCompression(LowPanHc1Addr_e dstCompression);
281 
286  void SetDstInterface(const uint8_t* dstInterface);
287 
292  void SetDstPrefix(const uint8_t* dstPrefix);
293 
298  void SetFlowLabel(uint32_t flowLabel);
299 
304  void SetNextHeader(uint8_t nextHeader);
305 
310  void SetSrcCompression(LowPanHc1Addr_e srcCompression);
311 
316  void SetSrcInterface(const uint8_t* srcInterface);
317 
322  void SetSrcPrefix(const uint8_t* srcPrefix);
323 
328  void SetTcflCompression(bool tcflCompression);
329 
334  void SetHc2HeaderPresent(bool hc2HeaderPresent);
335 
340  void SetTrafficClass(uint8_t trafficClass);
341 
342  private:
343  uint8_t m_hopLimit;
344  uint8_t m_srcPrefix[8];
345  uint8_t m_srcInterface[8];
346  uint8_t m_dstPrefix[8];
347  uint8_t m_dstInterface[8];
348  uint8_t m_trafficClass;
349  uint32_t m_flowLabel;
350  uint8_t m_nextHeader;
356 };
357 
365 std::ostream& operator<<(std::ostream& os, const SixLowPanHc1& header);
366 
371 class SixLowPanFrag1 : public Header
372 {
373  public:
374  SixLowPanFrag1();
375 
380  static TypeId GetTypeId();
381 
386  TypeId GetInstanceTypeId() const override;
387 
388  void Print(std::ostream& os) const override;
389 
394  uint32_t GetSerializedSize() const override;
395 
400  void Serialize(Buffer::Iterator start) const override;
401 
407  uint32_t Deserialize(Buffer::Iterator start) override;
408 
413  void SetDatagramSize(uint16_t datagramSize);
414 
419  uint16_t GetDatagramSize() const;
420 
425  void SetDatagramTag(uint16_t datagramTag);
426 
431  uint16_t GetDatagramTag() const;
432 
433  private:
434  uint16_t m_datagramSize;
435  uint16_t m_datagramTag;
436 };
437 
445 std::ostream& operator<<(std::ostream& os, const SixLowPanFrag1& header);
446 
451 class SixLowPanFragN : public Header
452 {
453  public:
454  SixLowPanFragN();
455 
460  static TypeId GetTypeId();
461 
466  TypeId GetInstanceTypeId() const override;
467 
468  void Print(std::ostream& os) const override;
469 
474  uint32_t GetSerializedSize() const override;
475 
480  void Serialize(Buffer::Iterator start) const override;
481 
487  uint32_t Deserialize(Buffer::Iterator start) override;
488 
493  void SetDatagramSize(uint16_t datagramSize);
494 
499  uint16_t GetDatagramSize() const;
500 
505  void SetDatagramTag(uint16_t datagramTag);
506 
511  uint16_t GetDatagramTag() const;
512 
517  void SetDatagramOffset(uint8_t datagramOffset);
518 
523  uint8_t GetDatagramOffset() const;
524 
525  private:
526  uint16_t m_datagramSize;
527  uint16_t m_datagramTag;
529 };
530 
538 std::ostream& operator<<(std::ostream& os, const SixLowPanFragN& header);
539 
544 class SixLowPanIpv6 : public Header
545 {
546  public:
547  SixLowPanIpv6();
548 
553  static TypeId GetTypeId();
554 
559  TypeId GetInstanceTypeId() const override;
560 
561  void Print(std::ostream& os) const override;
562 
567  uint32_t GetSerializedSize() const override;
568 
573  void Serialize(Buffer::Iterator start) const override;
574 
580  uint32_t Deserialize(Buffer::Iterator start) override;
581 };
582 
590 std::ostream& operator<<(std::ostream& os, const SixLowPanIpv6& header);
591 
603 class SixLowPanIphc : public Header
604 {
605  public:
616  {
617  TF_FULL = 0,
620  TF_ELIDED
621  };
622 
631  enum Hlim_e
632  {
637  };
638 
648  {
652  HC_COMPR_0
653  };
654 
655  SixLowPanIphc();
660  SixLowPanIphc(uint8_t dispatch);
661 
666  static TypeId GetTypeId();
667 
672  TypeId GetInstanceTypeId() const override;
673 
674  void Print(std::ostream& os) const override;
675 
680  uint32_t GetSerializedSize() const override;
681 
686  void Serialize(Buffer::Iterator start) const override;
687 
693  uint32_t Deserialize(Buffer::Iterator start) override;
694 
699  void SetTf(TrafficClassFlowLabel_e tfField);
700 
706 
711  void SetNh(bool nhField);
712 
717  bool GetNh() const;
718 
723  void SetHlim(Hlim_e hlimField);
724 
729  Hlim_e GetHlim() const;
730 
735  void SetCid(bool cidField);
736 
741  bool GetCid() const;
742 
747  void SetSac(bool sacField);
748 
753  bool GetSac() const;
754 
759  void SetSam(HeaderCompression_e samField);
760 
765  HeaderCompression_e GetSam() const;
766 
772  void SetSrcInlinePart(uint8_t srcInlinePart[16], uint8_t size);
773 
778  const uint8_t* GetSrcInlinePart() const;
779 
784  void SetM(bool mField);
785 
790  bool GetM() const;
791 
796  void SetDac(bool dacField);
797 
802  bool GetDac() const;
803 
808  void SetDam(HeaderCompression_e damField);
809 
814  HeaderCompression_e GetDam() const;
815 
821  void SetDstInlinePart(uint8_t dstInlinePart[16], uint8_t size);
822 
827  const uint8_t* GetDstInlinePart() const;
828 
833  void SetSrcContextId(uint8_t srcContextId);
834 
839  uint8_t GetSrcContextId() const;
840 
845  void SetDstContextId(uint8_t dstContextId);
846 
851  uint8_t GetDstContextId() const;
852 
857  void SetEcn(uint8_t ecn);
858 
863  uint8_t GetEcn() const;
864 
869  void SetDscp(uint8_t dscp);
870 
875  uint8_t GetDscp() const;
876 
881  void SetFlowLabel(uint32_t flowLabel);
882 
887  uint32_t GetFlowLabel() const;
888 
893  void SetNextHeader(uint8_t nextHeader);
894 
899  uint8_t GetNextHeader() const;
900 
905  void SetHopLimit(uint8_t hopLimit);
906 
911  uint8_t GetHopLimit() const;
912 
913  private:
914  uint16_t m_baseFormat;
916  uint8_t m_ecn : 2;
917  uint8_t m_dscp : 6;
918  uint32_t m_flowLabel : 20;
919  uint8_t m_nextHeader;
920  uint8_t m_hopLimit;
921  uint8_t m_srcInlinePart[16];
922  uint8_t m_dstInlinePart[16];
923 };
924 
932 std::ostream& operator<<(std::ostream& os, const SixLowPanIphc& header);
933 
945 {
946  public:
960  enum Eid_e
961  {
967  EID_IPv6_H = 7
968  };
969 
971 
976  static TypeId GetTypeId();
977 
982  TypeId GetInstanceTypeId() const override;
983 
984  void Print(std::ostream& os) const override;
985 
990  uint32_t GetSerializedSize() const override;
991 
996  void Serialize(Buffer::Iterator start) const override;
997 
1003  uint32_t Deserialize(Buffer::Iterator start) override;
1004 
1010 
1015  void SetEid(Eid_e extensionHeaderType);
1016 
1021  Eid_e GetEid() const;
1022 
1027  void SetNextHeader(uint8_t nextHeader);
1028 
1033  uint8_t GetNextHeader() const;
1034 
1039  void SetNh(bool nhField);
1040 
1045  bool GetNh() const;
1046 
1052  void SetBlob(const uint8_t* blob, uint32_t size);
1053 
1060  uint32_t CopyBlob(uint8_t* blob, uint32_t size) const;
1061 
1062  private:
1066  uint8_t m_nhcBlob[256];
1067 };
1068 
1076 std::ostream& operator<<(std::ostream& os, const SixLowPanNhcExtension& header);
1077 
1089 {
1090  public:
1099  enum Ports_e
1100  {
1105  };
1106 
1108 
1113  static TypeId GetTypeId();
1114 
1119  TypeId GetInstanceTypeId() const override;
1120 
1121  void Print(std::ostream& os) const override;
1122 
1127  uint32_t GetSerializedSize() const override;
1128 
1133  void Serialize(Buffer::Iterator start) const override;
1134 
1140  uint32_t Deserialize(Buffer::Iterator start) override;
1141 
1147 
1152  void SetPorts(Ports_e port);
1153 
1158  Ports_e GetPorts() const;
1159 
1164  void SetSrcPort(uint16_t port);
1165 
1170  uint16_t GetSrcPort() const;
1171 
1176  void SetDstPort(uint16_t port);
1177 
1182  uint16_t GetDstPort() const;
1183 
1188  void SetC(bool cField);
1189 
1194  bool GetC() const;
1195 
1200  void SetChecksum(uint16_t checksum);
1201 
1206  uint16_t GetChecksum() const;
1207 
1208  private:
1209  uint8_t m_baseFormat;
1210  uint16_t m_checksum;
1211  uint16_t m_srcPort;
1212  uint16_t m_dstPort;
1213 };
1214 
1222 std::ostream& operator<<(std::ostream& os, const SixLowPanUdpNhcExtension& header);
1223 
1228 class SixLowPanBc0 : public Header
1229 {
1230  public:
1231  SixLowPanBc0();
1232 
1237  static TypeId GetTypeId();
1238 
1243  TypeId GetInstanceTypeId() const override;
1244 
1245  void Print(std::ostream& os) const override;
1246 
1251  uint32_t GetSerializedSize() const override;
1252 
1257  void Serialize(Buffer::Iterator start) const override;
1258 
1264  uint32_t Deserialize(Buffer::Iterator start) override;
1265 
1270  void SetSequenceNumber(uint8_t seqNumber);
1271 
1276  uint8_t GetSequenceNumber() const;
1277 
1278  private:
1279  uint8_t m_seqNumber;
1280 };
1281 
1289 std::ostream& operator<<(std::ostream& os, const SixLowPanBc0& header);
1290 
1295 class SixLowPanMesh : public Header
1296 {
1297  public:
1298  SixLowPanMesh();
1299 
1304  static TypeId GetTypeId();
1305 
1310  TypeId GetInstanceTypeId() const override;
1311 
1312  void Print(std::ostream& os) const override;
1313 
1318  uint32_t GetSerializedSize() const override;
1319 
1324  void Serialize(Buffer::Iterator start) const override;
1325 
1331  uint32_t Deserialize(Buffer::Iterator start) override;
1332 
1337  void SetHopsLeft(uint8_t hopsLeft);
1338 
1343  uint8_t GetHopsLeft() const;
1344 
1349  void SetOriginator(Address originator);
1350 
1355  Address GetOriginator() const;
1356 
1361  void SetFinalDst(Address finalDst);
1362 
1367  Address GetFinalDst() const;
1368 
1369  private:
1370  uint8_t m_hopsLeft;
1371  bool m_v;
1372  bool m_f;
1375 };
1376 
1384 std::ostream& operator<<(std::ostream& os, const SixLowPanMesh& header);
1385 
1386 } // namespace ns3
1387 
1388 #endif /* SIXLOWPANHEADER_H_ */
a polymophic address class
Definition: address.h:101
iterator in a Buffer instance
Definition: buffer.h:100
Protocol header serialization and deserialization.
Definition: header.h:44
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
6LoWPAN BC0 header - see RFC 4944.
void Print(std::ostream &os) const override
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
TypeId GetInstanceTypeId() const override
Return the instance type identifier.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
void SetSequenceNumber(uint8_t seqNumber)
Set the "Sequence Number" field.
static TypeId GetTypeId()
Get the type ID.
uint8_t m_seqNumber
Sequence number.
uint8_t GetSequenceNumber() const
Get the "Sequence Number" field.
Dispatch header helper.
static Dispatch_e GetDispatchType(uint8_t dispatch)
Get the Dispatch type.
static NhcDispatch_e GetNhcDispatchType(uint8_t dispatch)
Get the NhcDispatch type.
NhcDispatch_e
Dispatch values for Next Header compression.
6LoWPAN FRAG1 header - see RFC 4944.
TypeId GetInstanceTypeId() const override
Return the instance type identifier.
static TypeId GetTypeId()
Get the type ID.
void SetDatagramSize(uint16_t datagramSize)
Set the datagram size.
void Print(std::ostream &os) const override
void SetDatagramTag(uint16_t datagramTag)
Set the datagram tag.
uint16_t GetDatagramSize() const
Get the datagram size.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint16_t m_datagramTag
Datagram tag.
uint16_t GetDatagramTag() const
Get the datagram tag.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
uint16_t m_datagramSize
Datagram size.
6LoWPAN FRAGN header - see RFC 4944.
TypeId GetInstanceTypeId() const override
Return the instance type identifier.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint16_t m_datagramTag
Datagram tag.
void SetDatagramSize(uint16_t datagramSize)
Set the datagram size.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
static TypeId GetTypeId()
Get the type ID.
uint16_t GetDatagramTag() const
Get the datagram tag.
void SetDatagramTag(uint16_t datagramTag)
Set the datagram tag.
void SetDatagramOffset(uint8_t datagramOffset)
Set the datagram offset.
uint8_t GetDatagramOffset() const
Get the datagram offset.
uint8_t m_datagramOffset
Datagram offset.
uint16_t GetDatagramSize() const
Get the datagram size.
uint16_t m_datagramSize
Datagram size.
void Print(std::ostream &os) const override
6LoWPAN HC1 header - see RFC 4944.
static TypeId GetTypeId()
Get the type ID.
void SetTcflCompression(bool tcflCompression)
Set the Traffic Class and Flow Labels as compressed.
uint8_t m_dstInterface[8]
Destination interface.
uint8_t GetHopLimit() const
Get the "Hop limit" field (TTL).
const uint8_t * GetSrcPrefix() const
Get the source prefix.
void SetFlowLabel(uint32_t flowLabel)
Set the Flow Label value.
uint8_t GetTrafficClass() const
Get the Traffic Class value.
void SetDstCompression(LowPanHc1Addr_e dstCompression)
Set Destination Compression type.
void SetTrafficClass(uint8_t trafficClass)
Set the Traffic Class value.
TypeId GetInstanceTypeId() const override
Return the instance type identifier.
void SetHopLimit(uint8_t limit)
Set the "Hop limit" field (TTL).
LowPanHc1Addr_e
Kind of address compression.
uint8_t m_srcInterface[8]
Source interface.
uint8_t m_dstPrefix[8]
Destination prefix.
uint32_t GetFlowLabel() const
Get the Flow Label value.
bool m_hc2HeaderPresent
Is next header HC2 compressed.
const uint8_t * GetSrcInterface() const
Get the source interface.
const uint8_t * GetDstPrefix() const
Get the destination prefix.
void SetHc2HeaderPresent(bool hc2HeaderPresent)
Set the next header a HC2 compressed header.
LowPanHc1NextHeader_e m_nextHeaderCompression
Next header compression.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
bool m_tcflCompression
Is TC and FL compressed.
uint32_t m_flowLabel
Flow Label.
void SetNextHeader(uint8_t nextHeader)
Set the Next Header value.
LowPanHc1Addr_e m_dstCompression
Destination compression type.
LowPanHc1NextHeader_e
Next header information.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
uint8_t m_hopLimit
Hop Limit.
void SetSrcCompression(LowPanHc1Addr_e srcCompression)
Set Source Compression type.
uint8_t m_srcPrefix[8]
Source prefix.
void SetDstInterface(const uint8_t *dstInterface)
Set the destination interface.
void SetDstPrefix(const uint8_t *dstPrefix)
Set the destination prefix.
const uint8_t * GetDstInterface() const
Get the destination interface.
LowPanHc1Addr_e m_srcCompression
Source compression type.
uint8_t m_nextHeader
Next header.
void Print(std::ostream &os) const override
void SetSrcPrefix(const uint8_t *srcPrefix)
Set the source prefix.
uint8_t GetNextHeader() const
Get the Next Header value.
void SetSrcInterface(const uint8_t *srcInterface)
Set the source interface.
uint8_t m_trafficClass
Traffic Class.
LowPanHc1Addr_e GetDstCompression() const
Get Destination Compression type.
bool IsHc2HeaderPresent() const
Check if there is a HC2 compressed header.
LowPanHc1Addr_e GetSrcCompression() const
Get Source Compression type.
bool IsTcflCompression() const
Check if the Traffic Class and Flow Labels are compressed.
LOWPAN_IPHC base Encoding - see RFC 6282.
bool GetSac() const
Get the SAC (Source Address Compression) compression.
void SetNextHeader(uint8_t nextHeader)
Set the Next Header field.
uint8_t GetNextHeader() const
Get the Next Header field.
void SetHlim(Hlim_e hlimField)
Set the HLIM (Hop Limit) compression.
void SetDstContextId(uint8_t dstContextId)
Set the DstContextId.
Hlim_e
HLIM: Hop Limit.
const uint8_t * GetSrcInlinePart() const
brief Get the source address inline part
uint8_t m_srcdstContextId
Src and Dst Context ID.
void SetSam(HeaderCompression_e samField)
Set the SAM (Source Address Mode) compression.
void SetNh(bool nhField)
Set the NH (Next Header) compression.
uint8_t GetDscp() const
Get the DSCP.
HeaderCompression_e
Source or Destination Address Mode.
HeaderCompression_e GetDam() const
Get the DAM (Destination Address Mode) compression.
uint8_t GetHopLimit() const
Get the Hop Limit field.
bool GetDac() const
Get the DAC (Destination Address Compression) compression.
uint8_t m_srcInlinePart[16]
source address inline part.
void SetEcn(uint8_t ecn)
Set the ECN (2bits).
uint8_t m_hopLimit
Hop Limit.
void SetFlowLabel(uint32_t flowLabel)
Set the Flow Label (20bits).
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
void SetDscp(uint8_t dscp)
Set the DSCP (6bits).
uint32_t GetFlowLabel() const
Get the Flow Label.
void SetTf(TrafficClassFlowLabel_e tfField)
Set the TF (Traffic Class, Flow Label) compression.
uint8_t GetEcn() const
Get the ECN.
static TypeId GetTypeId()
Get the type ID.
void SetDam(HeaderCompression_e damField)
Set the DAM (Destination Address Mode) compression.
void SetCid(bool cidField)
Set the CID (Context Identifier Extension) compression.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
Hlim_e GetHlim() const
Get the HLIM (Hop Limit) compression.
uint8_t m_dscp
DSCP bits.
void SetSac(bool sacField)
Set the SAC (Source Address Compression) compression.
bool GetNh() const
Get the NH (Next Header) compression.
void Print(std::ostream &os) const override
TrafficClassFlowLabel_e GetTf() const
Get the TF (Traffic Class, Flow Label) compression.
bool GetM() const
Get the M (Multicast) compression.
HeaderCompression_e GetSam() const
Get the SAM (Source Address Mode) compression.
uint8_t m_dstInlinePart[16]
destination address inline part.
TypeId GetInstanceTypeId() const override
Return the instance type identifier.
void SetDstInlinePart(uint8_t dstInlinePart[16], uint8_t size)
brief Set the destination address inline part
void SetSrcContextId(uint8_t srcContextId)
Set the SrcContextId.
void SetSrcInlinePart(uint8_t srcInlinePart[16], uint8_t size)
brief Set the source address inline part
TrafficClassFlowLabel_e
TF: Traffic Class, Flow Label.
void SetM(bool mField)
Set the M (Multicast) compression.
uint16_t m_baseFormat
Dispatch + encoding fields.
uint8_t m_nextHeader
Next header.
const uint8_t * GetDstInlinePart() const
brief Get the destination address inline part
bool GetCid() const
Get the CID (Context Identifier Extension) compression.
uint8_t GetSrcContextId() const
Get the SrcContextId.
uint32_t m_flowLabel
Flow Label bits.
void SetHopLimit(uint8_t hopLimit)
Set the Hop Limit field.
uint8_t m_ecn
ECN bits.
uint8_t GetDstContextId() const
Get the DstContextId.
void SetDac(bool dacField)
Set the DAC (Destination Address Compression) compression.
6LoWPAN IPv6 uncompressed header - see RFC 4944.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
static TypeId GetTypeId()
Get the type ID.
TypeId GetInstanceTypeId() const override
Return the instance type identifier.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
void Print(std::ostream &os) const override
6LoWPAN Mesh header - see RFC 4944.
bool m_f
True if Destination address is 16 bit.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Address GetOriginator() const
Get the "Originator" address.
bool m_v
True if Originator address is 16 bit.
void SetHopsLeft(uint8_t hopsLeft)
Set the "Hops Left" field.
void SetFinalDst(Address finalDst)
Set the "Final Destination" address.
uint8_t m_hopsLeft
Hops left.
Address m_src
Originator (source) address.
TypeId GetInstanceTypeId() const override
Return the instance type identifier.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
uint8_t GetHopsLeft() const
Get the "Hops Left" field.
static TypeId GetTypeId()
Get the type ID.
void Print(std::ostream &os) const override
Address GetFinalDst() const
Get the "Final Destination" address.
void SetOriginator(Address originator)
Set the "Originator" address.
Address m_dst
Destination (final) address.
LOWPAN_NHC Extension Header Encoding - see RFC 6282.
uint8_t m_nhcNextHeader
Next header.
uint8_t m_nhcBlob[256]
NHC compressed header.
virtual SixLowPanDispatch::NhcDispatch_e GetNhcDispatchType() const
Get the NhcDispatch type.
TypeId GetInstanceTypeId() const override
Return the instance type identifier.
bool GetNh() const
Get the Next Header field value.
uint8_t m_nhcExtensionHeader
NHC extension header type.
Eid_e GetEid() const
Get the Extension Header Type.
void SetNh(bool nhField)
Set the NH field values.
void SetEid(Eid_e extensionHeaderType)
Set the Extension Header Type.
uint8_t m_nhcBlobLength
Length of the NHC compressed header.
void SetBlob(const uint8_t *blob, uint32_t size)
Set the option header data blob.
void Print(std::ostream &os) const override
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
Eid_e
EID: IPv6 Extension Header ID.
uint32_t CopyBlob(uint8_t *blob, uint32_t size) const
Get the option header data blob.
uint8_t GetNextHeader() const
Get the Next Header field value.
void SetNextHeader(uint8_t nextHeader)
Set the Next Header field values.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
static TypeId GetTypeId()
Get the type ID.
UDP LOWPAN_NHC Extension Header Encoding - see RFC 6282.
void Serialize(Buffer::Iterator start) const override
Serialize the packet.
TypeId GetInstanceTypeId() const override
Return the instance type identifier.
uint8_t m_baseFormat
Dispatch + encoding fields.
Ports_e GetPorts() const
Get the compressed Src and Dst Ports.
uint16_t GetChecksum() const
Get the Checksum field value.
uint16_t GetDstPort() const
Get the Destination Port.
void SetPorts(Ports_e port)
Set the compressed Src and Dst Ports.
bool GetC() const
Get the C (Checksum).
static TypeId GetTypeId()
Get the type ID.
void Print(std::ostream &os) const override
void SetChecksum(uint16_t checksum)
Set the Checksum field values.
void SetDstPort(uint16_t port)
Set the Destination Port.
uint32_t GetSerializedSize() const override
Get the serialized size of the packet.
void SetSrcPort(uint16_t port)
Set the Source Port.
void SetC(bool cField)
Set the C (Checksum).
uint16_t m_dstPort
Destination port.
uint16_t m_srcPort
Source port.
virtual SixLowPanDispatch::NhcDispatch_e GetNhcDispatchType() const
Get the NhcDispatch type.
uint16_t GetSrcPort() const
Get the Source Port.
a unique identifier for an interface.
Definition: type-id.h:59
uint16_t port
Definition: dsdv-manet.cc:44
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:159