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 
28 namespace ns3 {
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,
92  };
93 
101  {
102  LOWPAN_NHC = 0xE0,
103  LOWPAN_NHC_N = 0xEF,
107  };
108 
109  SixLowPanDispatch (void);
110 
116  static Dispatch_e GetDispatchType (uint8_t dispatch);
117 
123  static NhcDispatch_e GetNhcDispatchType (uint8_t dispatch);
124 
125 };
126 
131 class SixLowPanHc1 : public Header
132 {
133 public:
142  {
143  HC1_PIII = 0x00,
144  HC1_PIIC = 0x01,
145  HC1_PCII = 0x02,
146  HC1_PCIC = 0x03
147  };
148 
156  {
157  HC1_NC = 0x00,
158  HC1_UDP = 0x01,
159  HC1_ICMP = 0x02,
160  HC1_TCP = 0x03
161  };
162 
163  SixLowPanHc1 (void);
164 
169  static TypeId GetTypeId (void);
170 
176  virtual TypeId GetInstanceTypeId (void) const;
177 
178  virtual void Print (std::ostream& os) const;
179 
184  virtual uint32_t GetSerializedSize (void) const;
185 
190  virtual void Serialize (Buffer::Iterator start) const;
191 
197  virtual uint32_t Deserialize (Buffer::Iterator start);
198 
203  void SetHopLimit (uint8_t limit);
204 
209  uint8_t GetHopLimit (void) const;
210 
216 
221  const uint8_t* GetDstInterface () const;
222 
227  const uint8_t* GetDstPrefix () const;
228 
233  uint32_t GetFlowLabel () const;
234 
239  uint8_t GetNextHeader () const;
240 
246 
251  const uint8_t* GetSrcInterface () const;
252 
257  const uint8_t* GetSrcPrefix () const;
258 
263  uint8_t GetTrafficClass () const;
264 
269  bool IsTcflCompression () const;
270 
275  bool IsHc2HeaderPresent () const;
276 
281  void SetDstCompression (LowPanHc1Addr_e dstCompression);
282 
287  void SetDstInterface (const uint8_t* dstInterface);
288 
293  void SetDstPrefix (const uint8_t* dstPrefix);
294 
299  void SetFlowLabel (uint32_t flowLabel);
300 
305  void SetNextHeader (uint8_t nextHeader);
306 
311  void SetSrcCompression (LowPanHc1Addr_e srcCompression);
312 
317  void SetSrcInterface (const uint8_t* srcInterface);
318 
323  void SetSrcPrefix (const uint8_t* srcPrefix);
324 
329  void SetTcflCompression (bool tcflCompression);
330 
335  void SetHc2HeaderPresent (bool hc2HeaderPresent);
336 
341  void SetTrafficClass (uint8_t trafficClass);
342 
343 private:
344  uint8_t m_hopLimit;
345  uint8_t m_srcPrefix[8];
346  uint8_t m_srcInterface[8];
347  uint8_t m_dstPrefix[8];
348  uint8_t m_dstInterface[8];
349  uint8_t m_trafficClass;
350  uint32_t m_flowLabel;
351  uint8_t m_nextHeader;
357 };
358 
366 std::ostream & operator<< (std::ostream & os, SixLowPanHc1 const &header);
367 
372 class SixLowPanFrag1 : public Header
373 {
374 public:
375  SixLowPanFrag1 (void);
376 
381  static TypeId GetTypeId (void);
382 
387  virtual TypeId GetInstanceTypeId (void) const;
388 
389  virtual void Print (std::ostream& os) const;
390 
395  virtual uint32_t GetSerializedSize (void) const;
396 
401  virtual void Serialize (Buffer::Iterator start) const;
402 
408  virtual uint32_t Deserialize (Buffer::Iterator start);
409 
414  void SetDatagramSize (uint16_t datagramSize);
415 
420  uint16_t GetDatagramSize (void) const;
421 
426  void SetDatagramTag (uint16_t datagramTag);
427 
432  uint16_t GetDatagramTag (void) const;
433 
434 private:
435  uint16_t m_datagramSize;
436  uint16_t m_datagramTag;
437 
438 };
439 
447 std::ostream & operator<< (std::ostream & os, SixLowPanFrag1 const & header);
448 
453 class SixLowPanFragN : public Header
454 {
455 public:
456  SixLowPanFragN (void);
457 
462  static TypeId GetTypeId (void);
463 
468  virtual TypeId GetInstanceTypeId (void) const;
469 
470  virtual void Print (std::ostream& os) const;
471 
476  virtual uint32_t GetSerializedSize (void) const;
477 
482  virtual void Serialize (Buffer::Iterator start) const;
483 
489  virtual uint32_t Deserialize (Buffer::Iterator start);
490 
495  void SetDatagramSize (uint16_t datagramSize);
496 
501  uint16_t GetDatagramSize (void) const;
502 
507  void SetDatagramTag (uint16_t datagramTag);
508 
513  uint16_t GetDatagramTag (void) const;
514 
519  void SetDatagramOffset (uint8_t datagramOffset);
520 
525  uint8_t GetDatagramOffset (void) const;
526 
527 private:
528  uint16_t m_datagramSize;
529  uint16_t m_datagramTag;
531 
532 };
533 
541 std::ostream & operator<< (std::ostream & os, SixLowPanFragN const &header);
542 
547 class SixLowPanIpv6 : public Header
548 {
549 public:
550  SixLowPanIpv6 (void);
551 
556  static TypeId GetTypeId (void);
557 
562  virtual TypeId GetInstanceTypeId (void) const;
563 
564  virtual void Print (std::ostream& os) const;
565 
570  virtual uint32_t GetSerializedSize (void) const;
571 
576  virtual void Serialize (Buffer::Iterator start) const;
577 
583  virtual uint32_t Deserialize (Buffer::Iterator start);
584 
585 };
586 
594 std::ostream & operator<< (std::ostream & os, SixLowPanIpv6 const & header);
595 
607 class SixLowPanIphc : public Header
608 {
609 public:
620  {
621  TF_FULL = 0,
625  };
626 
635  enum Hlim_e
636  {
641  };
642 
652  {
657  };
658 
659  SixLowPanIphc (void);
664  SixLowPanIphc (uint8_t dispatch);
665 
670  static TypeId GetTypeId (void);
671 
676  virtual TypeId GetInstanceTypeId (void) const;
677 
678  virtual void Print (std::ostream& os) const;
679 
684  virtual uint32_t GetSerializedSize (void) const;
685 
690  virtual void Serialize (Buffer::Iterator start) const;
691 
697  virtual uint32_t Deserialize (Buffer::Iterator start);
698 
703  void SetTf (TrafficClassFlowLabel_e tfField);
704 
709  TrafficClassFlowLabel_e GetTf (void) const;
710 
715  void SetNh (bool nhField);
716 
721  bool GetNh (void) const;
722 
727  void SetHlim (Hlim_e hlimField);
728 
733  Hlim_e GetHlim (void) const;
734 
739  void SetCid (bool cidField);
740 
745  bool GetCid (void) const;
746 
751  void SetSac (bool sacField);
752 
757  bool GetSac (void) const;
758 
763  void SetSam (HeaderCompression_e samField);
764 
769  HeaderCompression_e GetSam (void) const;
770 
775  void SetM (bool mField);
776 
781  bool GetM (void) const;
782 
787  void SetDac (bool dacField);
788 
793  bool GetDac (void) const;
794 
799  void SetDam (HeaderCompression_e damField);
800 
805  HeaderCompression_e GetDam (void) const;
806 
811  void SetSrcContextId (uint8_t srcContextId);
812 
817  uint8_t GetSrcContextId (void) const;
818 
823  void SetDstContextId (uint8_t dstContextId);
824 
829  uint8_t GetDstContextId (void) const;
830 
835  void SetEcn (uint8_t ecn);
836 
841  uint8_t GetEcn (void) const;
842 
847  void SetDscp (uint8_t dscp);
848 
853  uint8_t GetDscp (void) const;
854 
859  void SetFlowLabel (uint32_t flowLabel);
860 
865  uint32_t GetFlowLabel (void) const;
866 
871  void SetNextHeader (uint8_t nextHeader);
872 
877  uint8_t GetNextHeader (void) const;
878 
883  void SetHopLimit (uint8_t hopLimit);
884 
889  uint8_t GetHopLimit (void) const;
890 
895  void SetSrcAddress (Ipv6Address srcAddress);
896 
901  Ipv6Address GetSrcAddress () const;
902 
907  void SetDstAddress (Ipv6Address dstAddress);
908 
913  Ipv6Address GetDstAddress () const;
914 
915 private:
916  uint16_t m_baseFormat;
918  uint8_t m_ecn : 2;
919  uint8_t m_dscp : 6;
920  uint32_t m_flowLabel : 20;
921  uint8_t m_nextHeader;
922  uint8_t m_hopLimit;
925 
930  void PostProcessSac ();
935  void PostProcessDac ();
936 
937 };
938 
946 std::ostream & operator<< (std::ostream & os, SixLowPanIphc const &header);
947 
959 {
960 public:
974  enum Eid_e
975  {
982  };
983 
984  SixLowPanNhcExtension (void);
985 
990  static TypeId GetTypeId (void);
991 
996  virtual TypeId GetInstanceTypeId (void) const;
997 
998  virtual void Print (std::ostream& os) const;
999 
1004  virtual uint32_t GetSerializedSize (void) const;
1005 
1010  virtual void Serialize (Buffer::Iterator start) const;
1011 
1017  virtual uint32_t Deserialize (Buffer::Iterator start);
1018 
1024 
1029  void SetEid (Eid_e extensionHeaderType);
1030 
1035  Eid_e GetEid (void) const;
1036 
1041  void SetNextHeader (uint8_t nextHeader);
1042 
1047  uint8_t GetNextHeader (void) const;
1048 
1053  void SetNh (bool nhField);
1054 
1059  bool GetNh (void) const;
1060 
1066  void SetBlob (const uint8_t* blob, uint32_t size);
1067 
1074  uint32_t CopyBlob (uint8_t* blob, uint32_t size) const;
1075 
1076 private:
1080  uint8_t m_nhcBlob[256];
1081 };
1082 
1090 std::ostream & operator<< (std::ostream & os, SixLowPanNhcExtension const &header);
1091 
1092 
1104 {
1105 public:
1114  enum Ports_e
1115  {
1120  };
1121 
1122  SixLowPanUdpNhcExtension (void);
1123 
1128  static TypeId GetTypeId (void);
1129 
1134  virtual TypeId GetInstanceTypeId (void) const;
1135 
1136  virtual void Print (std::ostream& os) const;
1137 
1142  virtual uint32_t GetSerializedSize (void) const;
1143 
1148  virtual void Serialize (Buffer::Iterator start) const;
1149 
1155  virtual uint32_t Deserialize (Buffer::Iterator start);
1156 
1162 
1167  void SetPorts (Ports_e port);
1168 
1173  Ports_e GetPorts (void) const;
1174 
1179  void SetSrcPort (uint16_t port);
1180 
1185  uint16_t GetSrcPort () const;
1186 
1191  void SetDstPort (uint16_t port);
1192 
1197  uint16_t GetDstPort () const;
1198 
1203  void SetC (bool cField);
1204 
1209  bool GetC (void) const;
1210 
1215  void SetChecksum (uint16_t checksum);
1216 
1221  uint16_t GetChecksum (void) const;
1222 
1223 private:
1224  uint8_t m_baseFormat;
1225  uint16_t m_checksum;
1226  uint16_t m_srcPort;
1227  uint16_t m_dstPort;
1228 };
1229 
1237 std::ostream & operator<< (std::ostream & os, SixLowPanUdpNhcExtension const &header);
1238 
1243 class SixLowPanBc0 : public Header
1244 {
1245 public:
1246  SixLowPanBc0 (void);
1247 
1252  static TypeId GetTypeId (void);
1253 
1258  virtual TypeId GetInstanceTypeId (void) const;
1259 
1260  virtual void Print (std::ostream& os) const;
1261 
1266  virtual uint32_t GetSerializedSize (void) const;
1267 
1272  virtual void Serialize (Buffer::Iterator start) const;
1273 
1279  virtual uint32_t Deserialize (Buffer::Iterator start);
1280 
1285  void SetSequenceNumber (uint8_t seqNumber);
1286 
1291  uint8_t GetSequenceNumber (void) const;
1292 
1293 private:
1294  uint8_t m_seqNumber;
1295 };
1296 
1304 std::ostream & operator<< (std::ostream & os, SixLowPanBc0 const &header);
1305 
1310 class SixLowPanMesh : public Header
1311 {
1312 public:
1313  SixLowPanMesh (void);
1314 
1319  static TypeId GetTypeId (void);
1320 
1325  virtual TypeId GetInstanceTypeId (void) const;
1326 
1327  virtual void Print (std::ostream& os) const;
1328 
1333  virtual uint32_t GetSerializedSize (void) const;
1334 
1339  virtual void Serialize (Buffer::Iterator start) const;
1340 
1346  virtual uint32_t Deserialize (Buffer::Iterator start);
1347 
1352  void SetHopsLeft (uint8_t hopsLeft);
1353 
1358  uint8_t GetHopsLeft (void) const;
1359 
1364  void SetOriginator (Address originator);
1365 
1370  Address GetOriginator (void) const;
1371 
1376  void SetFinalDst (Address finalDst);
1377 
1382  Address GetFinalDst (void) const;
1383 
1384 private:
1385  uint8_t m_hopsLeft;
1386  bool m_v;
1387  bool m_f;
1390 };
1391 
1399 std::ostream & operator<< (std::ostream & os, SixLowPanMesh const &header);
1400 
1401 }
1402 
1403 #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.
Address GetOriginator(void) const
Get the "Originator" address.
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.
static TypeId GetTypeId(void)
Get the type ID.
uint8_t GetHopsLeft(void) const
Get the "Hops Left" field.
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.
bool m_f
True if Destination address is 16 bit.
uint8_t GetSequenceNumber(void) const
Get the "Sequence Number" field.
virtual void Print(std::ostream &os) const
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:1855
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.
uint8_t m_seqNumber
Sequence number.
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
a polymophic address class
Definition: address.h:90
uint8_t m_srcPrefix[8]
Source prefix.
void SetSequenceNumber(uint8_t seqNumber)
Set the "Sequence Number" field.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
void SetHopsLeft(uint8_t hopsLeft)
Set the "Hops Left" field.
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.
Address GetFinalDst(void) const
Get the "Final Destination" address.
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.
Address m_src
Originator (source) address.
void SetDstInterface(const uint8_t *dstInterface)
Set the destination interface.
LowPanHc1Addr_e m_dstCompression
Destination compression type.
Address m_dst
Destination (final) address.
bool GetNh(void) const
Get the NH (Next Header) compression.
void SetOriginator(Address originator)
Set the "Originator" address.
void SetSac(bool sacField)
Set the SAC (Source Address Compression) compression.
6LoWPAN BC0 header - see RFC 4944.
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
uint8_t m_hopsLeft
Hops left.
void SetChecksum(uint16_t checksum)
Set the Checksum field values.
static TypeId GetTypeId(void)
Get the type ID.
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.
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 uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
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 Deserialize(Buffer::Iterator start)
Deserialize the packet.
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.
virtual void Print(std::ostream &os) const
uint16_t GetSrcPort() const
Get the Source Port.
void SetDstContextId(uint8_t dstContextId)
Set the DstContextId.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
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).
void SetFinalDst(Address finalDst)
Set the "Final Destination" address.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
uint8_t m_datagramOffset
Datagram offset.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
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.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
6LoWPAN Mesh header - see RFC 4944.
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 void Serialize(Buffer::Iterator start) const
Serialize the packet.
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.
bool m_v
True if Originator address is 16 bit.
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