netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
addr.c File Reference
#include <netlink-local.h>
#include <netlink/netlink.h>
#include <netlink/utils.h>
#include <netlink/addr.h>
#include <linux/socket.h>
Include dependency graph for addr.c:

Functions

Creating Abstract Addresses
struct nl_addrnl_addr_alloc (size_t maxsize)
 Allocate new abstract address object. More...
 
struct nl_addrnl_addr_build (int family, void *buf, size_t size)
 Allocate new abstract address object based on a binary address. More...
 
struct nl_addrnl_addr_alloc_attr (struct nlattr *nla, int family)
 Allocate abstract address based on netlink attribute. More...
 
int nl_addr_parse (const char *addrstr, int hint, struct nl_addr **result)
 Allocate abstract address object based on a character string. More...
 
struct nl_addrnl_addr_clone (struct nl_addr *addr)
 Clone existing abstract address object. More...
 
Destroying Abstract Addresses
void nl_addr_destroy (struct nl_addr *addr)
 Destroy abstract address object. More...
 
Managing Usage References
struct nl_addrnl_addr_get (struct nl_addr *addr)
 
void nl_addr_put (struct nl_addr *addr)
 
int nl_addr_shared (struct nl_addr *addr)
 Check whether an abstract address object is shared. More...
 
Miscellaneous
int nl_addr_cmp (struct nl_addr *a, struct nl_addr *b)
 Compares two abstract address objects. More...
 
int nl_addr_cmp_prefix (struct nl_addr *a, struct nl_addr *b)
 Compares the prefix of two abstract address objects. More...
 
int nl_addr_iszero (struct nl_addr *addr)
 Returns true if the address consists of all zeros. More...
 
int nl_addr_valid (char *addr, int family)
 Check if an address matches a certain family. More...
 
int nl_addr_guess_family (struct nl_addr *addr)
 Guess address family of an abstract address object based on address size. More...
 
int nl_addr_fill_sockaddr (struct nl_addr *addr, struct sockaddr *sa, socklen_t *salen)
 Fill out sockaddr structure with values from abstract address object. More...
 
Getting Information About Addresses
int nl_addr_info (struct nl_addr *addr, struct addrinfo **result)
 Call getaddrinfo() for an abstract address object. More...
 
int nl_addr_resolve (struct nl_addr *addr, char *host, size_t hostlen)
 Resolve abstract address object to a name using getnameinfo(). More...
 
Attributes
void nl_addr_set_family (struct nl_addr *addr, int family)
 
int nl_addr_get_family (struct nl_addr *addr)
 
int nl_addr_set_binary_addr (struct nl_addr *addr, void *buf, size_t len)
 Set binary address of abstract address object. More...
 
void * nl_addr_get_binary_addr (struct nl_addr *addr)
 Get binary address of abstract address object. More...
 
unsigned int nl_addr_get_len (struct nl_addr *addr)
 Get length of binary address of abstract address object. More...
 
void nl_addr_set_prefixlen (struct nl_addr *addr, int prefixlen)
 
unsigned int nl_addr_get_prefixlen (struct nl_addr *addr)
 Get prefix length of abstract address object. More...
 
Translations to Strings
char * nl_addr2str (struct nl_addr *addr, char *buf, size_t size)
 Convert abstract address object to character string. More...
 

Address Family Transformations

char * nl_af2str (int family, char *buf, size_t size)
 
int nl_str2af (const char *name)