network

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListLocalIPAddresses

func ListLocalIPAddresses() string

func SaveSetting

func SaveSetting(set IPSetting)

* 每次仅允许修改一个IP设置,避免多个网口同时失效的致命错误

func UseAp

func UseAp(essid string, password string) error

Types

type IPSetting

type IPSetting struct {
	Auto          string
	Comments      string
	Name          string
	IpAddress     string
	Netmask       string
	Gateway       string
	Mode          string //static,dhcp
	WirelessMode  string
	WirelessEssid string
	WpaDriver     string
	WpaConf       string
}

/etc/network/interfaces

func GetCurrentSetting

func GetCurrentSetting() ([]IPSetting, error)

type WifiAccessPortal

type WifiAccessPortal struct {
	Address       string
	ESSID         string
	SingalLevel   int
	Protocol      string
	Mode          string
	Frequency     string
	EncryptionKey string
}

func ListAP

func ListAP(wifiInterface string) ([]WifiAccessPortal, error)

* wifiInterface:wifi网卡名称,如wlan0

Jump to

Keyboard shortcuts

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