iproute

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddrInfo

type AddrInfo struct {
	Family            string `json:"family"`
	Local             string `json:"local"`
	PrefixLen         int    `json:"prefixlen"`
	Broadcast         string `json:"broadcast,omitempty"`
	Scope             string `json:"scope"`
	Label             string `json:"label,omitempty"`
	ValidLifeTime     int64  `json:"valid_life_time"`
	PreferredLifeTime int64  `json:"preferred_life_time"`
	NoDAD             bool   `json:"nodad,omitempty"`
}

type ExecFunc

type ExecFunc func(cmd ...string) (stdout, stderr []byte, err error)
type Link struct {
	IfIndex     int        `json:"ifindex"`
	LinkIndex   int        `json:"link_index"`
	IfName      string     `json:"ifname"`
	Flags       []string   `json:"flags"`
	Mtu         int        `json:"mtu"`
	Qdisc       string     `json:"qdisc"`
	Master      string     `json:"master"`
	OperState   string     `json:"operstate"`
	Group       string     `json:"group"`
	LinkType    string     `json:"link_type"`
	Address     string     `json:"address"`
	Broadcast   string     `json:"broadcast"`
	LinkNetnsID int        `json:"link_netnsid"`
	Promiscuity int        `json:"promiscuity"`
	MinMtu      int        `json:"min_mtu"`
	MaxMtu      int        `json:"max_mtu"`
	LinkInfo    LinkInfo   `json:"linkinfo"`
	NumTxQueues int        `json:"num_tx_queues"`
	NumRxQueues int        `json:"num_rx_queues"`
	GsoMaxSize  int        `json:"gso_max_size"`
	GsoMaxSegs  int        `json:"gso_max_segs"`
	AddrInfo    []AddrInfo `json:"addr_info"`
}

func AddressShow

func AddressShow(device string, execFunc ExecFunc) ([]Link, error)

func (*Link) NonLinkLocalAddresses

func (l *Link) NonLinkLocalAddresses() []string

type LinkInfo

type LinkInfo struct {
	InfoKind string `json:"info_kind"`
}

type Route

type Route struct {
	Type     string        `json:"type"`
	Dst      string        `json:"dst"`
	Gateway  string        `json:"gateway,omitempty"`
	Dev      string        `json:"dev"`
	Protocol string        `json:"protocol"`
	Scope    string        `json:"scope"`
	Metric   int           `json:"metric"`
	Flags    []interface{} `json:"flags"`
	PrefSrc  string        `json:"prefsrc,omitempty"`
	Pref     string        `json:"pref"`
}

func RouteShow

func RouteShow(table, device string, execFunc ExecFunc) ([]Route, error)

type Rule

type Rule struct {
	Priority int    `json:"priority"`
	Src      string `json:"src"`
	Table    string `json:"table"`
	Protocol string `json:"protocol"`
	SrcLen   int    `json:"srclen,omitempty"`
}

func RuleShow

func RuleShow(device string, execFunc ExecFunc) ([]Rule, error)

Jump to

Keyboard shortcuts

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