22 #ifndef SIXLOWPANHEADER_H_
23 #define SIXLOWPANHEADER_H_
25 #include "ns3/header.h"
26 #include "ns3/ipv6-address.h"
178 virtual void Print (std::ostream& os)
const;
389 virtual void Print (std::ostream& os)
const;
470 virtual void Print (std::ostream& os)
const;
564 virtual void Print (std::ostream& os)
const;
678 virtual void Print (std::ostream& os)
const;
715 void SetNh (
bool nhField);
721 bool GetNh (
void)
const;
739 void SetCid (
bool cidField);
751 void SetSac (
bool sacField);
788 void SetM (
bool mField);
794 bool GetM (
void)
const;
800 void SetDac (
bool dacField);
861 void SetEcn (uint8_t ecn);
867 uint8_t
GetEcn (
void)
const;
989 virtual void Print (std::ostream& os)
const;
1044 void SetNh (
bool nhField);
1050 bool GetNh (
void)
const;
1057 void SetBlob (
const uint8_t* blob, uint32_t size);
1065 uint32_t
CopyBlob (uint8_t* blob, uint32_t size)
const;
1127 virtual void Print (std::ostream& os)
const;
1194 void SetC (
bool cField);
1200 bool GetC (
void)
const;
1251 virtual void Print (std::ostream& os)
const;
1318 virtual void Print (std::ostream& os)
const;
a polymophic address class
iterator in a Buffer instance
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.
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.
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.
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).
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.
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.
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 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.
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.
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.
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.
SixLowPanNhcExtension(void)
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.
@ EID_DESTINATION_OPTIONS_H
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.
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
SixLowPanUdpNhcExtension(void)
uint8_t m_baseFormat
Dispatch + encoding fields.
uint16_t m_checksum
Checksum.
uint16_t GetDstPort() const
Get the Destination Port.
@ PORTS_LAST_SRC_LAST_DST
void SetPorts(Ports_e port)
Set the compressed Src and Dst Ports.
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)