route_with_api

package
v0.0.0-...-2bcc11b Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ROUTE_FILE_PATH = "/proc/net/route"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NetRoute

type NetRoute struct {
	Metric      uint32 `json:"metric"`
	Destination string `json:"dest"`
	Gateway     string `json:"gateway"`
	Flags       string `json:"flags"`
	NetIf       string `json:"iface"`
}

func (NetRoute) ToPortableJSON

func (nr NetRoute) ToPortableJSON() string

func (NetRoute) ToTableString

func (nr NetRoute) ToTableString() string

type RouteFlag

type RouteFlag struct {
	U        bool `json:"up"`                       // 路由是活动的
	H        bool `json:"dest_is_single_host"`      // 目标是一个主机
	G        bool `json:"gateway"`                  // 路由指向网关
	S        bool `json:"static"`                   // bsd
	Cloned   bool `json:"clone_based_on_route"`     // bsd
	W        bool `json:"clone_auto_local"`         // bsd
	L        bool `json:"link_to_hw"`               // bsd
	Reinsta  bool `json:"reinstate_route"`          // linux
	D        bool `json:"dynamic_installed"`        // linux 由路由的后台程序动态地安装
	M        bool `json:"modified_from_routing_sw"` // linux 由路由的后台程序修改
	A        bool `json:"installed_by_addrconf"`    // linux
	Cached   bool `json:"cached"`                   // linux
	Rejected bool `json:"rejected"`                 // linux `!` 拒绝路由
}

func (RouteFlag) ToPortableJSON

func (rf RouteFlag) ToPortableJSON() string

func (RouteFlag) ToTableString

func (rf RouteFlag) ToTableString() string

Jump to

Keyboard shortcuts

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