diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-09-23 00:28:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-23 00:28:11 -0400 |
commit | 0b815a1a6d43ab498674b8430c8c35ab08487a16 (patch) | |
tree | 18ea2e50f36c1d38127c535f619e80209bfc4e07 /include | |
parent | 83bfba5fca16d040bb78a24148da844db3de6a76 (diff) |
net: network device name ifalias support
This patch add support for keeping an additional character alias
associated with an network interface. This is useful for maintaining
the SNMP ifAlias value which is a user defined value. Routers use this
to hold information like which circuit or line it is connected to. It
is just an arbitrary text label on the network device.
There are two exposed interfaces with this patch, the value can be
read/written either via netlink or sysfs.
This could be maintained just by the snmp daemon, but it is more
generally useful for other management tools, and the kernel is good
place to act as an agreed upon interface to store it.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/if.h | 1 | ||||
-rw-r--r-- | include/linux/if_link.h | 1 | ||||
-rw-r--r-- | include/linux/netdevice.h | 3 |
3 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/if.h b/include/linux/if.h index 5c9d1fa93fef..65246846c844 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/compiler.h> /* for "__user" et al */ | 24 | #include <linux/compiler.h> /* for "__user" et al */ |
25 | 25 | ||
26 | #define IFNAMSIZ 16 | 26 | #define IFNAMSIZ 16 |
27 | #define IFALIASZ 256 | ||
27 | #include <linux/hdlc/ioctl.h> | 28 | #include <linux/hdlc/ioctl.h> |
28 | 29 | ||
29 | /* Standard interface flags (netdevice->flags). */ | 30 | /* Standard interface flags (netdevice->flags). */ |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index 84c3492ae5cb..f9032c88716a 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -79,6 +79,7 @@ enum | |||
79 | IFLA_LINKINFO, | 79 | IFLA_LINKINFO, |
80 | #define IFLA_LINKINFO IFLA_LINKINFO | 80 | #define IFLA_LINKINFO IFLA_LINKINFO |
81 | IFLA_NET_NS_PID, | 81 | IFLA_NET_NS_PID, |
82 | IFLA_IFALIAS, | ||
82 | __IFLA_MAX | 83 | __IFLA_MAX |
83 | }; | 84 | }; |
84 | 85 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 488c56e649b5..d675df08b946 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -471,6 +471,8 @@ struct net_device | |||
471 | char name[IFNAMSIZ]; | 471 | char name[IFNAMSIZ]; |
472 | /* device name hash chain */ | 472 | /* device name hash chain */ |
473 | struct hlist_node name_hlist; | 473 | struct hlist_node name_hlist; |
474 | /* snmp alias */ | ||
475 | char *ifalias; | ||
474 | 476 | ||
475 | /* | 477 | /* |
476 | * I/O specific fields | 478 | * I/O specific fields |
@@ -1224,6 +1226,7 @@ extern int dev_ethtool(struct net *net, struct ifreq *); | |||
1224 | extern unsigned dev_get_flags(const struct net_device *); | 1226 | extern unsigned dev_get_flags(const struct net_device *); |
1225 | extern int dev_change_flags(struct net_device *, unsigned); | 1227 | extern int dev_change_flags(struct net_device *, unsigned); |
1226 | extern int dev_change_name(struct net_device *, char *); | 1228 | extern int dev_change_name(struct net_device *, char *); |
1229 | extern int dev_set_alias(struct net_device *, const char *, size_t); | ||
1227 | extern int dev_change_net_namespace(struct net_device *, | 1230 | extern int dev_change_net_namespace(struct net_device *, |
1228 | struct net *, const char *); | 1231 | struct net *, const char *); |
1229 | extern int dev_set_mtu(struct net_device *, int); | 1232 | extern int dev_set_mtu(struct net_device *, int); |