From a00f5adb73dff2850ffe747df4e4c077e3683641 Mon Sep 17 00:00:00 2001 From: daschott Date: Wed, 24 Sep 2025 13:55:31 -0500 Subject: [PATCH] added HCN subnet flags support Signed-off-by: daschott --- hcn/hcnnetwork.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hcn/hcnnetwork.go b/hcn/hcnnetwork.go index c31920ced9..c24d2abc84 100644 --- a/hcn/hcnnetwork.go +++ b/hcn/hcnnetwork.go @@ -11,6 +11,15 @@ import ( "github.com/sirupsen/logrus" ) +// SubnetFlags represents the flags that can be set on a subnet +type SubnetFlags uint32 + +// SubnetFlags constants (based on HNS API documentation) +const ( + SubnetFlagsNone SubnetFlags = 0 + SubnetFlagsDoNotReserveGatewayAddress SubnetFlags = 1 // This flag is needed to support scenario GatewayAddress == ManagementIP +) + // Route is associated with a subnet. type Route struct { NextHop string `json:",omitempty"` @@ -23,6 +32,7 @@ type Subnet struct { IpAddressPrefix string `json:",omitempty"` Policies []json.RawMessage `json:",omitempty"` Routes []Route `json:",omitempty"` + Flags SubnetFlags `json:",omitempty"` } // Ipam (Internet Protocol Address Management) is associated with a network