summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Graf <tgraf@redhat.com>2012-10-09 18:15:50 +0200
committerThomas Graf <tgraf@redhat.com>2012-10-09 18:15:50 +0200
commit6ac07179e580405608a39a377a88b2c65bbdba5c (patch)
treef5ed97ffab6258740c23893f60d12ed6d162435d /include
parente4192ff97f3fccbe8347e88139aca9ba49af29ab (diff)
downloadlibnl-6ac07179e580405608a39a377a88b2c65bbdba5c.tar.gz
link: Support IFLA_PROMISCUITY link attribute
* read-only attribute * dumped in details sections "promisc-mode (N users)" Signed-off-by: Thomas Graf <tgraf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/if_link.h18
-rw-r--r--include/netlink-types.h1
-rw-r--r--include/netlink/route/link.h5
3 files changed, 23 insertions, 1 deletions
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 8a27d5a..c0a1dd9 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -137,6 +137,11 @@ enum {
IFLA_AF_SPEC,
IFLA_GROUP, /* Group the device belongs to */
IFLA_NET_NS_FD,
+ IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
+ IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
+#define IFLA_PROMISCUITY IFLA_PROMISCUITY
+ IFLA_NUM_TX_QUEUES,
+ IFLA_NUM_RX_QUEUES,
__IFLA_MAX
};
@@ -246,6 +251,7 @@ struct ifla_vlan_qos_mapping {
enum {
IFLA_MACVLAN_UNSPEC,
IFLA_MACVLAN_MODE,
+ IFLA_MACVLAN_FLAGS,
__IFLA_MACVLAN_MAX,
};
@@ -258,6 +264,8 @@ enum macvlan_mode {
MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
};
+#define MACVLAN_FLAG_NOPROMISC 1
+
/* SR-IOV virtual function management section */
enum {
@@ -273,6 +281,7 @@ enum {
IFLA_VF_MAC, /* Hardware queue specific attributes */
IFLA_VF_VLAN,
IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
+ IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
__IFLA_VF_MAX,
};
@@ -294,13 +303,22 @@ struct ifla_vf_tx_rate {
__u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
};
+struct ifla_vf_spoofchk {
+ __u32 vf;
+ __u32 setting;
+};
+#ifdef __KERNEL__
+
+/* We don't want this structure exposed to user space */
struct ifla_vf_info {
__u32 vf;
__u8 mac[32];
__u32 vlan;
__u32 qos;
__u32 tx_rate;
+ __u32 spoofchk;
};
+#endif
/* VF ports management section
*
diff --git a/include/netlink-types.h b/include/netlink-types.h
index e885571..c7f9c4c 100644
--- a/include/netlink-types.h
+++ b/include/netlink-types.h
@@ -173,6 +173,7 @@ struct rtnl_link
void * l_af_data[AF_MAX];
void * l_info;
char * l_ifalias;
+ uint32_t l_promiscuity;
};
struct rtnl_ncacheinfo
diff --git a/include/netlink/route/link.h b/include/netlink/route/link.h
index 42ef7c8..c5824bc 100644
--- a/include/netlink/route/link.h
+++ b/include/netlink/route/link.h
@@ -6,7 +6,7 @@
* License as published by the Free Software Foundation version 2.1
* of the License.
*
- * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch>
+ * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch>
*/
#ifndef NETLINK_LINK_H_
@@ -197,6 +197,9 @@ extern int rtnl_link_set_stat(struct rtnl_link *, rtnl_link_stat_id_t,
extern int rtnl_link_set_type(struct rtnl_link *, const char *);
extern char * rtnl_link_get_type(struct rtnl_link *);
+extern void rtnl_link_set_promiscuity(struct rtnl_link *, uint32_t);
+extern uint32_t rtnl_link_get_promiscuity(struct rtnl_link *);
+
extern int rtnl_link_enslave_ifindex(struct nl_sock *, int, int);
extern int rtnl_link_enslave(struct nl_sock *, struct rtnl_link *,
struct rtnl_link *);