vlan.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #ifndef __BEN_VLAN_802_1Q_INC__
  2. #define __BEN_VLAN_802_1Q_INC__
  3. #include <linux/if_vlan.h>
  4. /* Uncomment this if you want debug traces to be shown. */
  5. /* #define VLAN_DEBUG */
  6. #define VLAN_ERR KERN_ERR
  7. #define VLAN_INF KERN_INFO
  8. #define VLAN_DBG KERN_ALERT /* change these... to debug, having a hard time
  9. * changing the log level at run-time..for some reason.
  10. */
  11. /*
  12. These I use for memory debugging. I feared a leak at one time, but
  13. I never found it..and the problem seems to have dissappeared. Still,
  14. I'll bet they might prove useful again... --Ben
  15. #define VLAN_MEM_DBG(x, y, z) printk(VLAN_DBG "%s: " x, __FUNCTION__, y, z);
  16. #define VLAN_FMEM_DBG(x, y) printk(VLAN_DBG "%s: " x, __FUNCTION__, y);
  17. */
  18. /* This way they don't do anything! */
  19. #define VLAN_MEM_DBG(x, y, z)
  20. #define VLAN_FMEM_DBG(x, y)
  21. extern unsigned short vlan_name_type;
  22. #define VLAN_GRP_HASH_SHIFT 5
  23. #define VLAN_GRP_HASH_SIZE (1 << VLAN_GRP_HASH_SHIFT)
  24. #define VLAN_GRP_HASH_MASK (VLAN_GRP_HASH_SIZE - 1)
  25. /* Find a VLAN device by the MAC address of its Ethernet device, and
  26. * it's VLAN ID. The default configuration is to have VLAN's scope
  27. * to be box-wide, so the MAC will be ignored. The mac will only be
  28. * looked at if we are configured to have a separate set of VLANs per
  29. * each MAC addressable interface. Note that this latter option does
  30. * NOT follow the spec for VLANs, but may be useful for doing very
  31. * large quantities of VLAN MUX/DEMUX onto FrameRelay or ATM PVCs.
  32. *
  33. * Must be invoked with rcu_read_lock (ie preempt disabled)
  34. * or with RTNL.
  35. */
  36. struct net_device *__find_vlan_dev(struct net_device* real_dev,
  37. unsigned short VID); /* vlan.c */
  38. /* found in vlan_dev.c */
  39. int vlan_dev_rebuild_header(struct sk_buff *skb);
  40. int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
  41. struct packet_type *ptype, struct net_device *orig_dev);
  42. int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
  43. unsigned short type, const void *daddr,
  44. const void *saddr, unsigned len);
  45. int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
  46. int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
  47. int vlan_dev_change_mtu(struct net_device *dev, int new_mtu);
  48. int vlan_dev_open(struct net_device* dev);
  49. int vlan_dev_stop(struct net_device* dev);
  50. int vlan_set_mac_address(struct net_device *dev, void *p);
  51. int vlan_dev_ioctl(struct net_device* dev, struct ifreq *ifr, int cmd);
  52. void vlan_dev_set_ingress_priority(const struct net_device *dev,
  53. u32 skb_prio, short vlan_prio);
  54. int vlan_dev_set_egress_priority(const struct net_device *dev,
  55. u32 skb_prio, short vlan_prio);
  56. int vlan_dev_set_vlan_flag(const struct net_device *dev,
  57. u32 flag, short flag_val);
  58. void vlan_dev_get_realdev_name(const struct net_device *dev, char *result);
  59. void vlan_dev_get_vid(const struct net_device *dev, unsigned short *result);
  60. void vlan_change_rx_flags(struct net_device *dev, int change);
  61. void vlan_dev_set_multicast_list(struct net_device *vlan_dev);
  62. int vlan_check_real_dev(struct net_device *real_dev, unsigned short vlan_id);
  63. void vlan_setup(struct net_device *dev);
  64. int register_vlan_dev(struct net_device *dev);
  65. int unregister_vlan_device(struct net_device *dev);
  66. int vlan_netlink_init(void);
  67. void vlan_netlink_fini(void);
  68. extern struct rtnl_link_ops vlan_link_ops;
  69. #endif /* !(__BEN_VLAN_802_1Q_INC__) */