adapter

package
v0.0.0-...-310db84 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeMACAddress

func ChangeMACAddress(adapterName, newMAC string) error

ChangeMACAddress changes the MAC address of the specified adapter

func GenerateMac

func GenerateMac() (string, error)

GenerateMac generates a random MAC address

func GetOriginalMAC

func GetOriginalMAC(adapterName string) (string, error)

GetOriginalMAC retrieves the current MAC address of the specified adapter

func RestartAdapter

func RestartAdapter(adapterName string) error

RestartAdapter disables and re-enables the network adapter

func RestoreOriginalMAC

func RestoreOriginalMAC(adapterName string) error

RestoreOriginalMAC restores the original MAC address of the specified adapter

Types

type AdapterInfo

type AdapterInfo struct {
	Name        string `json:"Name"`
	Description string `json:"InterfaceDescription"`
	MacAddress  string `json:"MacAddress"`
}

func ListAdapters

func ListAdapters() ([]AdapterInfo, error)

ListAdapters returns a list of all network adapters

Jump to

Keyboard shortcuts

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