netinterface

package
v0.0.0-...-410f0c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const GAA_FLAG_INCLUDE_ALL_COMPARTMENTS = 0x200

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365915(v=vs.85).aspx

Variables

This section is empty.

Functions

func InterfaceExists

func InterfaceExists(name string) (bool, error)

Types

type AdapterInfo

type AdapterInfo struct {
	Name            string
	Index           uint32
	LUID            NET_LUID
	PhysicalAddress net.HardwareAddr
	CompartmentId   uint32
}

type IP_ADAPTER_ADDRESSES

type IP_ADAPTER_ADDRESSES struct {
	Length                 uint32
	IfIndex                uint32
	Next                   *IP_ADAPTER_ADDRESSES
	AdapterName            *byte
	FirstUnicastAddress    *windows.IpAdapterUnicastAddress
	FirstAnycastAddress    *windows.IpAdapterAnycastAddress
	FirstMulticastAddress  *windows.IpAdapterMulticastAddress
	FirstDnsServerAddress  *windows.IpAdapterDnsServerAdapter
	DnsSuffix              *uint16
	Description            *uint16
	FriendlyName           *uint16
	PhysicalAddress        [windows.MAX_ADAPTER_ADDRESS_LENGTH]byte
	PhysicalAddressLength  uint32
	Flags                  uint32
	Mtu                    uint32
	IfType                 uint32
	OperStatus             uint32
	Ipv6IfIndex            uint32
	ZoneIndices            [16]uint32
	FirstPrefix            *windows.IpAdapterPrefix
	TransmitLinkSpeed      uint64
	ReceiveLinkSpeed       uint64
	FirstWinsServerAddress uint64
	FirstGatewayAddress    uint64
	Ipv4Metric             uint32
	Ipv6Metric             uint32
	Luid                   NET_LUID
	Dhcpv4Server           windows.SocketAddress
	CompartmentId          uint32
}

type InterfaceForIPNotFoundError

type InterfaceForIPNotFoundError struct {
	// contains filtered or unexported fields
}

func (*InterfaceForIPNotFoundError) Error

type InterfaceNotFoundError

type InterfaceNotFoundError struct {
	// contains filtered or unexported fields
}

func (*InterfaceNotFoundError) Error

func (e *InterfaceNotFoundError) Error() string

type MIB_IPINTERFACE_ROW

type MIB_IPINTERFACE_ROW struct {
	Family                               uint32
	InterfaceLuid                        NET_LUID
	InterfaceIndex                       uint32
	MaxReassemblySize                    uint32
	InterfaceIdentifier                  uint64
	MinRouterAdvertisementInterval       uint32
	MaxRouterAdvertisementInterval       uint32
	AdvertisingEnabled                   bool
	ForwardingEnabled                    bool
	WeakHostSend                         bool
	WeakHostReceive                      bool
	UseAutomaticMetric                   bool
	UseNeighborUnreachabilityDetection   bool
	ManagedAddressConfigurationSupported bool
	OtherStatefulConfigurationSupported  bool
	AdvertiseDefaultRoute                bool
	RouterDiscoveryBehavior              uint32
	DadTransmits                         uint32
	BaseReachableTime                    uint32
	RetransmitTime                       uint32
	PathMtuDiscoveryTimeout              uint32
	LinkLocalAddressBehavior             uint32
	LinkLocalAddressTimeout              uint32
	ZoneIndices                          [16]uint32
	SitePrefixLength                     uint32
	Metric                               uint32
	NlMtu                                uint32
	Connected                            bool
	SupportsWakeUpPatterns               bool
	SupportsNeighborDiscovery            bool
	SupportsRouterDiscovery              bool
	ReachableTime                        uint32
	TransmitOffload                      uint16
	ReceiveOffload                       uint16
	DisableDefaultRoutes                 bool
}

https://msdn.microsoft.com/en-us/library/windows/desktop/aa814496(v=vs.85).aspx

type NetInterface

type NetInterface struct{}

func (*NetInterface) ByIP

func (n *NetInterface) ByIP(ipStr string) (AdapterInfo, error)

func (*NetInterface) ByName

func (n *NetInterface) ByName(name string) (AdapterInfo, error)

func (*NetInterface) GetMTU

func (n *NetInterface) GetMTU(name string, family uint32) (uint32, error)

func (*NetInterface) SetMTU

func (n *NetInterface) SetMTU(name string, mtu uint32, family uint32) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL