config

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CliSuccess = iota
	CliSuccessExec
	CliSuccessShow
	CliSuccessModule
	CliSuccessRedirect
	CliSuccessRedirectShow
)
View Source
const (
	StateDir = iota
	StateDirMatched
	StateKey
	StateKeyMatched
	StateLeaf
	StateLeafMatched
	StateLeafList
	StateLeafListMatched
)
View Source
const (
	YMatchTypeKeyword = iota
	YMatchTypeNumber
	YMatchTypeString
)

Variables

View Source
var (
	GobgpNeighborMap   = map[string]bgpconfig.Neighbor{}
	GobgpNeighborMutex sync.Mutex
)

Map for configured neighbor. TODO: Revisit this. At present this is mostly redundant. Neighbor add/delete can be simplified

View Source
var (
	Hostname           string
	HostnameConfigured bool
)
View Source
var (
	OspfEtcdEndpoints  = []string{"http://127.0.0.1:2379"}
	OspfEtcdStatusPath = "/state/services/ospf"
)
View Source
var (
	RelayInstanceMap = map[string]*RelayInstance{}
	RelayGroupMap    = map[string]*RelayGroup{}
)
View Source
var (
	RootPath        = &Path{Map: PathMap{}}
	SubscribeMap    = map[*Subscriber]*Subscriber{}
	SubscribeWg     sync.WaitGroup
	SubscribeMutex  sync.RWMutex
	ValidateCount   int
	RibdAsyncUpdate = false
	ApiSyncCh       chan interface{}
)
View Source
var (
	VrrpEtcdEndpoints = []string{"http://127.0.0.1:2379"}
	VrrpEtcdPath      = "/state/services/port/vrrp"
)
View Source
var ConfigDir = "/usr/local/etc"
View Source
var ConfigRevisionMax = 50

mapping provided by gobgp config is incorrect

View Source
var DhcpProcessList = process.ProcessSlice{}
View Source
var DistributeListMap = map[int]DistributeList{}
View Source
var (

	// Mutex for serializing etcd event handling
	EtcdEventMutex sync.RWMutex
)
View Source
var EtcdVrfMap = map[int]VrfsConfig{}
View Source
var EtcdVrfStaticMap = map[int]*EtcdVrfStaticRoute{}
View Source
var GobgpHubNode = map[int]string{}
View Source
var GobgpHubProcessList = map[int]*process.Process{}
View Source
var GobgpWanProcess *process.Process

GoBGP WAN Process

View Source
var GobgpZebraRetry bool
View Source
var GrpcModuleMap = map[string]string{}
View Source
var IntToStateMap = map[int]State{
	0: STATE_MASTER,
	1: STATE_BACKUP,
}
View Source
var OspfProcessMap = map[int]*process.Process{}
View Source
var OspfVrfMap = map[int]OspfArray{}
View Source
var Parser *cmd.Node
View Source
var QuaggaConfigDir = "/etc/quagga/"
View Source
var QuaggaProc = map[int]process.ProcessSlice{}
View Source
var (
	RIBD_SYNCHRONIZED bool
)
View Source
var StateStr = map[int]string{
	StateDir:             "StateDir",
	StateDirMatched:      "StateDirMatched",
	StateKey:             "StateKey",
	StateKeyMatched:      "StateKeyMatched",
	StateLeaf:            "StateLeaf",
	StateLeafMatched:     "StateLeafMatched",
	StateLeafList:        "StateLeafList",
	StateLeafListMatched: "StateLeafListMatched",
}
View Source
var StateToIntMap = map[State]int{
	STATE_MASTER: 0,
	STATE_BACKUP: 1,
}
View Source
var TopCmd *cmd.Cmd
View Source
var VrfIfDeleteCache = map[string]bool{}
View Source
var VrrpInstanceMap = map[string][]*VrrpInstance{}

Functions

func AddIPAddress

func AddIPAddress(ifp Interface, ipaddrs []IPv4Addr)

func AddVlans

func AddVlans(ifp Interface, vlans []Vlan)

func CalculateAddressChanges

func CalculateAddressChanges(oldAddresses []IPv4Addr, newAddresses []IPv4Addr) ([]IPv4Addr, []IPv4Addr)

func CalculateVlanChanges

func CalculateVlanChanges(oldVlans []Vlan, newVlans []Vlan) ([]Vlan, []Vlan)

func CaseEntry

func CaseEntry(e *yang.Entry) *yang.Entry

func ClearGobgpGrpcEndpoint added in v0.8.1

func ClearGobgpGrpcEndpoint()

func ClearVrfCache

func ClearVrfCache()

func Commands

func Commands() string

func Commit

func Commit() error

func CompChoice

func CompChoice(ent *yang.Entry, comps cmd.CompSlice) cmd.CompSlice

func CompConfig

func CompConfig(config *Config, comps cmd.CompSlice) cmd.CompSlice

func CompDir

func CompDir(ent *yang.Entry, comps cmd.CompSlice) cmd.CompSlice

func CompHasName added in v0.8.1

func CompHasName(comps cmd.CompSlice, name string) bool

func CompKey

func CompKey(ent *yang.Entry, index int) cmd.CompSlice

func CompKeyMatched

func CompKeyMatched(ent *yang.Entry, comps cmd.CompSlice) cmd.CompSlice

func CompLeaf

func CompLeaf(ent *yang.Entry) cmd.CompSlice

func CompValue

func CompValue(config *Config, comps cmd.CompSlice, index int) cmd.CompSlice

func Compare

func Compare() string

func CompareCommand

func CompareCommand() string

func ConfigDiscard

func ConfigDiscard() bool

func ConfigDump

func ConfigDump(c *Config, depth int, keynode bool)

func ConfigDumpCandidate

func ConfigDumpCandidate()

func ConfigDumpTool

func ConfigDumpTool(c *Config)

func ConfigLookupVrf

func ConfigLookupVrf(ifName string) string

func ConfigureGobgpGrpcEndpointApi added in v0.8.1

func ConfigureGobgpGrpcEndpointApi(set bool, args []interface{})

func Delete

func Delete(c *Config, leaf bool)

func DhcpExitFunc

func DhcpExitFunc()

func DhcpJsonConfig

func DhcpJsonConfig(path []string, str string) error

func DhcpLeaseGet

func DhcpLeaseGet(poolConfig *DhcpIpPool) (string, error)

func DhcpLocalAddrLookup

func DhcpLocalAddrLookup(ifName string) string

func DhcpServerExec

func DhcpServerExec(dhcp *Dhcp, poolConfig *DhcpIpPool)

func DhcpServerStart

func DhcpServerStart(config string, pid string, lease string, ifName string, arg ...string)

func DhcpStatusUpdate

func DhcpStatusUpdate()

func DhcpVrf

func DhcpVrf(config *Dhcp) string

func DhcpVrfClear

func DhcpVrfClear(vrfId int, cfg *VrfsConfig)

func DhcpVrfDelete

func DhcpVrfDelete(vrfId int)

func DhcpVrfSync

func DhcpVrfSync(vrfId int, cfg *VrfsConfig)

func DirMatch

func DirMatch(e *yang.Entry, s string) *yang.Entry

func DiscardConfigChange added in v0.8.1

func DiscardConfigChange()

func DistributeListDelete added in v0.8.1

func DistributeListDelete(vrfId int)

func DistributeListExit added in v0.8.1

func DistributeListExit()

func DistributeListSync added in v0.8.1

func DistributeListSync(vrfId int, cfg *VrfsConfig)

func DynamicCompletion

func DynamicCompletion(commands []string, module string, args []string) []string

func DynamicCompletionLocal

func DynamicCompletionLocal(commands []string, module string, args []string) []string

func EntryDump

func EntryDump(e *yang.Entry, depth int)

func EntryExpandable

func EntryExpandable(e *yang.Entry) bool

func EntryExpanded

func EntryExpanded(e *yang.Entry) []string

func EntryLookup

func EntryLookup(e *yang.Entry, p []string) *yang.Entry

Yang entry lookup.

func EntryNextState

func EntryNextState(e *yang.Entry) int

func Env

func Env(key string) string

func EnvAll

func EnvAll() map[string]string

func EtcdDeletePath

func EtcdDeletePath(etcdEndpoints []string, etcdPath string)

func EtcdEndpointsAdd

func EtcdEndpointsAdd(endPoint string)

Add etcd endpoint.

func EtcdEndpointsApi

func EtcdEndpointsApi(set bool, Args []interface{})

func EtcdEndpointsDelete

func EtcdEndpointsDelete(endPoint string)

Delete etcd endpoint.

func EtcdEndpointsShow

func EtcdEndpointsShow() (str string)

func EtcdKeyDelete

func EtcdKeyDelete(key []byte)

func EtcdKeyValueParse

func EtcdKeyValueParse(key []byte, value []byte)

func EtcdLock

func EtcdLock(etcdClient clientv3.Client, lockPath string, myID string, block bool) (error, clientv3.LeaseID)

func EtcdPathApi

func EtcdPathApi(set bool, Args []interface{})

func EtcdUnlock

func EtcdUnlock(etcdClient clientv3.Client, lockPath string, leaseID clientv3.LeaseID) error

func EtcdVrfAddressAdd

func EtcdVrfAddressAdd(vrfId int, vrf *VrfsConfig)

func EtcdVrfAddressClear

func EtcdVrfAddressClear(vrfId int, vrf *VrfsConfig)

func EtcdVrfCommand

func EtcdVrfCommand(cmd *Command) bool

func EtcdVrfDelete

func EtcdVrfDelete(vrfId int, vrfIfDelete bool)

func EtcdVrfDeleteCacheCheck

func EtcdVrfDeleteCacheCheck(str string) bool

func EtcdVrfDeleteCacheRegister

func EtcdVrfDeleteCacheRegister(cmd *Command)

func EtcdVrfStaticClear

func EtcdVrfStaticClear(vrfId int)

func EtcdVrfStaticUpdate

func EtcdVrfStaticUpdate(vrfId int, vrf *VrfsConfig)

func EtcdVrfSync

func EtcdVrfSync(vrfId int, vrf *VrfsConfig)

func EtcdVrfVlanSubinterfacesAdd

func EtcdVrfVlanSubinterfacesAdd(vrf *VrfsConfig)

func EtcdVrfVlanSubinterfacesDelete

func EtcdVrfVlanSubinterfacesDelete(vrf *VrfsConfig)

func EtcdWatchStop

func EtcdWatchStop()

func EtcdWatchUpdate

func EtcdWatchUpdate()

func ExecCmd

func ExecCmd(c *Command)

func ExecLine

func ExecLine(line string) string

func ExecLineWaitIfNoMatch

func ExecLineWaitIfNoMatch(command string)

TODO: Return failure if we finally fail. TODO: Generic failure recovery mechanism for any configuration set

func ExtHelp

func ExtHelp(e *yang.Entry) string

func GobgpAddGlobalPolicy

func GobgpAddGlobalPolicy(client *client.Client, direction string, policyNames []string, defaultRouteType bgpconfig.DefaultPolicyType) error

func GobgpAddPolicyDefinition

func GobgpAddPolicyDefinition(client *client.Client, cfg bgpconfig.PolicyDefinition)

func GobgpAddVrf

func GobgpAddVrf(client *client.Client, c *VrfConfig) error

func GobgpClearAll

func GobgpClearAll()

func GobgpClearApi

func GobgpClearApi(Args []string) (inst int, instStr string)

configure# clear gobgp

func GobgpClearDefinedSet

func GobgpClearDefinedSet(client *client.Client)

func GobgpClearGlobal

func GobgpClearGlobal(client *client.Client)

func GobgpClearGlobalPolicy

func GobgpClearGlobalPolicy(client *client.Client)

func GobgpClearNeighbor

func GobgpClearNeighbor(client *client.Client)

func GobgpClearPolicyDefinition

func GobgpClearPolicyDefinition(client *client.Client)

func GobgpClearVrf

func GobgpClearVrf(client *client.Client)

func GobgpClearVrfRib

func GobgpClearVrfRib(c *VrfConfig) error

func GobgpDeleteGlobalPolicy

func GobgpDeleteGlobalPolicy(client *client.Client, direction string, policyNames []string) error

func GobgpDeletePolicyDefinition

func GobgpDeletePolicyDefinition(client *client.Client, cfg bgpconfig.PolicyDefinition)

func GobgpHubDelete

func GobgpHubDelete(vrfId int)

func GobgpHubUpdate

func GobgpHubUpdate(vrfConfig VrfConfig)

func GobgpNeighborAdd

func GobgpNeighborAdd(id string, jsonStr string)

func GobgpNeighborDelete

func GobgpNeighborDelete(id string)

func GobgpNeighborUpdate added in v0.8.1

func GobgpNeighborUpdate(ncfg *bgpconfig.Neighbor, add bool)

func GobgpParse

func GobgpParse(jsonStr string)

func GobgpReset

func GobgpReset(cfg *GobgpConfig) error

func GobgpResetApi

func GobgpResetApi(Args []string) (inst int, instStr string)

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 GobgpStaticPath

func GobgpStaticPath(s *Route) (*table.Path, error)

func GobgpStatus

func GobgpStatus() (string, error)

func GobgpStatusGlobal

func GobgpStatusGlobal(stat *GobgpStat) error

func GobgpStatusNeighbor

func GobgpStatusNeighbor(stat *GobgpStat) error

func GobgpStatusRib

func GobgpStatusRib(stat *GobgpStat) error

func GobgpStatusUpdate

func GobgpStatusUpdate()

func GobgpUpdate

func GobgpUpdate(cfg *GobgpConfig, withReset bool) 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 GobgpVrfEqual

func GobgpVrfEqual(ribs []VrfRib, rib VrfRib) bool

func GobgpVrfPath

func GobgpVrfPath(c *VrfRib) (*table.Path, error)

func GobgpVrfRibSync

func GobgpVrfRibSync(name string, old, new []VrfRib)

func GobgpVrfUpdate

func GobgpVrfUpdate(vrfConfig VrfConfig)

func GobgpWanConfig

func GobgpWanConfig(cfg *GobgpConfig)

GoBGP WAN configure

func GobgpWanExit

func GobgpWanExit()

func GobgpWanParse

func GobgpWanParse(jsonStr string, local bool)

GoBGP WAN

func GobgpWanStop

func GobgpWanStop(local bool)

func HasKey

func HasKey(e *yang.Entry) bool

func HostnameApi

func HostnameApi(set bool, Args []interface{})

func HostnameSet

func HostnameSet(hostName string)

func HostnameUnset

func HostnameUnset()

func IsAdditive added in v0.8.1

func IsAdditive(e *yang.Entry) bool

func IsCompDir added in v0.8.1

func IsCompDir(e *yang.Entry) bool

func IsEmptyLeaf

func IsEmptyLeaf(e *yang.Entry) bool

func IsMandatory

func IsMandatory(e *yang.Entry) bool

func IsPresenceContainer

func IsPresenceContainer(e *yang.Entry) bool

func IsRibdAsync

func IsRibdAsync(module string) bool

func JsonFlatten

func JsonFlatten(paths []string, v reflect.Value, f func([]string))

func JsonMarshal

func JsonMarshal() string

func JsonParse

func JsonParse(jsonString string) ([]string, error)

func KeyEntry

func KeyEntry(ent *yang.Entry, index int) *yang.Entry

func KeyIncludeValue

func KeyIncludeValue(key, value string) bool

func KeyIndexString

func KeyIndexString(key string, index int) string

func KeyLength

func KeyLength(ent *yang.Entry) int

func KeySlice

func KeySlice(key string) []string

func Load

func Load(path string) error

func LoadConfig

func LoadConfig(reader io.Reader) error

func LocalAddrLookup

func LocalAddrLookup(ifName string) string

func LocalCidrLookup

func LocalCidrLookup(ifName string) string

func MatchChoice

func MatchChoice(ent *yang.Entry, str string, status *YMatchState)

func MatchConfig

func MatchConfig(config *Config, val string, str string, s *YMatchState)

func MatchConfigDir

func MatchConfigDir(config *Config, str string, s *YMatchState)

func MatchConfigValue

func MatchConfigValue(config *Config, str string, s *YMatchState)

func MatchDir

func MatchDir(ent *yang.Entry, str string, status *YMatchState)

func MatchEntry

func MatchEntry(matchType int, ent *yang.Entry, typ *yang.YangType, name string, str string, state *YMatchState)

func MatchKey

func MatchKey(ent *yang.Entry, str string, status *YMatchState)

func MatchKeyMatched

func MatchKeyMatched(ent *yang.Entry, str string, status *YMatchState)

func MatchLeaf

func MatchLeaf(e *yang.Entry, str string, state *YMatchState)

func MatchNumber

func MatchNumber(str string, e *yang.Entry) (pos int, match cmd.MatchType)

func MatchString

func MatchString(str string, e *yang.Entry, typ *yang.YangType) (pos int, match cmd.MatchType)

func MatchType

func MatchType(e *yang.Entry, typ *yang.YangType, str string, state *YMatchState)

func ModuleStart

func ModuleStart()

func NewGobgpClient added in v0.8.1

func NewGobgpClient() (*client.Client, error)

func NexthopWalkerUpdate added in v0.8.1

func NexthopWalkerUpdate()

func OspfExec

func OspfExec(vrfId int, ospfArray *OspfArray)

func OspfStatusNeighbor

func OspfStatusNeighbor(vrfName string, stat *OspfVrfStat) error

func OspfStatusRoute

func OspfStatusRoute(vrfName string, stat *OspfVrfStat) error

func OspfStatusUpdate

func OspfStatusUpdate()

func OspfVrfDelete

func OspfVrfDelete(vrfId int)

func OspfVrfExit

func OspfVrfExit()

func OspfVrfStop

func OspfVrfStop(vrfId int)

func OspfVrfSync

func OspfVrfSync(vrfId int, cfg *VrfsConfig)

func Parse

func Parse(cmds []string, ent *yang.Entry, config *Config, s *YMatchState) (int, cmd.Callback, []interface{}, cmd.CompSlice)

func ParseDelete

func ParseDelete(cmds []string, config *Config, s *YMatchState) (int, cmd.Callback, []interface{}, cmd.CompSlice)

func PathDump

func PathDump(path *Path, depth int)

func PathRegisterCommand

func PathRegisterCommand(p *Path, c *Command, sync bool)

func ProcessDelete

func ProcessDelete(config *Config)

func ProcessInterfacesAdd

func ProcessInterfacesAdd(vrfId int, ifaces []Interface)

func ProcessInterfacesDelete

func ProcessInterfacesDelete(vrfId int, ifaces []Interface)

func ProcessQuaggaConfigDelete added in v0.8.1

func ProcessQuaggaConfigDelete(vrfId int, instanceName string)

func ProcessVrfInterfaceChanges

func ProcessVrfInterfaceChanges(vrfId int, currentConfig *VrfsConfig, newConfig *VrfsConfig)

func ProcessVrfUpdate

func ProcessVrfUpdate(vrfId int, vrf *VrfsConfig)

func QuaggaConfigSync added in v0.8.1

func QuaggaConfigSync(jsonStr string, vrfId int, instanceName string)

func QuaggaDelete

func QuaggaDelete(vrfId int)

func QuaggaExec

func QuaggaExec(vrfId int, interfaceName string, configStr string)

func QuaggaExit

func QuaggaExit()

func QuaggaStatusBgpSummary

func QuaggaStatusBgpSummary(vrf string, stat *GobgpStat) error

func QuaggaStatusRib

func QuaggaStatusRib(vrf string, stat *GobgpStat) error

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 RelayAdd

func RelayAdd(ifName, group string)

func RelayApi

func RelayApi(set bool, Args []interface{})

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 RemoveIPAddress

func RemoveIPAddress(ifp Interface, ipaddrs []IPv4Addr)

func RemoveVlans

func RemoveVlans(ifp Interface, vlans []Vlan)

func RollbackCompletion

func RollbackCompletion(commands []string) []string

func RollbackDetailFetch

func RollbackDetailFetch(fileName string) string

func RollbackRevisionIncrement

func RollbackRevisionIncrement() error

func SetGobgpGrpcEndpoint added in v0.8.1

func SetGobgpGrpcEndpoint(grpcEndpoint string)

func SubscribeAdd added in v0.8.1

func SubscribeAdd(stream rpc.Config_DoConfigServer, req *rpc.ConfigRequest)

func SubscribeDelete

func SubscribeDelete(stream rpc.Config_DoConfigServer) error

func SubscribeDump

func SubscribeDump()

func SubscribeHostLookup added in v0.8.3

func SubscribeHostLookup(name string) string

func SubscribeLocalAdd

func SubscribeLocalAdd(path []string, json SubPathJsonCallback)

func SubscribePortLookup

func SubscribePortLookup(name string) uint32

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 UnQuote

func UnQuote(args []string)

func UnregisterPath

func UnregisterPath(p *Path)

func Validate

func Validate() bool

func VrfDelete

func VrfDelete(vrfId int, vrfIfDelete bool)

func VrfGetIPv4localRoutes added in v0.8.1

func VrfGetIPv4localRoutes(vrf string) ([]netlink.Route, error)

func VrfGetRoutes added in v0.8.1

func VrfGetRoutes(vrf string, family int, tableType int) ([]netlink.Route, error)

func VrfIdByName added in v0.8.1

func VrfIdByName(vrf string) (int, error)

func VrfName

func VrfName(vrfId int) string

func VrfParse

func VrfParse(vrfId int, jsonStr string)

func VrfQuaggaGet added in v0.8.1

func VrfQuaggaGet(
	vrf string,
	prog string,
	pass string,
	timeout time.Duration,
	in []string) ([]string, error)

func VrrpJsonConfig

func VrrpJsonConfig(path []string, str string) error

Called from Commit()

func VrrpServerExec

func VrrpServerExec(vrrp *Vrrp, vrf string) *process.Process

func VrrpServerStart

func VrrpServerStart(config string, pid string, vrrpPid string, vrf string) *process.Process

func VrrpServerStopAll

func VrrpServerStopAll()

func VrrpStateDelete

func VrrpStateDelete(ifName string)

func VrrpVrfDelete

func VrrpVrfDelete(vrfId int)

func VrrpVrfSync

func VrrpVrfSync(vrfId int, cfg *VrfsConfig)

Called from etcd.

func YEntryJson

func YEntryJson(e *yang.Entry) string

func YParseDelete

func YParseDelete(param *cmd.Param) (int, cmd.Callback, []interface{}, cmd.CompSlice)

func YParseSet

func YParseSet(param *cmd.Param) (int, cmd.Callback, []interface{}, cmd.CompSlice)

func YangConfigPull

func YangConfigPull(Args []string)

func YangConfigPush

func YangConfigPush(Args []string)

func YangDelete

func YangDelete(Args []string) (inst int, instStr string)

func YangJsonParse

func YangJsonParse()

Yang based json parser.

func YangSet

func YangSet(Args []string) (inst int, instStr string)

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 Command

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

func NewCommand

func NewCommand(line string) *Command

type Config

type Config struct {
	Name          string
	Entry         *yang.Entry
	Parent        *Config
	KeyConfig     bool
	KeyOnlyConfig bool
	HasValue      bool
	HasListValue  bool
	Configs       ConfigSlice
	Keys          ConfigSlice
	Value         string
	ValueList     []string
	Prefix        string
	Case          *yang.Entry
}

func (*Config) Command

func (c *Config) Command() *Command

func (*Config) CommandLine

func (c *Config) CommandLine() []string

func (*Config) CommandList

func (c *Config) CommandList(list []*Config) []*Config

func (*Config) CommandPath

func (c *Config) CommandPath() []string

func (*Config) CommandString

func (c *Config) CommandString() string

func (*Config) Copy

func (c *Config) Copy(parent *Config) *Config

func (*Config) Delete

func (c *Config) Delete(n *Config)

func (*Config) DeleteKey

func (c *Config) DeleteKey(n *Config)

func (*Config) DisplayEntry

func (c *Config) DisplayEntry() bool

func (*Config) Empty

func (c *Config) Empty() bool

func (*Config) HasDir

func (c *Config) HasDir() bool

func (*Config) IsContainer

func (c *Config) IsContainer() bool

func (*Config) IsKeyConfig

func (c *Config) IsKeyConfig() bool

func (*Config) IsLeaf

func (c *Config) IsLeaf() bool

func (*Config) IsPresenceContainer

func (c *Config) IsPresenceContainer() bool

func (*Config) IsValueLeaf

func (c *Config) IsValueLeaf() bool

func (*Config) JsonMarshal

func (c *Config) JsonMarshal() string

func (*Config) LookupByPath

func (c *Config) LookupByPath(path []string) *Config

func (*Config) MandatoryCheck

func (c *Config) MandatoryCheck() error

func (*Config) PrefixWrite

func (c *Config) PrefixWrite(out io.Writer)

func (*Config) Priority

func (c *Config) Priority() int

Static config priority until we add priority to YANG entry.

func (*Config) Set

func (c *Config) Set(e *yang.Entry) *Config

func (*Config) SetKey

func (c *Config) SetKey(e *yang.Entry, key string, prefix string, last bool) *Config

func (*Config) SetLeafList

func (c *Config) SetLeafList(e *yang.Entry) *Config

func (*Config) SetListValue

func (c *Config) SetListValue(value string) *Config

func (*Config) SetValue

func (c *Config) SetValue(value string) *Config

func (*Config) Signature

func (c *Config) Signature(out io.Writer, via string)

func (*Config) String

func (c *Config) String() string

func (*Config) WriteCommandTo

func (c *Config) WriteCommandTo(path string)

func (*Config) WriteTo

func (c *Config) WriteTo(path string, by ...string)

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) Len

func (configs ConfigSlice) Len() int

ConfigSlice sort

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

func (*Dhcp) Equal

func (lhs *Dhcp) Equal(rhs *Dhcp) bool

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 DhcpRange

type DhcpRange struct {
	StartIp string `json:"start_ip"`
	EndIp   string `json:"end_ip"`
}

type DistributeList added in v0.8.1

type DistributeList struct {
	Primary []DistributeListEntry
	Backup  []DistributeListEntry
}

type DistributeListEntry added in v0.8.1

type DistributeListEntry struct {
	Action string `mapstructure:"action" json:"action,omitempty"`
	Ge     *int   `mapstructure:"ge" json:"ge,omitempty"`
	Le     *int   `mapstructure:"le" json:"le,omitempty"`
	Prefix string `mapstructure:"prefix" json:"prefix,omitempty"`
}

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 EtcdVrfStaticRoute

type EtcdVrfStaticRoute map[string]string

type EtcdWatcher added in v0.8.2

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

func NewWatcher added in v0.8.2

func NewWatcher(endpoints []string, etcdDialTimeout time.Duration, watchPrefix string, backOffTime time.Duration, putHandler func([]byte, []byte), deleteHandler func([]byte)) (*EtcdWatcher, error)

func (*EtcdWatcher) Close added in v0.8.2

func (watcher *EtcdWatcher) Close() error

func (*EtcdWatcher) ResyncAndWatch added in v0.8.2

func (watcher *EtcdWatcher) ResyncAndWatch(ctx context.Context, startRevision int64) (int64, error)

func (*EtcdWatcher) Watch added in v0.8.2

func (watcher *EtcdWatcher) Watch(ctx context.Context, startRevision int64) (int64, error)

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"`
	Interfaces        Interfaces                   `mapstructure:"interfaces" json:"interfaces,omitempty"`
}

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 GobgpStatGlobal struct {
	As       string `json:"as"`
	RouterId string `json:"router-id"`
}

type GobgpStatNeighbor

type GobgpStatNeighbor struct {
	Peer     string `json:"peer"`
	As       string `json:"as"`
	Age      string `json:"age"`
	State    string `json:"state"`
	Recevied string `json:"received"`
	Accepted string `json:"accepted"`
}

type GobgpStatRib

type GobgpStatRib struct {
	Network string `json:"network"`
	Nexthop string `json:"next-hop"`
	Metric  uint32 `json:"metric,omitempty"`
}

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

func (*Host) Equal

func (lhs *Host) Equal(rhs *Host) bool

type Hub

type Hub struct {
	Address string `mapstructure:"address" json:"address,omitempty"`
}

type IPv4

type IPv4 struct {
	Address []IPv4Addr `mapstructure:"address" json:"address,omitempty"`
}

type IPv4Addr

type IPv4Addr struct {
	Ip string `mapstructure:"ip" json:"ip,omitempty"`
}

type Interface

type Interface struct {
	IPv4           IPv4   `mapstructure:"ipv4" json:"ipv4,omitempty"`
	Vlans          []Vlan `mapstructure:"vlans" json:"vlans,omitempty"`
	Name           string `mapstructure:"name" json:"name,omitempty"`
	Duplex         string `mapstructure:"duplex" json:"duplex,omitempty"`
	Speed          string `mapstructure:"speed" json:"speed,omitempty"`
	DhcpRelayGroup string `mapstructure:"dhcp-relay-group" json:"dhcp-relay-group,omitempty"`
}

type InterfaceIp added in v0.8.1

type InterfaceIp struct {
	// original -> coreswitch:name
	Name string `mapstructure:"name" json:"name,omitempty"`
	// original -> coreswitch:ip
	Ip Ip `mapstructure:"ip" json:"ip,omitempty"`
}

struct for container coreswitch:interface

func (*InterfaceIp) Equal added in v0.8.1

func (lhs *InterfaceIp) Equal(rhs *InterfaceIp) bool

type Interfaces

type Interfaces struct {
	Interface []Interface `mapstructure:"interface" json:"interface,omitempty"`
}

func (Interfaces) Len

func (i Interfaces) Len() int

func (Interfaces) Less

func (i Interfaces) Less(j, k int) bool

func (Interfaces) Swap

func (i Interfaces) Swap(j, k int)

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 Ip added in v0.8.1

type Ip struct {
	// original -> coreswitch:ospf
	OspfIp OspfIp `mapstructure:"ospf" json:"ospf,omitempty"`
}

struct for container coreswitch:ip

func (*Ip) Equal added in v0.8.1

func (lhs *Ip) Equal(rhs *Ip) bool

type JsonBody

type JsonBody struct {
	Value   string
	Body    string `mapstructure:"body"`
	Version int    `mapstructure:"version"`
}

type LeaseMap

type LeaseMap map[string]*LeaseValue

func LoadLease

func LoadLease(reader io.Reader) (*LeaseMap, error)

type LeaseValue

type LeaseValue struct {
	Address        string `json:"address"`
	Hardware       string `json:"hardware"`
	ClientHostName string `json:"client-hostname"`
}

type NeighborConfig

type NeighborConfig struct {
	Neighbor bgpconfig.Neighbor `json:"neighbor"`
}

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

func (*Nexthop) Equal

func (lhs *Nexthop) Equal(rhs *Nexthop) bool

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 OpenBgpConfig added in v0.8.1

type OpenBgpConfig struct {
	QuaggaInstanceConfig string `mapstructure:"quagga-config" json:"quagga-config,omitempty"`
	RoutingProtocol      string `mapstructure:"routing-protocol" json:"routing-protocol,omitempty"`
}

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

func (*Option) Equal

func (lhs *Option) Equal(rhs *Option) bool

type Ospf

type Ospf struct {
	Network      string                `mapstructure:"network" json:"network,omitempty"`
	Area         uint32                `mapstructure:"area" json:"area,omitempty"`
	InterfaceIps []InterfaceIp         `mapstructure:"interfaces" json:"interfaces,omitempty"`
	Interface    string                `mapstructure:"interface" json:"interface,omitempty"` // Deplicated from 2.4
	PrimaryList  []DistributeListEntry `mapstructure:"distribute-list" json:"distribute-list,omitempty"`
	BackupList   []DistributeListEntry `mapstructure:"backup-distribute-list" json:"backup-distribute-list,omitempty"`
}

func (*Ospf) Equal

func (lhs *Ospf) Equal(rhs *Ospf) bool

type OspfArray

type OspfArray []Ospf

func (*OspfArray) Equal

func (lhs *OspfArray) Equal(rhs *OspfArray) bool

type OspfIfParam added in v0.8.1

type OspfIfParam struct {
	// original -> coreswitch:interfaces
	InterfaceIps []InterfaceIp `mapstructure:"interfaces" json:"interfaces,omitempty"`
}

struct for container coreswitch:ospf-if-param

func (*OspfIfParam) Equal added in v0.8.1

func (lhs *OspfIfParam) Equal(rhs *OspfIfParam) bool

type OspfIp added in v0.8.1

type OspfIp struct {
	// original -> coreswitch:authentication-key
	AuthenticationKey string `mapstructure:"authentication-key" json:"authentication-key,omitempty"`
	// original -> coreswitch:cost
	Cost uint16 `mapstructure:"cost" json:"cost,omitempty"`
	// original -> coreswitch:dead-interval
	DeadInterval uint16 `mapstructure:"dead-interval" json:"dead-interval,omitempty"`
	// original -> coreswitch:hello-interval
	HelloInterval uint16 `mapstructure:"hello-interval" json:"hello-interval,omitempty"`
	// original -> coreswitch:priority
	Priority string `mapstructure:"priority" json:"priority,omitempty"`
	// original -> coreswitch:retransmit-interval
	RetransmitInterval uint16 `mapstructure:"retransmit-interval" json:"retransmit-interval,omitempty"`
	// original -> coreswitch:transmit-delay
	TransmitDelay uint16 `mapstructure:"transmit-delay" json:"transmit-delay,omitempty"`
}

struct for container coreswitch:ospf

func (*OspfIp) Equal added in v0.8.1

func (lhs *OspfIp) Equal(rhs *OspfIp) bool

type OspfJSONRoutes

type OspfJSONRoutes struct {
	Prefix   string        `mapstructure:"prefix"`
	Nexthops []OspfNexthop `mapstructure:"nexthops"`
	Metric   int           `mapstructure:"metric"`
	Distance int           `mapstructure:"distance"`
	Type     string        `mapstructure:"type"`
}

Only used for JSON parse.

type OspfNeighbor

type OspfNeighbor struct {
	Neighbor  string `json:"neighbor"`
	Priority  int    `json:"priority"`
	State     string `json:"state"`
	Address   string `json:"address"`
	Interface string `json:"interface"`
}

type OspfNexthop

type OspfNexthop struct {
	Address   string `mapstructure:"address" json:"address"`
	Interface string `mapstructure:"interface" json:"interface"`
}

type OspfRoute

type OspfRoute struct {
	Network  string        `json:"network"`
	Nexthops []OspfNexthop `json:"next-hop"`
}

type OspfStat

type OspfStat struct {
	Ospf []OspfVrfStat `json:"ospf"`
}

type OspfVrfStat

type OspfVrfStat struct {
	Vrf       string         `json:"vrf"`
	Neighbors []OspfNeighbor `json:"neighbors"`
	Routes    []OspfRoute    `json:"routes"`
}

func OspfStatusVrf

func OspfStatusVrf(vrfName string) *OspfVrfStat

type Path

type Path struct {
	Name    string
	Parent  *Path
	Map     PathMap
	Refcnt  uint32
	SubPath []SubPath
}

func NewPath

func NewPath(name string, parent *Path) *Path

type PathMap

type PathMap map[string]*Path

type PriorityConfig added in v0.8.1

type PriorityConfig struct {
	Priority string `mapstructure:"priority" json:"priority,omitempty"`
}

type QuaggaAccess added in v0.8.1

type QuaggaAccess struct {
	Exp *expect.Expect
	// contains filtered or unexported fields
}

func VrfQuaggaAccess added in v0.8.1

func VrfQuaggaAccess(
	vrf string,
	prog string,
	pass string,
	timeout time.Duration) (*QuaggaAccess, error)

func (*QuaggaAccess) Auth added in v0.8.1

func (qa *QuaggaAccess) Auth(pass string) error

func (*QuaggaAccess) Batch added in v0.8.1

func (qa *QuaggaAccess) Batch(in []string) []string

func (*QuaggaAccess) Close added in v0.8.1

func (qa *QuaggaAccess) Close()

func (*QuaggaAccess) GetTempFileName added in v0.8.1

func (qa *QuaggaAccess) GetTempFileName() string

func (*QuaggaAccess) Init added in v0.8.1

func (qa *QuaggaAccess) Init(vrf string, addr net.IP, prog string, timeout time.Duration) error

type QuaggaBgp

type QuaggaBgp struct {
	CiscoConfig string `mapstructure:"cisco-config" json:"cisco-config,omitempty"`
	Interface   string `mapstructure:"interface" json:"interface,omitempty"`
}

type QuaggaInstanceConfig added in v0.8.1

type QuaggaInstanceConfig struct {
	QuaggaInstanceConfig string `mapstructure:"quagga-config" json:"quagga-config,omitempty"`
	RoutingProtocol      string `mapstructure:"routing-protocol" json:"routing-protocol,omitempty"`
}

type QuaggaInstanceManager added in v0.8.1

type QuaggaInstanceManager struct {
	QuaggaProcMap     map[int]map[string]process.ProcessSlice
	QuaggaConfigCache map[int]QuaggaInterfaceConfigs
	LocalCacheLock    *sync.Mutex
	QuaggaConfigDir   string
}

func GetInstanceManager added in v0.8.1

func GetInstanceManager(instanceName string) *QuaggaInstanceManager

func GetOrCreateInstanceManager added in v0.8.1

func GetOrCreateInstanceManager(instanceName string) *QuaggaInstanceManager

func NewQuaggaManager added in v0.8.1

func NewQuaggaManager() *QuaggaInstanceManager

func (QuaggaInstanceManager) LockLocalCache added in v0.8.1

func (qim QuaggaInstanceManager) LockLocalCache()

func (QuaggaInstanceManager) ProcessConfigDelete added in v0.8.1

func (qim QuaggaInstanceManager) ProcessConfigDelete(vrfId int, quaggaConfigMap QuaggaInterfaceConfigs)

func (QuaggaInstanceManager) ProcessQuaggaConfigAdd added in v0.8.1

func (qim QuaggaInstanceManager) ProcessQuaggaConfigAdd(vrfId int, quaggaConfigMap QuaggaInterfaceConfigs)

func (QuaggaInstanceManager) ProcessQuaggaConfigDelete added in v0.8.1

func (qim QuaggaInstanceManager) ProcessQuaggaConfigDelete(vrfId int)

func (QuaggaInstanceManager) ProcessVrfQuaggaConfigDelete added in v0.8.1

func (qim QuaggaInstanceManager) ProcessVrfQuaggaConfigDelete(vrfId int)

func (QuaggaInstanceManager) QuaggaBgpConfigDiff added in v0.8.1

func (QuaggaInstanceManager) QuaggaCleanup added in v0.8.1

func (qim QuaggaInstanceManager) QuaggaCleanup()

func (QuaggaInstanceManager) QuaggaConfigSync added in v0.8.1

func (qim QuaggaInstanceManager) QuaggaConfigSync(jsonStr string, vrfId int)

func (QuaggaInstanceManager) SpawnQuagga added in v0.8.1

func (qim QuaggaInstanceManager) SpawnQuagga(vrfId int, interfaceName string, configStr string)

func (QuaggaInstanceManager) UnLockLocalCache added in v0.8.1

func (qim QuaggaInstanceManager) UnLockLocalCache()

type QuaggaInterfaceConfigs added in v0.8.1

type QuaggaInterfaceConfigs map[string][]QuaggaInstanceConfig

type QuaggaManager added in v0.8.1

type QuaggaManager interface {
	SetConfig()
	DeleteConfig()
	Destroy()
}

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

func (*Range) Equal

func (lhs *Range) Equal(rhs *Range) bool

type RelayGroup

type RelayGroup struct {
	Server []string
}

type RelayInstance

type RelayInstance struct {
	IfName   string
	Vrf      string
	Group    string
	ExitFunc func()
}

type Rollback

type Rollback struct {
	Rev    int
	Detail string
}

func RollbackListGet

func RollbackListGet() ([]*Rollback, error)

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

func (*Route) Equal

func (lhs *Route) Equal(rhs *Route) bool

type RpcComponent

type RpcComponent struct {
	GrpcEndpoint string
}

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

func (*Server) Equal

func (lhs *Server) Equal(rhs *Server) bool

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 State

type State string

typedef for identity vrrp:state

const (
	STATE_MASTER State = "master"
	STATE_BACKUP State = "backup"
)

func (State) ToInt

func (v State) ToInt() int

func (State) Validate

func (v State) Validate() error

type Static

type Static struct {
	Route []Route `mapstructure:"route" json:"route,omitempty"`
}

type SubPath

type SubPath interface {
	Len() int
	Append([]string, *Command)
	RegisterPath([]string)
	Commit()
	Path() *Path
	Sync() bool
	CommandClear()
}

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 SubPathJsonCallback func([]string, string) error

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
	Host   string

	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) SendJSON added in v0.8.1

func (sub *Subscriber) SendJSON(path []string, json string)

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 Vlan

type Vlan struct {
	VlanId int `mapstructure:"vlan-id" json:"vlan-id,omitempty"`
}

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"`
	HubNode  string   `mapstructure:"hub_node" json:"hub_node,omitempty"`
	Static   Static
}

func (*VrfConfig) Equal

func (lhs *VrfConfig) Equal(rhs *VrfConfig) bool

type VrfRib

type VrfRib struct {
	Prefix  string `mapstructure:"prefix" json:"prefix,omitempty"`
	NextHop string `mapstructure:"next-hop" json:"next-hop,omitempty"`
	Same    bool
}

func (*VrfRib) Equal

func (lhs *VrfRib) Equal(rhs *VrfRib) bool

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"`
	HubNode    string         `mapstructure:"hub_node" json:"hub_node,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"`
	Ospf       OspfArray      `mapstructure:"ospf" json:"ospf,omitempty"`
	Pair       PriorityConfig `mapstructure:"pair" json:"pair,omitempty"`
	Gateway    PriorityConfig `mapstructure:"gateway" json:"gateway,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"`
	//Manual addition
	Name string `mapstructure:"name" json:"name,omitempty"`
}

struct for container vrrp:vrrp

func (*Vrrp) Equal

func (lhs *Vrrp) Equal(rhs *Vrrp) bool

type VrrpConfig

type VrrpConfig []Vrrp

type VrrpInstance

type VrrpInstance struct {
	IfName  string
	VrId    uint8
	Process *process.Process
}

type VrrpState

type VrrpState struct {
	State     string `json:"state"`
	ChangedAt int64  `json:"changed_at"`
}

type YMatchState

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

type YangComponent

type YangComponent struct {
	YangPaths   string
	YangModules []string
}

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.

Jump to

Keyboard shortcuts

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