netfilter_ipv6.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* IPv6-specific defines for netfilter.
  2. * (C)1998 Rusty Russell -- This code is GPL.
  3. * (C)1999 David Jeffery
  4. * this header was blatantly ripped from netfilter_ipv4.h
  5. * it's amazing what adding a bunch of 6s can do =8^)
  6. */
  7. #ifndef __LINUX_IP6_NETFILTER_H
  8. #define __LINUX_IP6_NETFILTER_H
  9. #include <uapi/linux/netfilter_ipv6.h>
  10. /* Extra routing may needed on local out, as the QUEUE target never returns
  11. * control to the table.
  12. */
  13. struct ip6_rt_info {
  14. struct in6_addr daddr;
  15. struct in6_addr saddr;
  16. u_int32_t mark;
  17. };
  18. struct nf_queue_entry;
  19. /*
  20. * Hook functions for ipv6 to allow xt_* modules to be built-in even
  21. * if IPv6 is a module.
  22. */
  23. struct nf_ipv6_ops {
  24. int (*chk_addr)(struct net *net, const struct in6_addr *addr,
  25. const struct net_device *dev, int strict);
  26. void (*route_input)(struct sk_buff *skb);
  27. int (*fragment)(struct net *net, struct sock *sk, struct sk_buff *skb,
  28. int (*output)(struct net *, struct sock *, struct sk_buff *));
  29. int (*route)(struct net *net, struct dst_entry **dst, struct flowi *fl,
  30. bool strict);
  31. int (*reroute)(struct sk_buff *skb, const struct nf_queue_entry *entry);
  32. };
  33. #ifdef CONFIG_NETFILTER
  34. int ip6_route_me_harder(struct net *net, struct sk_buff *skb);
  35. __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
  36. unsigned int dataoff, u_int8_t protocol);
  37. int ipv6_netfilter_init(void);
  38. void ipv6_netfilter_fini(void);
  39. extern const struct nf_ipv6_ops __rcu *nf_ipv6_ops;
  40. static inline const struct nf_ipv6_ops *nf_get_ipv6_ops(void)
  41. {
  42. return rcu_dereference(nf_ipv6_ops);
  43. }
  44. #else /* CONFIG_NETFILTER */
  45. static inline int ipv6_netfilter_init(void) { return 0; }
  46. static inline void ipv6_netfilter_fini(void) { return; }
  47. static inline const struct nf_ipv6_ops *nf_get_ipv6_ops(void) { return NULL; }
  48. #endif /* CONFIG_NETFILTER */
  49. #endif /*__LINUX_IP6_NETFILTER_H*/