IPv6 addresses.
#include "lwip/opt.h"
Data Structures | |
struct | ip6_addr |
struct | ip6_addr_packed |
Macros | |
#define | IP6_ADDR(ip6addr, index, a, b, c, d) |
Set an IPv6 partial address given by byte-parts. More... | |
#define | IP6_ADDR_ANY ((ip6_addr_t *)&ip6_addr_any) |
#define | IP6_ADDR_BLOCK1(ip6addr) ((u16_t)(htonl((ip6addr)->addr[0]) >> 16) & 0xffff) |
Access address in 16-bit block. More... | |
#define | IP6_ADDR_BLOCK2(ip6addr) ((u16_t)(htonl((ip6addr)->addr[0])) & 0xffff) |
#define | IP6_ADDR_BLOCK3(ip6addr) ((u16_t)(htonl((ip6addr)->addr[1]) >> 16) & 0xffff) |
#define | IP6_ADDR_BLOCK4(ip6addr) ((u16_t)(htonl((ip6addr)->addr[1])) & 0xffff) |
#define | IP6_ADDR_BLOCK5(ip6addr) ((u16_t)(htonl((ip6addr)->addr[2]) >> 16) & 0xffff) |
#define | IP6_ADDR_BLOCK6(ip6addr) ((u16_t)(htonl((ip6addr)->addr[2])) & 0xffff) |
#define | IP6_ADDR_BLOCK7(ip6addr) ((u16_t)(htonl((ip6addr)->addr[3]) >> 16) & 0xffff) |
#define | IP6_ADDR_BLOCK8(ip6addr) ((u16_t)(htonl((ip6addr)->addr[3])) & 0xffff) |
#define | ip6_addr_cmp(addr1, addr2) |
#define | ip6_addr_cmp_solicitednode(ip6addr, sn_addr) |
#define | ip6_addr_copy(dest, src) |
Copy IPv6 address - faster than ip6_addr_set: no NULL check. More... | |
#define | ip6_addr_debug_print(debug, ipaddr) |
#define | IP6_ADDR_DEPRECATED 0x50 |
#define | IP6_ADDR_INVALID 0x00 |
#define | ip6_addr_isallnodes_iflocal(ip6addr) |
#define | ip6_addr_isallnodes_linklocal(ip6addr) |
#define | ip6_addr_isallrouters_linklocal(ip6addr) |
#define | ip6_addr_isany(ip6addr) |
#define | ip6_addr_isdeprecated(addr_state) (addr_state == IP6_ADDR_DEPRECATED) |
#define | ip6_addr_isglobal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xe0000000UL)) == PP_HTONL(0x20000000UL)) |
#define | ip6_addr_isinvalid(addr_state) (addr_state == IP6_ADDR_INVALID) |
#define | ip6_addr_islinklocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfe800000UL)) |
#define | ip6_addr_isloopback(ip6addr) |
#define | ip6_addr_ismulticast(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff000000UL)) == PP_HTONL(0xff000000UL)) |
#define | ip6_addr_ismulticast_adminlocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff040000UL)) |
#define | ip6_addr_ismulticast_global(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff0e0000UL)) |
#define | ip6_addr_ismulticast_iflocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff010000UL)) |
#define | ip6_addr_ismulticast_linklocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff020000UL)) |
#define | ip6_addr_ismulticast_orglocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff080000UL)) |
#define | ip6_addr_ismulticast_sitelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff050000UL)) |
#define | ip6_addr_ispreferred(addr_state) (addr_state == IP6_ADDR_PREFERRED) |
#define | ip6_addr_issitelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfec00000UL)) |
#define | ip6_addr_issolicitednode(ip6addr) |
#define | ip6_addr_istentative(addr_state) (addr_state & IP6_ADDR_TENTATIVE) |
#define | ip6_addr_isuniquelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xfe000000UL)) == PP_HTONL(0xfc000000UL)) |
#define | ip6_addr_isvalid(addr_state) (addr_state & IP6_ADDR_VALID) /* Include valid, preferred, and deprecated. */ |
#define | ip6_addr_multicast_prefix_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00200000UL)) |
#define | ip6_addr_multicast_rendezvous_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00400000UL)) |
#define | ip6_addr_multicast_scope(ip6addr) ((htonl((ip6addr)->addr[0]) >> 16) & 0xf) |
#define | ip6_addr_multicast_transient_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00100000UL)) |
#define | ip6_addr_netcmp(addr1, addr2) |
Determine if two IPv6 address are on the same network. More... | |
#define | IP6_ADDR_PREFERRED 0x30 |
#define | ip6_addr_set(dest, src) |
Safely copy one IPv6 address to another (src may be NULL) More... | |
#define | ip6_addr_set_allnodes_linklocal(ip6addr) |
#define | ip6_addr_set_allrouters_linklocal(ip6addr) |
#define | ip6_addr_set_any(ip6addr) ip6_addr_set_zero(ip6addr) |
Set address to ipv6 'any' (no need for htonl()) More... | |
#define | ip6_addr_set_hton(dest, src) |
Safely copy one IPv6 address to another and change byte order from host- to network-order. More... | |
#define | ip6_addr_set_loopback(ip6addr) |
Set address to ipv6 loopback address. More... | |
#define | ip6_addr_set_solicitednode(ip6addr, if_id) |
#define | ip6_addr_set_zero(ip6addr) |
Set complete address to zero. More... | |
#define | IP6_ADDR_TENTATIVE 0x08 |
#define | IP6_ADDR_TENTATIVE_1 0x09 /* 1 probe sent */ |
#define | IP6_ADDR_TENTATIVE_2 0x0a /* 2 probes sent */ |
#define | IP6_ADDR_TENTATIVE_3 0x0b /* 3 probes sent */ |
#define | IP6_ADDR_TENTATIVE_4 0x0c /* 4 probes sent */ |
#define | IP6_ADDR_TENTATIVE_5 0x0d /* 5 probes sent */ |
#define | IP6_ADDR_TENTATIVE_6 0x0e /* 6 probes sent */ |
#define | IP6_ADDR_TENTATIVE_7 0x0f /* 7 probes sent */ |
#define | IP6_ADDR_VALID 0x10 |
#define | ip6_get_subnet_id(ip6addr) (htonl((ip6addr)->addr[2]) & 0x0000ffffUL) |
#define | IP6_MULTICAST_SCOPE_ADMIN_LOCAL 0x4 |
#define | IP6_MULTICAST_SCOPE_GLOBAL 0xe |
#define | IP6_MULTICAST_SCOPE_INTERFACE_LOCAL 0x1 |
#define | IP6_MULTICAST_SCOPE_LINK_LOCAL 0x2 |
#define | IP6_MULTICAST_SCOPE_ORGANIZATION_LOCAL 0x8 |
#define | IP6_MULTICAST_SCOPE_RESERVED 0x0 |
#define | IP6_MULTICAST_SCOPE_RESERVED0 0x0 |
#define | IP6_MULTICAST_SCOPE_RESERVED3 0x3 |
#define | IP6_MULTICAST_SCOPE_RESERVEDF 0xf |
#define | IP6_MULTICAST_SCOPE_SITE_LOCAL 0x5 |
#define | IP6ADDR_STRLEN_MAX 46 |
Typedefs | |
typedef struct ip6_addr_packed | ip6_addr_p_t |
typedef typedefPACK_STRUCT_END struct ip6_addr | ip6_addr_t |
ip6_addr_t uses a struct for convenience only, so that the same defines can operate both on ip6_addr_t as well as on ip6_addr_p_t. More... | |
Functions | |
int | ip6addr_aton (const char *cp, ip6_addr_t *addr) |
Check whether "cp" is a valid ascii representation of an IPv6 address and convert to a binary address. More... | |
char * | ip6addr_ntoa (const ip6_addr_t *addr) |
returns ptr to static buffer; not reentrant! More... | |
char * | ip6addr_ntoa_r (const ip6_addr_t *addr, char *buf, int buflen) |
Same as ipaddr_ntoa, but reentrant since a user-supplied buffer is used. More... | |
Variables | |
const ip6_addr_t | ip6_addr_any |
IP6_ADDR_ANY can be used as a fixed IPv6 address for the wildcard. More... | |
PACK_STRUCT_BEGIN struct ip6_addr_packed | PACK_STRUCT_STRUCT |
#define IP6_ADDR | ( | ip6addr, | |
index, | |||
a, | |||
b, | |||
c, | |||
d | |||
) |
#define IP6_ADDR_ANY ((ip6_addr_t *)&ip6_addr_any) |
Referenced by ip6_output_if_src(), mld6_send(), nd6_send_ns(), and nd6_send_rs().
Access address in 16-bit block.
Referenced by ip6_output().
Referenced by ip6_output().
Referenced by ip6_output().
Referenced by ip6_output().
Referenced by ip6_output().
Referenced by ip6_output().
Referenced by ip6_output().
Referenced by ip6_output().
#define ip6_addr_cmp | ( | addr1, | |
addr2 | |||
) |
Referenced by ip6_input(), ip6_output_if_src(), ip6_reass(), ip6_route(), mld6_joingroup(), mld6_leavegroup(), mld6_lookfor_group(), nd6_find_destination_cache_entry(), nd6_find_neighbor_cache_entry(), nd6_get_next_hop_entry(), nd6_get_router(), nd6_input(), nd6_reachability_hint(), netif_get_ip6_addr_match(), and udp_input().
#define ip6_addr_cmp_solicitednode | ( | ip6addr, | |
sn_addr | |||
) |
Referenced by ip6_input().
#define ip6_addr_copy | ( | dest, | |
src | |||
) |
Copy IPv6 address - faster than ip6_addr_set: no NULL check.
Referenced by icmp6_send_response(), ip6_input(), ip6_output(), ip6_output_if_src(), and nd6_get_next_hop_entry().
#define ip6_addr_debug_print | ( | debug, | |
ipaddr | |||
) |
#define IP6_ADDR_DEPRECATED 0x50 |
#define IP6_ADDR_INVALID 0x00 |
Referenced by nd6_input(), nd6_tmr(), and netif_add().
#define ip6_addr_isallnodes_iflocal | ( | ip6addr | ) |
Referenced by ip6_input().
#define ip6_addr_isallnodes_linklocal | ( | ip6addr | ) |
Referenced by ip6_input(), and mld6_input().
#define ip6_addr_isallrouters_linklocal | ( | ip6addr | ) |
#define ip6_addr_isany | ( | ip6addr | ) |
Referenced by ip6_input(), ip6_output_if(), ip6_route(), mld6_input(), mld6_joingroup(), mld6_leavegroup(), mld6_send(), nd6_input(), nd6_new_destination_cache_entry(), and udp_input().
#define ip6_addr_isdeprecated | ( | addr_state | ) | (addr_state == IP6_ADDR_DEPRECATED) |
#define ip6_addr_isglobal | ( | ip6addr | ) | (((ip6addr)->addr[0] & PP_HTONL(0xe0000000UL)) == PP_HTONL(0x20000000UL)) |
Referenced by ip6_select_source_address().
#define ip6_addr_isinvalid | ( | addr_state | ) | (addr_state == IP6_ADDR_INVALID) |
#define ip6_addr_islinklocal | ( | ip6addr | ) | (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfe800000UL)) |
Referenced by ip6_input(), ip6_route(), ip6_select_source_address(), nd6_get_next_hop_entry(), and nd6_input().
#define ip6_addr_isloopback | ( | ip6addr | ) |
#define ip6_addr_ismulticast | ( | ip6addr | ) | (((ip6addr)->addr[0] & PP_HTONL(0xff000000UL)) == PP_HTONL(0xff000000UL)) |
Referenced by ethip6_output(), icmp6_input(), ip6_input(), nd6_input(), and udp_input().
#define ip6_addr_ismulticast_adminlocal | ( | ip6addr | ) | (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff040000UL)) |
#define ip6_addr_ismulticast_global | ( | ip6addr | ) | (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff0e0000UL)) |
Referenced by ip6_select_source_address().
#define ip6_addr_ismulticast_iflocal | ( | ip6addr | ) | (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff010000UL)) |
Referenced by ip6_select_source_address(), and mld6_input().
#define ip6_addr_ismulticast_linklocal | ( | ip6addr | ) | (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff020000UL)) |
Referenced by ip6_select_source_address().
#define ip6_addr_ismulticast_orglocal | ( | ip6addr | ) | (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff080000UL)) |
Referenced by ip6_select_source_address().
#define ip6_addr_ismulticast_sitelocal | ( | ip6addr | ) | (((ip6addr)->addr[0] & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xff050000UL)) |
Referenced by ip6_select_source_address().
#define ip6_addr_ispreferred | ( | addr_state | ) | (addr_state == IP6_ADDR_PREFERRED) |
#define ip6_addr_issitelocal | ( | ip6addr | ) | (((ip6addr)->addr[0] & PP_HTONL(0xffc00000UL)) == PP_HTONL(0xfec00000UL)) |
Referenced by ip6_select_source_address().
#define ip6_addr_issolicitednode | ( | ip6addr | ) |
#define ip6_addr_istentative | ( | addr_state | ) | (addr_state & IP6_ADDR_TENTATIVE) |
Referenced by nd6_input(), and nd6_tmr().
#define ip6_addr_isuniquelocal | ( | ip6addr | ) | (((ip6addr)->addr[0] & PP_HTONL(0xfe000000UL)) == PP_HTONL(0xfc000000UL)) |
Referenced by ip6_select_source_address().
#define ip6_addr_isvalid | ( | addr_state | ) | (addr_state & IP6_ADDR_VALID) /* Include valid, preferred, and deprecated. */ |
Referenced by ip6_input(), ip6_output_if_src(), ip6_route(), ip6_select_source_address(), mld6_send(), nd6_input(), nd6_is_prefix_in_netif(), nd6_send_ns(), and nd6_send_rs().
#define ip6_addr_multicast_prefix_flag | ( | ip6addr | ) | ((ip6addr)->addr[0] & PP_HTONL(0x00200000UL)) |
#define ip6_addr_multicast_rendezvous_flag | ( | ip6addr | ) | ((ip6addr)->addr[0] & PP_HTONL(0x00400000UL)) |
#define ip6_addr_multicast_scope | ( | ip6addr | ) | ((htonl((ip6addr)->addr[0]) >> 16) & 0xf) |
#define ip6_addr_multicast_transient_flag | ( | ip6addr | ) | ((ip6addr)->addr[0] & PP_HTONL(0x00100000UL)) |
#define ip6_addr_netcmp | ( | addr1, | |
addr2 | |||
) |
Determine if two IPv6 address are on the same network.
Referenced by ip6_route(), ip6_select_source_address(), nd6_get_onlink_prefix(), and nd6_is_prefix_in_netif().
#define IP6_ADDR_PREFERRED 0x30 |
Referenced by nd6_tmr(), and netif_create_ip6_linklocal_address().
#define ip6_addr_set | ( | dest, | |
src | |||
) |
Safely copy one IPv6 address to another (src may be NULL)
Referenced by mld6_new_group(), mld6_send(), nd6_get_next_hop_entry(), nd6_input(), nd6_new_onlink_prefix(), nd6_new_router(), nd6_send_na(), nd6_send_ns(), and nd6_send_q().
#define ip6_addr_set_allnodes_linklocal | ( | ip6addr | ) |
Referenced by nd6_send_na().
#define ip6_addr_set_allrouters_linklocal | ( | ip6addr | ) |
Referenced by nd6_send_rs().
#define ip6_addr_set_any | ( | ip6addr | ) | ip6_addr_set_zero(ip6addr) |
Set address to ipv6 'any' (no need for htonl())
Referenced by ip6_input(), and nd6_get_next_hop_entry().
#define ip6_addr_set_hton | ( | dest, | |
src | |||
) |
Safely copy one IPv6 address to another and change byte order from host- to network-order.
#define ip6_addr_set_loopback | ( | ip6addr | ) |
#define ip6_addr_set_solicitednode | ( | ip6addr, | |
if_id | |||
) |
Referenced by nd6_input(), nd6_send_na(), nd6_send_ns(), and nd6_tmr().
#define ip6_addr_set_zero | ( | ip6addr | ) |
Set complete address to zero.
Referenced by nd6_free_neighbor_cache_entry(), and netif_add().
#define IP6_ADDR_TENTATIVE 0x08 |
Referenced by nd6_tmr(), and netif_create_ip6_linklocal_address().
#define IP6_ADDR_TENTATIVE_1 0x09 /* 1 probe sent */ |
#define IP6_ADDR_TENTATIVE_2 0x0a /* 2 probes sent */ |
#define IP6_ADDR_TENTATIVE_3 0x0b /* 3 probes sent */ |
#define IP6_ADDR_TENTATIVE_4 0x0c /* 4 probes sent */ |
#define IP6_ADDR_TENTATIVE_5 0x0d /* 5 probes sent */ |
#define IP6_ADDR_TENTATIVE_6 0x0e /* 6 probes sent */ |
#define IP6_ADDR_TENTATIVE_7 0x0f /* 7 probes sent */ |
#define IP6_ADDR_VALID 0x10 |
Referenced by netif_init().
#define ip6_get_subnet_id | ( | ip6addr | ) | (htonl((ip6addr)->addr[2]) & 0x0000ffffUL) |
#define IP6_MULTICAST_SCOPE_ADMIN_LOCAL 0x4 |
#define IP6_MULTICAST_SCOPE_GLOBAL 0xe |
#define IP6_MULTICAST_SCOPE_INTERFACE_LOCAL 0x1 |
#define IP6_MULTICAST_SCOPE_LINK_LOCAL 0x2 |
#define IP6_MULTICAST_SCOPE_ORGANIZATION_LOCAL 0x8 |
#define IP6_MULTICAST_SCOPE_RESERVED 0x0 |
#define IP6_MULTICAST_SCOPE_RESERVED0 0x0 |
#define IP6_MULTICAST_SCOPE_RESERVED3 0x3 |
#define IP6_MULTICAST_SCOPE_RESERVEDF 0xf |
#define IP6_MULTICAST_SCOPE_SITE_LOCAL 0x5 |
#define IP6ADDR_STRLEN_MAX 46 |
typedef struct ip6_addr_packed ip6_addr_p_t |
typedef typedefPACK_STRUCT_END struct ip6_addr ip6_addr_t |
ip6_addr_t uses a struct for convenience only, so that the same defines can operate both on ip6_addr_t as well as on ip6_addr_p_t.
int ip6addr_aton | ( | const char * | cp, |
ip6_addr_t * | addr | ||
) |
Check whether "cp" is a valid ascii representation of an IPv6 address and convert to a binary address.
Returns 1 if the address is valid, 0 if not.
cp | IPv6 address in ascii representation (e.g. "FF01::1") |
addr | pointer to which to save the ip address in network order |
char* ip6addr_ntoa | ( | const ip6_addr_t * | addr | ) |
returns ptr to static buffer; not reentrant!
returns ptr to static buffer; not reentrant!
returns ptr to static buffer; not reentrant!
addr | ip6 address in network order to convert |
References ip6addr_ntoa_r().
char* ip6addr_ntoa_r | ( | const ip6_addr_t * | addr, |
char * | buf, | ||
int | buflen | ||
) |
Same as ipaddr_ntoa, but reentrant since a user-supplied buffer is used.
addr | ip6 address in network order to convert |
buf | target buffer where the string is stored |
buflen | length of buf |
References htonl, NULL, and xchar.
Referenced by ip6addr_ntoa().
const ip6_addr_t ip6_addr_any |
IP6_ADDR_ANY can be used as a fixed IPv6 address for the wildcard.
PACK_STRUCT_BEGIN struct ip6_addr_packed PACK_STRUCT_STRUCT |