f-41: subnet: export du préfixe dans la VRF, suppression refusée tant qu'une VM l'utilise #41

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-11 20:28:16 +02:00
commit fe27d45262
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
12 changed files with 253 additions and 2 deletions

View file

@ -22,6 +22,8 @@ type host interface {
LinkUp(ns, iface string) error
RouteVia(ns string, dst *net.IPNet, gw net.IP, iface string) error
DeleteLink(name string) error
TableRouteVia(table uint32, dst *net.IPNet, gw net.IP, iface string) error
TableRouteDel(table uint32, dst *net.IPNet) error
ApplyVRF(v frr.VRF) error
WithdrawVRF(v frr.VRF) error
RemoveVRF(v frr.VRF) error
@ -80,6 +82,14 @@ func (system) RouteVia(ns string, dst *net.IPNet, gw net.IP, iface string) error
func (system) DeleteLink(name string) error { return netif.DeleteLinkIfExists(name) }
func (system) TableRouteVia(table uint32, dst *net.IPNet, gw net.IP, iface string) error {
return netif.RouteReplaceVia(int(table), dst, gw, iface)
}
func (system) TableRouteDel(table uint32, dst *net.IPNet) error {
return netif.RouteDelIfExists(int(table), dst)
}
func (s system) ApplyVRF(v frr.VRF) error { return s.frr.ApplyVRF(v) }
func (s system) WithdrawVRF(v frr.VRF) error { return s.frr.WithdrawVRF(v) }