config

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AFI

type AFI struct {
	Name string `yaml:"name"`
	SAFI SAFI   `yaml:"safi"`
}

type ASPathPrepend

type ASPathPrepend struct {
	ASN   uint32 `yaml:"asn"`
	Count uint16 `yaml:"count"`
}

type AddPath

type AddPath struct {
	Receive bool         `yaml:"receive"`
	Send    *AddPathSend `yaml:"send"`
}

type AddPathSend

type AddPathSend struct {
	Multipath bool  `yaml:"multipath"`
	PathCount uint8 `yaml:"path_count"`
}

type BGP

type BGP struct {
	Groups []*BGPGroup `yaml:"groups"`
}

type BGPGroup

type BGPGroup struct {
	Name              string `yaml:"name"`
	LocalAddress      string `yaml:"local_address"`
	LocalAddressIP    *bnet.IP
	TTL               uint8          `yaml:"ttl"`
	AuthenticationKey string         `yaml:"authentication_key"`
	PeerAS            uint32         `yaml:"peer_as"`
	LocalAS           uint32         `yaml:"local_as"`
	HoldTime          uint16         `yaml:"hold_time"`
	Multipath         *Multipath     `yaml:"multipath"`
	Import            []string       `yaml:"import"`
	Export            []string       `yaml:"export"`
	RouteServerClient bool           `yaml:"route_server_client"`
	Passive           bool           `yaml:"passive"`
	Neighbors         []*BGPNeighbor `yaml:"neighbors"`
	AFIs              []*AFI         `yaml:"afi"`
}

type BGPNeighbor

type BGPNeighbor struct {
	PeerAddress       string `yaml:"peer_address"`
	PeerAddressIP     *bnet.IP
	LocalAddress      string `yaml:"local_address"`
	LocalAddressIP    *bnet.IP
	TTL               uint8  `yaml:"ttl"`
	AuthenticationKey string `yaml:"authentication_key"`
	PeerAS            uint32 `yaml:"peer_as"`
	LocalAS           uint32 `yaml:"local_as"`
	HoldTime          uint16 `yaml:"hold_time"`
	HoldTimeDuration  time.Duration
	Multipath         *Multipath `yaml:"multipath"`
	Import            []string   `yaml:"import"`
	ImportFilterChain filter.Chain
	Export            []string `yaml:"export"`
	ExportFilterChain filter.Chain
	RouteServerClient *bool  `yaml:"route_server_client"`
	Passive           *bool  `yaml:"passive"`
	ClusterID         string `yaml:"cluster_id"`
	ClusterIDIP       *bnet.IP
	AFIs              []*AFI `yaml:"afi"`
}

type Config

type Config struct {
	PolicyOptions    *PolicyOptions     `yaml:"policy_options"`
	RoutingInstances []*RoutingInstance `yaml:"routing_instances"`
	RoutingOptions   *RoutingOptions    `yaml:"routing_options"`
	Protocols        *Protocols         `yaml:"protocols"`
}

func GetConfig

func GetConfig(filePath string) (*Config, error)

GetConfig gets the configuration

type ISIS

type ISIS struct {
	NETs        []string         `yaml:"NETs"`
	Level1      *ISISLevel       `yaml:"level1"`
	Level2      *ISISLevel       `yaml:"level2"`
	Interfaces  []*ISISInterface `yaml:"interfaces"`
	LSPLifetime uint16           `yaml:"lsp_lifetime"`
}

ISIS config

func (*ISIS) InterfaceConfigured

func (i *ISIS) InterfaceConfigured(name string) bool

type ISISInterface

type ISISInterface struct {
	Name         string              `yaml:"name"`
	Passive      bool                `yaml:"passive"`
	PointToPoint bool                `yaml:"point_to_point"`
	Level1       *ISISInterfaceLevel `yaml:"level1"`
	Level2       *ISISInterfaceLevel `yaml:"level2"`
}

ISISInterface interface config

type ISISInterfaceLevel

type ISISInterfaceLevel struct {
	Disable       bool   `yaml:"disable"`
	HelloInterval uint16 `yaml:"hello_interval"`
	HoldTime      uint16 `yaml:"hold_time"`
	Metric        uint32 `yaml:"metric"`
	Passive       bool   `yaml:"passive"`
	Priority      uint8  `yaml:"priority"`
}

ISISInterfaceLevel interface level config

type ISISLevel

type ISISLevel struct {
	Disable               bool   `yaml:"disable"`
	AuthenticationKey     string `yaml:"authentication_key"`
	NoCSNPAuthentication  bool   `yaml:"no_csnp_authentication"`
	NoHelloAuthentication bool   `yaml:"no_hello_authentication"`
	NoPSNPAuthentication  bool   `yaml:"no_psnp_authentication"`
	WideMetricsOnly       bool   `yaml:"wide_metrics_only"`
}

ISISLevel level config

type Multipath

type Multipath struct {
	Enable    bool `yaml:"enable"`
	MulipleAS bool `yaml:"multiple_as"`
}

type NextHop

type NextHop struct {
	Address string `yaml:"address"`
}

type PolicyOptions

type PolicyOptions struct {
	PolicyStatements       []*PolicyStatement `yaml:"policy_statements"`
	PolicyStatementsFilter []*filter.Filter
	PrefixLists            []PrefixList `yaml:"prefix_lists"`
}

type PolicyStatement

type PolicyStatement struct {
	Name  string                 `yaml:"name"`
	Terms []*PolicyStatementTerm `yaml:"terms"`
}

type PolicyStatementTerm

type PolicyStatementTerm struct {
	Name string                  `yaml:"name"`
	From PolicyStatementTermFrom `yaml:"from"`
	Then PolicyStatementTermThen `yaml:"then"`
}

type PolicyStatementTermFrom

type PolicyStatementTermFrom struct {
	RouteFilters []*RouteFilter `yaml:"route_filters"`
}

type PolicyStatementTermThen

type PolicyStatementTermThen struct {
	Accept        bool           `yaml:"accept"`
	Reject        bool           `yaml:"reject"`
	MED           *uint32        `yaml:"med"`
	LocalPref     *uint32        `yaml:"local_pref"`
	ASPathPrepend *ASPathPrepend `yaml:"as_path_prepend"`
	NextHop       *NextHop       `yaml:"next_hop"`
}

type PrefixList

type PrefixList struct {
	Prefixes []string `yaml:"prefixes"`
}

type Protocols

type Protocols struct {
	BGP  *BGP  `yaml:"bgp"`
	ISIS *ISIS `yaml:"isis"`
}

type RouteFilter

type RouteFilter struct {
	Prefix  string `yaml:"prefix"`
	Matcher string `yaml:"matcher"`
	LenMin  uint8  `yaml:"len_min"`
	LenMax  uint8  `yaml:"len_max"`
}

type RoutingInstance

type RoutingInstance struct {
	Name                       string
	RouteDistinguisher         string
	InternalRouteDistinguisher uint64
	RoutingOptions             *RoutingOptions
	Protocols                  *Protocols
}

type RoutingOptions

type RoutingOptions struct {
	StaticRoutes     []StaticRoute `yaml:"static_routes"`
	RouterID         string        `yaml:"router_id"`
	RouterIDUint32   uint32
	AutonomousSystem uint32 `yaml:"autonomous_system"`
}

type SAFI

type SAFI struct {
	Name    string   `yaml:"name"`
	AddPath *AddPath `yaml:"add_path"`
}

type StaticRoute

type StaticRoute struct {
	Prefix  string
	Discard bool
	NextHop string
	Resolve bool
}

Jump to

Keyboard shortcuts

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