Logo Search packages:      
Sourcecode: libnl version File versions  Download package

Abstract Address

Detailed Description

1) Transform character string to abstract address
 struct nl_addr *a = nl_addr_parse("::1", AF_UNSPEC);
 printf("Address family: %s\n", nl_af2str(nl_addr_get_family(a)));
 a = nl_addr_parse("11:22:33:44:55:66", AF_UNSPEC);
 printf("Address family: %s\n", nl_af2str(nl_addr_get_family(a)));

Address Family Transformations

static struct trans_tbl afs []
char * nl_af2str (char family, char *buf, size_t size)
char nl_str2af (const char *name)

Translations to Strings

char * nl_addr2str (struct nl_addr *addr, char *buf, size_t size)

Creating Abstract Addresses

struct nl_addr * nl_addr_alloc (size_t maxsize)
struct nl_addr * nl_addr_build (int family, void *buf, size_t size)
struct nl_addr * nl_addr_clone (struct nl_addr *addr)
struct nl_addr * nl_addr_parse (const char *addrstr, int hint)


int nl_addr_cmp (struct nl_addr *a, struct nl_addr *b)
int nl_addr_fill_sockaddr (struct nl_addr *addr, struct sockaddr *sa, socklen_t *salen)
int nl_addr_guess_family (struct nl_addr *addr)
int nl_addr_valid (char *addr, int family)

Destroying Abstract Addresses

void nl_addr_destroy (struct nl_addr *addr)

Managing Usage References

struct nl_addr * nl_addr_get (struct nl_addr *addr)
void nl_addr_put (struct nl_addr *addr)
int nl_addr_shared (struct nl_addr *addr)

Attribute Access

void * nl_addr_get_binary_addr (struct nl_addr *addr)
int nl_addr_get_family (struct nl_addr *addr)
unsigned int nl_addr_get_len (struct nl_addr *addr)
unsigned int nl_addr_get_prefixlen (struct nl_addr *addr)
int nl_addr_set_binary_addr (struct nl_addr *addr, void *buf, size_t len)
void nl_addr_set_family (struct nl_addr *addr, int family)
void nl_addr_set_prefixlen (struct nl_addr *addr, int prefixlen)

Getting Information About Addresses

struct addrinfo * nl_addr_info (struct nl_addr *addr)
int nl_addr_resolve (struct nl_addr *addr, char *host, size_t hostlen)


static uint16_t dn_ntohs (uint16_t addr)
static const char * dnet_ntop (char *addrbuf, size_t addrlen, char *str, size_t len)
static int dnet_num (const char *src, uint16_t *dst)
static int dnet_pton (const char *src, char *addrbuf)
static int do_digit (char *str, uint16_t *addr, uint16_t scale, size_t *pos, size_t len, int *started)

Generated by  Doxygen 1.6.0   Back to index