Skip to content

Commit

Permalink
windows: add enums for IpAdapterUnicastAddress
Browse files Browse the repository at this point in the history
These are for the enum fields in IpAdapterUnicastAddress.

Change-Id: Ibcb6ce674ab41a94dbe46d394f035208a94b6dae
GitHub-Last-Rev: 1837ff9
GitHub-Pull-Request: #204
Reviewed-on: https://go-review.googlesource.com/c/sys/+/598895
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Alex Brainman <[email protected]>
Reviewed-by: Michael Knyszek <[email protected]>
Reviewed-by: David Chase <[email protected]>
  • Loading branch information
database64128 authored and alexbrainman committed Aug 7, 2024
1 parent 29298aa commit 4c7077e
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions windows/types_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2031,6 +2031,50 @@ const (
IF_TYPE_IEEE1394 = 144
)

// Enum NL_PREFIX_ORIGIN for [IpAdapterUnicastAddress], see
// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_prefix_origin
const (
IpPrefixOriginOther = 0
IpPrefixOriginManual = 1
IpPrefixOriginWellKnown = 2
IpPrefixOriginDhcp = 3
IpPrefixOriginRouterAdvertisement = 4
IpPrefixOriginUnchanged = 1 << 4
)

// Enum NL_SUFFIX_ORIGIN for [IpAdapterUnicastAddress], see
// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_suffix_origin
const (
NlsoOther = 0
NlsoManual = 1
NlsoWellKnown = 2
NlsoDhcp = 3
NlsoLinkLayerAddress = 4
NlsoRandom = 5
IpSuffixOriginOther = 0
IpSuffixOriginManual = 1
IpSuffixOriginWellKnown = 2
IpSuffixOriginDhcp = 3
IpSuffixOriginLinkLayerAddress = 4
IpSuffixOriginRandom = 5
IpSuffixOriginUnchanged = 1 << 4
)

// Enum NL_DAD_STATE for [IpAdapterUnicastAddress], see
// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_dad_state
const (
NldsInvalid = 0
NldsTentative = 1
NldsDuplicate = 2
NldsDeprecated = 3
NldsPreferred = 4
IpDadStateInvalid = 0
IpDadStateTentative = 1
IpDadStateDuplicate = 2
IpDadStateDeprecated = 3
IpDadStatePreferred = 4
)

type SocketAddress struct {
Sockaddr *syscall.RawSockaddrAny
SockaddrLength int32
Expand Down

0 comments on commit 4c7077e

Please sign in to comment.