Getting details about an 802.1q VLAN interface from userspace
Subsystems (2)
Dave,
As stated below, I'm looking for a way to get specifics about an 802.1q VLAN interface from userspace. Currently, I listen to NEWLINK messages over a netlink socket and classify the different types of interfaces. I identify these VLAN devices by their name (e.g. "eth0.10", admittedly not a good idea since the vlan netdev name formats can vary) and existence in /proc/net/vlan/config. This seems kind of gross.
Is there a better way to get this information via netlink or some ioctl()? Would it be useful if I (or someone) added an ioctl() type to get information about a VLAN interface? (vlan, ifindex of trunking (real_dev) interface, priority maps; basically the content of struct vlan_dev_info)
Thanks,
William
----- Forwarded message from Ben Greear <[email protected]> -----
Date: Thu, 13 Feb 2003 14:09:41 -0800
From: Ben Greear <[email protected]>
To: Will Jhun <[email protected]>
Subject: Re: Determining if a new interface is an 802.1q VLAN interface
Quoted 10 lines · Will Jhun
Ben,
I have a program that listens for netlink NEWLINK updates and keeps track of interfaces in a system. I need to know if a new interface is an 802.1q VLAN interface and also what its trunking interface and vlan are. Right now, I'm just deducing these from the netdevice name and
/proc/net/vlan/config, since it looks like the netdev'spriv_flagsis never exported to userspace, either byioctl()or via netlink.Is there a better way to do this?
The flag that determines if an interface can handle VLAN is not currently exported to user-space through any ioctl that I know of. Maybe we could talk DaveM into adding such an ioctl?
The code would be simple enough if you could get Dave to accept it.
Please ask Dave, and CC me. (I didn't want to forward your email w/out permission...)
Ben
Quoted 4 lines
Thanks,
William
Signature · 7 lines
Ben Greear <[email protected]> <Ben_Greear AT excite.com> President of Candela Technologies Inc http://www.candelatech.com ScryMUD: http://scry.wanfear.com http://scry.wanfear.com/~greear ----- End forwarded message -----
From: Will Jhun <[email protected]>
Date: Thu, 13 Feb 2003 14:39:21 -0800
Is there a better way to get this information via netlink or some ioctl()? Would it be useful if I (or someone) added an ioctl() type to get information about a VLAN interface? (vlan, ifindex of trunking (real_dev) interface, priority maps; basically the content of struct vlan_dev_info)
I would accept new netlink interfaces to get and set this information. ioctls are gross and will not be tolerated :)
I think these should be new attributes to RTM_*LINK. No need to define a new message.
cheers,
jamal
Quoted 14 lines · David S. Miller
From: Will Jhun <[email protected]>
Date: Thu, 13 Feb 2003 14:39:21 -0800Is there a better way to get this information via netlink or some
ioctl()? Would it be useful if I (or someone) added anioctl()type to get information about a VLAN interface? (vlan, ifindex of trunking (real_dev) interface, priority maps; basically the content of structvlan_dev_info)I would accept new netlink interfaces to get and set this information. ioctls are gross and will not be tolerated :)
From: jamal <[email protected]>
Date: Tue, 18 Feb 2003 21:48:34 -0500 (EST)
I think these should be new attributes to RTM_*LINK. No need to define a new message.
I had overlooked this, you're certainly right.