Documentation ¶
Index ¶
- Constants
- Variables
- func Commands() string
- func Commit() bool
- func Compare() string
- func CompareCommand() string
- func ConfigDiscard() bool
- func ConfigLookupVrf(ifName string) string
- func Delete(c *Config, leaf bool)
- func DhcpExitFunc()
- func DhcpJsonConfig(path []string, str string) error
- func DhcpLeaseGet(poolConfig *DhcpIpPool) (string, error)
- func DhcpLocalAddrLookup(ifName string) string
- func DhcpServerExec(dhcp *Dhcp, poolConfig *DhcpIpPool)
- func DhcpServerStart(config string, pid string, lease string, ifName string, arg ...string)
- func DhcpStatusUpdate()
- func DhcpVrf(config *Dhcp) string
- func DhcpVrfClear(vrfId int, cfg *VrfsConfig)
- func DhcpVrfDelete(vrfId int)
- func DhcpVrfSync(vrfId int, cfg *VrfsConfig)
- func DynamicCompletion(commands []string, module string, args []string) []string
- func DynamicCompletionLocal(commands []string, module string, args []string) []string
- func Env(key string) string
- func EnvAll() map[string]string
- func EtcdEndpointsAdd(endPoint string)
- func EtcdEndpointsApi(set bool, Args []interface{})
- func EtcdEndpointsDelete(endPoint string)
- func EtcdEndpointsShow() (str string)
- func EtcdKeepWatch(cli *clientv3.Client, ctx context.Context, ctxS context.Context, ...)
- func EtcdKeyDelete(key []byte)
- func EtcdKeyValueParse(key, value []byte, get bool)
- func EtcdPathApi(set bool, Args []interface{})
- func EtcdRegisterCallback(callback chan bool, exiting chan struct{})
- func EtcdTrimServicesPrefix(keyStr string) []string
- func EtcdVrfAddressAdd(vrfId int, vrf *VrfsConfig)
- func EtcdVrfAddressClear(vrfId int, vrf *VrfsConfig)
- func EtcdVrfDelete(vrfId int)
- func EtcdVrfSync(vrfId int, vrf *VrfsConfig)
- func EtcdVrfVlanSubinterfacesAdd(vrf *VrfsConfig)
- func EtcdVrfVlanSubinterfacesDelete(vrf *VrfsConfig)
- func EtcdWatchStart(cfg clientv3.Config, watchPoint string) func()
- func EtcdWatchStop()
- func EtcdWatchUpdate()
- func ExecCmd(c *Command)
- func ExecLine(line string) string
- func ExecLineWaitIfNoMatch(command string)
- func GobgpAddGlobalPolicy(client *client.Client, direction string, policyNames []string) error
- func GobgpAddPolicyDefinition(client *client.Client, cfg bgpconfig.PolicyDefinition)
- func GobgpAddVrf(client *client.Client, c *VrfConfig) error
- func GobgpClearAll()
- func GobgpClearApi(Args []string) (inst int, instStr string)
- func GobgpClearDefinedSet(client *client.Client)
- func GobgpClearGlobal(client *client.Client)
- func GobgpClearGlobalPolicy(client *client.Client)
- func GobgpClearNeighbor(client *client.Client)
- func GobgpClearPolicyDefinition(client *client.Client)
- func GobgpClearVrf(client *client.Client)
- func GobgpClearVrfRib(c *VrfConfig) error
- func GobgpDeleteGlobalPolicy(client *client.Client, direction string, policyNames []string) error
- func GobgpDeletePolicyDefinition(client *client.Client, cfg bgpconfig.PolicyDefinition)
- func GobgpHubDelete(vrfId int)
- func GobgpHubUpdate(vrfConfig VrfConfig)
- func GobgpParse(jsonStr string)
- func GobgpReset(cfg *GobgpConfig) error
- func GobgpResetApi(Args []string) (inst int, instStr string)
- func GobgpRouterIdRegister(routerId string)
- func GobgpSetDefinedSet(client *client.Client, cfg *GobgpConfig)
- func GobgpSetGlobal(client *client.Client, cfg *GobgpConfig)
- func GobgpSetGlobalPolicy(client *client.Client, cfg *GobgpConfig) error
- func GobgpSetNeighbor(client *client.Client, cfg *GobgpConfig)
- func GobgpSetPolicyDefinition(client *client.Client, cfg *GobgpConfig)
- func GobgpSetRib(client *client.Client, cfg *GobgpConfig)
- func GobgpSetVrf(client *client.Client, cfg *GobgpConfig)
- func GobgpSetZebra(client *client.Client, cfg *GobgpConfig, version uint8)
- func GobgpSetZebraRoutine() error
- func GobgpSoftresetNeighbor(client *client.Client, cfg *GobgpConfig)
- func GobgpStatus() (string, error)
- func GobgpStatusGlobal(stat *GobgpStat) error
- func GobgpStatusNeighbor(stat *GobgpStat) error
- func GobgpStatusRib(stat *GobgpStat) error
- func GobgpStatusUpdate()
- func GobgpUpdate(cfg *GobgpConfig) error
- func GobgpUpdateNeighbor(client *client.Client, cfg *GobgpConfig)
- func GobgpUpdateVrf(client *client.Client, cfg *GobgpConfig)
- func GobgpVrfDelete(vrfId int)
- func GobgpVrfPath(c *VrfRib) (*table.Path, error)
- func GobgpVrfUpdate(vrfConfig VrfConfig)
- func GobgpWanConfig(cfg *GobgpConfig)
- func GobgpWanParse(jsonStr string)
- func GobgpWanStop()
- func HostnameApi(set bool, Args []interface{})
- func HostnameSet(hostName string)
- func HostnameUnset()
- func JsonConfigImport(jsonBuf []byte, yangRoot *yang.Entry, configRoot *Config) error
- func JsonFlatten(paths []string, v interface{}, f func([]string))
- func JsonMarshal() string
- func JsonParse(jsonString string) ([]string, error)
- func Load(path string) error
- func LoadConfig(reader io.Reader) error
- func LocalAddrLookup(ifName string) string
- func PathDump(path *Path, depth int)
- func PathRegisterCommand(p *Path, c *Command, sync bool)
- func Process(path []string, ent *yang.Entry, config *Config) error
- func ProcessDelete(config *Config)
- func QuaggaDelete(vrfId int)
- func QuaggaExec(vrfId int, interfaceName string, configStr string)
- func QuaggaExit()
- func QuaggaStatusBgpSummary(vrf string, stat *GobgpStat) error
- func QuaggaStatusRib(vrf string, stat *GobgpStat) error
- func QuaggaStatusUpdate()
- func QuaggaStatusVrf(vrf string, stats *QuaggaStat)
- func QuaggaVrfDelete(vrfId int)
- func QuaggaVrfSync(vrfId int, cfg *VrfsConfig)
- func RelayAdd(ifName, group string)
- func RelayApi(set bool, Args []interface{})
- func RelayDelete(ifName, group string)
- func RelayExitFunc()
- func RelayGroupExec(instance *RelayInstance, group *RelayGroup, vrf string) func()
- func RelayGroupUpdate(dhcp *Dhcp)
- func RollbackCompletion(commands []string) []string
- func RollbackDetailFetch(fileName string) string
- func RollbackRevisionIncrement() error
- func SubscribeDelete(stream rpc.Config_DoConfigServer) error
- func SubscribeDump()
- func SubscribeLocalAdd(path []string, json SubPathJsonCallback)
- func SubscribePortLookup(name string) uint32
- func SubscribeRemoteAdd(stream rpc.Config_DoConfigServer, req *rpc.ConfigRequest)
- func SubscribeRemoteAddMulti(stream rpc.Config_DoConfigServer, req *rpc.ConfigRequest)
- func SubscribeSync() bool
- func SubscribeValidateProcess(stream rpc.Config_DoConfigServer, typ rpc.ConfigType)
- func SubscribeValidateResult() bool
- func UnQuote(args []string)
- func UnregisterPath(p *Path)
- func Validate() bool
- func VrfDelete(vrfId int)
- func VrfParse(vrfId int, jsonStr string)
- func VrrpJsonConfig(path []string, str string) error
- func VrrpServerExec(vrrp *Vrrp, vrf string) func()
- func VrrpServerStart(config string, pid string, vrf string) func()
- func VrrpServerStopAll()
- func VrrpVrfDelete(vrfId int)
- func VrrpVrfSync(vrfId int, cfg *VrfsConfig)
- func YEntryJson(e *yang.Entry) string
- func YMatchKeyword(e *yang.Entry, str string, name string, complete bool, state *YMatchState)
- func YMatchNumber(e *yang.Entry, str string) (pos int, match cmd.MatchType)
- func YMatchString(e *yang.Entry, str string) (pos int, match cmd.MatchType)
- func YParseDelete(param *cmd.Param) (int, cmd.Callback, []interface{}, cmd.CompSlice)
- func YParseSet(param *cmd.Param) (int, cmd.Callback, []interface{}, cmd.CompSlice)
- func YangConfigPush(Args []string)
- func YangDelete(Args []string) (inst int, instStr string)
- func YangJsonParse()
- func YangSet(Args []string) (inst int, instStr string)
- type ClasslessRoutes
- type CliComponent
- type Command
- type Config
- func (c *Config) Command() *Command
- func (c *Config) CommandLine() []string
- func (c *Config) CommandList(list []*Config) []*Config
- func (c *Config) CommandPath() []string
- func (c *Config) CommandString() string
- func (c *Config) Copy(parent *Config) *Config
- func (c *Config) CopyShallow() *Config
- func (c *Config) Delete(n *Config)
- func (c *Config) DeleteKey(n *Config)
- func (c *Config) Empty() bool
- func (c *Config) IsKeyConfig() bool
- func (c *Config) IsLeaf() bool
- func (c *Config) JsonMarshal() string
- func (c *Config) LookupByPath(path []string) *Config
- func (c *Config) Priority() int
- func (c *Config) Set(e *yang.Entry) *Config
- func (c *Config) SetKey(e *yang.Entry, key string, prefix string) *Config
- func (c *Config) SetValue(value string) *Config
- func (c *Config) Signature(out io.Writer, via string)
- func (c *Config) String() string
- func (c *Config) WriteCommandTo(path string)
- func (c *Config) WriteTo(path string, by ...string)
- type ConfigComponent
- type ConfigSlice
- type Dhcp
- type DhcpIpPool
- type DhcpLeaseStatus
- type DhcpRange
- type DomainNameServers
- type GobgpConfig
- type GobgpStat
- type GobgpStatGlobal
- type GobgpStatNeighbor
- type GobgpStatRib
- type Host
- type Hub
- type IPv4
- type IPv4Addr
- type Interface
- type Interfaces
- type Interfacex
- type JsonBody
- type LeaseMap
- type LeaseValue
- type Nexthop
- type NtpServers
- type Option
- type Path
- type PathMap
- type QuaggaBgp
- type QuaggaStat
- type Range
- type RelayGroup
- type RelayInstance
- type Rollback
- type RollbackList
- type Route
- type RpcComponent
- type Server
- type ServerAddress
- type ServerGroup
- type ServerGroupList
- type SipServers
- type State
- type Static
- type SubPath
- type SubPathBase
- func (subPath *SubPathBase) Append(path []string, cmd *Command)
- func (subPath *SubPathBase) CommandClear()
- func (subPath *SubPathBase) Commit()
- func (subPath *SubPathBase) Len() int
- func (subPath *SubPathBase) Path() *Path
- func (subPath *SubPathBase) RegisterPath(paths []string)
- func (subPath *SubPathBase) Sync() bool
- type SubPathJsonCallback
- type SubPathLocal
- type SubPathRemote
- type Subscriber
- func (sub *Subscriber) CommandClear()
- func (sub *Subscriber) Commit()
- func (sub *Subscriber) CommitEnd()
- func (sub *Subscriber) CommitStart()
- func (sub *Subscriber) HasCommand() bool
- func (sub *Subscriber) SendCommand(cmd *Command)
- func (sub *Subscriber) SendMessage(typ rpc.ConfigType, path []string)
- func (sub *Subscriber) Validate()
- func (sub *Subscriber) ValidateEnd()
- func (sub *Subscriber) ValidateStart()
- type UnicastPeer
- type Vlan
- type VoipTftpServers
- type VrfConfig
- type VrfRib
- type VrfsConfig
- type Vrrp
- type VrrpConfig
- type VrrpInstance
- type YMatchState
- type YangComponent
Constants ¶
const ( CliSuccess = iota CliSuccessExec CliSuccessShow CliSuccessModule CliSuccessRedirect CliSuccessRedirectShow )
const ( DirState stateType = iota DirKeyState DirKeyMatched LeafState LeafMatched UnknownState )
const ( YMatchTypeKeyword yMatchType = iota YMatchTypeNumber YMatchTypeString )
Variables ¶
var ( Hostname string HostnameConfigured bool )
var ( RelayInstanceMap = map[string]*RelayInstance{} RelayGroupMap = map[string]*RelayGroup{} )
var ( RootPath = &Path{Map: PathMap{}} SubscribeMap = map[*Subscriber]struct{}{} SubscribeWg sync.WaitGroup SubscribeMutex sync.RWMutex ValidateCount int )
var ConfigDir = "/usr/local/etc"
var ConfigRevisionMax = 50
var DhcpProcessList = process.ProcessSlice{}
var EtcdVrfMap = map[int]VrfsConfig{}
var GobgpHubProcessList = map[int]*process.Process{}
var GobgpWanProcess *process.Process
GoBGP WAN Process
var GobgpZebraRetry bool
var GrpcModuleMap = map[string]string{}
var IntToStateMap = map[int]State{ 0: STATE_MASTER, 1: STATE_BACKUP, }
var Parser *cmd.Node
var QuaggaProc = map[int]process.ProcessSlice{}
var (
RIBD_SYNCHRONIZED bool
)
var StateToIntMap = map[State]int{ STATE_MASTER: 0, STATE_BACKUP: 1, }
var StateToString = map[stateType]string{ DirState: "DirState", DirKeyState: "DirKeyState", DirKeyMatched: "DirKeyMatched", LeafState: "LeafState", LeafMatched: "LeafMatched", UnknownState: "UnknownState", }
var TopCmd *cmd.Cmd
var VrrpInstanceMap = map[string][]*VrrpInstance{}
Functions ¶
func CompareCommand ¶
func CompareCommand() string
func ConfigDiscard ¶
func ConfigDiscard() bool
func ConfigLookupVrf ¶
func DhcpExitFunc ¶
func DhcpExitFunc()
func DhcpJsonConfig ¶
func DhcpLeaseGet ¶
func DhcpLeaseGet(poolConfig *DhcpIpPool) (string, error)
func DhcpLocalAddrLookup ¶
func DhcpServerExec ¶
func DhcpServerExec(dhcp *Dhcp, poolConfig *DhcpIpPool)
func DhcpServerStart ¶
func DhcpStatusUpdate ¶
func DhcpStatusUpdate()
func DhcpVrfClear ¶
func DhcpVrfClear(vrfId int, cfg *VrfsConfig)
func DhcpVrfDelete ¶
func DhcpVrfDelete(vrfId int)
func DhcpVrfSync ¶
func DhcpVrfSync(vrfId int, cfg *VrfsConfig)
func DynamicCompletion ¶
func DynamicCompletionLocal ¶
func EtcdEndpointsApi ¶
func EtcdEndpointsApi(set bool, Args []interface{})
func EtcdEndpointsShow ¶
func EtcdEndpointsShow() (str string)
func EtcdKeepWatch ¶
func EtcdKeyDelete ¶
func EtcdKeyDelete(key []byte)
func EtcdKeyValueParse ¶
func EtcdPathApi ¶
func EtcdPathApi(set bool, Args []interface{})
func EtcdRegisterCallback ¶
func EtcdRegisterCallback(callback chan bool, exiting chan struct{})
func EtcdTrimServicesPrefix ¶
func EtcdVrfAddressAdd ¶
func EtcdVrfAddressAdd(vrfId int, vrf *VrfsConfig)
func EtcdVrfAddressClear ¶
func EtcdVrfAddressClear(vrfId int, vrf *VrfsConfig)
func EtcdVrfDelete ¶
func EtcdVrfDelete(vrfId int)
func EtcdVrfSync ¶
func EtcdVrfSync(vrfId int, vrf *VrfsConfig)
func EtcdVrfVlanSubinterfacesAdd ¶
func EtcdVrfVlanSubinterfacesAdd(vrf *VrfsConfig)
func EtcdVrfVlanSubinterfacesDelete ¶
func EtcdVrfVlanSubinterfacesDelete(vrf *VrfsConfig)
func EtcdWatchStart ¶
func EtcdWatchStop ¶
func EtcdWatchStop()
func ExecLineWaitIfNoMatch ¶
func ExecLineWaitIfNoMatch(command string)
TODO: Return failure if we finally fail. TODO: Generic failure recovery mechanism for any configuration set
func GobgpAddGlobalPolicy ¶
func GobgpAddPolicyDefinition ¶
func GobgpAddPolicyDefinition(client *client.Client, cfg bgpconfig.PolicyDefinition)
func GobgpClearAll ¶
func GobgpClearAll()
func GobgpClearApi ¶
configure# clear gobgp
func GobgpClearDefinedSet ¶
func GobgpClearGlobal ¶
func GobgpClearGlobalPolicy ¶
func GobgpClearNeighbor ¶
func GobgpClearVrf ¶
func GobgpClearVrfRib ¶
func GobgpDeleteGlobalPolicy ¶
func GobgpDeletePolicyDefinition ¶
func GobgpDeletePolicyDefinition(client *client.Client, cfg bgpconfig.PolicyDefinition)
func GobgpHubDelete ¶
func GobgpHubDelete(vrfId int)
func GobgpHubUpdate ¶
func GobgpHubUpdate(vrfConfig VrfConfig)
func GobgpParse ¶
func GobgpParse(jsonStr string)
func GobgpReset ¶
func GobgpReset(cfg *GobgpConfig) error
func GobgpResetApi ¶
configure# reset gobgp
func GobgpRouterIdRegister ¶
func GobgpRouterIdRegister(routerId string)
func GobgpSetDefinedSet ¶
func GobgpSetDefinedSet(client *client.Client, cfg *GobgpConfig)
func GobgpSetGlobal ¶
func GobgpSetGlobal(client *client.Client, cfg *GobgpConfig)
func GobgpSetGlobalPolicy ¶
func GobgpSetGlobalPolicy(client *client.Client, cfg *GobgpConfig) error
func GobgpSetNeighbor ¶
func GobgpSetNeighbor(client *client.Client, cfg *GobgpConfig)
func GobgpSetPolicyDefinition ¶
func GobgpSetPolicyDefinition(client *client.Client, cfg *GobgpConfig)
func GobgpSetRib ¶
func GobgpSetRib(client *client.Client, cfg *GobgpConfig)
func GobgpSetVrf ¶
func GobgpSetVrf(client *client.Client, cfg *GobgpConfig)
func GobgpSetZebra ¶
func GobgpSetZebra(client *client.Client, cfg *GobgpConfig, version uint8)
func GobgpSetZebraRoutine ¶
func GobgpSetZebraRoutine() error
func GobgpSoftresetNeighbor ¶
func GobgpSoftresetNeighbor(client *client.Client, cfg *GobgpConfig)
func GobgpStatus ¶
func GobgpStatusGlobal ¶
func GobgpStatusNeighbor ¶
func GobgpStatusRib ¶
func GobgpStatusUpdate ¶
func GobgpStatusUpdate()
func GobgpUpdate ¶
func GobgpUpdate(cfg *GobgpConfig) error
func GobgpUpdateNeighbor ¶
func GobgpUpdateNeighbor(client *client.Client, cfg *GobgpConfig)
func GobgpUpdateVrf ¶
func GobgpUpdateVrf(client *client.Client, cfg *GobgpConfig)
func GobgpVrfDelete ¶
func GobgpVrfDelete(vrfId int)
func GobgpVrfUpdate ¶
func GobgpVrfUpdate(vrfConfig VrfConfig)
func GobgpWanStop ¶
func GobgpWanStop()
func HostnameApi ¶
func HostnameApi(set bool, Args []interface{})
func HostnameSet ¶
func HostnameSet(hostName string)
func HostnameUnset ¶
func HostnameUnset()
func JsonConfigImport ¶
Import JSON format config and put it into the Config tree according to the YANG tree.
func JsonFlatten ¶
func JsonMarshal ¶
func JsonMarshal() string
func LoadConfig ¶
func LocalAddrLookup ¶
func PathRegisterCommand ¶
func ProcessDelete ¶
func ProcessDelete(config *Config)
func QuaggaDelete ¶
func QuaggaDelete(vrfId int)
func QuaggaExec ¶
func QuaggaExit ¶
func QuaggaExit()
func QuaggaStatusBgpSummary ¶
func QuaggaStatusRib ¶
func QuaggaStatusUpdate ¶
func QuaggaStatusUpdate()
func QuaggaStatusVrf ¶
func QuaggaStatusVrf(vrf string, stats *QuaggaStat)
func QuaggaVrfDelete ¶
func QuaggaVrfDelete(vrfId int)
func QuaggaVrfSync ¶
func QuaggaVrfSync(vrfId int, cfg *VrfsConfig)
func RelayDelete ¶
func RelayDelete(ifName, group string)
func RelayExitFunc ¶
func RelayExitFunc()
func RelayGroupExec ¶
func RelayGroupExec(instance *RelayInstance, group *RelayGroup, vrf string) func()
func RelayGroupUpdate ¶
func RelayGroupUpdate(dhcp *Dhcp)
func RollbackCompletion ¶
func RollbackDetailFetch ¶
func RollbackRevisionIncrement ¶
func RollbackRevisionIncrement() error
func SubscribeDelete ¶
func SubscribeDelete(stream rpc.Config_DoConfigServer) error
func SubscribeDump ¶
func SubscribeDump()
func SubscribeLocalAdd ¶
func SubscribeLocalAdd(path []string, json SubPathJsonCallback)
func SubscribePortLookup ¶
func SubscribeRemoteAdd ¶
func SubscribeRemoteAdd(stream rpc.Config_DoConfigServer, req *rpc.ConfigRequest)
func SubscribeRemoteAddMulti ¶
func SubscribeRemoteAddMulti(stream rpc.Config_DoConfigServer, req *rpc.ConfigRequest)
func SubscribeSync ¶
func SubscribeSync() bool
func SubscribeValidateProcess ¶
func SubscribeValidateProcess(stream rpc.Config_DoConfigServer, typ rpc.ConfigType)
func SubscribeValidateResult ¶
func SubscribeValidateResult() bool
func UnregisterPath ¶
func UnregisterPath(p *Path)
func VrrpServerExec ¶
func VrrpServerStart ¶
func VrrpServerStopAll ¶
func VrrpServerStopAll()
func VrrpVrfDelete ¶
func VrrpVrfDelete(vrfId int)
func YEntryJson ¶
func YMatchKeyword ¶
func YParseDelete ¶
func YangConfigPush ¶
func YangConfigPush(Args []string)
func YangDelete ¶
Types ¶
type ClasslessRoutes ¶
type ClasslessRoutes struct { // original -> dhcp:prefix //dhcp:prefix's original type is inet:ipv4-prefix Prefix string `mapstructure:"prefix" json:"prefix,omitempty"` // original -> dhcp:nexthop //dhcp:nexthop's original type is inet:ipv4-address Nexthop string `mapstructure:"nexthop" json:"nexthop,omitempty"` }
struct for container dhcp:classless-routes
func (*ClasslessRoutes) Equal ¶
func (lhs *ClasslessRoutes) Equal(rhs *ClasslessRoutes) bool
type CliComponent ¶
type CliComponent struct{}
CLI component.
func (*CliComponent) Start ¶
func (this *CliComponent) Start() component.Component
CLI component start method.
func (*CliComponent) Stop ¶
func (this *CliComponent) Stop() component.Component
type Config ¶
type Config struct { Name string Entry *yang.Entry Parent *Config KeyConfig bool HasValue bool Configs ConfigSlice Keys ConfigSlice Value string Prefix string }
func (*Config) CommandLine ¶
func (*Config) CommandList ¶
func (*Config) CommandPath ¶
func (*Config) CommandString ¶
func (*Config) CopyShallow ¶
func (*Config) IsKeyConfig ¶
func (*Config) JsonMarshal ¶
func (*Config) LookupByPath ¶
func (*Config) WriteCommandTo ¶
type ConfigComponent ¶
type ConfigComponent struct { ConfigActiveFile string ConfigFileDir string TwoPhaseCommit bool ZeroConfig bool }
Config component.
func (*ConfigComponent) Start ¶
func (this *ConfigComponent) Start() component.Component
Config component start method.
func (*ConfigComponent) Stop ¶
func (this *ConfigComponent) Stop() component.Component
Config component stop method.
type ConfigSlice ¶
type ConfigSlice []*Config
func (ConfigSlice) Less ¶
func (configs ConfigSlice) Less(i, j int) bool
func (ConfigSlice) Swap ¶
func (configs ConfigSlice) Swap(i, j int)
type Dhcp ¶
type Dhcp struct { // original -> dhcp:server Server Server `mapstructure:"server" json:"server,omitempty"` // original -> dhcp:relay Relay ServerGroupList `mapstructure:"relay" json:"relay,omitempty"` }
struct for container dhcp:dhcp
type DhcpIpPool ¶
type DhcpIpPool struct { // original -> dhcp:ip-pool-name IpPoolName string `mapstructure:"ip-pool-name" json:"ip-pool-name,omitempty"` // original -> dhcp:interface Interface string `mapstructure:"interface" json:"interface,omitempty"` // original -> dhcp:subnet //dhcp:subnet's original type is inet:ipv4-prefix Subnet string `mapstructure:"subnet" json:"subnet,omitempty"` // original -> dhcp:gateway-ip //dhcp:gateway-ip's original type is inet:ipv4-address GatewayIp string `mapstructure:"gateway-ip" json:"gateway-ip,omitempty"` // original -> dhcp:default-lease-time DefaultLeaseTime uint32 `mapstructure:"default-lease-time" json:"default-lease-time,omitempty"` // original -> dhcp:max-lease-time MaxLeaseTime uint32 `mapstructure:"max-lease-time" json:"max-lease-time,omitempty"` // original -> dhcp:host HostList []Host `mapstructure:"host" json:"host,omitempty"` // original -> dhcp:range RangeList []Range `mapstructure:"range" json:"range,omitempty"` // original -> dhcp:option Option Option `mapstructure:"option" json:"option,omitempty"` // original -> dhcp:failover-role FailoverRole string `mapstructure:"failover-role" json:"failover-role,omitempty"` // original -> dhcp:failover-peer-address //dhcp:failover-peer-address's original type is inet:ipv4-address FailoverPeerAddress string `mapstructure:"failover-peer-address" json:"failover-peer-address,omitempty"` }
struct for container dhcp:dhcp-ip-pool
func (*DhcpIpPool) Equal ¶
func (lhs *DhcpIpPool) Equal(rhs *DhcpIpPool) bool
type DhcpLeaseStatus ¶
type DhcpLeaseStatus struct { LeaseTime uint32 `json:"lease-time"` Range []DhcpRange `json:"range"` Lease []LeaseValue `json:"lease"` }
type DomainNameServers ¶
type DomainNameServers struct { // original -> dhcp:server //dhcp:server's original type is inet:ipv4-address Server string `mapstructure:"server" json:"server,omitempty"` }
struct for container dhcp:domain-name-servers
func (*DomainNameServers) Equal ¶
func (lhs *DomainNameServers) Equal(rhs *DomainNameServers) bool
type GobgpConfig ¶
type GobgpConfig struct { Global bgpconfig.Global `mapstructure:"global"` Neighbors []bgpconfig.Neighbor `mapstructure:"neighbors"` Zebra bgpconfig.Zebra `mapstructure:"zebra"` Vrfs []VrfConfig `mapstructure:"vrfs"` DefinedSets bgpconfig.DefinedSets `mapstructure:"defined_sets"` PolicyDefinitions []bgpconfig.PolicyDefinition `mapstructure:"policy_definitions"` Ribs []VrfRib `mapstructure:"ribs" json:"ribs,omitempty" json:"ribs"` }
type GobgpStat ¶
type GobgpStat struct { Global GobgpStatGlobal `json:"global"` Neighbor []GobgpStatNeighbor `json:"neighbors"` Ribs []GobgpStatRib `json:"ribs"` Vrf string `json:"vrf,omitempty"` }
type GobgpStatGlobal ¶
type GobgpStatNeighbor ¶
type GobgpStatRib ¶
type Host ¶
type Host struct { // original -> dhcp:host-name HostName string `mapstructure:"host-name" json:"host-name,omitempty"` // original -> dhcp:mac-address MacAddress string `mapstructure:"mac-address" json:"mac-address,omitempty"` // original -> dhcp:ip-address //dhcp:ip-address's original type is inet:ipv4-address IpAddress string `mapstructure:"ip-address" json:"ip-address,omitempty"` }
struct for container dhcp:host
type IPv4 ¶
type IPv4 struct {
Address []IPv4Addr `mapstructure:"address" json:"address,omitempty"`
}
type Interfaces ¶
type Interfaces struct {
Interface []Interface `mapstructure:"interface" json:"interface,omitempty"`
}
type Interfacex ¶
type Interfacex struct { // original -> static:ifname Ifname string `mapstructure:"ifname" json:"ifname,omitempty"` }
struct for container static:interface
func (*Interfacex) Equal ¶
func (lhs *Interfacex) Equal(rhs *Interfacex) bool
type LeaseMap ¶
type LeaseMap map[string]*LeaseValue
type LeaseValue ¶
type Nexthop ¶
type Nexthop struct { // original -> static:address //static:address's original type is inet:ipv4-address Address string `mapstructure:"address" json:"address,omitempty"` }
struct for container static:nexthop
type NtpServers ¶
type NtpServers struct { // original -> dhcp:server //dhcp:server's original type is inet:ipv4-address Server string `mapstructure:"server" json:"server,omitempty"` }
struct for container dhcp:ntp-servers
func (*NtpServers) Equal ¶
func (lhs *NtpServers) Equal(rhs *NtpServers) bool
type Option ¶
type Option struct { // original -> dhcp:dhcp-server-identifier //dhcp:dhcp-server-identifier's original type is inet:ipv4-address DhcpServerIdentifier string `mapstructure:"dhcp-server-identifier" json:"dhcp-server-identifier,omitempty"` // original -> dhcp:domain-name DomainName string `mapstructure:"domain-name" json:"domain-name,omitempty"` // original -> dhcp:domain-name-servers DomainNameServersList []DomainNameServers `mapstructure:"domain-name-servers" json:"domain-name-servers,omitempty"` // original -> dhcp:ntp-servers NtpServersList []NtpServers `mapstructure:"ntp-servers" json:"ntp-servers,omitempty"` // original -> dhcp:interface-mtu InterfaceMtu uint32 `mapstructure:"interface-mtu" json:"interface-mtu,omitempty"` // original -> dhcp:netbios-name-server //dhcp:netbios-name-server's original type is inet:ip-address NetbiosNameServer string `mapstructure:"netbios-name-server" json:"netbios-name-server,omitempty"` // original -> dhcp:netbios-node-type NetbiosNodeType uint32 `mapstructure:"netbios-node-type" json:"netbios-node-type,omitempty"` // original -> dhcp:netbios-scope NetbiosScope string `mapstructure:"netbios-scope" json:"netbios-scope,omitempty"` // original -> dhcp:tftp-server-name TftpServerName string `mapstructure:"tftp-server-name" json:"tftp-server-name,omitempty"` // original -> dhcp:bootfile-name BootfileName string `mapstructure:"bootfile-name" json:"bootfile-name,omitempty"` // original -> dhcp:voip-tftp-servers VoipTftpServersList []VoipTftpServers `mapstructure:"voip-tftp-servers" json:"voip-tftp-servers,omitempty"` // original -> dhcp:sip-servers SipServersList []SipServers `mapstructure:"sip-servers" json:"sip-servers,omitempty"` // original -> dhcp:classless-routes ClasslessRoutesList []ClasslessRoutes `mapstructure:"classless-routes" json:"classless-routes,omitempty"` // original -> dhcp:time-offset TimeOffset int32 `mapstructure:"time-offset" json:"time-offset,omitempty"` }
struct for container dhcp:option
type QuaggaStat ¶
type QuaggaStat struct {
Stats []GobgpStat `json:"bgp_lan"`
}
type Range ¶
type Range struct { // original -> dhcp:range-index RangeIndex uint16 `mapstructure:"range-index" json:"range-index,omitempty"` // original -> dhcp:range-start-ip //dhcp:range-start-ip's original type is inet:ipv4-address RangeStartIp string `mapstructure:"range-start-ip" json:"range-start-ip,omitempty"` // original -> dhcp:range-end-ip //dhcp:range-end-ip's original type is inet:ipv4-address RangeEndIp string `mapstructure:"range-end-ip" json:"range-end-ip,omitempty"` }
struct for container dhcp:range
type RelayGroup ¶
type RelayGroup struct {
Server []string
}
type RelayInstance ¶
type Rollback ¶
func RollbackListGet ¶
type RollbackList ¶
type RollbackList []*Rollback
func (RollbackList) Len ¶
func (rlist RollbackList) Len() int
func (RollbackList) Less ¶
func (rlist RollbackList) Less(i, j int) bool
func (RollbackList) Swap ¶
func (rlist RollbackList) Swap(i, j int)
type Route ¶
type Route struct { // original -> static:prefix //static:prefix's original type is inet:ipv4-prefix Prefix string `mapstructure:"prefix" json:"prefix,omitempty"` // original -> static:nexthop NexthopList []Nexthop `mapstructure:"nexthop" json:"nexthop,omitempty"` // original -> static:interface InterfaceList []Interfacex `mapstructure:"interface" json:"interface,omitempty"` // original -> static:distance Distance uint8 `mapstructure:"distance" json:"distance,omitempty"` }
struct for container static:route
type RpcComponent ¶
type RpcComponent struct{}
RPC component.
func (*RpcComponent) Start ¶
func (this *RpcComponent) Start() component.Component
RPC component start method.
func (*RpcComponent) Stop ¶
func (this *RpcComponent) Stop() component.Component
type Server ¶
type Server struct { // original -> dhcp:default-lease-time DefaultLeaseTime uint32 `mapstructure:"default-lease-time" json:"default-lease-time,omitempty"` // original -> dhcp:max-lease-time MaxLeaseTime uint32 `mapstructure:"max-lease-time" json:"max-lease-time,omitempty"` // original -> dhcp:ping-check //dhcp:ping-check's original type is boolean PingCheck bool `mapstructure:"ping-check" json:"ping-check,omitempty"` // original -> dhcp:option Option Option `mapstructure:"option" json:"option,omitempty"` // original -> dhcp:dhcp-ip-pool DhcpIpPoolList []DhcpIpPool `mapstructure:"dhcp-ip-pool" json:"dhcp-ip-pool,omitempty"` }
struct for container dhcp:server
type ServerAddress ¶
type ServerAddress struct { // original -> dhcp:address //dhcp:address's original type is inet:ipv4-address Address string `mapstructure:"address" json:"address,omitempty"` }
struct for container dhcp:server-address
func (*ServerAddress) Equal ¶
func (lhs *ServerAddress) Equal(rhs *ServerAddress) bool
type ServerGroup ¶
type ServerGroup struct { // original -> dhcp:server-group-name ServerGroupName string `mapstructure:"server-group-name" json:"server-group-name,omitempty"` // original -> dhcp:server-address ServerAddressList []ServerAddress `mapstructure:"server-address" json:"server-address,omitempty"` }
struct for container dhcp:server-group
func (*ServerGroup) Equal ¶
func (lhs *ServerGroup) Equal(rhs *ServerGroup) bool
type ServerGroupList ¶
type ServerGroupList struct {
ServerGroupList []ServerGroup `mapstructure:"server-group" json:"server-group,omitempty"`
}
type SipServers ¶
type SipServers struct { // original -> dhcp:server //dhcp:server's original type is inet:ipv4-address Server string `mapstructure:"server" json:"server,omitempty"` }
struct for container dhcp:sip-servers
func (*SipServers) Equal ¶
func (lhs *SipServers) Equal(rhs *SipServers) bool
type SubPathBase ¶
type SubPathBase struct {
// contains filtered or unexported fields
}
func (*SubPathBase) Append ¶
func (subPath *SubPathBase) Append(path []string, cmd *Command)
func (*SubPathBase) CommandClear ¶
func (subPath *SubPathBase) CommandClear()
func (*SubPathBase) Commit ¶
func (subPath *SubPathBase) Commit()
func (*SubPathBase) Len ¶
func (subPath *SubPathBase) Len() int
func (*SubPathBase) Path ¶
func (subPath *SubPathBase) Path() *Path
func (*SubPathBase) RegisterPath ¶
func (subPath *SubPathBase) RegisterPath(paths []string)
func (*SubPathBase) Sync ¶
func (subPath *SubPathBase) Sync() bool
type SubPathJsonCallback ¶
type SubPathLocal ¶
type SubPathLocal struct { SubPathBase // contains filtered or unexported fields }
func (*SubPathLocal) Commit ¶
func (subPath *SubPathLocal) Commit()
type SubPathRemote ¶
type SubPathRemote struct { SubPathBase // contains filtered or unexported fields }
func (*SubPathRemote) Commit ¶
func (subPath *SubPathRemote) Commit()
type Subscriber ¶
type Subscriber struct { Type int Module string Port uint32 SubPath []SubPath // contains filtered or unexported fields }
func SubscribeLookup ¶
func SubscribeLookup(stream rpc.Config_DoConfigServer) *Subscriber
func (*Subscriber) CommandClear ¶
func (sub *Subscriber) CommandClear()
func (*Subscriber) Commit ¶
func (sub *Subscriber) Commit()
func (*Subscriber) CommitEnd ¶
func (sub *Subscriber) CommitEnd()
func (*Subscriber) CommitStart ¶
func (sub *Subscriber) CommitStart()
func (*Subscriber) HasCommand ¶
func (sub *Subscriber) HasCommand() bool
func (*Subscriber) SendCommand ¶
func (sub *Subscriber) SendCommand(cmd *Command)
func (*Subscriber) SendMessage ¶
func (sub *Subscriber) SendMessage(typ rpc.ConfigType, path []string)
func (*Subscriber) Validate ¶
func (sub *Subscriber) Validate()
func (*Subscriber) ValidateEnd ¶
func (sub *Subscriber) ValidateEnd()
func (*Subscriber) ValidateStart ¶
func (sub *Subscriber) ValidateStart()
type UnicastPeer ¶
type UnicastPeer struct { // original -> vrrp:address //vrrp:address's original type is inet:ipv4-address Address string `mapstructure:"address" json:"address,omitempty"` }
struct for container vrrp:unicast-peer
func (*UnicastPeer) Equal ¶
func (lhs *UnicastPeer) Equal(rhs *UnicastPeer) bool
type VoipTftpServers ¶
type VoipTftpServers struct { // original -> dhcp:server //dhcp:server's original type is inet:ipv4-address Server string `mapstructure:"server" json:"server,omitempty"` }
struct for container dhcp:voip-tftp-servers
func (*VoipTftpServers) Equal ¶
func (lhs *VoipTftpServers) Equal(rhs *VoipTftpServers) bool
type VrfConfig ¶
type VrfConfig struct { Name string `mapstructure:"name" json:"name,omitempty"` VrfId int `mapstructure:"vrf-id" json:"vrf-id,omitempty"` Rd string `mapstructure:"rd" json:"rd,omitempty"` RtImport string `mapstructure:"rt-import" json:"rt-import,omitempty"` RtExport string `mapstructure:"rt-export" json:"rt-export,omitempty"` RtBoth string `mapstructure:"rt-both" json:"rt-both,omitempty"` VrfRibs []VrfRib `mapstructure:"ribs" json:"ribs,omitempty"` Hubs []Hub `mapstructure:"hubs" json:"hubs,omitempty"` }
type VrfRib ¶
type VrfsConfig ¶
type VrfsConfig struct { Name string `mapstructure:"name" json:"name,omitempty"` Id int `mapstructure:"vrf_id" json:"vrf_id,omitempty"` Rd string `mapstructure:"rd" json:"rd,omitempty"` RtImport string `mapstructure:"rt_import" json:"rt_import,omitempty"` RtExport string `mapstructure:"rt_export" json:"rt_export,omitempty"` RtBoth string `mapstructure:"rt_both" json:"rt_both,omitempty"` VrfRibs []VrfRib `mapstructure:"ribs" json:"ribs,omitempty"` Hubs []Hub `mapstructure:"hubs" json:"hubs,omitempty"` Interfaces Interfaces `mapstructure:"interfaces" json:"interfaces,omitempty"` Vrrp []Vrrp `mapstructure:"vrrp" json:"vrrp,omitempty"` Dhcp Dhcp `mapstructure:"dhcp" json:"dhcp,omitempty"` Static Static `mapstructure:"static" json:"static,omitempty"` Bgp []QuaggaBgp `mapstructure:"bgp" json:"bgp,omitempty"` }
func (*VrfsConfig) Copy ¶
func (vrf *VrfsConfig) Copy() VrfConfig
type Vrrp ¶
type Vrrp struct { // original -> vrrp:vrid Vrid uint8 `mapstructure:"vrid" json:"vrid,omitempty"` // original -> vrrp:interface Interface string `mapstructure:"interface" json:"interface,omitempty"` // original -> vrrp:vrrp-state State State `mapstructure:"state" json:"state,omitempty"` // original -> vrrp:virtual-address //vrrp:virtual-address's original type is inet:ipv4-address VirtualAddress string `mapstructure:"virtual-address" json:"virtual-address,omitempty"` // original -> vrrp:priority Priority uint8 `mapstructure:"priority" json:"priority,omitempty"` // original -> vrrp:advertisement-interval AdvertisementInterval uint8 `mapstructure:"advertisement-interval" json:"advertisement-interval,omitempty"` // original -> vrrp:unicast-peer UnicastPeerList []UnicastPeer `mapstructure:"unicast-peer" json:"unicast-peer,omitempty"` // original -> vrrp:authentication-key AuthenticationKey string `mapstructure:"authentication-key" json:"authentication-key,omitempty"` // original -> vrrp:preempt //vrrp:preempt's original type is empty Preempt bool `mapstructure:"preempt" json:"preempt,omitempty"` // manual addition. Vrf string `mapstructure:"vrf" json:"vrf,omitempty"` }
struct for container vrrp:vrrp
type VrrpConfig ¶
type VrrpConfig []Vrrp
type VrrpInstance ¶
type VrrpInstance struct { //VrfId int VrId uint8 ExitFunc func() }
func VrrpInstanceGet ¶
func VrrpInstanceGet(vrf string, vrId uint8) *VrrpInstance
type YMatchState ¶
type YMatchState struct {
// contains filtered or unexported fields
}
func YMatchLeaf ¶
func YMatchLeaf(e *yang.Entry, str string, complete bool) *YMatchState
type YangComponent ¶
Yang component.
func (*YangComponent) Start ¶
func (this *YangComponent) Start() component.Component
Yang component start method.
func (*YangComponent) Stop ¶
func (this *YangComponent) Stop() component.Component
Yang component stop method.