From Dave Acker <[EMAIL PROTECTED]>

The purpose is to allow a user space program to use the vlan_ethhdr
structure when directly handling 802.1Q packets.  This can be done
by using a raw socket like:
int s = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
This socket should see VLAN packets from the base interface unchanged
(i.e. vlan tag still in packet).
Currently other user space programs that understand VLANs seem to all
create their own definitions for this structure.
This patch does NOT expose the defines related to the sizes of VLAN packets and
their fields; it only exposes the vlan_ethhdr structure.  It was determined
that these sizes are not useful since the packet could be as large the MTU
of the underlying physical network.  Also, you can have nested VLAN headers
such that the actual data offset is greater than the size of the vlan_ethhdr
structure.
-Dave Acker

Signed-off-by: David Acker <[EMAIL PROTECTED]>

----

This is a third attempt at a patch for include/linux/if_vlan.h .
I am sorry I got the diff wrong on the previous posts; I am a bit new
to linux kernel contributions.  This time I believe I fixed the patch
format to match the linux kernel doc.  Thus, it is taken from above
the tree instead of deep within.


--- linux-2.6.15.6/include/linux/if_vlan.h.orig 2006-04-07 13:53:53.000000000 
-0400
+++ linux-2.6.15.6/include/linux/if_vlan.h      2006-04-07 14:51:18.000000000 
-0400
@@ -13,6 +13,14 @@
 #ifndef _LINUX_IF_VLAN_H_
 #define _LINUX_IF_VLAN_H_

+struct vlan_ethhdr {
+   unsigned char       h_dest[ETH_ALEN];          /* destination eth addr      
*/
+   unsigned char       h_source[ETH_ALEN];        /* source ether addr */
+   __be16               h_vlan_proto;              /* Should always be 0x8100 
*/
+   __be16               h_vlan_TCI;                /* Encapsulates priority 
and VLAN ID */
+   unsigned short      h_vlan_encapsulated_proto; /* packet type ID field (or 
len) */
+};
+
 #ifdef __KERNEL__

 /* externally defined structs */
@@ -39,14 +47,6 @@ struct hlist_node;
 #define VLAN_ETH_DATA_LEN      1500    /* Max. octets in payload        */
 #define VLAN_ETH_FRAME_LEN     1518    /* Max. octets in frame sans FCS */

-struct vlan_ethhdr {
-   unsigned char       h_dest[ETH_ALEN];          /* destination eth addr      
*/
-   unsigned char       h_source[ETH_ALEN];        /* source ether addr */
-   __be16               h_vlan_proto;              /* Should always be 0x8100 
*/
-   __be16               h_vlan_TCI;                /* Encapsulates priority 
and VLAN ID */
-   unsigned short      h_vlan_encapsulated_proto; /* packet type ID field (or 
len) */
-};
-
 #include <linux/skbuff.h>

 static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to