openLbr Package

openLbr Module

class openvisualizer.openLbr.openLbr.OpenLbr

Bases: openvisualizer.eventBus.eventBusClient.eventBusClient

Class which is responsible for translating between 6LoWPAN and IPv6 headers.

This class implements the following RFCs:

FLOW_LABEL_RPL_DOMAIN = True
F_FLAG = 32
IANA_ICMPv6 = 58
IANA_IPv6HOPHEADER = 0
IANA_PROTOCOL_IPv6ROUTE = 43
IANA_UDP = 17
IPHC_CID_NO = 0
IPHC_CID_YES = 1
IPHC_DAC_STATEFUL = 1
IPHC_DAC_STATELESS = 0
IPHC_DAM_128B = 0
IPHC_DAM_16B = 2
IPHC_DAM_64B = 1
IPHC_DAM_ELIDED = 3
IPHC_DISPATCH = 3
IPHC_HLIM_1 = 1
IPHC_HLIM_255 = 3
IPHC_HLIM_64 = 2
IPHC_HLIM_INLINE = 0
IPHC_M_NO = 0
IPHC_M_YES = 1
IPHC_NH_COMPRESSED = 1
IPHC_NH_INLINE = 0
IPHC_SAC_STATEFUL = 1
IPHC_SAC_STATELESS = 0
IPHC_SAM_128B = 0
IPHC_SAM_16B = 2
IPHC_SAM_64B = 1
IPHC_SAM_ELIDED = 3
IPHC_TF_1B = 2
IPHC_TF_3B = 1
IPHC_TF_4B = 0
IPHC_TF_ELIDED = 3
IPv6_HEADER_LEN = 40
NHC_UDP_ID = 240
NHC_UDP_MASK = 248
O_FLAG = 128
R_FLAG = 64
SR_FIR_TYPE = 3
disassemble_ipv6(ipv6)

Turn byte array representing IPv6 packets into into dictionary of fields.

See http://tools.ietf.org/html/rfc2460#page-4.

Parameters:ipv6 – [in] Byte array representing an IPv6 packet.
Raises :ValueError when some part of the process is not defined in the standard.
Raises :NotImplementedError when some part of the process is defined in the standard, but not implemented in this module.
Returns:A dictionary of fields.
ipv6_to_lowpan(ipv6)

Compact IPv6 header into 6LowPAN header.

Parameters:ipv6 – [in] A disassembled IPv6 packet.
Raises :ValueError when some part of the process is not defined in the standard.
Raises :NotImplementedError when some part of the process is defined in the standard, but not implemented in this module.
Returns:A disassembled 6LoWPAN packet.
lowpan_to_ipv6(data)
reassemble_ipv6_packet(pkt)
reassemble_lowpan(lowpan)

Turn dictionary of 6LoWPAN header fields into byte array.

Parameters:lowpan – [in] dictionary of fields representing a 6LoWPAN header.
Returns:A list of bytes representing the 6LoWPAN packet.

Table Of Contents

Previous topic

moteState Package

Next topic

openTun Package

This Page