net

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: Apache-2.0 Imports: 15 Imported by: 7

Documentation

Index

Constants

View Source
const (
	SIOCETHTOOL        = 0x8946
	CMD_GSET           = 1
	CMD_GLINKSETTINGS  = 0x4c
	GSET_SIZE          = 44
	GLINKSETTINGS_SIZE = 48
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Flags

type Flags net.Flags

func (Flags) MarshalText

func (f Flags) MarshalText() ([]byte, error)

func (Flags) String

func (f Flags) String() string

func (Flags) UnmarshalText

func (f Flags) UnmarshalText(t []byte) error

type HardwareAddr

type HardwareAddr net.HardwareAddr

func (HardwareAddr) MarshalText

func (h HardwareAddr) MarshalText() ([]byte, error)

func (HardwareAddr) String

func (h HardwareAddr) String() string

func (*HardwareAddr) UnmarshalText

func (h *HardwareAddr) UnmarshalText(buf []byte) error

UnmarshalText unmarshalls the text represenatation of a HardwareAddr. Any format accepted by net.ParseMAC will be accepted.

type IPNet

type IPNet net.IPNet

func (*IPNet) IsCIDR

func (n *IPNet) IsCIDR() bool

IsCIDR returns whether this IP is in CIDR form.

func (*IPNet) MarshalText

func (n *IPNet) MarshalText() ([]byte, error)

func (*IPNet) String

func (n *IPNet) String() string

func (*IPNet) UnmarshalText

func (n *IPNet) UnmarshalText(buf []byte) error

UnmarshalText handles unmarshalling the string represenation of an IP address (v4 and v6, in CIDR form and as a raw address) into an IP.

type Info

type Info struct {
	Interfaces    []Interface
	HardwareAddrs map[string]string
	Addrs         map[string]string
}

func Gather

func Gather() (*Info, error)

func (*Info) Class

func (i *Info) Class() string

type Interface

type Interface struct {
	Name            string
	StableName      string
	OrdinalName     string
	Path            string
	Model           string
	Driver          string
	Vendor          string
	MTU             int
	Flags           Flags
	HardwareAddr    HardwareAddr
	Addrs           []*IPNet
	Supported       []ModeBit
	Advertised      []ModeBit
	PeerAdvertised  []ModeBit
	Speed           uint32
	Duplex          bool
	Autonegotiation bool
	Sys             struct {
		IsPhysical bool
		BusAddress string
		IfIndex    int64
		IfLink     int64
		OperState  string
		Type       string
		IsBridge   bool
		Bridge     struct {
			Members []string
			Master  string
		}
		IsVlan bool
		VLAN   struct {
			Id     int64
			Master string
		}
		IsBond bool
		Bond   struct {
			Mode      string
			Members   []string
			Master    string
			LinkState string
		}
	}
}

func (*Interface) Fill

func (i *Interface) Fill() error

type ModeBit

type ModeBit struct {
	Name, Phy       string
	Feature, Duplex bool
}

func (ModeBit) String

func (m ModeBit) String() string

Jump to

Keyboard shortcuts

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