![]() |
Low-Power Border Router
|
Compressor/decompressor for IPv6 addresses. More...
Public Member Functions | |
| def | __init__ |
| Initializes this object. | |
| def | compress |
| Compresses an IPv6 address. | |
| def | decompress |
| Decompresses an IPv6 address. | |
Public Attributes | |
| username | |
| inetContexts | |
| moteContexts | |
| log | |
Compressor/decompressor for IPv6 addresses.
| def Lowpan.AddressCompressor.AddressCompressor.__init__ | ( | self, | |
| username | |||
| ) |
Initializes this object.
| username | The name of the user this instance works for. |
| def Lowpan.AddressCompressor.AddressCompressor.compress | ( | self, | |
| addressS, | |||
| prefixS, | |||
| srcORdest | |||
| ) |
Compresses an IPv6 address.
Compressing an IPv6 address consists of compressing it will all available compressors (the non-context-based basis compressor as well as all available context-based compressors), and keeping the compressed address which yields the shorter packet.
If any context-based compressor 'fails', it compresses the address using the non-context-based basis compressor.
| addressS | The 128-bit IPv6 address to be compressed, in string format. |
| prefixS | The IPv6 prefix (at most 64 bits) of the mote network. |
| srcORdest | A string which indicates whether the address being compressed is the IPv6 src_addr ('src') or IPv6 dest_addrS ('dest'). This changes the set of contexts being used. |
| def Lowpan.AddressCompressor.AddressCompressor.decompress | ( | self, | |
| macAddrS, | |||
| m, | |||
| xac, | |||
| xam, | |||
| xci, | |||
| x_addrS, | |||
| prefixS, | |||
| srcORdest | |||
| ) |
Decompresses an IPv6 address.
Decompressing an address consist of applying every context available, then the default (non-context-based) decompressor, until one succeeds.
| macAddrS | The MAC address of the mote where this message originated. 'None' the address being decompressed in the destination address. |
| m | The value of the lowpan 'm' field, as read from the packet. None is x_addr if the source address. |
| xac | The value of the lowpan 'sac' or 'dac' field, as read from the packet. |
| xam | The value of the lowpan 'sam' or 'dam' field, as read from the packet. |
| xci | The value of the lowpan 'sci' or 'dci' field, as read from the packet. None if this field is not in the packet. |
| x_addrS | The value of the lowpan 'src_addrS' or 'dest_addrS' field, as read from the packet. |
| prefixS | The IPv6 prefix (at most 64 bits) of the mote network. |
| srcORdest | A string which indicates whether the address being compressed is the IPv6 src_addr ('src') or IPv6 dest_addrS ('dest'). This changes the set of contexts being used. |