bgp

package
v0.0.0-...-cc87309 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package bgp provides control functions for BGP operations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Asn      uint32
	RouterId string
}

Config stores a router's local configuration

type Daemon

type Daemon struct {
	BgpServer *gobgp.BgpServer
}

Daemon wraps a gobgp.BgpServer

func New

func New(asn uint32, routerId string) *Daemon

New constructs a new Daemon

func (Daemon) Announce

func (d Daemon) Announce(prefix net.IPNet, nexthop net.IPAddr) error

Announce announces a route

func (Daemon) Listen

func (d Daemon) Listen()

Listen starts the BGP server

func (*Daemon) NewPeer

func (d *Daemon) NewPeer(address string, asn uint32) error

NewPeer creates a new BGP session

type Session

type Session struct {
	Address string `json:"address" validate:"required"`
	Asn     uint32 `json:"asn" validate:"required"`
}

Session stores a BGP session

Jump to

Keyboard shortcuts

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