diff options
author | Thomas Graf <tgraf@suug.ch> | 2010-11-16 11:41:43 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2010-11-16 11:41:43 (GMT) |
commit | 53015f83811bd56d4b66331656633ad39051babf (patch) | |
tree | 9012ce9a769af8b977e98baa25b8b981cafbdba2 /include/netlink | |
parent | 2e3ca4db0cbca7974888e7d3e7d84ba8fbbcf639 (diff) | |
download | libnl-53015f83811bd56d4b66331656633ad39051babf.zip libnl-53015f83811bd56d4b66331656633ad39051babf.tar.gz libnl-53015f83811bd56d4b66331656633ad39051babf.tar.bz2 |
link: AF_INET link module
Note: The code for this is not upstream yet.
Extends the link api to allow address family modules to fill a link
message and implements a AF_INET address family link module which
uses the new interface.
Diffstat (limited to 'include/netlink')
-rw-r--r-- | include/netlink/route/link/api.h | 9 | ||||
-rw-r--r-- | include/netlink/route/link/inet.h | 29 |
2 files changed, 38 insertions, 0 deletions
diff --git a/include/netlink/route/link/api.h b/include/netlink/route/link/api.h index 2280b4a..960d3f1 100644 --- a/include/netlink/route/link/api.h +++ b/include/netlink/route/link/api.h @@ -110,6 +110,11 @@ struct rtnl_link_af_ops int (*ao_parse_af)(struct rtnl_link *, struct nlattr *, void *); + /** Called if a link message is sent to the kernel. Must append the + * link address family specific attributes to the message. */ + int (*ao_fill_af)(struct rtnl_link *, + struct nl_msg *msg, void *); + /** Dump address family specific link attributes */ void (*ao_dump[NL_DUMP_MAX+1])(struct rtnl_link *, struct nl_dump_params *, @@ -118,6 +123,10 @@ struct rtnl_link_af_ops extern struct rtnl_link_af_ops *rtnl_link_af_ops_lookup(unsigned int); extern void rtnl_link_af_ops_put(struct rtnl_link_af_ops *); +extern void * rtnl_link_af_alloc(struct rtnl_link *, + const struct rtnl_link_af_ops *); +extern void * rtnl_link_af_data(const struct rtnl_link *, + const struct rtnl_link_af_ops *); extern int rtnl_link_af_register(struct rtnl_link_af_ops *); extern int rtnl_link_af_unregister(struct rtnl_link_af_ops *); diff --git a/include/netlink/route/link/inet.h b/include/netlink/route/link/inet.h new file mode 100644 index 0000000..9feff37 --- /dev/null +++ b/include/netlink/route/link/inet.h @@ -0,0 +1,29 @@ +/* + * netlink/route/link/inet.h INET Link Module + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version 2.1 + * of the License. + * + * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> + */ + +#ifndef NETLINK_LINK_INET_H_ +#define NETLINK_LINK_INET_H_ + +#include <netlink/netlink.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern const char * rtnl_link_inet_devconf2str(int, char *, size_t); +extern unsigned int rtnl_link_inet_str2devconf(const char *); + +extern int rtnl_link_inet_get_conf(struct rtnl_link *, + const unsigned int, uint32_t *); +extern int rtnl_link_inet_set_conf(struct rtnl_link *, + const unsigned int, uint32_t); + +#endif |