fib_rules.h 1.5 KB

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