tun.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package option
  2. import "net/netip"
  3. type TunInboundOptions struct {
  4. InterfaceName string `json:"interface_name,omitempty"`
  5. MTU uint32 `json:"mtu,omitempty"`
  6. GSO bool `json:"gso,omitempty"`
  7. Address Listable[netip.Prefix] `json:"address,omitempty"`
  8. AutoRoute bool `json:"auto_route,omitempty"`
  9. IPRoute2TableIndex int `json:"iproute2_table_index,omitempty"`
  10. IPRoute2RuleIndex int `json:"iproute2_rule_index,omitempty"`
  11. AutoRedirect bool `json:"auto_redirect,omitempty"`
  12. AutoRedirectInputMark uint32 `json:"auto_redirect_input_mark,omitempty"`
  13. AutoRedirectOutputMark uint32 `json:"auto_redirect_output_mark,omitempty"`
  14. StrictRoute bool `json:"strict_route,omitempty"`
  15. RouteAddress Listable[netip.Prefix] `json:"route_address,omitempty"`
  16. RouteAddressSet Listable[string] `json:"route_address_set,omitempty"`
  17. RouteExcludeAddress Listable[netip.Prefix] `json:"route_exclude_address,omitempty"`
  18. RouteExcludeAddressSet Listable[string] `json:"route_exclude_address_set,omitempty"`
  19. IncludeInterface Listable[string] `json:"include_interface,omitempty"`
  20. ExcludeInterface Listable[string] `json:"exclude_interface,omitempty"`
  21. IncludeUID Listable[uint32] `json:"include_uid,omitempty"`
  22. IncludeUIDRange Listable[string] `json:"include_uid_range,omitempty"`
  23. ExcludeUID Listable[uint32] `json:"exclude_uid,omitempty"`
  24. ExcludeUIDRange Listable[string] `json:"exclude_uid_range,omitempty"`
  25. IncludeAndroidUser Listable[int] `json:"include_android_user,omitempty"`
  26. IncludePackage Listable[string] `json:"include_package,omitempty"`
  27. ExcludePackage Listable[string] `json:"exclude_package,omitempty"`
  28. EndpointIndependentNat bool `json:"endpoint_independent_nat,omitempty"`
  29. UDPTimeout UDPTimeoutCompat `json:"udp_timeout,omitempty"`
  30. Stack string `json:"stack,omitempty"`
  31. Platform *TunPlatformOptions `json:"platform,omitempty"`
  32. InboundOptions
  33. // Deprecated: merged to Address
  34. Inet4Address Listable[netip.Prefix] `json:"inet4_address,omitempty"`
  35. // Deprecated: merged to Address
  36. Inet6Address Listable[netip.Prefix] `json:"inet6_address,omitempty"`
  37. // Deprecated: merged to RouteAddress
  38. Inet4RouteAddress Listable[netip.Prefix] `json:"inet4_route_address,omitempty"`
  39. // Deprecated: merged to RouteAddress
  40. Inet6RouteAddress Listable[netip.Prefix] `json:"inet6_route_address,omitempty"`
  41. // Deprecated: merged to RouteExcludeAddress
  42. Inet4RouteExcludeAddress Listable[netip.Prefix] `json:"inet4_route_exclude_address,omitempty"`
  43. // Deprecated: merged to RouteExcludeAddress
  44. Inet6RouteExcludeAddress Listable[netip.Prefix] `json:"inet6_route_exclude_address,omitempty"`
  45. }