/build/buildd/libnl-1.0~pre6/include/netlink/addr.h

00001 /*
00002  * netlink/addr.h               Abstract Address
00003  *
00004  *      This library is free software; you can redistribute it and/or
00005  *      modify it under the terms of the GNU Lesser General Public
00006  *      License as published by the Free Software Foundation version 2.1
00007  *      of the License.
00008  *
00009  * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
00010  */
00011 
00012 #ifndef NETLINK_ADDR_H_
00013 #define NETLINK_ADDR_H_
00014 
00015 #include <netlink/netlink.h>
00016 
00017 struct nl_addr;
00018 
00019 /* Creation */
00020 extern struct nl_addr * nl_addr_alloc(size_t);
00021 extern struct nl_addr * nl_addr_build(int, void *, size_t);
00022 extern struct nl_addr * nl_addr_parse(const char *, int);
00023 extern struct nl_addr * nl_addr_clone(struct nl_addr *);
00024 
00025 /* Destroyage */
00026 extern void             nl_addr_destroy(struct nl_addr *);
00027 
00028 /* Usage Management */
00029 extern struct nl_addr * nl_addr_get(struct nl_addr *);
00030 extern void             nl_addr_put(struct nl_addr *);
00031 extern int              nl_addr_shared(struct nl_addr *);
00032 
00033 extern int              nl_addr_cmp(struct nl_addr *, struct nl_addr *);
00034 extern int              nl_addr_valid(char *, int);
00035 extern int              nl_addr_guess_family(struct nl_addr *);
00036 extern struct addrinfo *nl_addr_info(struct nl_addr *addr);
00037 extern int              nl_addr_resolve(struct nl_addr *addr, char *host, size_t hostlen);
00038 
00039 /* Access Functions */
00040 extern void             nl_addr_set_family(struct nl_addr *, int);
00041 extern int              nl_addr_get_family(struct nl_addr *);
00042 extern int              nl_addr_set_binary_addr(struct nl_addr *, void *,
00043                                                 size_t);
00044 extern void *           nl_addr_get_binary_addr(struct nl_addr *);
00045 extern unsigned int     nl_addr_get_len(struct nl_addr *);
00046 extern void             nl_addr_set_prefixlen(struct nl_addr *, int);
00047 extern unsigned int     nl_addr_get_prefixlen(struct nl_addr *);
00048 
00049 /* Address Family Translations */
00050 extern char *           nl_af2str(char, char *, size_t);
00051 extern char             nl_str2af(const char *);
00052 
00053 /* Translations to Strings */
00054 extern char *           nl_addr2str(struct nl_addr *, char *, size_t);
00055 
00056 #endif

Generated on Fri Apr 27 14:14:07 2007 for libnl by  doxygen 1.5.1