syscall.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package nl
  2. // syscall package lack of rule attributes type.
  3. // Thus there are defined below
  4. const (
  5. FRA_UNSPEC = iota
  6. FRA_DST /* destination address */
  7. FRA_SRC /* source address */
  8. FRA_IIFNAME /* interface name */
  9. FRA_GOTO /* target to jump to (FR_ACT_GOTO) */
  10. FRA_UNUSED2
  11. FRA_PRIORITY /* priority/preference */
  12. FRA_UNUSED3
  13. FRA_UNUSED4
  14. FRA_UNUSED5
  15. FRA_FWMARK /* mark */
  16. FRA_FLOW /* flow/class id */
  17. FRA_TUN_ID
  18. FRA_SUPPRESS_IFGROUP
  19. FRA_SUPPRESS_PREFIXLEN
  20. FRA_TABLE /* Extended table id */
  21. FRA_FWMASK /* mask for netfilter mark */
  22. FRA_OIFNAME
  23. FRA_PAD
  24. FRA_L3MDEV /* iif or oif is l3mdev goto its table */
  25. FRA_UID_RANGE /* UID range */
  26. FRA_PROTOCOL /* Originator of the rule */
  27. FRA_IP_PROTO /* ip proto */
  28. FRA_SPORT_RANGE /* sport */
  29. FRA_DPORT_RANGE /* dport */
  30. )
  31. // ip rule netlink request types
  32. const (
  33. FR_ACT_UNSPEC = iota
  34. FR_ACT_TO_TBL /* Pass to fixed table */
  35. FR_ACT_GOTO /* Jump to another rule */
  36. FR_ACT_NOP /* No operation */
  37. FR_ACT_RES3
  38. FR_ACT_RES4
  39. FR_ACT_BLACKHOLE /* Drop without notification */
  40. FR_ACT_UNREACHABLE /* Drop with ENETUNREACH */
  41. FR_ACT_PROHIBIT /* Drop with EACCES */
  42. )
  43. // socket diags related
  44. const (
  45. SOCK_DIAG_BY_FAMILY = 20 /* linux.sock_diag.h */
  46. SOCK_DESTROY = 21
  47. TCPDIAG_NOCOOKIE = 0xFFFFFFFF /* TCPDIAG_NOCOOKIE in net/ipv4/tcp_diag.h*/
  48. )
  49. // RTA_ENCAP subtype
  50. const (
  51. MPLS_IPTUNNEL_UNSPEC = iota
  52. MPLS_IPTUNNEL_DST
  53. )
  54. // light weight tunnel encap types
  55. const (
  56. LWTUNNEL_ENCAP_NONE = iota
  57. LWTUNNEL_ENCAP_MPLS
  58. LWTUNNEL_ENCAP_IP
  59. LWTUNNEL_ENCAP_ILA
  60. LWTUNNEL_ENCAP_IP6
  61. LWTUNNEL_ENCAP_SEG6
  62. LWTUNNEL_ENCAP_BPF
  63. LWTUNNEL_ENCAP_SEG6_LOCAL
  64. )
  65. // routing header types
  66. const (
  67. IPV6_SRCRT_STRICT = 0x01 // Deprecated; will be removed
  68. IPV6_SRCRT_TYPE_0 = 0 // Deprecated; will be removed
  69. IPV6_SRCRT_TYPE_2 = 2 // IPv6 type 2 Routing Header
  70. IPV6_SRCRT_TYPE_4 = 4 // Segment Routing with IPv6
  71. )