nRF51 IoT SDK
|
Common IoT definitions that are needed by IoT modules. More...
Data Structures | |
struct | eui64_t |
union | ipv6_addr_t |
struct | ipv6_header_t |
struct | udp6_header_t |
struct | icmp6_header_t |
Macros | |
#define | EUI_64_ADDR_SIZE 8 |
#define | IPV6_ADDR_SIZE 16 |
#define | IPV6_CONTEXT_IDENTIFIER_NONE 0xFF |
#define | IPV6_IID_FLIP_VALUE 0x02 |
#define | IPV6_IP_HEADER_SIZE 40 |
#define | ICMP6_HEADER_SIZE 4 |
#define | UDP_HEADER_SIZE 8 |
#define | COAP_HEADER_SIZE 4 |
#define | IPV6_DEFAULT_VER_TC 0x60 |
#define | IPV6_DEFAULT_TC_FL 0x00 |
#define | IPV6_DEFAULT_FL 0x00 |
#define | IPV6_NEXT_HEADER_TCP 6 |
#define | IPV6_NEXT_HEADER_UDP 17 |
#define | IPV6_NEXT_HEADER_ICMP6 58 |
#define | IPV6_NEXT_HEADER_RESERVED 255 |
#define | ICMP6_TYPE_DESTINATION_UNREACHABLE 1 |
#define | ICMP6_TYPE_PACKET_TOO_LONG 2 |
#define | ICMP6_TYPE_TIME_EXCEED 3 |
#define | ICMP6_TYPE_PARAMETER_PROBLEM 4 |
#define | ICMP6_TYPE_ECHO_REQUEST 128 |
#define | ICMP6_TYPE_ECHO_REPLY 129 |
#define | ICMP6_TYPE_ROUTER_SOLICITATION 133 |
#define | ICMP6_TYPE_ROUTER_ADVERTISEMENT 134 |
#define | ICMP6_TYPE_NEIGHBOR_SOLICITATION 135 |
#define | ICMP6_TYPE_NEIGHBOR_ADVERTISEMENT 136 |
#define | HTONS(val) ((((uint16_t) (val) & 0xff00) >> 8) | ((((uint16_t) (val) & 0x00ff) << 8))) |
Host to network byte-orders on half word. | |
#define | HTONL(val) |
Host to network byte-orders on full word. More... | |
#define | NTOHS(val) HTONS(val) |
Network to host byte-orders on half word. | |
#define | NTOHL(val) HTONL(val) |
Network to host byte-orders on full word. | |
#define | IPV6_ADDRESS_INITIALIZE(ADDR) memset((ADDR)->u8, 0, IPV6_ADDR_SIZE) |
Initializes IPv6 address. | |
#define | IPV6_ADDRESS_PREFIX_CMP(prefix, prefix2, length) |
Checks if prefixes match. Length in bits. More... | |
#define | IPV6_ADDRESS_PREFIX_SET(pfx_to, pfx_from, length) |
Sets address prefix. Length in bits. More... | |
#define | IPV6_EUI64_CREATE_FROM_EUI48(eui64, eui48, addr_type) |
Creates EUI-64 address from EUI-48. Universal/local bit set, according to BT 6LoWPAN draft ch. 3.2.1. More... | |
#define | IPV6_CREATE_LINK_LOCAL_FROM_EUI64(addr, eui64) |
Creates link-local address from EUI-64. More... | |
#define | IPV6_ADDRESS_IS_LINK_LOCAL(addr) ((addr)->u16[0] == HTONS(0xfe80)) |
Checks if address is a link-local address. | |
#define | IPV6_ADDRESS_IS_MULTICAST(addr) ((addr)->u8[0] == 0xff) |
Checks if address is a multicast address. | |
#define | IPV6_ADDRESS_IS_ALL_NODE(addr) |
Checks if address is a multicast all-node address. More... | |
#define | IPV6_ADDRESS_IS_ALL_ROUTER(addr) |
Checks if address is a multicast all-router address. More... | |
#define | IPV6_ADDRESS_IS_MLDV2_MCAST(addr) |
Checks if address is a multicast MLDv2 address. More... | |
#define | IPV6_ADDRESS_IS_UNSPECIFIED(addr) |
Checks if address is an unspecified address. More... | |
#define | IPV6_ADDRESS_CMP(addr1, addr2) memcmp((addr1)->u8, (addr2)->u8, IPV6_ADDR_SIZE) |
Compares two IPv6 addresses. | |
#define | IPV6_ADDRESS_SWAP(addr1, addr2) |
Swaps two IPv6 addresses. More... | |
#define | IPV6_ADDR_ANY &ipv6_addr_any |
#define | EUI64_LOCAL_IID &eui64_local_iid |
Enumerations | |
enum | ipv6_addr_state_t { IPV6_ADDR_STATE_UNUSED = 0, IPV6_ADDR_STATE_TENTATIVE, IPV6_ADDR_STATE_PREFERRED, IPV6_ADDR_STATE_DEPRECATED } |
IPv6 address states. More... | |
Variables | |
ipv6_addr_t | ipv6_addr_any |
eui64_t | eui64_local_iid |
Common IoT definitions that are needed by IoT modules.
This module abstracts common data structures and constants related to IoT. These definitions can be used by all IoT modules.
#define COAP_HEADER_SIZE 4 |
CoAP header size.
#define EUI64_LOCAL_IID &eui64_local_iid |
EUI-64 IID of the device.
#define EUI_64_ADDR_SIZE 8 |
Size of EUI-64.
#define HTONL | ( | val | ) |
Host to network byte-orders on full word.
#define ICMP6_HEADER_SIZE 4 |
ICMP header size.
#define ICMP6_TYPE_DESTINATION_UNREACHABLE 1 |
ICMPv6: Destination unreachable error message.
#define ICMP6_TYPE_ECHO_REPLY 129 |
ICMPv6: Echo reply message.
#define ICMP6_TYPE_ECHO_REQUEST 128 |
ICMPv6: Echo request message.
#define ICMP6_TYPE_NEIGHBOR_ADVERTISEMENT 136 |
ICMPv6: Neighbor discovery, neighbor advertisement message.
#define ICMP6_TYPE_NEIGHBOR_SOLICITATION 135 |
ICMPv6: Neighbor discovery, neighbor solicitation message.
#define ICMP6_TYPE_PACKET_TOO_LONG 2 |
ICMPv6: Packet too long error message.
#define ICMP6_TYPE_PARAMETER_PROBLEM 4 |
ICMPv6: Parameter problem error message.
#define ICMP6_TYPE_ROUTER_ADVERTISEMENT 134 |
ICMPv6: Neighbor discovery, router advertisement message.
#define ICMP6_TYPE_ROUTER_SOLICITATION 133 |
ICMPv6: Neighbor discovery, router solicitation message.
#define ICMP6_TYPE_TIME_EXCEED 3 |
ICMPv6: Time-out error message.
#define IPV6_ADDR_ANY &ipv6_addr_any |
IPV6 address represents any address.
#define IPV6_ADDR_SIZE 16 |
Size of IPv6 128-bit address.
#define IPV6_ADDRESS_IS_ALL_NODE | ( | addr | ) |
#define IPV6_ADDRESS_IS_ALL_ROUTER | ( | addr | ) |
#define IPV6_ADDRESS_IS_MLDV2_MCAST | ( | addr | ) |
#define IPV6_ADDRESS_IS_UNSPECIFIED | ( | addr | ) |
Checks if address is an unspecified address.
#define IPV6_ADDRESS_PREFIX_CMP | ( | prefix, | |
prefix2, | |||
length | |||
) |
Checks if prefixes match. Length in bits.
#define IPV6_ADDRESS_PREFIX_SET | ( | pfx_to, | |
pfx_from, | |||
length | |||
) |
Sets address prefix. Length in bits.
#define IPV6_ADDRESS_SWAP | ( | addr1, | |
addr2 | |||
) |
Swaps two IPv6 addresses.
EUI 64 data type.
#define IPV6_CONTEXT_IDENTIFIER_NONE 0xFF |
No context identifier in use.
#define IPV6_CREATE_LINK_LOCAL_FROM_EUI64 | ( | addr, | |
eui64 | |||
) |
Creates link-local address from EUI-64.
#define IPV6_DEFAULT_FL 0x00 |
Default value of the flow label's two last bytes in IPv6 header.
#define IPV6_DEFAULT_TC_FL 0x00 |
Default value of traffic class and flow label fields in IPv6 header.
#define IPV6_DEFAULT_VER_TC 0x60 |
Default value of version and traffic class fields in IPv6 header.
#define IPV6_EUI64_CREATE_FROM_EUI48 | ( | eui64, | |
eui48, | |||
addr_type | |||
) |
Creates EUI-64 address from EUI-48. Universal/local bit set, according to BT 6LoWPAN draft ch. 3.2.1.
#define IPV6_IID_FLIP_VALUE 0x02 |
Value XORed with first byte of EUI-64 to get IID. In some older linux implementation, this value could be 0x03.
#define IPV6_IP_HEADER_SIZE 40 |
IPv6 header size.
#define IPV6_NEXT_HEADER_ICMP6 58 |
ICMPv6: protocol number.
#define IPV6_NEXT_HEADER_RESERVED 255 |
Reserved value.
#define IPV6_NEXT_HEADER_TCP 6 |
TCP: protocol number.
#define IPV6_NEXT_HEADER_UDP 17 |
UDP: protocol number.
#define UDP_HEADER_SIZE 8 |
UDP header size.
enum ipv6_addr_state_t |
eui64_t eui64_local_iid |
External variable assumed to be implemented in the application with desired EUI-64 to be used as the IID for SLAAC.