network

package
v0.0.0-...-67f2643 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Address string `json:"address"`
	Mask    int    `json:"mask"`
}

Address 代表一个 IPv4 或 IPv6 地址配置。

type IPV6PrefixAssignment

type IPV6PrefixAssignment struct {
	Address      string `json:"address"`
	Mask         int    `json:"mask"`
	LocalAddress struct {
		Address string `json:"address"`
		Mask    int    `json:"mask"`
	} `json:"local-address"`
}

IPV6PrefixAssignment 代表一个分配的 IPv6 前缀。

type InterfaceInfo

type InterfaceInfo struct {
	Interface            string                 `json:"interface"`
	Up                   bool                   `json:"up"`
	Pending              bool                   `json:"pending"`
	Available            bool                   `json:"available"`
	Autostart            bool                   `json:"autostart"`
	Dynamic              bool                   `json:"dynamic"`
	Uptime               int                    `json:"uptime"`
	L3Device             string                 `json:"l3_device"`
	Device               string                 `json:"device"`
	Protocol             string                 `json:"proto"`
	IPV4Address          []Address              `json:"ipv4-address"`
	IPV6Address          []Address              `json:"ipv6-address"`
	IPV6Prefix           []Address              `json:"ipv6-prefix"`
	Route                []Route                `json:"route"`
	DNSServer            []string               `json:"dns-server"`
	DNSSearch            []string               `json:"dns-search"`
	Data                 map[string]interface{} `json:"data"`
	Updated              []string               `json:"updated,omitempty"`
	Metric               int                    `json:"metric,omitempty"`
	DNSMetric            int                    `json:"dns_metric,omitempty"`
	Delegation           bool                   `json:"delegation,omitempty"`
	IPV6PrefixAssignment []IPV6PrefixAssignment `json:"ipv6-prefix-assignment,omitempty"`
	Neighbors            []json.RawMessage      `json:"neighbors,omitempty"`
	Inactive             json.RawMessage        `json:"inactive,omitempty"`
}

InterfaceInfo 代表一个网络接口的详细状态。 这是更新后的、更完整的结构体。

type Route

type Route struct {
	Target  string `json:"target"`
	Mask    int    `json:"mask"`
	Nexthop string `json:"nexthop"`
	Device  string `json:"device,omitempty"`
	OnLink  bool   `json:"on-link,omitempty"`
	Source  string `json:"source,omitempty"` // 增加了缺失的 source 字段
}

Route 代表一个网络路由。

Source Files

  • network.go

Jump to

Keyboard shortcuts

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