X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetdev-provider.h;h=e013e2026fc83bb8bf9e9065b715994f7fdaa1be;hb=9ab3d9a3c24ee7132d85f5874f35ea5cb98b1588;hp=3bc7fd4448be0e3f324b76f78c5efbdd004c913a;hpb=d65349ea28bb67a0062a9b4b60ff97538206373b;p=sliver-openvswitch.git diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h index 3bc7fd444..e013e2026 100644 --- a/lib/netdev-provider.h +++ b/lib/netdev-provider.h @@ -164,6 +164,16 @@ struct netdev_class { * bytes for Ethernet devices.*/ int (*get_mtu)(const struct netdev *, int *mtup); + /* Returns the ifindex of 'netdev', if successful, as a positive number. + * On failure, returns a negative errno value. + * + * The desired semantics of the ifindex value are a combination of those + * specified by POSIX for if_nametoindex() and by SNMP for ifIndex. An + * ifindex value should be unique within a host and remain stable at least + * until reboot. SNMP says an ifindex "ranges between 1 and the value of + * ifNumber" but many systems do not follow this rule anyhow. */ + int (*get_ifindex)(const struct netdev *); + /* Sets 'carrier' to true if carrier is active (link light is on) on * 'netdev'. */ int (*get_carrier)(const struct netdev *netdev, bool *carrier);