Documentation
¶
Index ¶
- type Adapter
- type AdapterType
- type ByteList
- type Connector
- type ConnectorCatalog
- type FhrpGroup
- type FhrpMode
- type FirewallDumper
- type JSONSerializer
- type Member
- type Mode
- type Node
- type NodeSession
- type NodeType
- type Port
- type PortIterator
- type PortStatus
- type StringList
- type TypedInterface
- type Vrf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface {
ParseName(force bool) string
PortList(force bool) []Port
RouteTable(force bool) (ipv4TableMap, ipv6TableMap map[string]*network.AddressTable)
GetConfig(force bool) interface{}
BatchRun(interface{}) (interface{}, error)
BatchConfig(p ...interface{}) (interface{}, error)
TaskId() uint
AttachChannel(out chan string) bool
Info(bool) (*device.DeviceBaseInfo, error)
GetRawConfig(string, bool) (any, error)
}
type ByteList ¶
type ByteList []byte
func (ByteList) GormDataType ¶
func (ByteList) MarshalJSON ¶
func (*ByteList) UnmarshalJSON ¶
type Connector ¶
type Connector interface {
TypedInterface
JSONSerializer
ID() string
Verify(port Port) validator.Result
GetOrCreateFhrpGroup(groupIp string, mode FhrpMode) FhrpGroup
PortCount() int
Port(name string) Port
Attach(port Port)
SelectPortListByNetwork(net network.AbbrNet, vrf string) []Port
HitByNetwork(net network.AbbrNet, vrf string) bool
HitByIp(ipWithPrefix, vrf string) bool
SelectNodeByIp(ip, vrf string) (Node, Port)
AddFhrpGroupMember(member Member)
// NetworkList() []map[network.IPFamily][]string
IPv4List() StringList
IPv6List() StringList
PortList() []Port
Mode() Mode
WithPortIterator(iterator PortIterator)
}
type FhrpGroup ¶
type FhrpGroup interface {
TypedInterface
JSONSerializer
AddMember(member Member)
Active() Member
GroupIp() string
}
type FirewallDumper ¶
type JSONSerializer ¶
type Member ¶
type Member interface {
TypedInterface
JSONSerializer
IsActive() bool
Hit(ip string) bool
Ip() string
FhrpMode() FhrpMode
PortName() string
}
type Node ¶
type Node interface {
TypedInterface
JSONSerializer
WithID(id string) Node
ID() string
GetOrCreateVrf(name string) Vrf
GetVrf(name string) Vrf
SetIpv4RouteTable(vrfName string, table *network.AddressTable)
SetIpv6RouteTable(vrfName string, table *network.AddressTable)
GetPortByNameOrAlias(name string) Port
GetPortByIfIndex(ifIndex int) Port
GetPortByID(id string) Port
AddPort(port Port, connection []*config.ConnectionInfo)
FlattenPath() []string
FlattenName() string
WithNodeMap(name string) Node
WithName(name string) Node
Ipv4RouteTable(vrfName string) *network.AddressTable
Ipv6RouteTable(vrfName string) *network.AddressTable
Ipv6RouteCheck(netList network.NetworkList, inPort, vrf string) (bool, *tools.Table, []string, error)
Ipv4RouteCheck(netList network.NetworkList, inPort, vrf string) (bool, *tools.Table, []string, error)
IpRouteCheck(netList network.NetworkList, inPort, vrf string, af network.IPFamily) (bool, *tools.Table, []string, error)
Name() string
Vrfs() []Vrf
PortList() []Port
PortRefs() []string
WithCmdIp(ip string)
CmdIp() string
NodeType() NodeType
WithPortIterator(iterator PortIterator) Node
SetDeviceConfig(deviceConfig *config.DeviceConfig)
GetDeviceConfig() *config.DeviceConfig
ExtraInit(adapter Adapter, deviceConfig *config.DeviceConfig)
}
type NodeSession ¶
type Port ¶
type Port interface {
TypedInterface
JSONSerializer
ID() string
Name() string
Node() Node
// Connector() Connector
ConnectorID() string
// AttachToConnector(connector Connector)
Members() []Member
AliasName() []string
PeerVrf() []string
Vrf() string
AddIpv6(ip string)
AddIpv4(ip string)
Ipv4List() []string
Ipv6List() []string
V4NetworkGroup() *network.NetworkGroup
V6NetworkGroup() *network.NetworkGroup
HitByNetwork(net network.AbbrNet) bool
FullMatchByIp(ip, vrf string) bool
HitByIpWithoutPrefix(target, vrf string) bool
HitByIp(target, vrf string) bool
HitByIfIndex(ifIndex int) bool
MatchVrfOrPeerVrf(name string) bool
HitByName(name string) bool
IfIndex() int
WithStatus(status string) Port
WithNode(node Node) Port
WithVrf(vrf string) Port
WithPeerVrf(name string) Port
WithAliasName(name string) Port
GetIpList() map[network.IPFamily][]string
FlattenName() string
FlattenPath() []string
NetworkGroup() *network.NetworkGroup
WithID(id string) Port
// WithConnector(c Connector)
WithConnectorID(id string)
// Area related methods
WithArea(areaName string, ipFamily network.IPFamily) Port
Area(ipFamily network.IPFamily) string
// StubArea related methods
WithStubArea(isStubArea bool, ipFamily network.IPFamily) Port
IsStubArea(ipFamily network.IPFamily) bool
}
type PortIterator ¶
type PortIterator interface {
// GetPort 根据端口引用(名称或ID)返回对应的 Port 对象
GetPort(ref string) Port
// GetAllPorts 返回所有的 Port 对象
GetAllPorts() []Port
}
PortIterator 定义了一个接口,用于从 NodeMap 中获取 Port 对象
type PortStatus ¶
type PortStatus int
const ( UNKNOWN PortStatus = iota DOWN UP )
func NewPortStatusFromString ¶
func NewPortStatusFromString(status string) PortStatus
func (PortStatus) String ¶
func (p PortStatus) String() string
type StringList ¶
type StringList []string
func (StringList) GormDataType ¶
func (StringList) GormDataType() string
func (*StringList) Scan ¶
func (m *StringList) Scan(value interface{}) error
type TypedInterface ¶
type TypedInterface interface {
TypeName() string
}
type Vrf ¶
type Vrf interface {
TypedInterface
JSONSerializer
Name() string
Ipv4Table() *network.AddressTable
Ipv6Table() *network.AddressTable
}
Click to show internal directories.
Click to hide internal directories.