host.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package models
  2. import (
  3. "net"
  4. "github.com/google/uuid"
  5. "golang.zx2c4.com/wireguard/wgctrl/wgtypes"
  6. )
  7. // WIREGUARD_INTERFACE name of wireguard interface
  8. const WIREGUARD_INTERFACE = "netmaker"
  9. // Host - represents a host on the network
  10. type Host struct {
  11. ID uuid.UUID `json:"id" yaml:"id"`
  12. Verbosity int `json:"verbosity" yaml:"verbosity"`
  13. FirewallInUse string `json:"firewallinuse" yaml:"firewallinuse"`
  14. Version string `json:"version" yaml:"version"`
  15. IPForwarding bool `json:"ipforwarding" yaml:"ipforwarding"`
  16. DaemonInstalled bool `json:"daemoninstalled" yaml:"daemoninstalled"`
  17. HostPass string `json:"hostpass" yaml:"hostpass"`
  18. Name string `json:"name" yaml:"name"`
  19. OS string `json:"os" yaml:"os"`
  20. Interface string `json:"interface" yaml:"interface"`
  21. Debug bool `json:"debug" yaml:"debug"`
  22. ListenPort int `json:"listenport" yaml:"listenport"`
  23. LocalAddress net.IPNet `json:"localaddress" yaml:"localaddress"`
  24. LocalRange net.IPNet `json:"localrange" yaml:"localrange"`
  25. LocalListenPort int `json:"locallistenport" yaml:"locallistenport"`
  26. ProxyListenPort int `json:"proxy_listen_port" yaml:"proxy_listen_port"`
  27. MTU int `json:"mtu" yaml:"mtu"`
  28. PublicKey wgtypes.Key `json:"publickey" yaml:"publickey"`
  29. MacAddress net.HardwareAddr `json:"macaddress" yaml:"macaddress"`
  30. TrafficKeyPublic []byte `json:"traffickeypublic" yaml:"trafficekeypublic"`
  31. InternetGateway net.UDPAddr `json:"internetgateway" yaml:"internetgateway"`
  32. Nodes []string `json:"nodes" yaml:"nodes"`
  33. }