modulepackage
0.0.0-20200921205816-84d0a1a3b210
Repository: https://github.com/tailscale/winipcfg-go.git
Documentation: pkg.go.dev
# README
winipcfg
: Windows Network Management API
This was created for use in WireGuard but may be useful for other projects too.
$ go get golang.zx2c4.com/winipcfg
Documentation
License
Copyright (C) 2019 WireGuard LLC. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# Functions
Returns DEFAULT GetAdapterAddressesFlags struct.
Returns FULL GetAdapterAddressesFlags struct.
Returns anycast IP address specified by the input criteria.
Returns all anycast IP addresses from the system.
Returns IfRow struct with specified InterfaceLuid.
Returns all IfRow structs found in the system.
The same as GetInterfacesEx() with 'flags' input argument gotten from DefaultGetAdapterAddressesFlags().
Returns all available interfaces.
Corresponds to GetIpInterfaceEntry function (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getipinterfaceentry).
Corresponds to GetIpInterfaceTable function (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getipinterfacetable).
Returns UnicastIpAddressRow struct that matches to provided 'ip' argument, or nil if no such unicast address is found on the system.
Returns all the routes.
Returns all unicast IP addresses assigned to any interface.
The same as InterfaceFromFriendlyNameEx() with 'flags' input argument gotten from DefaultGetAdapterAddressesFlags().
Returns interface with specified friendly name.
The same as InterfaceFromGUIDEx() with 'flags' input argument gotten from DefaultGetAdapterAddressesFlags().
Returns interface with specified GUID.
The same as InterfaceFromIndexEx() with 'flags' input argument gotten from DefaultGetAdapterAddressesFlags().
Returns interface at specified index.
The same as InterfaceFromLUIDEx() with 'flags' input argument gotten from DefaultGetAdapterAddressesFlags().
Returns interface with specified LUID.
No description provided by the author
No description provided by the author
Returns MIN GetAdapterAddressesFlags struct.
No description provided by the author
wtSockaddrIn constructor.
Registering new InterfaceChangeCallback.
No description provided by the author
No description provided by the author
# Constants
According to https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getipforwardtable2.
According to https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getipforwardtable2.
According to https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getipforwardtable2.
Avalon Parallel Processor.
No description provided by the author
AAL5 over ATM.
Asymmetric Digital Subscrbr Loop.
ATM Emulated LAN for 802.3.
ATM Emulated LAN for 802.5.
Appletalk Remote Access Protocol.
No description provided by the author
No description provided by the author
Asynchronous Protocol.
ATM cells.
ATM DXI.
ATM FUNI.
ATM IMA.
ATM Logical Port.
No description provided by the author
ATM Sub Interface.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Bisynchronous Protocol.
ATM Emulated circuit.
Circuit Emulation Service.
No description provided by the author
Combat Net Radio.
Coffee pot.
No description provided by the author
Data Communications Network.
No description provided by the author
No description provided by the author
IP over Power Lines.
Data Link Switching.
CATV Downstream interface.
CATV Mac Layer.
CATV Upstream interface.
Digital Signal Level 0.
Group of ds0s on the same ds1.
DS1-MIB.
No description provided by the author
DS3-MIB.
Dynamic syncronous Transfer Mode.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Obsolete; see DS1-MIB.
CLNP over IP.
Ext Pos Loc Report Sys.
IBM Enterprise Systems Connection.
No description provided by the author
No description provided by the author
Fast channel.
Fast Ethernet (100BaseT).
Fast Ethernet (100BaseFX).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DTE only.
Obsolete, use 32 or 44.
Multiproto Interconnect over FR.
FRNETSERV-MIB.
No description provided by the author
Obsolete; see DS1-MIB.
CCITT G703 at 64Kbps.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
CCITT-ITU X.29 PAD Protocol.
No description provided by the author
No description provided by the author
IBM System 360/370 OEMI Channel.
No description provided by the author
IEEE1394 High Perf Serial Bus.
Radio spread spectrum.
100BaseVG.
IEEE 802.15.4 WPAN interface.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Interleave channel.
IP (for APPN HPR in IP networks).
IP Forwarding Interface.
IBM ipOverAtm.
IBM ipOverCdlc.
IBM Common Link Access to Workstn.
IP Switching Objects.
No description provided by the author
ISDN and X.25.
ISDN S/T interface.
ISDN U interface.
No description provided by the author
No description provided by the author
ISO 802.5 CRFP.
ISO 802.5j Fiber Token Ring.
No description provided by the author
ISO 802.5r DTR.
No description provided by the author
No description provided by the author
Layer 2 Virtual LAN using 802.1Q.
Layer 3 Virtual LAN using IP.
Layer 3 Virtual LAN using IPX.
No description provided by the author
Link Access Protocol D.
No description provided by the author
No description provided by the author
Multimedia Mail over IP.
No description provided by the author
No description provided by the author
Generic Modem.
IBM multi-proto channel support.
No description provided by the author
No description provided by the author
Multi-rate Symmetric DSL.
No description provided by the author
Myricom Myrinet.
No description provided by the author
XNS over IP.
No description provided by the author
No description provided by the author
None of the below.
Parallel port.
No description provided by the author
No description provided by the author
No description provided by the author
PPP Multilink Bundle.
No description provided by the author
No description provided by the author
Proprietary Connectionless Proto.
No description provided by the author
No description provided by the author
No description provided by the author
Proprietary multiplexing.
proprietary serial.
Proprietary virtual/internal.
No description provided by the author
No description provided by the author
No description provided by the author
SNA QLLC.
No description provided by the author
Rate-Adapt Digital Subscrbr Loop.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Remote Source Route Bridging.
No description provided by the author
Symmetric Digital Subscriber Loop.
No description provided by the author
SMDS, coffee.
Generic Slip.
No description provided by the author
SMDS InterCarrier Interface.
No description provided by the author
SONET or SDH.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IBM stackToStack.
No description provided by the author
IBM twinaxial data link control.
CCITT-ITU X.3 PAD Facility.
No description provided by the author
No description provided by the author
Encapsulation interface.
ULTRA Technologies.
No description provided by the author
CCITT V.11/X.21.
No description provided by the author
CCITT V.36.
No description provided by the author
Very H-Speed Digital Subscrb Loop.
IBM VIPA.
Voice recEive and transMit.
Voice encapsulation.
Voice Foreign Exchange Office.
Voice Foreign Exchange Station.
Voice over IP encapsulation.
No description provided by the author
No description provided by the author
WWAN devices based on GSM technology.
WWAN devices based on CDMA technology.
CCITT-ITU X213.
X.25 Hunt Group.
Multi-Link Protocol.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Never use link locals.
Always use link locals (default for IPv6).
Use link locals only if no other addresses.
No description provided by the author
Defined in iptypes.h.
No description provided by the author
No description provided by the author
No description provided by the author
Addition.
Deletion.
No description provided by the author
No description provided by the author
Initial notification.
ParameterChange.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
defined for convenience, not a real medium.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
includes ADSL and UADSL (G.Lite).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Windows-specific definitions.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
Corresponds to MIB_ANYCASTIPADDRESS_ROW defined in netioapi.h (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_anycastipaddress_row).
Determines the amount of data we want to get by GetInterfaces() function and similar functions which are returning Interface struct(s).
Corresponds to MIB_IF_ROW2 struct defined in netioapi.h (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_if_row2).
Corresponds to Windows struct IP_ADAPTER_ADDRESSES (https://docs.microsoft.com/en-us/windows/desktop/api/iptypes/ns-iptypes-_ip_adapter_addresses_lh).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Corresponds to Windows struct MIB_IPINTERFACE_ROW (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_ipinterface_row).
No description provided by the author
Corresponds to MIB_IPFORWARD_ROW2 defined in netioapi.h (https://docs.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipforward_row2).
No description provided by the author
No description provided by the author
Specifies transport address and port.
No description provided by the author
Defines function that can be used as a callback.
Corresponds to MIB_UNICASTIPADDRESS_ROW defined in netioapi.h (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_unicastipaddress_row).
# Type aliases
Defined in ws2def.h as AddressFamily.
https://docs.microsoft.com/en-us/windows/desktop/api/ifdef/ne-ifdef-if_oper_status IF_OPER_STATUS defined in ifdef.h.
IFTYPE (of type ULONG), Defined in ipifcons.h.
IP_DAD_STATE defined in iptypes.h.
IP_PREFIX_ORIGIN defined in iptypes.h.
IP_SUFFIX_ORIGIN defined in iptypes.h.
MIB_IF_ENTRY_LEVEL defined in netioapi.h (https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getifentry2ex).
https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ne-netioapi-_mib_notification_type MIB_NOTIFICATION_TYPE defined in netioapi.h.
NDIS_MEDIUM defined in ntddndis.h (https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ntddndis/ne-ntddndis-_ndis_medium).
NDIS_PHYSICAL_MEDIUM defined in ntddndis.h(https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/ns-netioapi-_mib_if_row2).
NET_IF_ACCESS_TYPE defined in ifdef.h (https://docs.microsoft.com/en-us/windows/desktop/api/ifdef/ne-ifdef-_net_if_access_type).
NET_IF_ADMIN_STATUS defined in ifdef.h (https://docs.microsoft.com/en-us/windows/desktop/api/ifdef/ne-ifdef-net_if_admin_status).
https://docs.microsoft.com/en-us/windows/desktop/api/ifdef/ne-ifdef-_net_if_connection_type NET_IF_CONNECTION_TYPE defined in ifdef.h.
NET_IF_DIRECTION_TYPE defined in ifdef.h (https://docs.microsoft.com/en-us/windows/desktop/api/ifdef/ne-ifdef-net_if_direction_type).
NET_IF_MEDIA_CONNECT_STATE defined in ifdef.h (https://docs.microsoft.com/en-us/windows/desktop/api/ifdef/ne-ifdef-_net_if_media_connect_state).
https://docs.microsoft.com/en-us/windows/desktop/api/nldef/ne-nldef-nl_dad_state NL_DAD_STATE defined in nldef.h.
https://docs.microsoft.com/en-us/windows/desktop/api/nldef/ne-nldef-_nl_link_local_address_behavior NL_LINK_LOCAL_ADDRESS_BEHAVIOR defined in nldef.h.
https://docs.microsoft.com/en-us/windows/desktop/api/nldef/ne-nldef-nl_prefix_origin NL_PREFIX_ORIGIN defined in nldef.h.
NL_ROUTE_ORIGIN defined in nldef.h.
https://docs.microsoft.com/en-us/windows/desktop/api/nldef/ne-nldef-nl_route_protocol NL_ROUTE_PROTOCOL defined in nldef.h.
https://docs.microsoft.com/en-us/windows/desktop/api/nldef/ne-nldef-_nl_router_discovery_behavior NL_ROUTER_DISCOVERY_BEHAVIOR defined in nldef.h.
https://docs.microsoft.com/en-us/windows/desktop/api/nldef/ne-nldef-nl_suffix_origin NL_SUFFIX_ORIGIN defined in nldef.h.
https://docs.microsoft.com/en-us/windows/desktop/api/ifdef/ne-ifdef-tunnel_type TUNNEL_TYPE defined in ifdef.h.