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
28namespace ns3 {
29
46{
47public:
77 {
81 LOWPAN_HC1 = 0x42,
82 LOWPAN_BC0 = 0x50,
92 };
93
101 {
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
131class SixLowPanHc1 : public Header
132{
133public:
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
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
343private:
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];
351 uint8_t m_nextHeader;
357};
358
366std::ostream & operator<< (std::ostream & os, SixLowPanHc1 const &header);
367
372class SixLowPanFrag1 : public Header
373{
374public:
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
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
434private:
435 uint16_t m_datagramSize;
436 uint16_t m_datagramTag;
437
438};
439
447std::ostream & operator<< (std::ostream & os, SixLowPanFrag1 const & header);
448
453class SixLowPanFragN : public Header
454{
455public:
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
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
527private:
528 uint16_t m_datagramSize;
529 uint16_t m_datagramTag;
531
532};
533
541std::ostream & operator<< (std::ostream & os, SixLowPanFragN const &header);
542
547class SixLowPanIpv6 : public Header
548{
549public:
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
584
585};
586
594std::ostream & operator<< (std::ostream & os, SixLowPanIpv6 const & header);
595
607class SixLowPanIphc : public Header
608{
609public:
620 {
625 };
626
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
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
776 void SetSrcInlinePart (uint8_t srcInlinePart[16], uint8_t size);
777
782 const uint8_t* GetSrcInlinePart (void) const;
783
788 void SetM (bool mField);
789
794 bool GetM (void) const;
795
800 void SetDac (bool dacField);
801
806 bool GetDac (void) const;
807
812 void SetDam (HeaderCompression_e damField);
813
818 HeaderCompression_e GetDam (void) const;
819
825 void SetDstInlinePart (uint8_t dstInlinePart[16], uint8_t size);
826
831 const uint8_t* GetDstInlinePart (void) const;
832
837 void SetSrcContextId (uint8_t srcContextId);
838
843 uint8_t GetSrcContextId (void) const;
844
849 void SetDstContextId (uint8_t dstContextId);
850
855 uint8_t GetDstContextId (void) const;
856
861 void SetEcn (uint8_t ecn);
862
867 uint8_t GetEcn (void) const;
868
873 void SetDscp (uint8_t dscp);
874
879 uint8_t GetDscp (void) const;
880
885 void SetFlowLabel (uint32_t flowLabel);
886
891 uint32_t GetFlowLabel (void) const;
892
897 void SetNextHeader (uint8_t nextHeader);
898
903 uint8_t GetNextHeader (void) const;
904
909 void SetHopLimit (uint8_t hopLimit);
910
915 uint8_t GetHopLimit (void) const;
916
917private:
918 uint16_t m_baseFormat;
920 uint8_t m_ecn : 2;
921 uint8_t m_dscp : 6;
923 uint8_t m_nextHeader;
924 uint8_t m_hopLimit;
925 uint8_t m_srcInlinePart[16];
926 uint8_t m_dstInlinePart[16];
927
928};
929
937std::ostream & operator<< (std::ostream & os, SixLowPanIphc const &header);
938
950{
951public:
965 enum Eid_e
966 {
972 EID_IPv6_H = 7
973 };
974
976
981 static TypeId GetTypeId (void);
982
987 virtual TypeId GetInstanceTypeId (void) const;
988
989 virtual void Print (std::ostream& os) const;
990
995 virtual uint32_t GetSerializedSize (void) const;
996
1001 virtual void Serialize (Buffer::Iterator start) const;
1002
1009
1015
1020 void SetEid (Eid_e extensionHeaderType);
1021
1026 Eid_e GetEid (void) const;
1027
1032 void SetNextHeader (uint8_t nextHeader);
1033
1038 uint8_t GetNextHeader (void) const;
1039
1044 void SetNh (bool nhField);
1045
1050 bool GetNh (void) const;
1051
1057 void SetBlob (const uint8_t* blob, uint32_t size);
1058
1065 uint32_t CopyBlob (uint8_t* blob, uint32_t size) const;
1066
1067private:
1071 uint8_t m_nhcBlob[256];
1072};
1073
1081std::ostream & operator<< (std::ostream & os, SixLowPanNhcExtension const &header);
1082
1083
1095{
1096public:
1106 {
1112
1114
1119 static TypeId GetTypeId (void);
1120
1125 virtual TypeId GetInstanceTypeId (void) const;
1126
1127 virtual void Print (std::ostream& os) const;
1128
1133 virtual uint32_t GetSerializedSize (void) const;
1134
1139 virtual void Serialize (Buffer::Iterator start) const;
1140
1147
1153
1158 void SetPorts (Ports_e port);
1159
1164 Ports_e GetPorts (void) const;
1165
1170 void SetSrcPort (uint16_t port);
1171
1176 uint16_t GetSrcPort () const;
1177
1182 void SetDstPort (uint16_t port);
1183
1188 uint16_t GetDstPort () const;
1189
1194 void SetC (bool cField);
1195
1200 bool GetC (void) const;
1201
1206 void SetChecksum (uint16_t checksum);
1207
1212 uint16_t GetChecksum (void) const;
1213
1214private:
1216 uint16_t m_checksum;
1217 uint16_t m_srcPort;
1218 uint16_t m_dstPort;
1219};
1220
1228std::ostream & operator<< (std::ostream & os, SixLowPanUdpNhcExtension const &header);
1229
1234class SixLowPanBc0 : public Header
1235{
1236public:
1237 SixLowPanBc0 (void);
1238
1243 static TypeId GetTypeId (void);
1244
1249 virtual TypeId GetInstanceTypeId (void) const;
1250
1251 virtual void Print (std::ostream& os) const;
1252
1257 virtual uint32_t GetSerializedSize (void) const;
1258
1263 virtual void Serialize (Buffer::Iterator start) const;
1264
1271
1276 void SetSequenceNumber (uint8_t seqNumber);
1277
1282 uint8_t GetSequenceNumber (void) const;
1283
1284private:
1285 uint8_t m_seqNumber;
1286};
1287
1295std::ostream & operator<< (std::ostream & os, SixLowPanBc0 const &header);
1296
1301class SixLowPanMesh : public Header
1302{
1303public:
1304 SixLowPanMesh (void);
1305
1310 static TypeId GetTypeId (void);
1311
1316 virtual TypeId GetInstanceTypeId (void) const;
1317
1318 virtual void Print (std::ostream& os) const;
1319
1324 virtual uint32_t GetSerializedSize (void) const;
1325
1330 virtual void Serialize (Buffer::Iterator start) const;
1331
1338
1343 void SetHopsLeft (uint8_t hopsLeft);
1344
1349 uint8_t GetHopsLeft (void) const;
1350
1355 void SetOriginator (Address originator);
1356
1361 Address GetOriginator (void) const;
1362
1367 void SetFinalDst (Address finalDst);
1368
1373 Address GetFinalDst (void) const;
1374
1375private:
1376 uint8_t m_hopsLeft;
1377 bool m_v;
1378 bool m_f;
1381};
1382
1390std::ostream & operator<< (std::ostream & os, SixLowPanMesh const &header);
1391
1392}
1393
1394#endif /* SIXLOWPANHEADER_H_ */
a polymophic address class
Definition: address.h:91
iterator in a Buffer instance
Definition: buffer.h:99
Protocol header serialization and deserialization.
Definition: header.h:43
6LoWPAN BC0 header - see RFC 4944.
virtual void Print(std::ostream &os) const
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
static TypeId GetTypeId(void)
Get the type ID.
uint8_t GetSequenceNumber(void) const
Get the "Sequence Number" field.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
void SetSequenceNumber(uint8_t seqNumber)
Set the "Sequence Number" field.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
uint8_t m_seqNumber
Sequence number.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
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.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
void SetDatagramSize(uint16_t datagramSize)
Set the datagram size.
void SetDatagramTag(uint16_t datagramTag)
Set the datagram tag.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
virtual void Print(std::ostream &os) const
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
uint16_t GetDatagramSize(void) const
Get the datagram size.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
uint16_t GetDatagramTag(void) const
Get the datagram tag.
static TypeId GetTypeId(void)
Get the type ID.
uint16_t m_datagramTag
Datagram tag.
uint16_t m_datagramSize
Datagram size.
6LoWPAN FRAGN header - see RFC 4944.
static TypeId GetTypeId(void)
Get the type ID.
uint16_t GetDatagramTag(void) const
Get the datagram tag.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
uint8_t GetDatagramOffset(void) const
Get the datagram offset.
uint16_t m_datagramTag
Datagram tag.
void SetDatagramSize(uint16_t datagramSize)
Set the datagram size.
uint16_t GetDatagramSize(void) const
Get the datagram size.
void SetDatagramTag(uint16_t datagramTag)
Set the datagram tag.
virtual void Print(std::ostream &os) const
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
void SetDatagramOffset(uint8_t datagramOffset)
Set the datagram offset.
uint8_t m_datagramOffset
Datagram offset.
uint16_t m_datagramSize
Datagram size.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
6LoWPAN HC1 header - see RFC 4944.
void SetTcflCompression(bool tcflCompression)
Set the Traffic Class and Flow Labels as compressed.
uint8_t m_dstInterface[8]
Destination interface.
const uint8_t * GetSrcPrefix() const
Get the source prefix.
void SetFlowLabel(uint32_t flowLabel)
Set the Flow Label value.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
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.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
void SetHopLimit(uint8_t limit)
Set the "Hop limit" field (TTL).
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
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.
uint8_t GetHopLimit(void) const
Get the "Hop limit" field (TTL).
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.
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.
uint8_t m_hopLimit
Hop Limit.
void SetSrcCompression(LowPanHc1Addr_e srcCompression)
Set Source Compression type.
uint8_t m_srcPrefix[8]
Source prefix.
virtual void Print(std::ostream &os) const
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.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
LowPanHc1Addr_e m_srcCompression
Source compression type.
uint8_t m_nextHeader
Next header.
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.
static TypeId GetTypeId(void)
Get the type ID.
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.
void SetNextHeader(uint8_t nextHeader)
Set the Next Header field.
bool GetM(void) const
Get the M (Multicast) compression.
void SetHlim(Hlim_e hlimField)
Set the HLIM (Hop Limit) compression.
bool GetSac(void) const
Get the SAC (Source Address Compression) compression.
void SetDstContextId(uint8_t dstContextId)
Set the DstContextId.
Hlim_e
HLIM: Hop Limit.
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.
HeaderCompression_e
Source or Destination Address Mode.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
uint8_t m_srcInlinePart[16]
source address inline part.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
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).
TrafficClassFlowLabel_e GetTf(void) const
Get the TF (Traffic Class, Flow Label) compression.
bool GetDac(void) const
Get the DAC (Destination Address Compression) compression.
void SetDscp(uint8_t dscp)
Set the DSCP (6bits).
uint8_t GetDstContextId(void) const
Get the DstContextId.
void SetTf(TrafficClassFlowLabel_e tfField)
Set the TF (Traffic Class, Flow Label) compression.
const uint8_t * GetDstInlinePart(void) const
brief Get the destination address inline part
bool GetCid(void) const
Get the CID (Context Identifier Extension) compression.
void SetDam(HeaderCompression_e damField)
Set the DAM (Destination Address Mode) compression.
void SetCid(bool cidField)
Set the CID (Context Identifier Extension) compression.
uint8_t GetEcn(void) const
Get the ECN.
HeaderCompression_e GetSam(void) const
Get the SAM (Source Address Mode) compression.
uint8_t m_dscp
DSCP bits.
uint8_t GetHopLimit(void) const
Get the Hop Limit field.
bool GetNh(void) const
Get the NH (Next Header) compression.
void SetSac(bool sacField)
Set the SAC (Source Address Compression) compression.
HeaderCompression_e GetDam(void) const
Get the DAM (Destination Address Mode) compression.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
uint8_t m_dstInlinePart[16]
destination address inline part.
const uint8_t * GetSrcInlinePart(void) const
brief Get the source address inline part
void SetDstInlinePart(uint8_t dstInlinePart[16], uint8_t size)
brief Set the destination address inline part
uint8_t GetSrcContextId(void) const
Get the SrcContextId.
void SetSrcContextId(uint8_t srcContextId)
Set the SrcContextId.
void SetSrcInlinePart(uint8_t srcInlinePart[16], uint8_t size)
brief Set the source address inline part
uint8_t GetDscp(void) const
Get the DSCP.
TrafficClassFlowLabel_e
TF: Traffic Class, Flow Label.
Hlim_e GetHlim(void) const
Get the HLIM (Hop Limit) compression.
static TypeId GetTypeId(void)
Get the type ID.
void SetM(bool mField)
Set the M (Multicast) compression.
uint16_t m_baseFormat
Dispatch + encoding fields.
uint8_t m_nextHeader
Next header.
uint32_t GetFlowLabel(void) const
Get the Flow Label.
uint8_t GetNextHeader(void) const
Get the Next Header field.
uint32_t m_flowLabel
Flow Label bits.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
virtual void Print(std::ostream &os) const
void SetHopLimit(uint8_t hopLimit)
Set the Hop Limit field.
uint8_t m_ecn
ECN bits.
void SetDac(bool dacField)
Set the DAC (Destination Address Compression) compression.
6LoWPAN IPv6 uncompressed header - see RFC 4944.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
virtual void Print(std::ostream &os) const
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
static TypeId GetTypeId(void)
Get the type ID.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
6LoWPAN Mesh header - see RFC 4944.
static TypeId GetTypeId(void)
Get the type ID.
bool m_f
True if Destination address is 16 bit.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
bool m_v
True if Originator address is 16 bit.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
void SetHopsLeft(uint8_t hopsLeft)
Set the "Hops Left" field.
Address GetFinalDst(void) const
Get the "Final Destination" address.
virtual void Print(std::ostream &os) const
void SetFinalDst(Address finalDst)
Set the "Final Destination" address.
uint8_t m_hopsLeft
Hops left.
Address m_src
Originator (source) address.
Address GetOriginator(void) const
Get the "Originator" address.
uint8_t GetHopsLeft(void) const
Get the "Hops Left" field.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
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.
uint8_t m_nhcExtensionHeader
NHC extension header type.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
uint8_t GetNextHeader(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.
void SetNh(bool nhField)
Set the NH field values.
Eid_e GetEid(void) const
Get the Extension Header Type.
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.
virtual SixLowPanDispatch::NhcDispatch_e GetNhcDispatchType(void) const
Get the NhcDispatch type.
Eid_e
EID: IPv6 Extension Header ID.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
uint32_t CopyBlob(uint8_t *blob, uint32_t size) const
Get the option header data blob.
virtual void Print(std::ostream &os) const
bool GetNh(void) const
Get the Next Header field value.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
void SetNextHeader(uint8_t nextHeader)
Set the Next Header field values.
UDP LOWPAN_NHC Extension Header Encoding - see RFC 6282.
virtual void Print(std::ostream &os) const
uint8_t m_baseFormat
Dispatch + encoding fields.
uint16_t GetDstPort() const
Get the Destination Port.
void SetPorts(Ports_e port)
Set the compressed Src and Dst Ports.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the packet.
virtual void Serialize(Buffer::Iterator start) const
Serialize the packet.
uint16_t GetChecksum(void) const
Get the Checksum field value.
virtual TypeId GetInstanceTypeId(void) const
Return the instance type identifier.
virtual uint32_t GetSerializedSize(void) const
Get the serialized size of the packet.
bool GetC(void) const
Get the C (Checksum).
void SetChecksum(uint16_t checksum)
Set the Checksum field values.
void SetDstPort(uint16_t port)
Set the Destination Port.
static TypeId GetTypeId(void)
Get the type ID.
virtual SixLowPanDispatch::NhcDispatch_e GetNhcDispatchType(void) const
Get the NhcDispatch type.
void SetSrcPort(uint16_t port)
Set the Source Port.
void SetC(bool cField)
Set the C (Checksum).
uint16_t m_dstPort
Destination port.
Ports_e GetPorts(void) const
Get the compressed Src and Dst Ports.
uint16_t m_srcPort
Source port.
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:45
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:139
def start()
Definition: core.py:1852