From ff739ad4502d892c6074c83c6ed95eadf0c55ed2 Mon Sep 17 00:00:00 2001 From: daschott Date: Tue, 16 Sep 2025 15:34:12 -0500 Subject: [PATCH] added flags to subnet --- hcn/hcnnetwork.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hcn/hcnnetwork.go b/hcn/hcnnetwork.go index f3f02c0..c991c74 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