lwIP
2.1.0
Lightweight IP stack
|
Data Structures | |
struct | ip6_addr |
Macros | |
#define | IP6_ADDR_PART(ip6addr, index, a, b, c, d) (ip6addr)->addr[index] = PP_HTONL(LWIP_MAKEU32(a,b,c,d)) |
#define | IP6_ADDR(ip6addr, idx0, idx1, idx2, idx3) |
#define | IP6_ADDR_BLOCK1(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xffff)) |
#define | IP6_ADDR_BLOCK2(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[0])) & 0xffff)) |
#define | IP6_ADDR_BLOCK3(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[1]) >> 16) & 0xffff)) |
#define | IP6_ADDR_BLOCK4(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[1])) & 0xffff)) |
#define | IP6_ADDR_BLOCK5(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[2]) >> 16) & 0xffff)) |
#define | IP6_ADDR_BLOCK6(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[2])) & 0xffff)) |
#define | IP6_ADDR_BLOCK7(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[3]) >> 16) & 0xffff)) |
#define | IP6_ADDR_BLOCK8(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[3])) & 0xffff)) |
#define | ip6_addr_copy(dest, src) |
#define | ip6_addr_set(dest, src) |
#define | ip6_addr_copy_from_packed(dest, src) |
#define | ip6_addr_copy_to_packed(dest, src) |
#define | ip6_addr_set_zero(ip6addr) |
#define | ip6_addr_set_any(ip6addr) ip6_addr_set_zero(ip6addr) |
#define | ip6_addr_set_loopback(ip6addr) |
#define | ip6_addr_set_hton(dest, src) |
#define | ip6_addr_netcmp_zoneless(addr1, addr2) |
#define | ip6_addr_netcmp(addr1, addr2) |
#define | ip6_addr_cmp_zoneless(addr1, addr2) |
#define | ip6_addr_cmp(addr1, addr2) |
#define | ip6_addr_cmp_packed(ip6addr, paddr, zone_idx) |
Typedefs | |
typedef struct ip6_addr | ip6_addr_t |
Functions | |
int | ip6addr_aton (const char *cp, ip6_addr_t *addr) |
char * | ip6addr_ntoa (const ip6_addr_t *addr) |
char * | ip6addr_ntoa_r (const ip6_addr_t *addr, char *buf, int buflen) |
IPv6 addresses.
#define IP6_ADDR | ( | ip6addr, | |
idx0, | |||
idx1, | |||
idx2, | |||
idx3 | |||
) |
Set a full IPv6 address by passing the 4 u32_t indices in network byte order (use PP_HTONL() for constants)
#define IP6_ADDR_BLOCK1 | ( | ip6addr | ) | ((u16_t)((lwip_htonl((ip6addr)->addr[0]) >> 16) & 0xffff)) |
Access address in 16-bit block
#define IP6_ADDR_BLOCK2 | ( | ip6addr | ) | ((u16_t)((lwip_htonl((ip6addr)->addr[0])) & 0xffff)) |
Access address in 16-bit block
#define IP6_ADDR_BLOCK3 | ( | ip6addr | ) | ((u16_t)((lwip_htonl((ip6addr)->addr[1]) >> 16) & 0xffff)) |
Access address in 16-bit block
#define IP6_ADDR_BLOCK4 | ( | ip6addr | ) | ((u16_t)((lwip_htonl((ip6addr)->addr[1])) & 0xffff)) |
Access address in 16-bit block
#define IP6_ADDR_BLOCK5 | ( | ip6addr | ) | ((u16_t)((lwip_htonl((ip6addr)->addr[2]) >> 16) & 0xffff)) |
Access address in 16-bit block
#define IP6_ADDR_BLOCK6 | ( | ip6addr | ) | ((u16_t)((lwip_htonl((ip6addr)->addr[2])) & 0xffff)) |
Access address in 16-bit block
#define IP6_ADDR_BLOCK7 | ( | ip6addr | ) | ((u16_t)((lwip_htonl((ip6addr)->addr[3]) >> 16) & 0xffff)) |
Access address in 16-bit block
#define IP6_ADDR_BLOCK8 | ( | ip6addr | ) | ((u16_t)((lwip_htonl((ip6addr)->addr[3])) & 0xffff)) |
Access address in 16-bit block
#define ip6_addr_cmp | ( | addr1, | |
addr2 | |||
) |
Determine if two IPv6 addresses are the same. In particular, the address part of both must be the same, and the zone must be compatible.
addr1 | IPv6 address 1 |
addr2 | IPv6 address 2 |
#define ip6_addr_cmp_packed | ( | ip6addr, | |
paddr, | |||
zone_idx | |||
) |
Compare IPv6 address to packed address and zone
#define ip6_addr_cmp_zoneless | ( | addr1, | |
addr2 | |||
) |
Compare IPv6 addresses, ignoring zone information. To be used sparingly!
#define ip6_addr_copy | ( | dest, | |
src | |||
) |
Copy IPv6 address - faster than ip6_addr_set: no NULL check
#define ip6_addr_copy_from_packed | ( | dest, | |
src | |||
) |
Copy packed IPv6 address to unpacked IPv6 address; zone is not set
#define ip6_addr_copy_to_packed | ( | dest, | |
src | |||
) |
Copy unpacked IPv6 address to packed IPv6 address; zone is lost
#define ip6_addr_netcmp | ( | addr1, | |
addr2 | |||
) |
Determine if two IPv6 address are on the same network.
addr1 | IPv6 address 1 |
addr2 | IPv6 address 2 |
#define ip6_addr_netcmp_zoneless | ( | addr1, | |
addr2 | |||
) |
Compare IPv6 networks, ignoring zone information. To be used sparingly!
#define IP6_ADDR_PART | ( | ip6addr, | |
index, | |||
a, | |||
b, | |||
c, | |||
d | |||
) | (ip6addr)->addr[index] = PP_HTONL(LWIP_MAKEU32(a,b,c,d)) |
Set an IPv6 partial address given by byte-parts
#define ip6_addr_set | ( | dest, | |
src | |||
) |
Safely copy one IPv6 address to another (src may be NULL)
#define ip6_addr_set_any | ( | ip6addr | ) | ip6_addr_set_zero(ip6addr) |
Set address to ipv6 'any' (no need for lwip_htonl())
#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 | ) |
Set address to ipv6 loopback address
#define ip6_addr_set_zero | ( | ip6addr | ) |
Set complete address to zero
typedef struct ip6_addr ip6_addr_t |
IPv6 address
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!
Convert numeric IPv6 address into ASCII representation. returns ptr to static buffer; not reentrant!
addr | ip6 address in network order to convert |
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 |