tun.go 2.0 KB

12345678910111213141516171819202122232425262728293031
  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. Inet4Address Listable[netip.Prefix] `json:"inet4_address,omitempty"`
  8. Inet6Address Listable[netip.Prefix] `json:"inet6_address,omitempty"`
  9. AutoRoute bool `json:"auto_route,omitempty"`
  10. StrictRoute bool `json:"strict_route,omitempty"`
  11. Inet4RouteAddress Listable[netip.Prefix] `json:"inet4_route_address,omitempty"`
  12. Inet6RouteAddress Listable[netip.Prefix] `json:"inet6_route_address,omitempty"`
  13. Inet4RouteExcludeAddress Listable[netip.Prefix] `json:"inet4_route_exclude_address,omitempty"`
  14. Inet6RouteExcludeAddress Listable[netip.Prefix] `json:"inet6_route_exclude_address,omitempty"`
  15. IncludeInterface Listable[string] `json:"include_interface,omitempty"`
  16. ExcludeInterface Listable[string] `json:"exclude_interface,omitempty"`
  17. IncludeUID Listable[uint32] `json:"include_uid,omitempty"`
  18. IncludeUIDRange Listable[string] `json:"include_uid_range,omitempty"`
  19. ExcludeUID Listable[uint32] `json:"exclude_uid,omitempty"`
  20. ExcludeUIDRange Listable[string] `json:"exclude_uid_range,omitempty"`
  21. IncludeAndroidUser Listable[int] `json:"include_android_user,omitempty"`
  22. IncludePackage Listable[string] `json:"include_package,omitempty"`
  23. ExcludePackage Listable[string] `json:"exclude_package,omitempty"`
  24. EndpointIndependentNat bool `json:"endpoint_independent_nat,omitempty"`
  25. UDPTimeout UDPTimeoutCompat `json:"udp_timeout,omitempty"`
  26. Stack string `json:"stack,omitempty"`
  27. Platform *TunPlatformOptions `json:"platform,omitempty"`
  28. InboundOptions
  29. }