summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorVlad Dogaru <ddvlad@rosedu.org>2011-01-13 23:38:30 +0000
committerDavid S. Miller <davem@davemloft.net>2011-01-19 23:31:09 -0800
commitcbda10fa97d72c7a1923be4426171aa90e8c6dab (patch)
tree113206ef603189e9f91f075e154cbdc8e1ac3f40 /include/linux
parent441c793a56502638d45d5da2195056d686147370 (diff)
downloadop-kernel-dev-cbda10fa97d72c7a1923be4426171aa90e8c6dab.zip
op-kernel-dev-cbda10fa97d72c7a1923be4426171aa90e8c6dab.tar.gz
net_device: add support for network device groups
Net devices can now be grouped, enabling simpler manipulation from userspace. This patch adds a group field to the net_device structure, as well as rtnetlink support to query and modify it. Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org> Acked-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/if_link.h1
-rw-r--r--include/linux/netdevice.h7
2 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 6485d2a..f4a2e6b 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -135,6 +135,7 @@ enum {
IFLA_VF_PORTS,
IFLA_PORT_SELF,
IFLA_AF_SPEC,
+ IFLA_GROUP, /* Group the device belongs to */
__IFLA_MAX
};
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d971346..68a4627 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -75,6 +75,9 @@ struct wireless_dev;
#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */
#define NET_RX_DROP 1 /* packet dropped */
+/* Initial net device group. All devices belong to group 0 by default. */
+#define INIT_NETDEV_GROUP 0
+
/*
* Transmit return codes: transmit return codes originate from three different
* namespaces:
@@ -1153,6 +1156,9 @@ struct net_device {
/* phy device may attach itself for hardware timestamping */
struct phy_device *phydev;
+
+ /* group the device belongs to */
+ int group;
};
#define to_net_dev(d) container_of(d, struct net_device, dev)
@@ -1844,6 +1850,7 @@ extern int dev_set_alias(struct net_device *, const char *, size_t);
extern int dev_change_net_namespace(struct net_device *,
struct net *, const char *);
extern int dev_set_mtu(struct net_device *, int);
+extern void dev_set_group(struct net_device *, int);
extern int dev_set_mac_address(struct net_device *,
struct sockaddr *);
extern int dev_hard_start_xmit(struct sk_buff *skb,
OpenPOWER on IntegriCloud