RTRlib
 All Data Structures Functions Typedefs Enumerations Enumerator Groups Pages
Functions
Utility functions

Functions

bool lrtr_ip_addr_equal (const struct lrtr_ip_addr a, const struct lrtr_ip_addr b)
 
int lrtr_ip_addr_to_str (const struct lrtr_ip_addr *ip, char *str, const unsigned int len)
 
bool lrtr_ip_str_cmp (const struct lrtr_ip_addr *addr1, const char *addr2)
 
int lrtr_ip_str_to_addr (const char *str, struct lrtr_ip_addr *ip)
 
void lrtr_ipv6_addr_to_host_byte_order (const uint32_t *src, uint32_t *dest)
 

Detailed Description

Parameters
[in]alrtr_ip_addr
[in]blrtr_ip_addr
Returns
true If a == b.
false If a != b.

Function Documentation

int lrtr_ip_addr_to_str ( const struct lrtr_ip_addr ip,
char *  str,
const unsigned int  len 
)

Converts the passed lrtr_ip_addr struct to string representation.

Parameters
[in]iplrtr_ip_addr
[out]strPointer to a char array. The array must be at least INET_ADDRSTRLEN bytes long if the passed lrtr_ip_addr stores an IPv4 address. If lrtr_ip_addr stores an IPv6 address, str must be at least INET6_ADDRSTRLEN bytes long.
[in]lenLength of the str array.
Returns
0 On success.
-1 On error.
bool lrtr_ip_str_cmp ( const struct lrtr_ip_addr addr1,
const char *  addr2 
)

Compares addr1 in the lrtr_ip_addr struct with addr2 in string representation.

Parameters
[in]addr1lrtr_ip_addr
[in]addr2IP-address as string
Returns
true If a == b
false If a != b

References lrtr_ip_str_to_addr().

int lrtr_ip_str_to_addr ( const char *  str,
struct lrtr_ip_addr ip 
)

Converts the passed IP address in string representation to an lrtr_ip_addr.

Parameters
[in]strPointer to a Null terminated char array.
[out]ipPointer to a lrtr_ip_addr struct.
Returns
0 On success.
-1 On error.

Referenced by lrtr_ip_str_cmp().

void lrtr_ipv6_addr_to_host_byte_order ( const uint32_t *  src,
uint32_t *  dest 
)

[{ Converts the passed IPv6 address first_bit network byte order to host byte order.

Parameters
[in]srcPointer to a uint32_t array storing a ipv6 address in network byte order.
[out]destPointer a uint32_t array that will be used to store the ipv6 addr in host byte order. }