interface_

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderAsc  = "asc"  // 按升序排列
	OrderDesc = "desc" // 按降序排列
)

Order 排序方式

View Source
const (
	InterfaceTypePhysicalIf = "PHYSICALIF" // 物理口
	InterfaceTypeSubIf      = "SUBIF"      // 子接口
	InterfaceTypeChannelIf  = "CHANNELIF"  // 聚合口
	InterfaceTypeVlanIf     = "VLANIF"     // vlan对应的3层接口
	InterfaceTypeVpnTun     = "VPNTUN"     // vpn隧道口
	InterfaceTypeLoopback   = "LOOPBACK"   // 回环口
	InterfaceTypeGreTun     = "GRETUN"     // GRE隧道口
	InterfaceTypeSslTun     = "SSLTUN"     // SSL隧道口
	InterfaceTypeVsysIf     = "VSYSIF"     // 虚拟系统的虚拟接口
	InterfaceTypeTunnelIf   = "TUNNELIF"   // 隧道口
)

InterfaceType 接口类型

View Source
const (
	InterfaceModeRoute        = "ROUTE"        // 路由类型,接口作为3层接口
	InterfaceModeSwitch       = "SWITCH"       // 交换类型,接口作为2层接口
	InterfaceModeVirtualLine  = "VIRTUALLINE"  // 虚拟线类型,接口作为虚拟线的一端
	InterfaceModeBypassMirror = "BYPASSMIRROR" // 旁路镜像类型,该模式进来的报文,只处理不转发
)

InterfaceMode 接口工作模式

View Source
const (
	IPv4ModeStatic = "STATIC" // 静态配置
	IPv4ModeDHCP   = "DHCP"   // dhcp方式获取
	IPv4ModePPPOE  = "PPPOE"  // pppoe方式获取
)

IPv4Mode IPv4地址获取类型

View Source
const (
	IPv6ModeStatic = "STATIC" // static IP
	IPv6ModeDHCP6  = "DHCP6"  // dhcp6
)

IPv6Mode IPv6地址获取类型

View Source
const (
	NDInspectionTypeDrop    = "DROP"    // 丢包
	NDInspectionTypeForward = "FORWARD" // 转发
	NDInspectionTypeOff     = "OFF"     // 关闭
)

NDInspectionType NDP检查模式

View Source
const (
	RouterPreferenceHigh   = "HIGH"   // 高优先级
	RouterPreferenceLow    = "LOW"    // 低优先级
	RouterPreferenceMedium = "MEDIUM" // 中优先级
)

RouterPreference 路由器优先级

View Source
const (
	RASupressAll     = "ALL"     // 周期性发送RA
	RASupressPart    = "PART"    // 不主动发送RA,收到RS会回应
	RASupressDisable = "DISABLE" // 不主动发送,也不应答
)

RASupress RA的抑制配置

View Source
const (
	VLANModeAccess = "ACCESS" // access模式
	VLANModeTrunk  = "TRUNK"  // trunk模式
)

VLANMode VLAN模式

View Source
const (
	ChannelModeStatic = "STATIC" // 静态
	ChannelModeLACP   = "LACP"   // 动态
)

ChannelMode 汇聚口的工作模式配置

View Source
const (
	StaticModeFailover    = "FAILOVER"    // 故障转移
	StaticModeLoadBalance = "LOADBALANCE" // 负载均衡
)

StaticMode 模式选择

View Source
const (
	LoadBalanceRoundRobin = "ROUNDROBIN" // 平衡轮询策略
	LoadBalanceL2Hash     = "L2HASH"     // hash负载分担平衡策略
	LoadBalanceL3Hash     = "L3HASH"     // hash负载分担平衡策略
	LoadBalanceL4Hash     = "L4HASH"     // hash负载分担平衡策略
	LoadBalanceTLB        = "TLB"        // tlb策略
)

LoadBalance 负载均衡的方法

View Source
const (
	HashModeMAC    = "MAC"    // 源与目的mac
	HashMode2Tuple = "2TUPLE" // 源与目的IP、mac
	HashMode3Tuple = "3TUPLE" // 源与目的IP、mac、port
)

HashMode 哈希策略

View Source
const (
	NegotiateModeInitiative = "INITIATIVE" // 源与目的IP
	NegotiateModePassive    = "PASSIVE"    // 源与目的IP、mac
)

NegotiateMode 协商模式

View Source
const (
	GRETunnelTypeIPv4 = "IPV4" // IPV4 隧道封装
	GRETunnelTypeIPv6 = "IPV6" // IPV6 隧道封装
)

GRETunnelType 隧道IP地址类型

View Source
const (
	TunnelIfTypeIPIPv6 = "IPIPV6" // IPv4 over IPv6隧道
	TunnelIfTypeIPv6IP = "IPV6IP" // IPv6 over IPv4隧道
	TunnelIfType6To4   = "6TO4"   // 6to4自动隧道
	TunnelIfTypeISATAP = "ISATAP" // ISATAP自动隧道
)

TunnelIfType 隧道类型

View Source
const (
	LLDPStateDisable = "DISABLE" // 既不能接收LLDP报文,也不能发送LLDP报文
	LLDPStateRX      = "RX"      // 只能接收LLDP报文
	LLDPStateTX      = "TX"      // 只能发送LLDP报文
	LLDPStateTXRX    = "TXRX"    // 既能接收LLDP报文,也能发送LLDP报文
)

LLDPState LLDP工作模式

View Source
const (
	PortP2PForceTrue  = "FORCETRUE"  // 强制指定为点对点链路
	PortP2PForceFalse = "FORCEFALSE" // 强制指定为非点对点链路
	PortP2PAuto       = "AUTO"       // 系统自动检测是否为点对点链路
)

PortP2P 指定端口是否是点对点链路

View Source
const (
	IPMacBindDisable = "DISABLE" // 禁用
	IPMacBindLoose   = "LOOSE"   // 宽松模式
	IPMacBindStrict  = "STRICT"  // 严格模式
)

IPMacBind IP-MAC绑定

View Source
const (
	Speed100Mbps    = 100    // 选择100Mbps
	Speed1000Mbps   = 1000   // 选择1000Mbps
	Speed10000Mbps  = 10000  // 选择10000Mbps
	Speed40000Mbps  = 40000  // 选择40000Mbps
	Speed100000Mbps = 100000 // 选择100000Mbps
)

Speed 接口速率

View Source
const (
	DuplexHalf = "half" // 半双工模式
	DuplexFull = "full" // 全双工模式
)

Duplex 双工模式

View Source
const (
	DHCP6ClientModeAddr = "ADDR" // dhcp6 client addr模式
)

DHCP6ClientMode DHCP6客户端模式

Variables

This section is empty.

Functions

This section is empty.

Types

type BandSwitch

type BandSwitch struct {
	IngressBandSwitch struct {
		Value uint64 `json:"value"` // 数值大小 (0-1099511627776)
	} `json:"ingressbandSwitch"` // 接口接收的带宽限制
	EgressBandSwitch struct {
		Value uint64 `json:"value"` // 数值大小 (0-1099511627776)
	} `json:"egressbandSwitch"` // 接口发送的带宽限制
}

BandSwitch 接口接收或发送的带宽限制

type BasicTLV

type BasicTLV struct {
	ManagementAddress bool `json:"managementAddress"` // 管理地址tlv
	SystemCapability  bool `json:"systemCapability"`  // 系统能力tlv
	SystemDescription bool `json:"systemDescription"` // 系统描述tlv
	SystemName        bool `json:"systemName"`        // 系统名称tlv
	PortDescription   bool `json:"portDescription"`   // 端口描述tlv
}

BasicTLV 基本tlv

type BypassMirror

type BypassMirror struct {
	StatsEnable bool     `json:"statsEnable"` // 是否启用流量统计 (必填)
	IPGroup     []string `json:"ipGroup"`     // 内网网络对象,旁路镜像模式开启流量统计时使用
}

BypassMirror 旁路镜像模式配置

type ChannelIf

type ChannelIf struct {
	ChannelMode   string         `json:"channelMode"`   // 汇聚口的工作模式配置 (STATIC/LACP, 必填)
	ChannelStatic *ChannelStatic `json:"channelStatic"` // 聚合口静态模式下的相关配置,聚合口工作模式为静态时使用
	ChannelLACP   *ChannelLACP   `json:"channelLacp"`   // 聚合口动态模式下的相关配置,聚合口工作模式为动态时使用
	EthSelect     []string       `json:"ethSelect"`     // 选择的物理口列表 (必填)
	BypassMirror  *BypassMirror  `json:"bypassMirror"`  // 旁路镜像模式有效
}

ChannelIf 聚合口相关配置

type ChannelLACP

type ChannelLACP struct {
	HashMode      string `json:"hashMode"`      // 哈希策略 (MAC/2TUPLE/3TUPLE, 必填)
	NegotiateMode string `json:"negotiateMode"` // 协商模式 (INITIATIVE/PASSIVE, 必填)
}

ChannelLACP 聚合口动态模式下的相关配置

type ChannelStatic

type ChannelStatic struct {
	StaticMode  string    `json:"staticMode"`  // 模式选择 (FAILOVER/LOADBALANCE, 必填)
	Failover    *Failover `json:"failover"`    // 故障转移
	LoadBalance string    `json:"loadbalance"` // 负载均衡的方法,聚合口静态模式选择负载均衡时使用 (ROUNDROBIN/L2HASH/L3HASH/L4HASH/TLB)
}

ChannelStatic 聚合口静态模式下的相关配置

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client 接口客户端

func NewClient

func NewClient(host, token, sessid string, httpClient *http.Client) *Client

NewClient 创建新的接口客户端

func NewClientWithNamespace

func NewClientWithNamespace(host, token, sessid, namespace string, httpClient *http.Client) *Client

NewClientWithNamespace 创建新的接口客户端(指定命名空间)

func (*Client) GetInterfaces

func (c *Client) GetInterfaces(req *GetInterfacesRequest) (*GetInterfacesResponse, error)

GetInterfaces 获取接口列表

type DAD

type DAD struct {
	Time     uint32 `json:"time"`     // 发送DAD的间隔 (1000-3600000)
	Attempts uint32 `json:"attempts"` // 尝试的次数,超过则认为DAD检测成功 (0-600)
}

DAD 重复地址检测消息配置

type DHCP

type DHCP struct {
	Gateway bool `json:"gateway"` // 是否设置dhcp gateway
	DNS     bool `json:"dns"`     // 设置dns
	Unicast bool `json:"unicast"` // 是否设置dhcp 单播模式
}

DHCP IPv4 DHCP客户端配置

type DHCP6

type DHCP6 struct {
	ClientMode     string        `json:"clientMode"`     // 客户端模式 (ADDR)
	ServerIP       *IPv6ServerIP `json:"serverIp"`       // dhcp6客户端指定的server ip
	RapidOption    bool          `json:"rapidOption"`    // 是否开启dhcp6 rapid-commit(快速分配)选项
	InfoOnlyOption bool          `json:"infoOnlyOption"` // 是否开启dhcp6 info-only(只获取信息)选项
}

DHCP6 IPv6 DHCP6客户端配置

type DNSDomain

type DNSDomain struct {
	Name     string `json:"name"`     // dns域名 (最大127字符)
	Lifetime uint32 `json:"lifetime"` // 首选生存时间 (0-4294967295)
}

DNSDomain RA消息中dns域名

type DNSServer

type DNSServer struct {
	IPv6Address string `json:"ipv6Address"` // dns服务器地址 (ip6-address格式)
	Lifetime    uint32 `json:"lifetime"`    // 首选生存时间 (0-4294967295)
}

DNSServer RA消息中dns服务器配置

type DefaultGateway

type DefaultGateway struct {
	IPv4Gateway string `json:"ipv4Gateway"` // ipv4 gateway (IPv4地址格式,示例:192.168.1.10)
	IPv6Gateway string `json:"ipv6Gateway"` // ipv6 gateway (ip6-address格式)
}

DefaultGateway 接口默认网关

type Dot1TLV

type Dot1TLV struct {
	PortVlanID bool `json:"portVlanId"` // 端口vlan id tlv (默认false)
}

Dot1TLV 802.1tlv

type Dot3TLV

type Dot3TLV struct {
	LinkAggregation  bool `json:"linkAggregation"`  // 链路聚合tlv (默认false)
	MacPhysic        bool `json:"macPhysic"`        // 物理信息tlv (默认false)
	MaximumFrameSize bool `json:"maximumFrameSize"` // 最大帧长度tlv (默认false)
}

Dot3TLV 802.3tlv

type Failover

type Failover struct {
	Preempt        bool   `json:"preempt"`        // 主备模式下的抢占或非抢占
	ChannelPrimary string `json:"channelPrimary"` // 聚合口主备模式的主接口,状态字段,配置无效
}

Failover 故障转移

type GRETunIf

type GRETunIf struct {
	Type           string     `json:"type"`           // 隧道IP地址类型 (IPV4/IPV6)
	TunnelSrc      string     `json:"tunnelSrc"`      // 隧道的源地址 (ip-address格式)
	TunnelDst      string     `json:"tunnelDst"`      // 隧道的目的地址 (ip-address格式)
	GREKey         int64      `json:"greKey"`         // gre的密钥 (-1-4294967295)
	CheckSumEnable bool       `json:"checkSumEnable"` // 是否开启报文检验和 (默认false)
	Keepalive      *Keepalive `json:"keepalive"`      // keepalive相关配置
	CreateTime     string     `json:"createTime"`     // 隧道创建时间 (格式:YYYY-MM-DD HH:MM:SS)
}

GRETunIf GRE隧道口相关配置

type GetInterfacesRequest

type GetInterfacesRequest struct {
	// 获取可选择的HA接口
	HAItf bool
	// 获取虚拟IP可使用的接口
	VirtualHAItf bool
	// 获取监视端口vlan和接口
	HAMonitorItf bool
	// 模糊搜索关键字 (最大95字符)
	Search string
	// 过滤参数:接口类型
	// PHYSICALIF: 物理口
	// SUBIF: 子接口
	// CHANNELIF: 汇聚口
	// VLANIF: vlan对应的3层接口
	// LOOPBACK: 本地环回口
	// GRETUN: GRE隧道
	// VSYSIF: 虚拟接口
	// TUNNELIF: 隧道口
	IfType string
	// 起始位置,从 0 开始 (0-2000000, 默认0)
	Start int
	// 获取最大长度,限制最大值,如果数据不够可能返回小于 length (1-200, 默认100)
	Length int
	// 过滤参数:接口模式,用于物理口,聚合口
	// ROUTE: 路由类型,接口作为3层接口
	// SWITCH: 交换类型,接口作为2层接口
	// VIRTUALLINE: 虚拟线类型,接口作为虚拟线的一端
	// BYPASSMIRROR: 旁路镜像类型,该模式进来的报文,只处理不转发
	IfMode string
	// 指定排序字段 (最大100字符)
	SortBy string
	// 指定排序方式(正序/倒序)(asc/desc, 默认asc)
	Order string
	// 选择字段,字段用逗号分隔 (最大1000字符)
	Select string
	// 过滤wan口
	WanEnable bool
	// 是否去除被聚合口选择的物理口
	OptionalItf bool
	// 获取子接口可用的父接口
	SubFatherItf bool
	// 否为聚合口可选择的物理口
	SelectChannel bool
	// 接口对外公用插件
	FilterInterfaces string
	// 获取该接口所属于的聚合口的配置 (接口名称格式)
	GetChannel string
	// 过滤接口veth.0
	FilterVeth0 bool
	// 获取本地可用同步/传输网口
	MkptItf bool
	// 是否为区域可选择的接口
	ZoneItf bool
	// 过滤管理口
	OobManage bool
	// 获取所有三层接口
	RouteItf bool
	// 显示流量趋势支持的接口
	Traffics bool
}

GetInterfacesRequest 获取接口列表请求参数

type GetInterfacesResponse

type GetInterfacesResponse struct {
	Code    int    `json:"code"`    // 错误码
	Message string `json:"message"` // 错误信息
	Data    struct {
		TotalItems    int32           `json:"totalItems"`    // 总共多少项目
		TotalPages    int32           `json:"totalPages"`    // 总共多少页
		PageNumber    int32           `json:"pageNumber"`    // 当前页码,从 1 开始
		PageSize      int32           `json:"pageSize"`      // 每页多大
		ItemsOffset   int32           `json:"itemsOffset"`   // 当前条目偏移,从 0 开始
		ItemLength    int32           `json:"itemLength"`    // 数据列表长度
		PrivateOffset uint64          `json:"privateOffset"` // 内部偏移
		Items         []InterfaceItem `json:"items"`         // 有效数据列表
	} `json:"data"`
}

GetInterfacesResponse 获取接口列表响应

func (*GetInterfacesResponse) IsSuccess

func (r *GetInterfacesResponse) IsSuccess() bool

IsSuccess 检查请求是否成功

type IPAddress

type IPAddress struct {
	Start string `json:"start"` // ip范围的起始位置 (ip-address格式,必填)
	End   string `json:"end"`   // ip范围的终止位置 (ip-address格式,可选)
	Bits  uint8  `json:"bits"`  // ip掩码简写 (可选)
}

IPAddress IPv4地址范围

type IPv4Config

type IPv4Config struct {
	IPv4Mode       string     `json:"ipv4Mode"`       // IPv4地址获取类型 (STATIC/DHCP/PPPOE)
	StaticIP       []StaticIP `json:"staticIp"`       // IPv4地址列表,三层模式IPv4为静态IP时使用
	DHCP           *DHCP      `json:"dhcp"`           // dhcp4 client配置,三层模式IPv4为DHCP时使用
	PPPOEGroupName string     `json:"pppoeGroupName"` // PPPoE名称,三层模式IPv4为PPPoE时使用
}

IPv4Config IPv4配置

type IPv6Config

type IPv6Config struct {
	IPv6Mode               string         `json:"ipv6Mode"`               // IPv6地址获取类型,路由模式有效 (STATIC/DHCP6)
	AutoconfigEnable       bool           `json:"autoconfigEnable"`       // AUTOCONFIG模式是否开启
	AutoconfigDefaultRoute bool           `json:"autoconfigDefaultRoute"` // default route 是否设置
	StaticIP               []IPv6StaticIP `json:"staticIp"`               // IPv6地址列表,IPv6地址为静态IP时使用
	DHCP6                  *DHCP6         `json:"dhcp6"`                  // dhcp6客户端配置
	IPv6Param              *IPv6Param     `json:"ipv6Param"`              // ipv6参数
}

IPv6Config IPv6配置

type IPv6Param

type IPv6Param struct {
	Enable       bool          `json:"enable"`        // 是否启用ipv6 (默认false)
	MTU          uint32        `json:"mtu"`           // 最大传输单元设置 (1280-1500)
	NDLearning   bool          `json:"nd_learning"`   // 是否启用nd学习
	NDInspection *NDInspection `json:"nd_inspection"` // ND检查
	ND           *ND           `json:"nd"`            // ipv6ND协议配置
}

IPv6Param IPv6参数

type IPv6ServerIP

type IPv6ServerIP struct {
	Start string `json:"start"` // ip范围的起始位置 (ip-address格式,必填)
	End   string `json:"end"`   // ip范围的终止位置 (ip-address格式,可选)
	Bits  uint8  `json:"bits"`  // ip掩码简写 (可选)
}

IPv6ServerIP IPv6 DHCP6服务器IP范围

type IPv6StaticIP

type IPv6StaticIP struct {
	Start string `json:"start"` // ip范围的起始位置 (ip-address格式,必填)
	End   string `json:"end"`   // ip范围的终止位置 (ip-address格式,可选)
	Bits  uint8  `json:"bits"`  // ip掩码简写 (可选)
}

IPv6StaticIP IPv6静态IP配置

type InterfaceItem

type InterfaceItem struct {
	// 基础信息
	UUID        string   `json:"uuid"`        // uuid
	Name        string   `json:"name"`        // 接口名称 (必填,接口名称格式)
	Description string   `json:"description"` // 接口描述 (0-95字符,不能包含特殊字符)
	VSys        []string `json:"vsys"`        // 虚拟系统
	MTU         int32    `json:"mtu"`         // 最大传输单元 (68-1500)

	// 接口类型和模式
	IfType string `json:"ifType"` // 表示接口类型 (必填)
	// 可选值: PHYSICALIF, SUBIF, CHANNELIF, VLANIF, VPNTUN, LOOPBACK, GRETUN, SSLTUN, VSYSIF, TUNNELIF
	IfMode string `json:"ifMode"` // 接口的工作模式,接口类型为物理口和聚合口时使用

	// 物理口和聚合口特有字段
	MAC      string `json:"mac"`      // 接口的mac地址,接口类型为物理口和聚合口时使用
	Shutdown bool   `json:"shutdown"` // 接口的启用或禁用,接口类型为物理口和聚合口时使用

	// IPv4配置
	IPv4 *IPv4Config `json:"ipv4"` // 接口ipv4相关配置,三层模式时使用

	// IPv6配置
	IPv6 *IPv6Config `json:"ipv6"` // 接口ipv6相关配置,三层模式时使用

	// 其他配置
	WanEnable          bool            `json:"wanEnable"`          // 是否开启接口的wan模式,接口类型为物理口和聚合口时使用
	DefaultGateway     *DefaultGateway `json:"defaultGateway"`     // 接口默认网关
	ReverseRoute       *ReverseRoute   `json:"reverseRoute"`       // 接口源进源出下一跳
	ReverseRouteEnable bool            `json:"reverseRouteEnable"` // 标识接口是否开启源进源出
	BandSwitch         *BandSwitch     `json:"bandSwitch"`         // 接口接收或发送的带宽限制,物理口和聚合口的路由模式时使用
	Manage             *Manage         `json:"manage"`             // 本地策略控制,接口上控制是否放行对应类型的报文,三层模式时使用
	Jumbo              bool            `json:"jumbo"`              // 巨帧模式 (默认false)
	VLAN               *VLANConfig     `json:"vlan"`               // vlan配置,物理口和聚合口透明模式时使用
	VLANID             uint32          `json:"vlanId"`             // 标识子接口和vlan口的vlanid,接口类型为物理口和聚合口时使用 (0-4094)

	// 接口类型特定配置
	PhysicalIf *PhysicalIf `json:"physicalif"` // 物理口相关配置,接口类型为物理接口时使用
	SubIf      *SubIf      `json:"subif"`      // 子接口相关配置,接口类型为子接口时使用
	ChannelIf  *ChannelIf  `json:"channelif"`  // 聚合口相关配置,接口类型为聚合接口时使用
	GRETunIf   *GRETunIf   `json:"gretunif"`   // GRE隧道口相关配置
	TunnelIf   *TunnelIf   `json:"tunnelif"`   // 隧道口相关配置

	// 其他配置
	OobManage  bool        `json:"oobManage"`  // 带外管理起禁用
	LLDPConfig *LLDPConfig `json:"lldpConfig"` // 接口lldp参数配置信息
	RSTP       *RSTP       `json:"rstp"`       // rstp接口配置信息,按条件选择
	IPMacBind  string      `json:"ipmacBind"`  // ip-mac绑定 (DISABLE/LOOSE/STRICT)
}

InterfaceItem 接口项

type Keepalive

type Keepalive struct {
	AliveEnable bool   `json:"aliveEnable"` // 是否开启keepalive保活功能 (默认false)
	Interval    uint16 `json:"interval"`    // 间隔时间 (1-32767)
	Attempt     uint16 `json:"attempt"`     // 最大发送次数 (1-255)
}

Keepalive Keepalive相关配置

type LLDPConfig

type LLDPConfig struct {
	State    string    `json:"state"`    // 工作模式 (DISABLE/RX/TX/TXRX)
	BasicTLV *BasicTLV `json:"basicTlv"` // 基本tlv
	Dot1TLV  *Dot1TLV  `json:"dot1Tlv"`  // 802.1tlv
	Dot3TLV  *Dot3TLV  `json:"dot3Tlv"`  // 802.3tlv
}

LLDPConfig 接口lldp参数配置信息

type Manage

type Manage struct {
	SSH   bool `json:"ssh"`   // 是否启用ssh (默认false)
	SNMP  bool `json:"snmp"`  // 是否启用snmp (默认false)
	HTTPS bool `json:"https"` // 是否启用https
	Ping  bool `json:"ping"`  // 是否启用ping
}

Manage 本地策略控制

type ND

type ND struct {
	DAD         *DAD          `json:"dad"`          // 重复地址检测消息配置
	NUD         *NUD          `json:"nud"`          // 邻居不可达检测配置
	Router      *Router       `json:"router"`       // ipv6,路由相关配置
	RAPrefix    []RAPrefix    `json:"ra_prefix"`    // ipv6 RA参数
	RoutePrefix []RoutePrefix `json:"route_prefix"` // ipv6 ROUTE参数
	NSInterval  uint32        `json:"ns_interval"`  // NS重传间隔,单位为毫秒 (1000-4294967295)
}

ND IPv6 ND协议配置

type NDInspection

type NDInspection struct {
	InspectionType string `json:"inspectionType"` // NDP检查模式 (DROP/FORWARD/OFF)
	Trust          bool   `json:"trust"`          // 接口可信 (默认false)
	DenyRA         bool   `json:"denyra"`         // 禁止接收RA (默认false)
	RateLimit      uint32 `json:"rate_limit"`     // NDP报文速率限制 (0-10000)
}

NDInspection ND检查

type NUD

type NUD struct {
	RetryBase     uint32 `json:"retry_base"`     // 失败次数超过则nd表项做状态切换 (1-3)
	Attempts      uint32 `json:"attempts"`       // 发送NUD次数 (1-10)
	Interval      uint32 `json:"interval"`       // 发送NUD间隔 (1000-3600000)
	ReachableTime uint32 `json:"reachable_time"` // 判断ipv6节点是否可达的最大时间,超过则认为不可达 (1000-3600000)
}

NUD 邻居不可达检测配置

type PhysicalIf

type PhysicalIf struct {
	SpeedDuplex  SpeedDuplex   `json:"speedDuplex"`  // 速率双工配置 (必填)
	BypassMirror *BypassMirror `json:"bypassMirror"` // 旁路镜像模式配置,物理接口旁路镜像模式时使用
}

PhysicalIf 物理口相关配置

type RAPrefix

type RAPrefix struct {
	Prefix            string `json:"prefix"`            // IPV6 ND前缀信息(前缀信息或者default)
	ValidLifetime     uint32 `json:"validLifetime"`     // 有效生存时间 (0-4294967295)
	PreferredLifetime uint32 `json:"perferredLifetime"` // 首选生存时间 (0-4294967295)
	NoAutoconfig      bool   `json:"noAutoconfig"`      // IPV6 ND前缀autoconfig选项 (默认false)
	OffLink           bool   `json:"offLink"`           // 控制IPV6 ND前缀分配给本地链路开关选项 (默认false)
	NoAdvertise       bool   `json:"noAdvertise"`       // 控制IPV6 ND前缀是否包含在RA消息中开关选项 (默认false)
}

RAPrefix IPv6 RA参数

type RSTP

type RSTP struct {
	RSTPState    bool   `json:"rstpState"`    // 接口是否起禁用rstp (默认false)
	RSTPPriority uint8  `json:"rstpPriority"` // 端口优先级 (0-240)
	PortEdge     bool   `json:"portEdge"`     // 设置边缘端口, 为true时,自动管理;false时:强制指定为非边缘端口
	PortPathCost uint32 `json:"portPathCost"` // rstp端口开销 (1-200000000)
	PortP2P      string `json:"portP2P"`      // 指定端口是否是点对点链路 (FORCETRUE/FORCEFALSE/AUTO)
}

RSTP RSTP接口配置信息

type ReverseRoute

type ReverseRoute struct {
	IPv4Nexthop string `json:"ipv4Nexthop"` // reverse route ipv4 gnexthop (IPv4地址格式,示例:192.168.1.10)
	IPv6Nexthop string `json:"ipv6Nexthop"` // reverse route ipv6 gnexthop (ip6-address格式)
}

ReverseRoute 接口源进源出下一跳

type RoutePrefix

type RoutePrefix struct {
	Prefix     string `json:"prefix"`   // IPV6 路由前缀信息 (IPv6地址格式,示例:fe80::40ca:81ff:fea9:a768/24)
	Lifetime   uint32 `json:"lifetime"` // 生存时间 (0-4294967295)
	Preference string `json:"prefence"` // 路由前缀的优先级 (HIGH/LOW/MEDIUM)
}

RoutePrefix IPv6 ROUTE参数

type Router

type Router struct {
	RAIntervalOption bool       `json:"ra_interval_option"` // ra中公告间隔选项是否打开
	Preference       string     `json:"prefence"`           // 路由器的优先级 (HIGH/LOW/MEDIUM)
	RAMinInterval    uint32     `json:"ra_min_interval"`    // RA发送最小间隔,单位s (3-1800)
	RAMaxInterval    uint32     `json:"ra_max_interval"`    // RA发送最大间隔,单位s (4-1800, max必须大于min)
	RALifetime       uint32     `json:"ra_lifetime"`        // RA中路由器的生命周期 (0-9000)
	RASupress        string     `json:"ra_supress"`         // ra的抑制配置 (ALL/PART/DISABLE)
	ManageFlag       bool       `json:"manage_flag"`        // RA报文中M标记位 (默认false)
	OtherFlag        bool       `json:"other_flag"`         // RA报文中O标记位 (默认false)
	NoLinkMTU        bool       `json:"no_linkmtu"`         // 用来配置RA消息中不携带MTU选项 (默认false)
	DNSServer        *DNSServer `json:"dns_server"`         // RA消息中dns服务器配置
	DNSDomain        *DNSDomain `json:"dns_domain"`         // RA消息中dns域名
	HopLimit         uint16     `json:"hopLimit"`           // TTL (0-255)
}

Router IPv6路由相关配置

type SpeedDuplex

type SpeedDuplex struct {
	Autoneg bool   `json:"autoneg"` // 接口速率工作模式自动协商,为true时speed和duplex不再生效
	Speed   uint32 `json:"speed"`   // 接口速率,autoneg为false时speed配置生效 (100/1000/10000/40000/100000)
	Duplex  string `json:"duplex"`  // 双工模式,autoneg为false时duplex配置生效 (half/full)
}

SpeedDuplex 速率双工配置

type StaticIP

type StaticIP struct {
	IPAddress IPAddress `json:"ipaddress"` // IPv4地址
	IsSync    bool      `json:"isSync"`    // 是否不同步到备机的选项
}

StaticIP IPv4静态IP配置

type SubIf

type SubIf struct {
	FatherInterface string `json:"fatherInterface"` // 接口的父接口,子接口时表示父接口 (必填)
}

SubIf 子接口相关配置

type TrunkConfig

type TrunkConfig struct {
	NativeID   int32        `json:"nativeId"`   // trunk native vlanid (1-4094, 必填)
	TrunkRange []TrunkRange `json:"trunkRange"` // trunk vlan 范围 (必填)
}

TrunkConfig Trunk配置

type TrunkRange

type TrunkRange struct {
	Start uint32 `json:"start"` // vlan范围起始值 (1-4094)
	End   uint32 `json:"end"`   // vlan范围结束值 (1-4094)
}

TrunkRange Trunk VLAN范围

type TunnelIf

type TunnelIf struct {
	Type        string `json:"type"`        // 隧道类型 (IPIPV6/IPV6IP/6TO4/ISATAP)
	Source      string `json:"source"`      // 隧道源信息
	Destination string `json:"destination"` // 隧道目的信息 (ip-address格式)
}

TunnelIf 隧道口相关配置

type VLANConfig

type VLANConfig struct {
	VLANMode    string       `json:"vlanMode"`    // vlan模式 (ACCESS/TRUNK)
	AccessID    uint32       `json:"accessId"`    // access vlan id,透明模式下选择access时使用 (1-4094)
	TrunkConfig *TrunkConfig `json:"trunkConfig"` // trunk配置,透明模式下选择trunk时使用
}

VLANConfig VLAN配置

Jump to

Keyboard shortcuts

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