Lines Matching refs:skb

61 static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)  in vlan_eth_hdr()  argument
63 return (struct vlan_ethhdr *)skb_mac_header(skb); in vlan_eth_hdr()
189 extern bool vlan_do_receive(struct sk_buff **skb);
238 static inline bool vlan_do_receive(struct sk_buff **skb) in vlan_do_receive() argument
295 static inline int __vlan_insert_tag(struct sk_buff *skb, in __vlan_insert_tag() argument
300 if (skb_cow_head(skb, VLAN_HLEN) < 0) in __vlan_insert_tag()
303 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); in __vlan_insert_tag()
306 memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN); in __vlan_insert_tag()
307 skb->mac_header -= VLAN_HLEN; in __vlan_insert_tag()
332 static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, in vlan_insert_tag() argument
337 err = __vlan_insert_tag(skb, vlan_proto, vlan_tci); in vlan_insert_tag()
339 dev_kfree_skb_any(skb); in vlan_insert_tag()
342 return skb; in vlan_insert_tag()
357 static inline struct sk_buff *vlan_insert_tag_set_proto(struct sk_buff *skb, in vlan_insert_tag_set_proto() argument
361 skb = vlan_insert_tag(skb, vlan_proto, vlan_tci); in vlan_insert_tag_set_proto()
362 if (skb) in vlan_insert_tag_set_proto()
363 skb->protocol = vlan_proto; in vlan_insert_tag_set_proto()
364 return skb; in vlan_insert_tag_set_proto()
376 static inline struct sk_buff *__vlan_hwaccel_push_inside(struct sk_buff *skb) in __vlan_hwaccel_push_inside() argument
378 skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto, in __vlan_hwaccel_push_inside()
379 skb_vlan_tag_get(skb)); in __vlan_hwaccel_push_inside()
380 if (likely(skb)) in __vlan_hwaccel_push_inside()
381 skb->vlan_tci = 0; in __vlan_hwaccel_push_inside()
382 return skb; in __vlan_hwaccel_push_inside()
394 static inline struct sk_buff *vlan_hwaccel_push_inside(struct sk_buff *skb) in vlan_hwaccel_push_inside() argument
396 if (skb_vlan_tag_present(skb)) in vlan_hwaccel_push_inside()
397 skb = __vlan_hwaccel_push_inside(skb); in vlan_hwaccel_push_inside()
398 return skb; in vlan_hwaccel_push_inside()
409 static inline void __vlan_hwaccel_put_tag(struct sk_buff *skb, in __vlan_hwaccel_put_tag() argument
412 skb->vlan_proto = vlan_proto; in __vlan_hwaccel_put_tag()
413 skb->vlan_tci = VLAN_TAG_PRESENT | vlan_tci; in __vlan_hwaccel_put_tag()
423 static inline int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) in __vlan_get_tag() argument
425 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; in __vlan_get_tag()
442 static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, in __vlan_hwaccel_get_tag() argument
445 if (skb_vlan_tag_present(skb)) { in __vlan_hwaccel_get_tag()
446 *vlan_tci = skb_vlan_tag_get(skb); in __vlan_hwaccel_get_tag()
463 static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) in vlan_get_tag() argument
465 if (skb->dev->features & NETIF_F_HW_VLAN_CTAG_TX) { in vlan_get_tag()
466 return __vlan_hwaccel_get_tag(skb, vlan_tci); in vlan_get_tag()
468 return __vlan_get_tag(skb, vlan_tci); in vlan_get_tag()
481 static inline __be16 __vlan_get_protocol(struct sk_buff *skb, __be16 type, in __vlan_get_protocol() argument
484 unsigned int vlan_depth = skb->mac_len; in __vlan_get_protocol()
501 if (unlikely(!pskb_may_pull(skb, in __vlan_get_protocol()
505 vh = (struct vlan_hdr *)(skb->data + vlan_depth); in __vlan_get_protocol()
525 static inline __be16 vlan_get_protocol(struct sk_buff *skb) in vlan_get_protocol() argument
527 return __vlan_get_protocol(skb, skb->protocol, NULL); in vlan_get_protocol()
530 static inline void vlan_set_encap_proto(struct sk_buff *skb, in vlan_set_encap_proto() argument
543 skb->protocol = proto; in vlan_set_encap_proto()
556 skb->protocol = htons(ETH_P_802_3); in vlan_set_encap_proto()
561 skb->protocol = htons(ETH_P_802_2); in vlan_set_encap_proto()
571 static inline bool skb_vlan_tagged(const struct sk_buff *skb) in skb_vlan_tagged() argument
573 if (!skb_vlan_tag_present(skb) && in skb_vlan_tagged()
574 likely(skb->protocol != htons(ETH_P_8021Q) && in skb_vlan_tagged()
575 skb->protocol != htons(ETH_P_8021AD))) in skb_vlan_tagged()
588 static inline bool skb_vlan_tagged_multi(const struct sk_buff *skb) in skb_vlan_tagged_multi() argument
590 __be16 protocol = skb->protocol; in skb_vlan_tagged_multi()
592 if (!skb_vlan_tag_present(skb)) { in skb_vlan_tagged_multi()
599 veh = (struct vlan_ethhdr *)skb->data; in skb_vlan_tagged_multi()
616 static inline netdev_features_t vlan_features_check(const struct sk_buff *skb, in vlan_features_check() argument
619 if (skb_vlan_tagged_multi(skb)) in vlan_features_check()