fib_rules.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 1
  7. #define FIB_RULE_INVERT 2
  8. #define FIB_RULE_UNRESOLVED 4
  9. struct fib_rule_hdr
  10. {
  11. __u8 family;
  12. __u8 dst_len;
  13. __u8 src_len;
  14. __u8 tos;
  15. __u8 table;
  16. __u8 res1; /* reserved */
  17. __u8 res2; /* reserved */
  18. __u8 action;
  19. __u32 flags;
  20. };
  21. enum
  22. {
  23. FRA_UNSPEC,
  24. FRA_DST, /* destination address */
  25. FRA_SRC, /* source address */
  26. FRA_IFNAME, /* interface name */
  27. FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */
  28. FRA_UNUSED2,
  29. FRA_PRIORITY, /* priority/preference */
  30. FRA_UNUSED3,
  31. FRA_UNUSED4,
  32. FRA_UNUSED5,
  33. FRA_FWMARK, /* mark */
  34. FRA_FLOW, /* flow/class id */
  35. FRA_UNUSED6,
  36. FRA_UNUSED7,
  37. FRA_UNUSED8,
  38. FRA_TABLE, /* Extended table id */
  39. FRA_FWMASK, /* mask for netfilter mark */
  40. __FRA_MAX
  41. };
  42. #define FRA_MAX (__FRA_MAX - 1)
  43. enum
  44. {
  45. FR_ACT_UNSPEC,
  46. FR_ACT_TO_TBL, /* Pass to fixed table */
  47. FR_ACT_GOTO, /* Jump to another rule */
  48. FR_ACT_RES2,
  49. FR_ACT_RES3,
  50. FR_ACT_RES4,
  51. FR_ACT_BLACKHOLE, /* Drop without notification */
  52. FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */
  53. FR_ACT_PROHIBIT, /* Drop with EACCES */
  54. __FR_ACT_MAX,
  55. };
  56. #define FR_ACT_MAX (__FR_ACT_MAX - 1)
  57. #endif