IPv6 addresses.
Macros | |
#define | in_range(c, lo, up) ((u8_t)c >= lo && (u8_t)c <= up) |
#define | isdigit(c) in_range(c, '0', '9') |
#define | islower(c) in_range(c, 'a', 'z') |
#define | isprint(c) in_range(c, 0x20, 0x7f) |
#define | isspace(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v') |
#define | isxdigit(c) (isdigit(c) || in_range(c, 'a', 'f') || in_range(c, 'A', 'F')) |
#define | xchar(i) ((i) < 10 ? '0' + (i) : 'A' + (i) - 10) |
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) |
Convert numeric IPv6 address into ASCII representation. 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 = { { 0ul, 0ul, 0ul, 0ul } } |
IP6_ADDR_ANY can be used as a fixed IPv6 address for the wildcard. More... | |
#define isdigit | ( | c | ) | in_range(c, '0', '9') |
Referenced by ip6addr_aton().
#define islower | ( | c | ) | in_range(c, 'a', 'z') |
Referenced by ip6addr_aton().
#define isprint | ( | c | ) | in_range(c, 0x20, 0x7f) |
#define isspace | ( | c | ) | (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v') |
Referenced by ip6addr_aton().
#define xchar | ( | i | ) | ((i) < 10 ? '0' + (i) : 'A' + (i) - 10) |
Referenced by ip6addr_ntoa_r().
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 | ) |
Convert numeric IPv6 address into ASCII representation.
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 = { { 0ul, 0ul, 0ul, 0ul } } |
IP6_ADDR_ANY can be used as a fixed IPv6 address for the wildcard.