fib_rules.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef __LINUX_FIB_RULES_H
  2. #define __LINUX_FIB_RULES_H
  3. #include <linux/types.h>
  4. #include <linux/rtnetlink.h>
  5. /* rule is permanent, and cannot be deleted */
  6. #define FIB_RULE_PERMANENT 0x00000001
  7. #define FIB_RULE_INVERT 0x00000002
  8. #define FIB_RULE_UNRESOLVED 0x00000004
  9. #define FIB_RULE_IIF_DETACHED 0x00000008
  10. #define FIB_RULE_DEV_DETACHED FIB_RULE_IIF_DETACHED
  11. #define FIB_RULE_OIF_DETACHED 0x00000010
  12. /* try to find source address in routing lookups */
  13. #define FIB_RULE_FIND_SADDR 0x00010000
  14. struct fib_rule_hdr {
  15. __u8 family;
  16. __u8 dst_len;
  17. __u8 src_len;
  18. __u8 tos;
  19. __u8 table;
  20. __u8 res1; /* reserved */
  21. __u8 res2; /* reserved */
  22. __u8 action;
  23. __u32 flags;
  24. };
  25. enum {
  26. FRA_UNSPEC,
  27. FRA_DST, /* destination address */
  28. FRA_SRC, /* source address */
  29. FRA_IIFNAME, /* interface name */
  30. #define FRA_IFNAME FRA_IIFNAME
  31. FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */
  32. FRA_UNUSED2,
  33. FRA_PRIORITY, /* priority/preference */
  34. FRA_UNUSED3,
  35. FRA_UNUSED4,
  36. FRA_UNUSED5,
  37. FRA_FWMARK, /* mark */
  38. FRA_FLOW, /* flow/class id */
  39. FRA_TUN_ID,
  40. FRA_SUPPRESS_IFGROUP,
  41. FRA_SUPPRESS_PREFIXLEN,
  42. FRA_TABLE, /* Extended table id */
  43. FRA_FWMASK, /* mask for netfilter mark */
  44. FRA_OIFNAME,
  45. __FRA_MAX
  46. };
  47. #define FRA_MAX (__FRA_MAX - 1)
  48. enum {
  49. FR_ACT_UNSPEC,
  50. FR_ACT_TO_TBL, /* Pass to fixed table */
  51. FR_ACT_GOTO, /* Jump to another rule */
  52. FR_ACT_NOP, /* No operation */
  53. FR_ACT_RES3,
  54. FR_ACT_RES4,
  55. FR_ACT_BLACKHOLE, /* Drop without notification */
  56. FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */
  57. FR_ACT_PROHIBIT, /* Drop with EACCES */
  58. FR_ACT_RES9,
  59. FR_ACT_RES10,
  60. FR_ACT_RES11,
  61. FR_ACT_POLICY_FAILED, /* Drop with EACCES */
  62. __FR_ACT_MAX,
  63. };
  64. #define FR_ACT_FAILED_POLICY FR_ACT_POLICY_FAILED
  65. #define FR_ACT_MAX (__FR_ACT_MAX - 1)
  66. #endif