config

package
v0.0.3-pre4.0...-0ec3cfc Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 10 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 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"`
}

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