A Discrete-Event Network Simulator
API
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,
82  LOWPAN_IPv6 = 0x41,
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  void SetHopLimit (uint8_t limit);
206 
211  uint8_t GetHopLimit (void) const;
212 
218 
223  const uint8_t* GetDstInterface () const;
224 
229  const uint8_t* GetDstPrefix () const;
230 
235  uint32_t GetFlowLabel () const;
236 
241  uint8_t GetNextHeader () const;
242 
248 
253  const uint8_t* GetSrcInterface () const;
254 
259  const uint8_t* GetSrcPrefix () const;
260 
265  uint8_t GetTrafficClass () const;
266 
271  bool IsTcflCompression () const;
272 
277  bool IsHc2HeaderPresent () const;
278 
283  void SetDstCompression (LowPanHc1Addr_e dstCompression);
284 
289  void SetDstInterface (const uint8_t* dstInterface);
290 
295  void SetDstPrefix (const uint8_t* dstPrefix);
296 
301  void SetFlowLabel (uint32_t flowLabel);
302 
307  void SetNextHeader (uint8_t nextHeader);
308 
313  void SetSrcCompression (LowPanHc1Addr_e srcCompression);
314 
319  void SetSrcInterface (const uint8_t* srcInterface);
320 
325  void SetSrcPrefix (const uint8_t* srcPrefix);
326 
331  void SetTcflCompression (bool tcflCompression);
332 
337  void SetHc2HeaderPresent (bool hc2HeaderPresent);
338 
343  void SetTrafficClass (uint8_t trafficClass);
344 
345 private:
346  uint8_t m_hopLimit;
347  uint8_t m_srcPrefix[8];
348  uint8_t m_srcInterface[8];
349  uint8_t m_dstPrefix[8];
350  uint8_t m_dstInterface[8];
351  uint8_t m_trafficClass;
352  uint32_t m_flowLabel;
353  uint8_t m_nextHeader;
359 };
360 
368 std::ostream & operator<< (std::ostream & os, SixLowPanHc1 const &header);
369 
374 class SixLowPanFrag1 : public Header
375 {
376 public:
377  SixLowPanFrag1 (void);
378 
383  static TypeId GetTypeId (void);
384 
389  virtual TypeId GetInstanceTypeId (void) const;
390 
391  virtual void Print (std::ostream& os) const;
392 
397  virtual uint32_t GetSerializedSize (void) const;
398 
403  virtual void Serialize (Buffer::Iterator start) const;
404 
410  virtual uint32_t Deserialize (Buffer::Iterator start);
411 
416  void SetDatagramSize (uint16_t datagramSize);
417 
422  uint16_t GetDatagramSize (void) const;
423 
428  void SetDatagramTag (uint16_t datagramTag);
429 
434  uint16_t GetDatagramTag (void) const;
435 
436 private:
437  uint16_t m_datagramSize;
438  uint16_t m_datagramTag;
439 
440 };
441 
449 std::ostream & operator<< (std::ostream & os, SixLowPanFrag1 const & header);
450 
455 class SixLowPanFragN : public Header
456 {
457 public:
458  SixLowPanFragN (void);
459 
464  static TypeId GetTypeId (void);
465 
470  virtual TypeId GetInstanceTypeId (void) const;
471 
472  virtual void Print (std::ostream& os) const;
473 
478  virtual uint32_t GetSerializedSize (void) const;
479 
484  virtual void Serialize (Buffer::Iterator start) const;
485 
491  virtual uint32_t Deserialize (Buffer::Iterator start);
492 
497  void SetDatagramSize (uint16_t datagramSize);
498 
503  uint16_t GetDatagramSize (void) const;
504 
509  void SetDatagramTag (uint16_t datagramTag);
510 
515  uint16_t GetDatagramTag (void) const;
516 
521  void SetDatagramOffset (uint8_t datagramOffset);
522 
527  uint8_t GetDatagramOffset (void) const;
528 
529 private:
530  uint16_t m_datagramSize;
531  uint16_t m_datagramTag;
533 
534 };
535 
543 std::ostream & operator<< (std::ostream & os, SixLowPanFragN const &header);
544 
549 class SixLowPanIpv6 : public Header
550 {
551 public:
552  SixLowPanIpv6 (void);
553 
558  static TypeId GetTypeId (void);
559 
564  virtual TypeId GetInstanceTypeId (void) const;
565 
566  virtual void Print (std::ostream& os) const;
567 
572  virtual uint32_t GetSerializedSize (void) const;
573 
578  virtual void Serialize (Buffer::Iterator start) const;
579 
585  virtual uint32_t Deserialize (Buffer::Iterator start);
586 
587 };
588 
596 std::ostream & operator<< (std::ostream & os, SixLowPanIpv6 const & header);
597 
609 class SixLowPanIphc : public Header
610 {
611 public:
622  {
623  TF_FULL = 0,
627  };
628 
637  enum Hlim_e
638  {
643  };
644 
654  {
659  };
660 
661  SixLowPanIphc (void);
666  SixLowPanIphc (uint8_t dispatch);
667 
672  static TypeId GetTypeId (void);
673 
678  virtual TypeId GetInstanceTypeId (void) const;
679 
680  virtual void Print (std::ostream& os) const;
681 
686  virtual uint32_t GetSerializedSize (void) const;
687 
692  virtual void Serialize (Buffer::Iterator start) const;
693 
699  virtual uint32_t Deserialize (Buffer::Iterator start);
700 
705  void SetTf (TrafficClassFlowLabel_e tfField);
706 
711  TrafficClassFlowLabel_e GetTf (void) const;
712 
717  void SetNh (bool nhField);
718 
723  bool GetNh (void) const;
724 
729  void SetHlim (Hlim_e hlimField);
730 
735  Hlim_e GetHlim (void) const;
736 
741  void SetCid (bool cidField);
742 
747  bool GetCid (void) const;
748 
753  void SetSac (bool sacField);
754 
759  bool GetSac (void) const;
760 
765  void SetSam (HeaderCompression_e samField);
766 
771  HeaderCompression_e GetSam (void) const;
772 
777  void SetM (bool mField);
778 
783  bool GetM (void) const;
784 
789  void SetDac (bool dacField);
790 
795  bool GetDac (void) const;
796 
801  void SetDam (HeaderCompression_e damField);
802 
807  HeaderCompression_e GetDam (void) const;
808 
813  void SetSrcContextId (uint8_t srcContextId);
814 
819  uint8_t GetSrcContextId (void) const;
820 
825  void SetDstContextId (uint8_t dstContextId);
826 
831  uint8_t GetDstContextId (void) const;
832 
837  void SetEcn (uint8_t ecn);
838 
843  uint8_t GetEcn (void) const;
844 
849  void SetDscp (uint8_t dscp);
850 
855  uint8_t GetDscp (void) const;
856 
861  void SetFlowLabel (uint32_t flowLabel);
862 
867  uint32_t GetFlowLabel (void) const;
868 
873  void SetNextHeader (uint8_t nextHeader);
874 
879  uint8_t GetNextHeader (void) const;
880 
885  void SetHopLimit (uint8_t hopLimit);
886 
891  uint8_t GetHopLimit (void) const;
892 
897  void SetSrcAddress (Ipv6Address srcAddress);
898 
903  Ipv6Address GetSrcAddress () const;
904 
909  void SetDstAddress (Ipv6Address dstAddress);
910 
915  Ipv6Address GetDstAddress () const;
916 
917 private:
918  uint16_t m_baseFormat;
920  uint8_t m_ecn : 2;
921  uint8_t m_dscp : 6;
922  uint32_t m_flowLabel : 20;
923  uint8_t m_nextHeader;
924  uint8_t m_hopLimit;
927 
932  void PostProcessSac ();
937  void PostProcessDac ();
938 
939 };
940 
948 std::ostream & operator<< (std::ostream & os, SixLowPanIphc const &header);
949 
961 {
962 public:
976  enum Eid_e
977  {
984  };
985 
986  SixLowPanNhcExtension (void);
987 
992  static TypeId GetTypeId (void);
993 
998  virtual TypeId GetInstanceTypeId (void) const;
999 
1000  virtual void Print (std::ostream& os) const;
1001 
1006  virtual uint32_t GetSerializedSize (void) const;
1007 
1012  virtual void Serialize (Buffer::Iterator start) const;
1013 
1019  virtual uint32_t Deserialize (Buffer::Iterator start);
1020 
1026 
1031  void SetEid (Eid_e extensionHeaderType);
1032 
1037  Eid_e GetEid (void) const;
1038 
1043  void SetNextHeader (uint8_t nextHeader);
1044 
1049  uint8_t GetNextHeader (void) const;
1050 
1055  void SetNh (bool nhField);
1056 
1061  bool GetNh (void) const;
1062 
1068  void SetBlob (const uint8_t* blob, uint32_t size);
1069 
1076  uint32_t CopyBlob (uint8_t* blob, uint32_t size) const;
1077 
1078 private:
1082  uint8_t m_nhcBlob[256];
1083 };
1084 
1092 std::ostream & operator<< (std::ostream & os, SixLowPanNhcExtension const &header);
1093 
1094 
1106 {
1107 public:
1116  enum Ports_e
1117  {
1122  };
1123 
1124  SixLowPanUdpNhcExtension (void);
1125 
1130  static TypeId GetTypeId (void);
1131 
1136  virtual TypeId GetInstanceTypeId (void) const;
1137 
1138  virtual void Print (std::ostream& os) const;
1139 
1144  virtual uint32_t GetSerializedSize (void) const;
1145 
1150  virtual void Serialize (Buffer::Iterator start) const;
1151 
1157  virtual uint32_t Deserialize (Buffer::Iterator start);
1158 
1164 
1169  void SetPorts (Ports_e port);
1170 
1175  Ports_e GetPorts (void) const;
1176 
1181  void SetSrcPort (uint16_t port);
1182 
1187  uint16_t GetSrcPort () const;
1188 
1193  void SetDstPort (uint16_t port);
1194 
1199  uint16_t GetDstPort () const;
1200 
1205  void SetC (bool cField);
1206 
1211  bool GetC (void) const;
1212 
1217  void SetChecksum (uint16_t checksum);
1218 
1223  uint16_t GetChecksum (void) const;
1224 
1225 private:
1226  uint8_t m_baseFormat;
1227  uint16_t m_checksum;
1228  uint16_t m_srcPort;
1229  uint16_t m_dstPort;
1230 };
1231 
1239 std::ostream & operator<< (std::ostream & os, SixLowPanUdpNhcExtension const &header);
1240 
1241 }
1242 
1243 #endif /* SIXLOWPANHEADER_H_ */
uint8_t GetEcn(void) const
Get the ECN.
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 value.
NhcDispatch_e
Dispatch values for Next Header compression.
uint8_t GetDstContextId(void) const
Get the DstContextId.
void SetTcflCompression(bool tcflCompression)
Set the Traffic Class and Flow Labels as compressed.
uint8_t m_ecn
ECN bits.
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.
void SetDstCompression(LowPanHc1Addr_e dstCompression)
Set Destination Compression type.
6LoWPAN IPv6 uncompressed header - see RFC 4944.
uint8_t GetDscp(void) const
Get the DSCP.
uint16_t GetDstPort() const
Get the Destination Port.
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.
def start()
Definition: core.py:1844
void PostProcessDac()
Post-process the Destination address stateful compression.
Hlim_e GetHlim(void) const
Get the HLIM (Hop Limit) 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.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
HeaderCompression_e GetSam(void) const
Get the SAM (Source Address Mode) compression.
LowPanHc1Addr_e m_srcCompression
Source compression type.
bool GetNh(void) const
Get the Next Header field value.
LOWPAN_NHC Extension Header Encoding - see RFC 6282.
Hlim_e
HLIM: Hop Limit.
void SetDatagramOffset(uint8_t datagramOffset)
Set the datagram offset.
void SetSam(HeaderCompression_e samField)
Set the SAM (Source Address Mode) compression.
6LoWPAN FRAGN header - see RFC 4944.
uint32_t GetFlowLabel(void) const
Get the Flow Label.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
void SetDatagramSize(uint16_t datagramSize)
Set the datagram size.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
static TypeId GetTypeId(void)
Get the type ID.
const uint8_t * GetSrcInterface() const
Get the source interface.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
void SetTrafficClass(uint8_t trafficClass)
Set the Traffic Class value.
uint16_t port
Definition: dsdv-manet.cc:45
iterator in a Buffer instance
Definition: buffer.h:98
uint8_t m_srcPrefix[8]
Source prefix.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
static TypeId GetTypeId(void)
Get the type ID.
void SetHlim(Hlim_e hlimField)
Set the HLIM (Hop Limit) compression.
virtual void Print(std::ostream &os) const
uint16_t m_srcPort
Source port.
virtual void Print(std::ostream &os) const
uint8_t GetHopLimit(void) const
Get the "Hop limit" field (TTL).
uint8_t GetSrcContextId(void) const
Get the SrcContextId.
void SetBlob(const uint8_t *blob, uint32_t size)
Set the option header data blob.
HeaderCompression_e GetDam(void) const
Get the DAM (Destination Address Mode) compression.
void SetHc2HeaderPresent(bool hc2HeaderPresent)
Set the next header a HC2 compressed header.
void SetDscp(uint8_t dscp)
Set the DSCP (6bits).
uint16_t m_datagramTag
Datagram tag.
uint8_t m_hopLimit
Hop Limit.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
void SetDstInterface(const uint8_t *dstInterface)
Set the destination interface.
LowPanHc1Addr_e m_dstCompression
Destination compression type.
bool GetNh(void) const
Get the NH (Next Header) compression.
void SetSac(bool sacField)
Set the SAC (Source Address Compression) compression.
Dispatch header helper.
uint16_t m_datagramSize
Datagram size.
void SetNh(bool nhField)
Set the NH (Next Header) compression.
virtual void Print(std::ostream &os) const
void SetChecksum(uint16_t checksum)
Set the Checksum field values.
Ipv6Address GetSrcAddress() const
Get the Source Address.
uint8_t GetNextHeader(void) const
Get the Next Header field.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
void SetDstPort(uint16_t port)
Set the Destination Port.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
uint32_t m_flowLabel
Flow Label.
uint8_t GetTrafficClass() const
Get the Traffic Class value.
void SetDatagramSize(uint16_t datagramSize)
Set the datagram size.
static TypeId GetTypeId(void)
Get the type ID.
bool IsHc2HeaderPresent() const
Check if there is a HC2 compressed header.
virtual void Print(std::ostream &os) const
virtual void Print(std::ostream &os) const
void SetSrcPort(uint16_t port)
Set the Source Port.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
uint16_t m_datagramTag
Datagram tag.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
uint8_t m_dscp
DSCP bits.
const uint8_t * GetDstPrefix() const
Get the destination prefix.
static TypeId GetTypeId(void)
Get the type ID.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
bool GetCid(void) const
Get the CID (Context Identifier Extension) compression.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetNextHeader(uint8_t nextHeader)
Set the Next Header field.
TrafficClassFlowLabel_e GetTf(void) const
Get the TF (Traffic Class, Flow Label) compression.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
bool IsTcflCompression() const
Check if the Traffic Class and Flow Labels are compressed.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
uint8_t m_trafficClass
Traffic Class.
uint16_t GetSrcPort() const
Get the Source Port.
void SetDstContextId(uint8_t dstContextId)
Set the DstContextId.
LowPanHc1Addr_e GetDstCompression() const
Get Destination Compression type.
virtual SixLowPanDispatch::NhcDispatch_e GetNhcDispatchType(void) const
Get the NhcDispatch type.
void SetSrcAddress(Ipv6Address srcAddress)
Set the Source Address.
uint8_t GetDatagramOffset(void) const
Get the datagram offset.
LowPanHc1NextHeader_e m_nextHeaderCompression
Next header compression.
bool GetSac(void) const
Get the SAC (Source Address Compression) compression.
uint16_t GetChecksum(void) const
Get the Checksum field value.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
uint16_t GetDatagramSize(void) const
Get the datagram size.
6LoWPAN HC1 header - see RFC 4944.
void SetHopLimit(uint8_t limit)
Set the "Hop limit" field (TTL).
void SetDac(bool dacField)
Set the DAC (Destination Address Compression) compression.
uint8_t m_hopLimit
Hop Limit.
uint8_t m_nhcExtensionHeader
NHC extension header type.
void SetSrcInterface(const uint8_t *srcInterface)
Set the source interface.
void SetDstPrefix(const uint8_t *dstPrefix)
Set the destination prefix.
uint16_t GetDatagramTag(void) const
Get the datagram tag.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
Describes an IPv6 address.
Definition: ipv6-address.h:49
Ipv6Address m_srcAddress
Src address.
uint32_t GetFlowLabel() const
Get the Flow Label value.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
void SetFlowLabel(uint32_t flowLabel)
Set the Flow Label (20bits).
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
uint8_t m_datagramOffset
Datagram offset.
bool m_tcflCompression
Is TC and FL compressed.
uint32_t m_flowLabel
Flow Label bits.
uint8_t GetHopLimit(void) const
Get the Hop Limit field.
uint8_t m_dstPrefix[8]
Destination prefix.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
uint16_t m_datagramSize
Datagram size.
uint8_t m_baseFormat
Dispatch + encoding fields.
uint8_t m_srcInterface[8]
Source interface.
LowPanHc1Addr_e GetSrcCompression() const
Get Source Compression type.
uint8_t m_nhcBlobLength
Length of the NHC compressed header.
virtual void Print(std::ostream &os) const
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.
void SetEid(Eid_e extensionHeaderType)
Set the Extension Header Type.
Eid_e GetEid(void) const
Get the Extension Header Type.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
bool m_hc2HeaderPresent
Is next header HC2 compressed.
Ports_e GetPorts(void) const
Get the compressed Src and Dst Ports.
void SetNh(bool nhField)
Set the NH field values.
uint8_t m_nhcNextHeader
Next header.
void SetTf(TrafficClassFlowLabel_e tfField)
Set the TF (Traffic Class, Flow Label) compression.
uint16_t GetDatagramSize(void) const
Get the datagram size.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
Dispatch_e
Dispatch values, as defined in RFC 4944 and RFC 6282
LowPanHc1NextHeader_e
Next header information.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
HeaderCompression_e
Source or Destination Address Mode.
void SetDstAddress(Ipv6Address dstAddress)
Set the Destination Address.
uint8_t m_nextHeader
Next header.
static TypeId GetTypeId(void)
Get the type ID.
void SetM(bool mField)
Set the M (Multicast) compression.
virtual SixLowPanDispatch::NhcDispatch_e GetNhcDispatchType(void) const
Get the NhcDispatch type.
void SetSrcPrefix(const uint8_t *srcPrefix)
Set the source prefix.
bool GetM(void) const
Get the M (Multicast) compression.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
uint32_t CopyBlob(uint8_t *blob, uint32_t size) const
Get the option header data blob.
void SetDatagramTag(uint16_t datagramTag)
Set the datagram tag.
void SetEcn(uint8_t ecn)
Set the ECN (2bits).
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
bool GetC(void) const
Get the C (Checksum).
uint16_t GetDatagramTag(void) const
Get the datagram tag.
6LoWPAN FRAG1 header - see RFC 4944.
a unique identifier for an interface.
Definition: type-id.h:58
bool GetDac(void) const
Get the DAC (Destination Address Compression) compression.
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).
const uint8_t * GetSrcPrefix() const
Get the source prefix.
uint8_t m_srcdstContextId
Src and Dst Context ID.
void SetNextHeader(uint8_t nextHeader)
Set the Next Header value.
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.
Ipv6Address GetDstAddress() const
Get the Destination Address.
void SetDatagramTag(uint16_t datagramTag)
Set the datagram tag.
void PostProcessSac()
Post-process the Source address stateful compression.
const uint8_t * GetDstInterface() const
Get the destination interface.
uint8_t GetNextHeader() const
Get the Next Header value.
virtual void Print(std::ostream &os) const