diff options
| author | Len Brown <len.brown@intel.com> | 2004-10-08 09:20:41 -0400 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2004-10-08 09:20:41 -0400 |
| commit | 790180f61be4244168732f33023e690ae0a8c512 (patch) | |
| tree | 284553900d177b1d84f1afd2c1c62ef8eccf4e63 /include/linux | |
| parent | f2493ff8e27a501063d270a2c6089295c77c73fc (diff) | |
| parent | 0363141540e337254680ff3c63d35292a49928d9 (diff) | |
Merge intel.com:/home/lenb/bk/26-latest-ref
into intel.com:/home/lenb/src/26-latest-dev
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/if_ether.h | 12 | ||||
| -rw-r--r-- | include/linux/if_tr.h | 9 | ||||
| -rw-r--r-- | include/linux/if_vlan.h | 10 | ||||
| -rw-r--r-- | include/linux/netfilter_bridge/ebt_802_3.h | 9 | ||||
| -rw-r--r-- | include/linux/skbuff.h | 1 |
5 files changed, 36 insertions, 5 deletions
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index d62b4dfd8305..4037aaab7aa9 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h @@ -96,11 +96,19 @@ * This is an Ethernet frame header. */ -struct ethhdr -{ +struct ethhdr { unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ unsigned char h_source[ETH_ALEN]; /* source ether addr */ unsigned short h_proto; /* packet type ID field */ } __attribute__((packed)); +#ifdef __KERNEL__ +#include <linux/skbuff.h> + +static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) +{ + return (struct ethhdr *)skb->mac.raw; +} +#endif + #endif /* _LINUX_IF_ETHER_H */ diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h index f7c97eeb95c8..4fd451f81ccb 100644 --- a/include/linux/if_tr.h +++ b/include/linux/if_tr.h @@ -48,6 +48,15 @@ struct trh_hdr { __u16 rseg[8]; /* routing registers */ }; +#ifdef __KERNEL__ +#include <linux/skbuff.h> + +static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb) +{ + return (struct trh_hdr *)skb->mac.raw; +} +#endif + /* This is an Token-Ring LLC structure */ struct trllc { __u8 dsap; /* destination SAP */ diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 529c401a9a86..29b6e104657e 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -18,7 +18,6 @@ /* externally defined structs */ struct vlan_group; struct net_device; -struct sk_buff; struct packet_type; struct vlan_collection; struct vlan_dev_info; @@ -48,6 +47,13 @@ struct vlan_ethhdr { 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) +{ + return (struct vlan_ethhdr *)skb->mac.raw; +} + struct vlan_hdr { unsigned short h_vlan_TCI; /* Encapsulates priority and VLAN ID */ unsigned short h_vlan_encapsulated_proto; /* packet type ID field (or len) */ @@ -180,7 +186,7 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, * This allows the VLAN to have a different MAC than the underlying * device, and still route correctly. */ - if (!memcmp(skb->mac.ethernet->h_dest, skb->dev->dev_addr, ETH_ALEN)) + if (!memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN)) skb->pkt_type = PACKET_HOST; break; }; diff --git a/include/linux/netfilter_bridge/ebt_802_3.h b/include/linux/netfilter_bridge/ebt_802_3.h index b3d6c3219075..b9f712c14a0a 100644 --- a/include/linux/netfilter_bridge/ebt_802_3.h +++ b/include/linux/netfilter_bridge/ebt_802_3.h @@ -49,6 +49,15 @@ struct ebt_802_3_hdr { } llc; }; +#ifdef __KERNEL__ +#include <linux/skbuff.h> + +static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb) +{ + return (struct ebt_802_3_hdr *)skb->mac.raw; +} +#endif + struct ebt_802_3_info { uint8_t sap; diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index b6c6ef59ab16..71fc2bdc0cd6 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -219,7 +219,6 @@ struct sk_buff { } nh; union { - struct ethhdr *ethernet; unsigned char *raw; } mac; |
