Contiki-NG
Loading...
Searching...
No Matches
uIP address manipulation library

Files

file  uiplib.c
 Implementation of the IP address manipulation library.
 
file  uiplib.h
 Header file for the IP address manipulation library.
 

Macros

#define uiplib_ipaddrconv   uiplib_ip6addrconv
 Convert a textual representation of an IP address to a numerical representation.
 

Functions

void uiplib_ipaddr_print (const uip_ipaddr_t *addr)
 Print an IP address using printf().
 
int uiplib_ipaddr_snprint (char *buf, size_t size, const uip_ipaddr_t *addr)
 Write at most size - 1 characters of the IP address to the output string.
 

Detailed Description

A library with various IP address manipulation functions

Macro Definition Documentation

◆ 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
addrstrA pointer to a string containing the IP address in textual form.
addrA pointer to a uip_ip4addr_t that will be filled in with the numerical representation of the address.
Return values
0If the IP address could not be parsed.
Non-zeroIf the IP address was parsed.

Definition at line 71 of file uiplib.h.

Referenced by coap_endpoint_parse().

Function Documentation

◆ uiplib_ipaddr_print()

void uiplib_ipaddr_print ( const uip_ipaddr_t * addr)

Print an IP address using printf().

Parameters
addrA pointer to a uip_ipaddr_t that will be printed with printf().

Definition at line 158 of file uiplib.c.

References addr, and uiplib_ipaddr_snprint().

Referenced by coap_endpoint_print().

◆ 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
bufferA pointer to an output string with at least size bytes.
sizeThe max number of characters to write to the output string.
addrA pointer to a uip_ipaddr_t that will be printed with printf().

Definition at line 166 of file uiplib.c.

References addr.

Referenced by coap_endpoint_snprint(), log_6addr(), rpl_neighbor_snprint(), shell_output_6addr(), uip_sr_link_snprint(), and uiplib_ipaddr_print().