diff --git a/plugin/networkinterface.go b/plugin/networkinterface.go index 2267218..2fd7a41 100644 --- a/plugin/networkinterface.go +++ b/plugin/networkinterface.go @@ -5,6 +5,7 @@ package plugin import ( "context" + "net/netip" ) type NetworkInterfaceState string @@ -35,14 +36,22 @@ type NetworkInterfaceSpec struct { Metadata *NetworkInterfaceMetadata `json:"metadata"` Name string `json:"name"` NetworkId string `json:"networkId"` + Hostname string `json:"hostname"` Ips []string `json:"ips"` } +// NetworkInterfaceStatus is returned by a plugin after successfully applying a +// network interface. It contains the effective configuration of the interface +// and the device type that the hypervisor can consume. A plugin must exactly +// one non-nil device type. type NetworkInterfaceStatus struct { - Name string `json:"name"` Handle string `json:"handle"` State NetworkInterfaceState `json:"state"` + Prefixes netip.Prefix `json:"prefixes"` + Ips []netip.Addr `json:"ips"` + VirtualIp netip.Addr `json:"virtual-ip"` + PCI *PCI TAP *TAP Netdev *Netdev