A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
sixlowpan-header.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Universita' di Firenze, Italy
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: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19  * Michele Muccio <michelemuccio@virgilio.it>
20  */
21 
22 #ifndef SIXLOWPANHEADER_H_
23 #define SIXLOWPANHEADER_H_
24 
25 #include "ns3/header.h"
26 #include "ns3/ipv6-address.h"
27 #include "ns3/packet.h"
28 #include "ns3/ipv6-header.h"
29 
30 namespace ns3 {
31 
48 {
49 public:
79  {
80  LOWPAN_NALP = 0x0,
81  LOWPAN_NALP_N = 0x3F,
83  LOWPAN_HC1 = 0x42,
84  LOWPAN_BC0 = 0x50,
85  LOWPAN_IPHC = 0x60,
86  LOWPAN_IPHC_N = 0x7F,
87  LOWPAN_MESH = 0x80,
88  LOWPAN_MESH_N = 0xBF,
89  LOWPAN_FRAG1 = 0xC0,
91  LOWPAN_FRAGN = 0xE0,
94  };
95 
103  {
104  LOWPAN_NHC = 0xE0,
105  LOWPAN_NHC_N = 0xEF,
109  };
110 
111  SixLowPanDispatch (void);
112 
118  static Dispatch_e GetDispatchType (uint8_t dispatch);
119 
125  static NhcDispatch_e GetNhcDispatchType (uint8_t dispatch);
126 
127 };
128 
133 class SixLowPanHc1 : public Header
134 {
135 public:
144  {
145  HC1_PIII = 0x00,
146  HC1_PIIC = 0x01,
147  HC1_PCII = 0x02,
148  HC1_PCIC = 0x03
149  };
150 
158  {
159  HC1_NC = 0x00,
160  HC1_UDP = 0x01,
161  HC1_ICMP = 0x02,
162  HC1_TCP = 0x03
163  };
164 
165  SixLowPanHc1 (void);
166 
171  static TypeId GetTypeId (void);
172 
178  virtual TypeId GetInstanceTypeId (void) const;
179 
180  virtual void Print (std::ostream& os) const;
181 
186  virtual uint32_t GetSerializedSize (void) const;
187 
192  virtual void Serialize (Buffer::Iterator start) const;
193 
199  virtual uint32_t Deserialize (Buffer::Iterator start);
200 
205  // virtual Dispatch_e GetDispatchType (void) const;
206 
211  void SetHopLimit (uint8_t limit);
212 
217  uint8_t GetHopLimit (void) const;
218 
224 
229  const uint8_t* GetDstInterface () const;
230 
235  const uint8_t* GetDstPrefix () const;
236 
241  uint32_t GetFlowLabel () const;
242 
247  uint8_t GetNextHeader () const;
248 
254 
259  const uint8_t* GetSrcInterface () const;
260 
265  const uint8_t* GetSrcPrefix () const;
266 
271  uint8_t GetTrafficClass () const;
272 
277  bool IsTcflCompression () const;
278 
283  bool IsHc2HeaderPresent () const;
284 
289  void SetDstCompression (LowPanHc1Addr_e dstCompression);
290 
295  void SetDstInterface (const uint8_t* dstInterface);
296 
301  void SetDstPrefix (const uint8_t* dstPrefix);
302 
307  void SetFlowLabel (uint32_t flowLabel);
308 
313  void SetNextHeader (uint8_t nextHeader);
314 
319  void SetSrcCompression (LowPanHc1Addr_e srcCompression);
320 
325  void SetSrcInterface (const uint8_t* srcInterface);
326 
331  void SetSrcPrefix (const uint8_t* srcPrefix);
332 
337  void SetTcflCompression (bool tcflCompression);
338 
343  void SetHc2HeaderPresent (bool hc2HeaderPresent);
344 
349  void SetTrafficClass (uint8_t trafficClass);
350 
351 private:
352  uint8_t m_hopLimit;
353  uint8_t m_srcPrefix[8];
354  uint8_t m_srcInterface[8];
355  uint8_t m_dstPrefix[8];
356  uint8_t m_dstInterface[8];
357  uint8_t m_trafficClass;
358  uint32_t m_flowLabel;
359  uint8_t m_nextHeader;
365 };
366 
374 std::ostream & operator<< (std::ostream & os, SixLowPanHc1 const &header);
375 
380 class SixLowPanFrag1 : public Header
381 {
382 public:
383  SixLowPanFrag1 (void);
384 
389  static TypeId GetTypeId (void);
390 
395  virtual TypeId GetInstanceTypeId (void) const;
396 
397  virtual void Print (std::ostream& os) const;
398 
403  virtual uint32_t GetSerializedSize (void) const;
404 
409  virtual void Serialize (Buffer::Iterator start) const;
410 
416  virtual uint32_t Deserialize (Buffer::Iterator start);
417 
422  // virtual Dispatch_e GetDispatchType (void) const;
423 
428  void SetDatagramSize (uint16_t datagramSize);
429 
434  uint16_t GetDatagramSize (void) const;
435 
440  void SetDatagramTag (uint16_t datagramTag);
441 
446  uint16_t GetDatagramTag (void) const;
447 
448 private:
449  uint16_t m_datagramSize;
450  uint16_t m_datagramTag;
451 
452 };
453 
461 std::ostream & operator<< (std::ostream & os, SixLowPanFrag1 const & header);
462 
467 class SixLowPanFragN : public Header
468 {
469 public:
470  SixLowPanFragN (void);
471 
476  static TypeId GetTypeId (void);
477 
482  virtual TypeId GetInstanceTypeId (void) const;
483 
484  virtual void Print (std::ostream& os) const;
485 
490  virtual uint32_t GetSerializedSize (void) const;
491 
496  virtual void Serialize (Buffer::Iterator start) const;
497 
503  virtual uint32_t Deserialize (Buffer::Iterator start);
504 
509  // virtual Dispatch_e GetDispatchType (void) const;
510 
515  void SetDatagramSize (uint16_t datagramSize);
516 
521  uint16_t GetDatagramSize (void) const;
522 
527  void SetDatagramTag (uint16_t datagramTag);
528 
533  uint16_t GetDatagramTag (void) const;
534 
539  void SetDatagramOffset (uint8_t datagramOffset);
540 
545  uint8_t GetDatagramOffset (void) const;
546 
547 private:
548  uint16_t m_datagramSize;
549  uint16_t m_datagramTag;
551 
552 };
553 
561 std::ostream & operator<< (std::ostream & os, SixLowPanFragN const &header);
562 
574 class SixLowPanIphc : public Header
575 {
576 public:
587  {
588  TF_FULL = 0,
592  };
593 
602  enum Hlim_e
603  {
608  };
609 
619  {
624  };
625 
626  SixLowPanIphc (void);
631  SixLowPanIphc (uint8_t dispatch);
632 
637  static TypeId GetTypeId (void);
638 
643  virtual TypeId GetInstanceTypeId (void) const;
644 
645  virtual void Print (std::ostream& os) const;
646 
651  virtual uint32_t GetSerializedSize (void) const;
652 
657  virtual void Serialize (Buffer::Iterator start) const;
658 
664  virtual uint32_t Deserialize (Buffer::Iterator start);
665 
670  // virtual Dispatch_e GetDispatchType (void) const;
671 
676  void SetTf (TrafficClassFlowLabel_e tfField);
677 
682  TrafficClassFlowLabel_e GetTf (void) const;
683 
688  void SetNh (bool nhField);
689 
694  bool GetNh (void) const;
695 
700  void SetHlim (Hlim_e hlimField);
701 
706  Hlim_e GetHlim (void) const;
707 
712  void SetCid (bool cidField);
713 
718  bool GetCid (void) const;
719 
724  void SetSac (bool sacField);
725 
730  bool GetSac (void) const;
731 
736  void SetSam (HeaderCompression_e samField);
737 
742  HeaderCompression_e GetSam (void) const;
743 
748  void SetM (bool mField);
749 
754  bool GetM (void) const;
755 
760  void SetDac (bool dacField);
761 
766  bool GetDac (void) const;
767 
772  void SetDam (HeaderCompression_e damField);
773 
778  HeaderCompression_e GetDam (void) const;
779 
784  void SetSrcContextId (uint8_t srcContextId);
785 
790  uint8_t GetSrcContextId (void) const;
791 
796  void SetDstContextId (uint8_t dstContextId);
797 
802  uint8_t GetDstContextId (void) const;
803 
808  void SetEcn (uint8_t ecn);
809 
814  uint8_t GetEcn (void) const;
815 
820  void SetDscp (uint8_t dscp);
821 
826  uint8_t GetDscp (void) const;
827 
832  void SetFlowLabel (uint32_t flowLabel);
833 
838  uint32_t GetFlowLabel (void) const;
839 
844  void SetNextHeader (uint8_t nextHeader);
845 
850  uint8_t GetNextHeader (void) const;
851 
856  void SetHopLimit (uint8_t hopLimit);
857 
862  uint8_t GetHopLimit (void) const;
863 
868  void SetSrcAddress (Ipv6Address srcAddress);
869 
874  Ipv6Address GetSrcAddress () const;
875 
880  void SetDstAddress (Ipv6Address dstAddress);
881 
886  Ipv6Address GetDstAddress () const;
887 
888 private:
889  uint16_t m_baseFormat;
891  uint8_t m_ecn : 2;
892  uint8_t m_dscp : 6;
893  uint32_t m_flowLabel : 20;
894  uint8_t m_nextHeader;
895  uint8_t m_hopLimit;
898 
903  void PostProcessSac ();
908  void PostProcessDac ();
909 
910 };
911 
919 std::ostream & operator<< (std::ostream & os, SixLowPanIphc const &header);
920 
932 {
933 public:
947  enum Eid_e
948  {
955  };
956 
957  SixLowPanNhcExtension (void);
958 
963  static TypeId GetTypeId (void);
964 
969  virtual TypeId GetInstanceTypeId (void) const;
970 
971  virtual void Print (std::ostream& os) const;
972 
977  virtual uint32_t GetSerializedSize (void) const;
978 
983  virtual void Serialize (Buffer::Iterator start) const;
984 
990  virtual uint32_t Deserialize (Buffer::Iterator start);
991 
997 
1002  void SetEid (Eid_e extensionHeaderType);
1003 
1008  Eid_e GetEid (void) const;
1009 
1014  void SetNextHeader (uint8_t nextHeader);
1015 
1020  uint8_t GetNextHeader (void) const;
1021 
1026  void SetNh (bool nhField);
1027 
1032  bool GetNh (void) const;
1033 
1039  void SetBlob (const uint8_t* blob, uint32_t size);
1040 
1047  uint32_t CopyBlob (uint8_t* blob, uint32_t size) const;
1048 
1049 private:
1053  uint8_t m_nhcBlob[256];
1054 };
1055 
1063 std::ostream & operator<< (std::ostream & os, SixLowPanNhcExtension const &header);
1064 
1065 
1077 {
1078 public:
1087  enum Ports_e
1088  {
1093  };
1094 
1095  SixLowPanUdpNhcExtension (void);
1096 
1101  static TypeId GetTypeId (void);
1102 
1107  virtual TypeId GetInstanceTypeId (void) const;
1108 
1109  virtual void Print (std::ostream& os) const;
1110 
1115  virtual uint32_t GetSerializedSize (void) const;
1116 
1121  virtual void Serialize (Buffer::Iterator start) const;
1122 
1128  virtual uint32_t Deserialize (Buffer::Iterator start);
1129 
1135 
1140  void SetPorts (Ports_e port);
1141 
1146  Ports_e GetPorts (void) const;
1147 
1152  void SetSrcPort (uint16_t port);
1153 
1158  uint16_t GetSrcPort () const;
1159 
1164  void SetDstPort (uint16_t port);
1165 
1170  uint16_t GetDstPort () const;
1171 
1176  void SetC (bool cField);
1177 
1182  bool GetC (void) const;
1183 
1188  void SetChecksum (uint16_t checksum);
1189 
1194  uint16_t GetChecksum (void) const;
1195 
1196 private:
1197  uint8_t m_baseFormat;
1198  uint16_t m_checksum;
1199  uint16_t m_srcPort;
1200  uint16_t m_dstPort;
1201 };
1202 
1210 std::ostream & operator<< (std::ostream & os, SixLowPanUdpNhcExtension const &header);
1211 
1212 }
1213 
1214 #endif /* SIXLOWPANHEADER_H_ */
Protocol header serialization and deserialization.
Definition: header.h:42
static TypeId GetTypeId(void)
Get the type ID.
void SetCid(bool cidField)
Set the CID (Context Identifier Extension) compression.
uint8_t GetNextHeader(void) const
Get the Next Header field.
Ports_e GetPorts(void) const
Get the compressed Src and Dst Ports.
NhcDispatch_e
Dispatch values for Next Header compression.
void SetTcflCompression(bool tcflCompression)
Set the Traffic Class and Flow Labels as compressed.
uint8_t m_ecn
ECN bits.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
uint8_t GetNextHeader() const
Get the Next Header value.
Ipv6Address m_dstAddress
Dst address.
TrafficClassFlowLabel_e
TF: Traffic Class, Flow Label.
uint16_t m_dstPort
Destination port.
static TypeId GetTypeId(void)
Get the type ID.
void SetHopLimit(uint8_t hopLimit)
Set the Hop Limit field.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
void SetDstCompression(LowPanHc1Addr_e dstCompression)
Set Destination Compression type.
virtual void Print(std::ostream &os) const
virtual SixLowPanDispatch::NhcDispatch_e GetNhcDispatchType(void) const
Get the NhcDispatch type.
void SetNextHeader(uint8_t nextHeader)
Set the Next Header field values.
uint8_t m_nhcBlob[256]
NHC compressed header.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
static Dispatch_e GetDispatchType(uint8_t dispatch)
Get the Dispatch type.
LOWPAN_IPHC base Encoding - see RFC 6282.
void PostProcessDac()
Post-process the Destination address stateful compression.
void SetPorts(Ports_e port)
Set the compressed Src and Dst Ports.
void SetSrcCompression(LowPanHc1Addr_e srcCompression)
Set Source Compression type.
void SetSrcContextId(uint8_t srcContextId)
Set the SrcContextId.
uint16_t GetDatagramSize(void) const
Get the datagram size.
LowPanHc1Addr_e m_srcCompression
Source compresison type.
uint16_t GetDatagramSize(void) const
Get the datagram size.
virtual void Print(std::ostream &os) const
LOWPAN_NHC Extension Header Encoding - see RFC 6282.
Hlim_e
HLIM: Hop Limit.
void SetDatagramOffset(uint8_t datagramOffset)
Set the datagram offset.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
void SetSam(HeaderCompression_e samField)
Set the SAM (Source Address Mode) compression.
virtual void Print(std::ostream &os) const
6LoWPAN FRAGN header - see RFC 4944
TrafficClassFlowLabel_e GetTf(void) const
Get the TF (Traffic Class, Flow Label) compression.
void SetDatagramSize(uint16_t datagramSize)
Get the Dispatch type.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
static TypeId GetTypeId(void)
Return the instance type identifier.
bool IsTcflCompression() const
Check if the Traffic Class and Flow Labels are compressed.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
bool GetM(void) const
Get the M (Multicast) compression.
void SetTrafficClass(uint8_t trafficClass)
Set the Traffic Class value.
virtual SixLowPanDispatch::NhcDispatch_e GetNhcDispatchType(void) const
Get the NhcDispatch type.
uint16_t port
Definition: dsdv-manet.cc:44
iterator in a Buffer instance
Definition: buffer.h:98
uint8_t m_srcPrefix[8]
Source prefix.
uint16_t GetDstPort() const
Get the Destination Port.
bool GetNh(void) const
Get the Next Header field value.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
static TypeId GetTypeId(void)
Get the type ID.
uint8_t GetDscp(void) const
Get the DSCP.
void SetHlim(Hlim_e hlimField)
Set the HLIM (Hop Limit) compression.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
uint16_t m_srcPort
Source port.
uint16_t GetDatagramTag(void) const
Get the datagram tag.
Ipv6Address GetSrcAddress() const
Get the Source Address.
uint16_t GetSrcPort() const
Get the Destination Port.
void SetBlob(const uint8_t *blob, uint32_t size)
Set the option header data blob.
const uint8_t * GetSrcInterface() const
Get the source interface.
void SetHc2HeaderPresent(bool hc2HeaderPresent)
Set the next header a HC2 compressed header.
bool GetCid(void) const
Get the CID (Context Identifier Extension) compression.
void SetDscp(uint8_t dscp)
Set the DSCP (6bits).
uint8_t GetTrafficClass() const
Get the Traffic Class value.
uint16_t m_datagramTag
datagram tag
uint8_t m_hopLimit
Hop Limit.
void SetDstInterface(const uint8_t *dstInterface)
Set the destination interface.
LowPanHc1Addr_e m_dstCompression
Destination compresison type.
void SetSac(bool sacField)
Set the SAC (Source Address Compression) compression.
bool IsHc2HeaderPresent() const
Check if there is a HC2 compressed header.
Dispatch header helper.
uint16_t m_datagramSize
datagram size
void SetNh(bool nhField)
Set the NH (Next Header) compression.
Ipv6Address GetDstAddress() const
Get the Destination Address.
void SetChecksum(uint16_t checksum)
Set the Checksum field values.
uint16_t GetDatagramTag(void) const
Get the datagram tag.
uint8_t GetHopLimit(void) const
Get the Hop Limit field.
LowPanHc1Addr_e GetDstCompression() const
Get Destination Compression type.
uint8_t GetEcn(void) const
Get the ECN.
void SetDstPort(uint16_t port)
Set the Destination Port.
uint32_t m_flowLabel
Flow Label.
void SetDatagramSize(uint16_t datagramSize)
Get the Dispatch type.
static TypeId GetTypeId(void)
Get the type ID.
uint8_t GetHopLimit(void) const
Get the "Hop limit" field (TTL).
bool GetNh(void) const
Get the NH (Next Header) compression.
HeaderCompression_e GetDam(void) const
Get the DAM (Destination Address Mode) compression.
virtual void Print(std::ostream &os) const
Hlim_e GetHlim(void) const
Get the HLIM (Hop Limit) compression.
uint8_t GetSrcContextId(void) const
Get the SrcContextId.
void SetSrcPort(uint16_t port)
Set the Destination Port.
HeaderCompression_e GetSam(void) const
Get the SAM (Source Address Mode) compression.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:43
uint16_t m_datagramTag
datagram tag
uint8_t m_dscp
DSCP bits.
static TypeId GetTypeId(void)
Get the type ID.
void SetNextHeader(uint8_t nextHeader)
Set the Next Header field.
uint32_t GetFlowLabel() const
Get the Flow Label value.
virtual void Print(std::ostream &os) const
uint8_t m_trafficClass
Traffic Class.
bool GetC(void) const
Get the C (Checksum).
bool GetSac(void) const
Get the SAC (Source Address Compression) compression.
void SetDstContextId(uint8_t dstContextId)
Set the DstContextId.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
void SetSrcAddress(Ipv6Address srcAddress)
Set the Source Address.
bool GetDac(void) const
Get the DAC (Destination Address Compression) compression.
LowPanHc1NextHeader_e m_nextHeaderCompression
next header compression
const uint8_t * GetDstPrefix() const
Get the destination prefix.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
uint8_t GetNextHeader(void) const
Get the Next Header field value.
6LoWPAN HC1 header - see RFC 4944
void SetHopLimit(uint8_t limit)
Get the Dispatch type.
void SetDac(bool dacField)
Set the DAC (Destination Address Compression) compression.
uint8_t m_hopLimit
Hop Limit.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
uint8_t m_nhcExtensionHeader
NHC extension header type.
void SetSrcInterface(const uint8_t *srcInterface)
Set the source interface.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
void SetDstPrefix(const uint8_t *dstPrefix)
Set the destination prefix.
Describes an IPv6 address.
Definition: ipv6-address.h:46
Ipv6Address m_srcAddress
Src address.
void SetFlowLabel(uint32_t flowLabel)
Set the Flow Label (20bits).
Eid_e GetEid(void) const
Get the Extension Header Type.
uint8_t m_datagramOffset
datagram offset
bool m_tcflCompression
is TC and FL compressed
uint32_t m_flowLabel
Flow Label bits.
uint8_t m_dstPrefix[8]
Destinaiton prefix.
const uint8_t * GetSrcPrefix() const
Get the source prefix.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
uint16_t m_datagramSize
datagram size
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
uint8_t m_baseFormat
Dispatch + encoding fields.
uint8_t m_srcInterface[8]
Source interface.
uint8_t m_nhcBlobLength
Length of the NHC compressed header.
uint32_t GetFlowLabel(void) const
Get the Flow Label.
uint8_t GetDstContextId(void) const
Get the DstContextId.
static NhcDispatch_e GetNhcDispatchType(uint8_t dispatch)
Get the NhcDispatch type.
uint16_t m_baseFormat
Dispatch + encoding fields.
Eid_e
EID: IPv6 Extension Header ID.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
void SetEid(Eid_e extensionHeaderType)
Set the Extension Header Type.
bool m_hc2HeaderPresent
is next header HC2 compressed
void SetNh(bool nhField)
Set the NH field values.
uint8_t m_nhcNextHeader
Next header.
void SetTf(TrafficClassFlowLabel_e tfField)
Get the Dispatch type.
Dispatch_e
Dispatch values, as defined in RFC4944 and RFC6282.
LowPanHc1NextHeader_e
Next header information.
uint32_t CopyBlob(uint8_t *blob, uint32_t size) const
Get the option header data blob.
const uint8_t * GetDstInterface() const
Get the destination interface.
HeaderCompression_e
Source or Destination Address Mode.
void SetDstAddress(Ipv6Address dstAddress)
Set the Destination Address.
uint8_t m_nextHeader
Next header.
void SetM(bool mField)
Set the M (Multicast) compression.
void SetSrcPrefix(const uint8_t *srcPrefix)
Set the source prefix.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
void SetDatagramTag(uint16_t datagramTag)
Set the datagram tag.
void SetEcn(uint8_t ecn)
Set the ECN (2bits).
6LoWPAN FRAG1 header - see RFC 4944
uint8_t GetDatagramOffset(void) const
Get the datagram offset.
LowPanHc1Addr_e GetSrcCompression() const
Get Source Compression type.
a unique identifier for an interface.
Definition: type-id.h:49
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
uint8_t m_dstInterface[8]
Destination interface.
UDP LOWPAN_NHC Extension Header Encoding - see RFC 6282.
uint8_t m_nextHeader
Next header.
void SetC(bool cField)
Set the C (Checksum).
uint8_t m_srcdstContextId
Src and Dst Context ID.
void SetNextHeader(uint8_t nextHeader)
Set the Next Header value.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
void SetDam(HeaderCompression_e damField)
Set the DAM (Destination Address Mode) compression.
LowPanHc1Addr_e
Kind of address compression.
void SetFlowLabel(uint32_t flowLabel)
Set the Flow Label value.
void SetDatagramTag(uint16_t datagramTag)
Set the datagram tag.
uint16_t GetChecksum(void) const
Get the Checksum field value.
void PostProcessSac()
Post-process the Source address stateful compression.
virtual void Print(std::ostream &os) const