diff options
author | Thomas Graf <tgr@deb.localdomain> | 2008-01-30 13:14:58 +0100 |
---|---|---|
committer | Thomas Graf <tgr@deb.localdomain> | 2008-01-30 13:14:58 +0100 |
commit | 0fa6756cca2444ddf665cc140585822d6c04507a (patch) | |
tree | 0202e361d2feb81e5337fd4bb75e05abeacff803 /lib/addr.c | |
parent | 3607dbfa54e7ca775a89078f64bdcb150ea9306b (diff) | |
download | libnl-0fa6756cca2444ddf665cc140585822d6c04507a.tar.gz |
Abstract address allocation based on netlink attribute
Diffstat (limited to 'lib/addr.c')
-rw-r--r-- | lib/addr.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -203,6 +203,21 @@ struct nl_addr *nl_addr_build(int family, void *buf, size_t size) } /** + * Allocate abstract address based on netlink attribute. + * @arg nla Netlink attribute of unspecific type. + * @arg family Address family. + * + * Considers the netlink attribute payload a address of the specified + * family and allocates a new abstract address based on it. + * + * @return Newly allocated address handle or NULL. + */ +struct nl_addr *nl_addr_alloc_from_attr(struct nlattr *nla, int family) +{ + return nl_addr_build(family, nla_data(nla), nla_len(nla)); +} + +/** * Allocate abstract address object based on a character string * @arg addrstr Address represented as character string. * @arg hint Address family hint or AF_UNSPEC. |