logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

netfilter.h (1731B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef __LINUX_NETFILTER_H
  3. #define __LINUX_NETFILTER_H
  4. #include <linux/types.h>
  5. #include <linux/in.h>
  6. #include <linux/in6.h>
  7. /* Responses from hook functions. */
  8. #define NF_DROP 0
  9. #define NF_ACCEPT 1
  10. #define NF_STOLEN 2
  11. #define NF_QUEUE 3
  12. #define NF_REPEAT 4
  13. #define NF_STOP 5 /* Deprecated, for userspace nf_queue compatibility. */
  14. #define NF_MAX_VERDICT NF_STOP
  15. /* we overload the higher bits for encoding auxiliary data such as the queue
  16. * number or errno values. Not nice, but better than additional function
  17. * arguments. */
  18. #define NF_VERDICT_MASK 0x000000ff
  19. /* extra verdict flags have mask 0x0000ff00 */
  20. #define NF_VERDICT_FLAG_QUEUE_BYPASS 0x00008000
  21. /* queue number (NF_QUEUE) or errno (NF_DROP) */
  22. #define NF_VERDICT_QMASK 0xffff0000
  23. #define NF_VERDICT_QBITS 16
  24. #define NF_QUEUE_NR(x) ((((x) << 16) & NF_VERDICT_QMASK) | NF_QUEUE)
  25. #define NF_DROP_ERR(x) (((-x) << 16) | NF_DROP)
  26. /* only for userspace compatibility */
  27. /* NF_VERDICT_BITS should be 8 now, but userspace might break if this changes */
  28. #define NF_VERDICT_BITS 16
  29. enum nf_inet_hooks {
  30. NF_INET_PRE_ROUTING,
  31. NF_INET_LOCAL_IN,
  32. NF_INET_FORWARD,
  33. NF_INET_LOCAL_OUT,
  34. NF_INET_POST_ROUTING,
  35. NF_INET_NUMHOOKS,
  36. NF_INET_INGRESS = NF_INET_NUMHOOKS,
  37. };
  38. enum nf_dev_hooks {
  39. NF_NETDEV_INGRESS,
  40. NF_NETDEV_EGRESS,
  41. NF_NETDEV_NUMHOOKS
  42. };
  43. enum {
  44. NFPROTO_UNSPEC = 0,
  45. NFPROTO_INET = 1,
  46. NFPROTO_IPV4 = 2,
  47. NFPROTO_ARP = 3,
  48. NFPROTO_NETDEV = 5,
  49. NFPROTO_BRIDGE = 7,
  50. NFPROTO_IPV6 = 10,
  51. NFPROTO_DECNET = 12,
  52. NFPROTO_NUMPROTO,
  53. };
  54. union nf_inet_addr {
  55. __u32 all[4];
  56. __be32 ip;
  57. __be32 ip6[4];
  58. struct in_addr in;
  59. struct in6_addr in6;
  60. };
  61. #endif /* __LINUX_NETFILTER_H */