config

package
v0.0.0-...-5841409 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DockerRouterImage = "topomate/router"
	DockerRSImage     = "topomate/route-server"
	DockerRTRImage    = "topomate/rtr"
)

Variables

View Source
var ASOnly []int
View Source
var ConfigDir string
View Source
var VFlag bool

Functions

This section is empty.

Types

type ASConfig

type ASConfig struct {
	ASN          int           `yaml:"asn,omitempty"`
	NumRouters   int           `yaml:"routers,omitempty"`
	IGP          string        `yaml:"igp,omitempty"`
	ISIS         ISISConfig    `yaml:"isis"`
	OSPF         OSPFConfig    `yaml:"ospf"`
	Prefix       string        `yaml:"prefix,omitempty"`
	SubnetLength int           `yaml:"subnet_length"`
	LoRange      string        `yaml:"loopback_start,omitempty"`
	BGP          BGPConfig     `yaml:"bgp"`
	Links        InternalLinks `yaml:"links,omitempty"`
	MPLS         bool          `yaml:"mpls,omitempty"`
	VPN          []VPNConfig
	RPKI         struct {
		Servers []string `yaml:"servers"`
	} `yaml:"rpki"`
}

type BGPConfig

type BGPConfig struct {
	IBGP            IBGPConfig `yaml:"ibgp"`
	Disabled        bool       `yaml:"disabled"`
	RedistributeIGP bool       `yaml:"redistribute_igp"`
}

type BGPRelationConfig

type BGPRelationConfig struct {
	Community int `yaml:"community,omitempty"`
	LocalPref int `yaml:"local_pref,omitempty"`
}

type BaseConfig

type BaseConfig struct {
	Name         string                `yaml:"name,omitempty"`
	Global       GlobalConfig          `yaml:"global_settings"`
	AS           []ASConfig            `yaml:"autonomous_systems"`
	ExternalFile string                `yaml:"external_links_file"`
	External     []ExternalLink        `yaml:"external_links"`
	IXPs         []IXPConfig           `yaml:"ixps"`
	RPKI         map[string]RPKIConfig `yaml:"rpki"`
}
type ExternalLink struct {
	From         ExternalLinkItem `yaml:"from"`
	To           ExternalLinkItem `yaml:"to"`
	Relationship string           `yaml:"rel"`
}

type ExternalLinkItem

type ExternalLinkItem struct {
	ASN      int `yaml:"asn"`
	RouterID int `yaml:"router_id"`
}

type GlobalBGPConfig

type GlobalBGPConfig struct {
	Provider BGPRelationConfig `yaml:"provider,omitempty"`
	Customer BGPRelationConfig `yaml:"customer,omitempty"`
	Peer     BGPRelationConfig `yaml:"peer,omitempty"`
}
var DefaultBGPSettings GlobalBGPConfig

func (*GlobalBGPConfig) ToGlobal

func (c *GlobalBGPConfig) ToGlobal()

type GlobalConfig

type GlobalConfig struct {
	BGP GlobalBGPConfig
}

type IBGPConfig

type IBGPConfig struct {
	Manual bool
	RR     []struct {
		Router  int   `yaml:"router"`
		Clients []int `yaml:"clients,flow"`
	} `yaml:"route_reflectors"`
	Cliques [][]int `yaml:"cliques,flow"`
}

type ISISConfig

type ISISConfig struct {
	L1    []int         `yaml:"level-1,flow"`
	L2    []int         `yaml:"level-2,flow"`
	L12   []int         `yaml:"level-1-2,flow"`
	Areas map[int][]int `yaml:"areas,flow"`
}

func (*ISISConfig) CheckArea

func (c *ISISConfig) CheckArea(routerID int) int

CheckArea returns the area of the router designed by routerID. It defaults to 1.

func (*ISISConfig) CheckLevel

func (c *ISISConfig) CheckLevel(routerID int) int

CheckLevel returns the level of the router designed by routerID. It returns 1 for a L1 router, 2 for L2, 3 for L1-2 and 0 if it is not found.

type IXPConfig

type IXPConfig struct {
	ASN      int      `yaml:"asn"`
	Peers    []string `yaml:"peers,flow"`
	Prefix   string   `yaml:"prefix"`
	Loopback string   `yaml:"loopback"`
}
type InternalLinks struct {
	Kind     string              `yaml:"kind"`
	Preset   string              `yaml:"preset,omitempty"`
	Specs    []map[string]string `yaml:"specs,omitempty"`
	Filepath string              `yaml:"file"`
	Speed    int                 `yaml:"speed"`
	Cost     int                 `yaml:"cost"`
}

type OSPFConfig

type OSPFConfig struct {
	Networks []networkOSPF `yaml:"networks"`
	Stubs    []int         `yaml:"stubs"`
}

type ROA

type ROA struct {
	Prefix    string `yaml:"prefix"`
	MaxLength int    `yaml:"maxLength"`
	ASN       int    `yaml:"asn"`
}

type RPKIConfig

type RPKIConfig struct {
	// ASN        int      `yaml:"asn"`
	Address string `yaml:"server_address"`
	// NeighborAS []string `yaml:"neighbors_as,flow"`
	RouterLink struct {
		ASN      int `yaml:"asn"`
		RouterID int `yaml:"router_id"`
	} `yaml:"linked_to"`
	CacheFile string `yaml:"cache_file"`
	ROAs      []ROA  `yaml:"roas"`
}

type VPNConfig

type VPNConfig struct {
	VRF       string `yaml:"vrf"`
	HubMode   bool   `yaml:"hub_and_spoke"`
	Customers []struct {
		Hostname     string `yaml:"hostname"`
		Loopback     string `yaml:"loopback"`
		RemoteSubnet string `yaml:"remote_subnet"`
		Subnet       string `yaml:"subnet"`
		SubnetDown   string `yaml:"downstream_subnet"`
		Parent       int    `yaml:"parent"`
		Hub          bool
	} `yaml:"customers"`
}

Jump to

Keyboard shortcuts

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