bgp

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AFI_IP  = 1
	AFI_IP6 = 2
)

Variables

This section is empty.

Functions

func AttrToString

func AttrToString(attrs *pbbgp.BGPUpdate_Attributes) string

func NewBgpHeaderBuf

func NewBgpHeaderBuf(buf []byte, v6, AS4 bool) *bgpHeaderBuf

func NewBgpUpdateBuf

func NewBgpUpdateBuf(buf []byte, v6, AS4 bool) *bgpUpdateBuf

func ParseAttrs

func ParseAttrs(buf []byte, AS4, v6 bool) (*pbbgp.BGPUpdate_Attributes, error, []*pbcom.PrefixWrapper, []*pbcom.PrefixWrapper)

Types

type AggregatorWrapper

type AggregatorWrapper struct {
	*pbbgp.BGPUpdate_Aggregator
	IP net.IP `json:"IP,omitempty"`
}

func NewAggregatorWrapper

func NewAggregatorWrapper(base *pbbgp.BGPUpdate_Aggregator) *AggregatorWrapper

type AttrsWrapper

type AttrsWrapper struct {
	*pbbgp.BGPUpdate_Attributes
	NextHop    net.IP             `json:"next_hop,omitempty"`
	Aggregator *AggregatorWrapper `json:"aggregator,omitempty"`
}

func NewAttrsWrapper

func NewAttrsWrapper(base *pbbgp.BGPUpdate_Attributes) *AttrsWrapper

type PrefixWrapper

type PrefixWrapper struct {
	Prefix net.IP `json:"prefix"`
	Mask   uint32 `json:"mask"`
}

Neither of these fields should be omitted

func NewPrefixWrapper

func NewPrefixWrapper(pw *pbcom.PrefixWrapper) *PrefixWrapper

type UpdateWrapper

type UpdateWrapper struct {
	AdvertisedRoutes []*PrefixWrapper `json:"advertised_routes,omitempty"`
	WithdrawnRoutes  []*PrefixWrapper `json:"withdrawn_routes,omitempty"`
	Attrs            *AttrsWrapper    `json:"attrs,omitempty"`
}

func NewUpdateWrapper

func NewUpdateWrapper(update *pbbgp.BGPUpdate) *UpdateWrapper

Jump to

Keyboard shortcuts

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