network

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: MIT Imports: 8 Imported by: 2

Documentation

Overview

Package network provides utility functions to extract some data about network

Index

Constants

This section is empty.

Variables

View Source
var (
	BroadcastMAC = net.HardwareAddr{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
	LoopbackMAC  = net.HardwareAddr{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
)

Functions

func DisplayInterfaces

func DisplayInterfaces(includeAny bool) error

func GetDefaultGatewayIPv4

func GetDefaultGatewayIPv4() (netip.Addr, error)

func GetDefaultInterface

func GetDefaultInterface() (*net.Interface, error)

func GetGatewayIPv4FromInterface

func GetGatewayIPv4FromInterface(iface string) (netip.Addr, error)

func GetIPv4PrefixFromInterface

func GetIPv4PrefixFromInterface(iface *net.Interface) (netip.Prefix, error)

func InterfaceByName

func InterfaceByName(name string) (*net.Interface, error)

InterfaceByName returns the interface specified by name.

func IsLocalAddress added in v0.0.10

func IsLocalAddress(addr string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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