diff --git a/internal/definitions/network/interface.go b/internal/definitions/network/interface.go index 476c6a7..9b6b7e6 100644 --- a/internal/definitions/network/interface.go +++ b/internal/definitions/network/interface.go @@ -2,15 +2,14 @@ package network import ( "encoding/json" - - "nfsense.net/nfsense/internal/definitions/common" + "net/netip" ) type Interface struct { Alias string `json:"alias,omitempty" validate:"min=0,max=3"` Type InterfaceType `json:"type" validate:"min=0,max=3"` AddressingMode InterfaceAddressingMode `json:"addressing_mode" validate:"min=0,max=2"` - Address *common.IPCIDR `json:"address,omitempty" validate:"excluded_unless=AddressingMode 1"` + Address *netip.Prefix `json:"address,omitempty" validate:"excluded_unless=AddressingMode 1"` HardwareDevice *string `json:"hardware_device,omitempty"` // TODO fix Validator for int pointers with min=0,max=4094 VlanID *uint `json:"vlan_id,omitempty"` diff --git a/internal/definitions/network/static_route.go b/internal/definitions/network/static_route.go index 3f01bae..c2ce9a2 100644 --- a/internal/definitions/network/static_route.go +++ b/internal/definitions/network/static_route.go @@ -2,14 +2,12 @@ package network import ( "net/netip" - - "nfsense.net/nfsense/internal/definitions/common" ) type StaticRoute struct { Name string `json:"name,omitempty"` Interface string `json:"interface,omitempty"` Gateway netip.Addr `json:"gateway,omitempty"` - Destination common.IPNet `json:"destination,omitempty"` + Destination netip.Prefix `json:"destination,omitempty"` Metric uint `json:"metric,omitempty"` } diff --git a/internal/definitions/object/address.go b/internal/definitions/object/address.go index 94aae0f..e805e43 100644 --- a/internal/definitions/object/address.go +++ b/internal/definitions/object/address.go @@ -5,7 +5,6 @@ import ( "net/netip" "go4.org/netipx" - "nfsense.net/nfsense/internal/definitions/common" ) type Address struct { @@ -13,7 +12,7 @@ type Address struct { Comment string `json:"comment,omitempty"` Host *netip.Addr `json:"host,omitempty" validate:"excluded_unless=Type 0"` Range *netipx.IPRange `json:"range,omitempty" validate:"excluded_unless=Type 1"` - NetworkAddress *common.IPNet `json:"network,omitempty" validate:"excluded_unless=Type 2"` + NetworkAddress *netip.Prefix `json:"network,omitempty" validate:"excluded_unless=Type 2"` Children *[]string `json:"children,omitempty"` }