net

package
v0.0.0-...-083900a Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModalTreeView

func ModalTreeView(netState NetState, pages *tview.Pages) (tview.Primitive, error)

func NMTUIRunner

func NMTUIRunner(app *tview.Application, pages *tview.Pages, treeView *tview.TreeView) func()

func TreeView

func TreeView(netState NetState, pages *tview.Pages) (*tview.TreeView, error)

func ValidateConnectivity

func ValidateConnectivity(address string) ([]byte, error)

Types

type DNSConfig

type DNSConfig struct {
	Servers       []string `json:"server,omitempty"`
	SearchDomains []string `json:"search,omitempty"`
}

type DNSResolver

type DNSResolver struct {
	Running DNSConfig `json:"running,omitempty"`
}

type Hostname

type Hostname struct {
	Running string `json:"running"`
}

type IPConfig

type IPConfig struct {
	Enabled   bool        `json:"enabled,omitempty"`
	Addresses []net.IPNet `json:"address,omitempty"`
}

func (*IPConfig) UnmarshalJSON

func (ipc *IPConfig) UnmarshalJSON(data []byte) error

type Iface

type Iface struct {
	Name  string   `json:"name"`
	Type  string   `json:"type"`
	State string   `json:"state"`
	MTU   int      `json:"mtu"`
	IPv4  IPConfig `json:"ipv4,omitempty"`
	IPv6  IPConfig `json:"ipv6,omitempty"`
}

type NetState

type NetState struct {
	Hostname Hostname    `json:"hostname,omitempty"`
	DNS      DNSResolver `json:"dns-resolver,omitempty"`
	Routes   RoutesRC    `json:"routes,omitempty"`
	Ifaces   []Iface     `json:"interfaces"`
}

func (*NetState) GetDefaultNextHopIface

func (ns *NetState) GetDefaultNextHopIface() (r *Iface)

type Route

type Route struct {
	Destination  string `json:"destination"`
	NextHopIface string `json:"next-hop-interface"`
	NextHopAddr  string `json:"next-hop-address"`
}

type RoutesRC

type RoutesRC struct {
	Running []Route `json:"running"`
}

Jump to

Keyboard shortcuts

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