Re: Question relating to VLAN 802.1Q implementation.

Ben Greear (greear@cyberhighway.net)
Sun, 20 Dec 1998 13:28:47 -0700


Alan Cox wrote:
>
> > First: There is a device struct found in <linux/netdevice.h>. It has
> > a type field. After some grep'ing though the code, I think that this
> > field must correspond to the values defined in <linux/if_arp.h>. Is
> > this true? (Has anyone suggested moving a bunch of the #defines to
> > enums??)
>
> Why - a lot of them are constants with fixed values and value ranges,
> a #define si clearer. also libc5 exposes them as #defines to user
> space as bsd does

If type was an enum, then I could grep the code to find where the enum
is defined. That makes it crystal clear what values are valid or not.

If it's a #define, and I'm new to the code, and there are no comments
telling me what the 'type' represents, then it is much harder for me to
figure out what it really means.

After delving into it farther, it looks like type may be overloaded
in a thousand different ways, so in this case #defines are probably
the way to go.

>
> > If so, I think I need to add one to handle the VLAN type of device. Do
> > I
> > just get to pick my favorite un-used number, or are they defined in some
> > standard somewhere?
>
> If 802.1Q uses a blue book ID use that if not use th enext free value
> below 1500

The protocol-id for 802.1Q VLAN's is: 0x8100. The stack is starting
to make a wee bit more sense now, think I know what to do with it!

Thanks,
Ben

>
> Alan

-- 
Ben Greear (greear@cyberhighway.net)  http://www.primenet.com/~greear 
Author of ScryMUD:  mud.primenet.com 4444
http://www.primenet.com/~greear/ScryMUD/scry.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/