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 | |
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')
-rw-r--r-- | include/linux/if_link.h | 8 | ||||
-rw-r--r-- | include/linux/inetdevice.h | 36 | ||||
-rw-r--r-- | include/netlink-local.h | 2 | ||||
-rw-r--r-- | include/netlink/route/link/api.h | 9 | ||||
-rw-r--r-- | include/netlink/route/link/inet.h | 29 |
5 files changed, 83 insertions, 1 deletions
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index 292d1cd..b60ff97 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h @@ -147,6 +147,14 @@ enum { #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) #endif +enum { + IFLA_INET_UNSPEC, + IFLA_INET_CONF, + __IFLA_INET_MAX, +}; + +#define IFLA_INET_MAX (__IFLA_INET_MAX - 1) + /* ifi_flags. IFF_* flags. diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h new file mode 100644 index 0000000..fd4d2df --- /dev/null +++ b/include/linux/inetdevice.h @@ -0,0 +1,36 @@ +#ifndef _LINUX_INETDEVICE_H +#define _LINUX_INETDEVICE_H + +enum +{ + IPV4_DEVCONF_FORWARDING=1, + IPV4_DEVCONF_MC_FORWARDING, + IPV4_DEVCONF_PROXY_ARP, + IPV4_DEVCONF_ACCEPT_REDIRECTS, + IPV4_DEVCONF_SECURE_REDIRECTS, + IPV4_DEVCONF_SEND_REDIRECTS, + IPV4_DEVCONF_SHARED_MEDIA, + IPV4_DEVCONF_RP_FILTER, + IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE, + IPV4_DEVCONF_BOOTP_RELAY, + IPV4_DEVCONF_LOG_MARTIANS, + IPV4_DEVCONF_TAG, + IPV4_DEVCONF_ARPFILTER, + IPV4_DEVCONF_MEDIUM_ID, + IPV4_DEVCONF_NOXFRM, + IPV4_DEVCONF_NOPOLICY, + IPV4_DEVCONF_FORCE_IGMP_VERSION, + IPV4_DEVCONF_ARP_ANNOUNCE, + IPV4_DEVCONF_ARP_IGNORE, + IPV4_DEVCONF_PROMOTE_SECONDARIES, + IPV4_DEVCONF_ARP_ACCEPT, + IPV4_DEVCONF_ARP_NOTIFY, + IPV4_DEVCONF_ACCEPT_LOCAL, + IPV4_DEVCONF_SRC_VMARK, + IPV4_DEVCONF_PROXY_ARP_PVLAN, + __IPV4_DEVCONF_MAX +}; + +#define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1) + +#endif /* _LINUX_INETDEVICE_H */ diff --git a/include/netlink-local.h b/include/netlink-local.h index 59f1d61..fbcf961 100644 --- a/include/netlink-local.h +++ b/include/netlink-local.h @@ -48,7 +48,7 @@ #include <linux/gen_stats.h> #include <linux/ip_mp_alg.h> #include <linux/atm.h> - +#include <linux/inetdevice.h> #include <linux/ipv6.h> #include <linux/snmp.h> 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 |