syscall.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. TCPDIAG_NOCOOKIE = 0xFFFFFFFF /* TCPDIAG_NOCOOKIE in net/ipv4/tcp_diag.h*/
  47. )
  48. // RTA_ENCAP subtype
  49. const (
  50. MPLS_IPTUNNEL_UNSPEC = iota
  51. MPLS_IPTUNNEL_DST
  52. )
  53. // light weight tunnel encap types
  54. const (
  55. LWTUNNEL_ENCAP_NONE = iota
  56. LWTUNNEL_ENCAP_MPLS
  57. LWTUNNEL_ENCAP_IP
  58. LWTUNNEL_ENCAP_ILA
  59. LWTUNNEL_ENCAP_IP6
  60. LWTUNNEL_ENCAP_SEG6
  61. LWTUNNEL_ENCAP_BPF
  62. LWTUNNEL_ENCAP_SEG6_LOCAL
  63. )
  64. // routing header types
  65. const (
  66. IPV6_SRCRT_STRICT = 0x01 // Deprecated; will be removed
  67. IPV6_SRCRT_TYPE_0 = 0 // Deprecated; will be removed
  68. IPV6_SRCRT_TYPE_2 = 2 // IPv6 type 2 Routing Header
  69. IPV6_SRCRT_TYPE_4 = 4 // Segment Routing with IPv6
  70. )