vlan.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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, void *daddr, void *saddr,
  44. 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_set_mac_address(struct net_device *dev, void* addr);
  49. int vlan_dev_open(struct net_device* dev);
  50. int vlan_dev_stop(struct net_device* dev);
  51. int vlan_dev_ioctl(struct net_device* dev, struct ifreq *ifr, int cmd);
  52. int vlan_dev_set_ingress_priority(char* dev_name, __u32 skb_prio, short vlan_prio);
  53. int vlan_dev_set_egress_priority(char* dev_name, __u32 skb_prio, short vlan_prio);
  54. int vlan_dev_set_vlan_flag(char* dev_name, __u32 flag, short flag_val);
  55. int vlan_dev_get_realdev_name(const char* dev_name, char* result);
  56. int vlan_dev_get_vid(const char* dev_name, unsigned short* result);
  57. void vlan_dev_set_multicast_list(struct net_device *vlan_dev);
  58. #endif /* !(__BEN_VLAN_802_1Q_INC__) */