|
esp8266ndn
NDN Arduino library for ESP8266 and more
|
Helper to pack IPv6 endpoint into 64-bit EndpointId. More...
#include <ipv6-endpointid.hpp>
Public Member Functions | |
| Ipv6EndpointIdHelper () | |
| uint64_t | encode (const uint8_t *addr, size_t addrLen, uint16_t port) |
| Pack IP address+port into EndpointId. | |
| size_t | decode (uint64_t endpointId, uint8_t addr[16], uint16_t *port) |
| Unpack IP address+port from EndpointId. | |
Helper to pack IPv6 endpoint into 64-bit EndpointId.
| capacity | maximum is 15. |
IPv6 address+port has 144 bits, longer than the 64-bit EndpointId. This data structure has an internal table to store parts of each full IPv6 endpoint, while the returned EndpointId contains an index into this table and a checksum. This table can track at least capacity distinct flows. Overflow may cause failed or incorrect unpacking.
|
inline |
|
inline |
Unpack IP address+port from EndpointId.
| endpointId | 64-bit EndpointId. | |
| [out] | addr | IP address, 4 or 16 bytes. |
| [out] | port | port number. |
|
inline |
Pack IP address+port into EndpointId.
| addr | IP address, 4 or 16 bytes. |
| addrLen | IP address length, either 4 or 16. |
| port | port number. |