Add Static Route Backend

This commit is contained in:
Samuel Lorch 2023-04-08 17:07:26 +02:00
parent dec123e9ee
commit 3197f291fa
4 changed files with 40 additions and 6 deletions

View file

@ -1,5 +1,6 @@
package definitions
type Network struct {
Interfaces map[string]Interface `json:"interfaces" validate:"required,dive"`
Interfaces map[string]Interface `json:"interfaces" validate:"required,dive"`
StaticRoutes []StaticRoute `json:"static_routes" validate:"required,dive"`
}

View file

@ -0,0 +1,13 @@
package definitions
import (
"net/netip"
)
type StaticRoute struct {
Name string `json:"name,omitempty"`
Interface string `json:"interface,omitempty"`
Gateway netip.Addr `json:"gateway,omitempty"`
Destination IPNet `json:"destination,omitempty"`
Metric uint `json:"metric,omitempty"`
}