netfilter_ipv6.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef __LINUX_IP6_NETFILTER_H
  2. #define __LINUX_IP6_NETFILTER_H
  3. /* IPv6-specific defines for netfilter.
  4. * (C)1998 Rusty Russell -- This code is GPL.
  5. * (C)1999 David Jeffery
  6. * this header was blatantly ripped from netfilter_ipv4.h
  7. * it's amazing what adding a bunch of 6s can do =8^)
  8. */
  9. #include <linux/netfilter.h>
  10. /* only for userspace compatibility */
  11. #ifndef __KERNEL__
  12. /* IP Cache bits. */
  13. /* Src IP address. */
  14. #define NFC_IP6_SRC 0x0001
  15. /* Dest IP address. */
  16. #define NFC_IP6_DST 0x0002
  17. /* Input device. */
  18. #define NFC_IP6_IF_IN 0x0004
  19. /* Output device. */
  20. #define NFC_IP6_IF_OUT 0x0008
  21. /* TOS. */
  22. #define NFC_IP6_TOS 0x0010
  23. /* Protocol. */
  24. #define NFC_IP6_PROTO 0x0020
  25. /* IP options. */
  26. #define NFC_IP6_OPTIONS 0x0040
  27. /* Frag & flags. */
  28. #define NFC_IP6_FRAG 0x0080
  29. /* Per-protocol information: only matters if proto match. */
  30. /* TCP flags. */
  31. #define NFC_IP6_TCPFLAGS 0x0100
  32. /* Source port. */
  33. #define NFC_IP6_SRC_PT 0x0200
  34. /* Dest port. */
  35. #define NFC_IP6_DST_PT 0x0400
  36. /* Something else about the proto */
  37. #define NFC_IP6_PROTO_UNKNOWN 0x2000
  38. #endif /* ! __KERNEL__ */
  39. /* IP6 Hooks */
  40. /* After promisc drops, checksum checks. */
  41. #define NF_IP6_PRE_ROUTING 0
  42. /* If the packet is destined for this box. */
  43. #define NF_IP6_LOCAL_IN 1
  44. /* If the packet is destined for another interface. */
  45. #define NF_IP6_FORWARD 2
  46. /* Packets coming from a local process. */
  47. #define NF_IP6_LOCAL_OUT 3
  48. /* Packets about to hit the wire. */
  49. #define NF_IP6_POST_ROUTING 4
  50. #define NF_IP6_NUMHOOKS 5
  51. enum nf_ip6_hook_priorities {
  52. NF_IP6_PRI_FIRST = INT_MIN,
  53. NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
  54. NF_IP6_PRI_SELINUX_FIRST = -225,
  55. NF_IP6_PRI_CONNTRACK = -200,
  56. NF_IP6_PRI_MANGLE = -150,
  57. NF_IP6_PRI_NAT_DST = -100,
  58. NF_IP6_PRI_FILTER = 0,
  59. NF_IP6_PRI_NAT_SRC = 100,
  60. NF_IP6_PRI_SELINUX_LAST = 225,
  61. NF_IP6_PRI_LAST = INT_MAX,
  62. };
  63. #ifdef CONFIG_NETFILTER
  64. extern int ip6_route_me_harder(struct sk_buff *skb);
  65. extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
  66. unsigned int dataoff, u_int8_t protocol);
  67. extern int ipv6_netfilter_init(void);
  68. extern void ipv6_netfilter_fini(void);
  69. #else /* CONFIG_NETFILTER */
  70. static inline int ipv6_netfilter_init(void) { return 0; }
  71. static inline void ipv6_netfilter_fini(void) { return; }
  72. #endif /* CONFIG_NETFILTER */
  73. #endif /*__LINUX_IP6_NETFILTER_H*/