A library with various IP address manipulation functions.
More...
|
file | uiplib.c |
| Implementation of the IP address manipulation library.
|
|
file | uiplib.h |
| Header file for the IP address manipulation library.
|
|
|
#define | uiplib_ipaddrconv uiplib_ip6addrconv |
| Convert a textual representation of an IP address to a numerical representation. More...
|
|
A library with various IP address manipulation functions.
◆ uiplib_ipaddrconv
#define uiplib_ipaddrconv uiplib_ip6addrconv |
Convert a textual representation of an IP address to a numerical representation.
This function takes a textual representation of an IP address in the form a.b.c.d for IPv4 or a:b:c:d:e:f:g:h for IPv6 and converts it into a numeric IP address representation that can be used by other uIP functions.
- Parameters
-
addrstr | A pointer to a string containing the IP address in textual form. |
addr | A pointer to a uip_ip4addr_t that will be filled in with the numerical representation of the address. |
- Return values
-
0 | If the IP address could not be parsed. |
Non-zero | If the IP address was parsed. |
Definition at line 72 of file uiplib.h.
◆ uiplib_ipaddr_print()
void uiplib_ipaddr_print |
( |
const uip_ipaddr_t * |
addr | ) |
|
Print an IP address using printf().
- Parameters
-
addr | A pointer to a uip_ipaddr_t that will be printed with printf(). |
Definition at line 160 of file uiplib.c.
◆ uiplib_ipaddr_snprint()
int uiplib_ipaddr_snprint |
( |
char * |
buffer, |
|
|
size_t |
size, |
|
|
const uip_ipaddr_t * |
addr |
|
) |
| |
Write at most size - 1 characters of the IP address to the output string.
The output is always null-terminated, unless size is 0.
- Parameters
-
buffer | A pointer to an output string with at least size bytes. |
size | The max number of characters to write to the output string. |
addr | A pointer to a uip_ipaddr_t that will be printed with printf(). |
Definition at line 168 of file uiplib.c.