Re: Netlink and 802.1q VLANs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 11, 2010 at 3:26 PM, Marcin Kucharczyk <marcin@xxxxxxxxxxxxx> wrote:
>
> Hi,
>
> is there any way to get information about VLAN ID using netlink? When I add
> VLAN interface using vconfig I get RTM_NEWLINK message but there isn't any
> attribute about VLAN ID.

Marcin,

I hope you found an answer to your question by now, as it's been quite
a while, but I thought I'd take a shot at answering it anyway.   For
future questions of this type, you might consider asking on
linux-netdev which has a lot more activity than this list.

There is in fact a VLAN ID attribute in the RTM_NEWLINK message, but
you have to go digging for it a bit.  VLAN devices will have a
LINKINFO attribute as part of NEWLINK, which is a nested attribute
that will contain INFO_KIND and INFO_DATA attributes.  INFO_KIND is a
string, which for 802.1q VLANs will be "vlan".  INFO_DATA is another
nested attribute, who's contents depend on INFO_KIND.  For VLAN
devices, INFO_DATA will contain a VLAN_ID attribute.

Here's a link to some code I wrote for the Open-FCoE project that
parses RTM_NEWLINK messages and does some special handling for VLAN
devices.
http://www.open-fcoe.org/openfc/gitweb/?p=openfc/fcoe-utils.git;a=blob;f=fipvlan.c;h=f802cd877fd0adca65af8d9f8f68d207b1094ebf;hb=HEAD#l305

- Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux