f-88: netif: MAC d'IP flottante, règles de routage par source #88

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-29 21:14:39 +01:00
commit 19eeb0c281
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
5 changed files with 110 additions and 0 deletions

View file

@ -12,6 +12,7 @@ const (
RoleRouter byte = 0x02
RoleHostGateway byte = 0x03
RoleNATGateway byte = 0x04
RoleFloatingIP byte = 0x05
MaxVNI = 1<<24 - 1
)
@ -28,6 +29,10 @@ func AnycastMAC(vni int) (net.HardwareAddr, error) {
return vniMAC(RoleAnycastGateway, vni)
}
func FloatingIPMAC(public net.IP) (net.HardwareAddr, error) {
return HostMAC(RoleFloatingIP, public)
}
func NATGatewayMAC(l3vni int) (net.HardwareAddr, error) {
return vniMAC(RoleNATGateway, l3vni)
}