fib_rules.h 1.3 KB

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