This is patch for include/linux/if_vlan.h .  Its 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 fields and sizes of things.
This patch exposes the defines related to the sizes of VLAN packets and
their fields along with the vlan_ethhdr structure.  The sizes are useful
since they let the user space program know how much space is really
needed to receive VLAN packets.
-Dave Acker

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

----

*** if_vlan.h.orig      2006-03-19 21:11:01.000000000 -0500
--- if_vlan.h   2006-03-19 21:14:32.000000000 -0500
***************
*** 13,31 ****
  #ifndef _LINUX_IF_VLAN_H_
  #define _LINUX_IF_VLAN_H_

- #ifdef __KERNEL__
-
- /* externally defined structs */
- struct vlan_group;
- struct net_device;
- struct packet_type;
- struct vlan_collection;
- struct vlan_dev_info;
- struct hlist_node;
-
- #include <linux/proc_fs.h> /* for proc_dir_entry */
- #include <linux/netdevice.h>
-
  #define VLAN_HLEN     4               /* The additional bytes (on top of the 
Ethernet header)
                                         * that VLAN requires.
                                         */
--- 13,18 ----
***************
*** 47,52 ****
--- 34,51 ----
     unsigned short     h_vlan_encapsulated_proto; /* packet type ID field (or 
len) */
  };

+ #ifdef __KERNEL__
+
+ /* externally defined structs */
+ struct vlan_group;
+ struct net_device;
+ struct packet_type;
+ struct vlan_collection;
+ struct vlan_dev_info;
+ struct hlist_node;
+
+ #include <linux/proc_fs.h> /* for proc_dir_entry */
+ #include <linux/netdevice.h>
  #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