config

package
v0.0.0-...-87151e1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2017 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CliSuccess = iota
	CliSuccessExec
	CliSuccessShow
	CliSuccessModule
	CliSuccessRedirect
	CliSuccessRedirectShow
)
View Source
const (
	DirState stateType = iota
	DirKeyState
	DirKeyMatched
	LeafState
	LeafMatched
	UnknownState
)
View Source
const (
	YMatchTypeKeyword yMatchType = iota
	YMatchTypeNumber
	YMatchTypeString
)

Variables

View Source
var (
	Hostname           string
	HostnameConfigured bool
)
View Source
var (
	RelayInstanceMap = map[string]*RelayInstance{}
	RelayGroupMap    = map[string]*RelayGroup{}
)
View Source
var (
	RootPath       = &Path{Map: PathMap{}}
	SubscribeMap   = map[*Subscriber]struct{}{}
	SubscribeWg    sync.WaitGroup
	SubscribeMutex sync.RWMutex
	ValidateCount  int
)
View Source
var ConfigDir = "/usr/local/etc"
View Source
var ConfigRevisionMax = 50
View Source
var DhcpProcessList = process.ProcessSlice{}
View Source
var EtcdVrfMap = map[int]VrfsConfig{}
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 Parser *cmd.Node
View Source
var QuaggaProc = map[int]process.ProcessSlice{}
View Source
var (
	RIBD_SYNCHRONIZED bool
)
View Source
var StateToIntMap = map[State]int{
	STATE_MASTER: 0,
	STATE_BACKUP: 1,
}
View Source
var StateToString = map[stateType]string{
	DirState:      "DirState",
	DirKeyState:   "DirKeyState",
	DirKeyMatched: "DirKeyMatched",
	LeafState:     "LeafState",
	LeafMatched:   "LeafMatched",
	UnknownState:  "UnknownState",
}
View Source
var TopCmd *cmd.Cmd
View Source
var VrrpInstanceMap = map[string][]*VrrpInstance{}

Functions

func Commands

func Commands() string

func Commit

func Commit() bool

func Compare

func Compare() string

func CompareCommand

func CompareCommand() string

func ConfigDiscard

func ConfigDiscard() bool

func ConfigLookupVrf

func ConfigLookupVrf(ifName string) string

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 DynamicCompletion

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

func DynamicCompletionLocal

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

func Env

func Env(key string) string

func EnvAll

func EnvAll() map[string]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 EtcdKeepWatch

func EtcdKeepWatch(cli *clientv3.Client, ctx context.Context, ctxS context.Context, watchPoint string, exiting chan struct{}, callback chan bool)

func EtcdKeyDelete

func EtcdKeyDelete(key []byte)

func EtcdKeyValueParse

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

func EtcdPathApi

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

func EtcdRegisterCallback

func EtcdRegisterCallback(callback chan bool, exiting chan struct{})

func EtcdTrimServicesPrefix

func EtcdTrimServicesPrefix(keyStr string) []string

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 EtcdWatchStart(cfg clientv3.Config, watchPoint string) func()

func EtcdWatchStop

func EtcdWatchStop()

func EtcdWatchUpdate

func EtcdWatchUpdate()

Update etcd endpoints.

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 GobgpAddGlobalPolicy

func GobgpAddGlobalPolicy(client *client.Client, direction string, policyNames []string) 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 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 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) 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 GobgpVrfPath

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

func GobgpVrfUpdate

func GobgpVrfUpdate(vrfConfig VrfConfig)

func GobgpWanConfig

func GobgpWanConfig(cfg *GobgpConfig)

GoBGP WAN configure

func GobgpWanParse

func GobgpWanParse(jsonStr string)

GoBGP WAN

func GobgpWanStop

func GobgpWanStop()

func HostnameApi

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

func HostnameSet

func HostnameSet(hostName string)

func HostnameUnset

func HostnameUnset()

func JsonConfigImport

func JsonConfigImport(jsonBuf []byte, yangRoot *yang.Entry, configRoot *Config) error

Import JSON format config and put it into the Config tree according to the YANG tree.

func JsonFlatten

func JsonFlatten(paths []string, v interface{}, f func([]string))

func JsonMarshal

func JsonMarshal() string

func JsonParse

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

func Load

func Load(path string) error

func LoadConfig

func LoadConfig(reader io.Reader) error

func LocalAddrLookup

func LocalAddrLookup(ifName string) string

func PathDump

func PathDump(path *Path, depth int)

func PathRegisterCommand

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

func Process

func Process(path []string, ent *yang.Entry, config *Config) error

func ProcessDelete

func ProcessDelete(config *Config)

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 RollbackCompletion

func RollbackCompletion(commands []string) []string

func RollbackDetailFetch

func RollbackDetailFetch(fileName string) string

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

func VrfParse

func VrfParse(vrfId int, jsonStr string)

func VrrpJsonConfig

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

Called from Commit()

func VrrpServerExec

func VrrpServerExec(vrrp *Vrrp, vrf string) func()

func VrrpServerStart

func VrrpServerStart(config string, pid string, vrf string) func()

func VrrpServerStopAll

func VrrpServerStopAll()

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 YMatchKeyword

func YMatchKeyword(e *yang.Entry, str string, name string, complete bool, state *YMatchState)

func YMatchNumber

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

func YMatchString

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

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 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
	HasValue  bool
	Configs   ConfigSlice
	Keys      ConfigSlice
	Value     string
	Prefix    string
}

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

func (c *Config) CopyShallow() *Config

func (*Config) Delete

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

func (*Config) DeleteKey

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

func (*Config) Empty

func (c *Config) Empty() bool

func (*Config) IsKeyConfig

func (c *Config) IsKeyConfig() bool

func (*Config) IsLeaf

func (c *Config) IsLeaf() bool

func (*Config) JsonMarshal

func (c *Config) JsonMarshal() string

func (*Config) LookupByPath

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

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) *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 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 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"`
	DhcpRelayGroup string `mapstructure:"dhcp-relay-group" json:"dhcp-relay-group,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 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 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 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 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 QuaggaBgp

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

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{}

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

	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 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"`
}

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"`
}

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"`
	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

func (*Vrrp) Equal

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

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

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