types.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package netconf
  2. type NetworkConfig struct {
  3. PreCmds []string `yaml:"pre_cmds,omitempty"`
  4. DHCPTimeout int `yaml:"dhcp_timeout,omitempty"`
  5. DNS DNSConfig `yaml:"dns,omitempty"`
  6. Interfaces map[string]InterfaceConfig `yaml:"interfaces,omitempty"`
  7. PostCmds []string `yaml:"post_cmds,omitempty"`
  8. HTTPProxy string `yaml:"http_proxy,omitempty"`
  9. HTTPSProxy string `yaml:"https_proxy,omitempty"`
  10. NoProxy string `yaml:"no_proxy,omitempty"`
  11. WifiNetworks map[string]WifiNetworkConfig `yaml:"wifi_networks,omitempty"`
  12. ModemNetworks map[string]ModemNetworkConfig `yaml:"modem_networks,omitempty"`
  13. }
  14. type InterfaceConfig struct {
  15. Match string `yaml:"match,omitempty"`
  16. DHCP bool `yaml:"dhcp,omitempty"`
  17. DHCPArgs string `yaml:"dhcp_args,omitempty"`
  18. Address string `yaml:"address,omitempty"`
  19. Addresses []string `yaml:"addresses,omitempty"`
  20. IPV4LL bool `yaml:"ipv4ll,omitempty"`
  21. Gateway string `yaml:"gateway,omitempty"`
  22. GatewayIpv6 string `yaml:"gateway_ipv6,omitempty"`
  23. MTU int `yaml:"mtu,omitempty"`
  24. Bridge string `yaml:"bridge,omitempty"`
  25. Bond string `yaml:"bond,omitempty"`
  26. BondOpts map[string]string `yaml:"bond_opts,omitempty"`
  27. PostUp []string `yaml:"post_up,omitempty"`
  28. PreUp []string `yaml:"pre_up,omitempty"`
  29. Vlans string `yaml:"vlans,omitempty"`
  30. WifiNetwork string `yaml:"wifi_network,omitempty"`
  31. }
  32. type DNSConfig struct {
  33. Nameservers []string `yaml:"nameservers,flow,omitempty"`
  34. Search []string `yaml:"search,flow,omitempty"`
  35. }
  36. type WifiNetworkConfig struct {
  37. Address string `yaml:"address,omitempty"`
  38. Gateway string `yaml:"gateway,omitempty"`
  39. ScanSSID int `yaml:"scan_ssid,omitempty"`
  40. SSID string `yaml:"ssid,omitempty"`
  41. PSK string `yaml:"psk,omitempty"`
  42. Priority int `yaml:"priority,omitempty"`
  43. Pairwise string `yaml:"pairwise,omitempty"`
  44. Group string `yaml:"group,omitempty"`
  45. Eap string `yaml:"eap,omitempty"`
  46. Identity string `yaml:"identity,omitempty"`
  47. AnonymousIdentity string `yaml:"anonymous_identity,omitempty"`
  48. CaCerts []string `yaml:"ca_certs,omitempty"`
  49. ClientCerts []string `yaml:"client_certs,omitempty"`
  50. PrivateKeys []string `yaml:"private_keys,omitempty"`
  51. PrivateKeyPasswds []string `yaml:"private_key_passwds,omitempty"`
  52. Phases []string `yaml:"phases,omitempty"`
  53. EapolFlags int `yaml:"eapol_flags,omitempty"`
  54. KeyMgmt string `yaml:"key_mgmt,omitempty"`
  55. Password string `yaml:"password,omitempty"`
  56. }
  57. type ModemNetworkConfig struct {
  58. Apn string `yaml:"apn"`
  59. ExtraArgs string `yaml:"extra_args,omitempty"`
  60. }