bgproute

package
v0.0.0-...-57bc72d Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2015 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Age

type Age struct {
	AgeSecs string `xml:"seconds,attr" json:"age-seconds,omitempty"`
	AgeTime string `xml:",chardata"    json:"age,omitempty"`
}

type BGPRoute

type BGPRoute struct {
	XMLName    xml.Name   `xml:"route-information"     json:"-"`
	RouteTable RouteTable `xml:"route-table,omitempty" json:"route-table,omitempty"`
	Errors     []RPCError `xml:"rpc-error,omitempty"   json:"rpc-error,omitempty"`
	OriginHost string     `json:"originhost,omitempty"`
	OriginIP   string     `json:"originip,omitempty"`
}

Represents the BGP route XML structure, and is used to convert it from XML to JSON.

func (*BGPRoute) ReadJSONFrom

func (bgpRoute *BGPRoute) ReadJSONFrom(r io.Reader) (n int64, err error)

func (*BGPRoute) ReadXMLFrom

func (bgpRoute *BGPRoute) ReadXMLFrom(r io.Reader) (n int64, err error)

func (*BGPRoute) WriteCLITo

func (bgpRoute *BGPRoute) WriteCLITo(w io.Writer) error

func (*BGPRoute) WriteJSONTo

func (bgpRoute *BGPRoute) WriteJSONTo(w io.Writer) (n int64, err error)

func (*BGPRoute) WriteXMLTo

func (bgpRoute *BGPRoute) WriteXMLTo(w io.Writer) (n int64, err error)

type NH

type NH struct {
	// <selected-next-hop> is either present as an empty tag, or not present
	// so we need a pointer to distinguish its presence (not nil), or lack thereof (nil)
	SelectedNextHop *string `xml:"selected-next-hop"  json:"selected-next-hop"`
	To              string  `xml:"to,omitempty"       json:"to,omitempty"`
	Via             string  `xml:"via,omitempty"      json:"via,omitempty"`
	LSPName         string  `xml:"lsp-name,omitempty" json:"lsp-name,omitempty"`
}

type RPCError

type RPCError struct {
	Type     string `xml:"error-type"     json:"error-type"`
	Tag      string `xml:"error-tag"      json:"error-tag"`
	Severity string `xml:"error-severity" json:"error-severity"`
	Path     string `xml:"error-path"     json:"error-path"`
	Message  string `xml:"error-message"  json:"error-message"`
	Info     string `xml:",innerxml"      json:",string`
}

type RT

type RT struct {
	RTDestination string    `xml:"rt-destination,omitempty" json:"rt-destination,omitempty"`
	RTEntry       []RTEntry `xml:"rt-entry,omitempty"       json:"rt-entry,omitempty"`
}

type RTEntry

type RTEntry struct {
	ActiveTag       string `xml:"active-tag,omitempty"       json:"active-date,omitempty"`
	CurrentActive   string `xml:"current-active,omitempty"   json:"current-active,omitempty"`
	LastActive      string `xml:"last-active,omitempty"      json:"last-active,omitempty"`
	ProtocolName    string `xml:"protocol-name,omitempty"    json:"protocol-name,omitempty"`
	Preference      int    `xml:"preference,omitempty"       json:"preference,omitempty"`
	Age             Age    `xml:"age,omitempty"              json:"age,omitempty"`
	Med             int    `xml:"med,omitempty"              json:"med,omitempty"`
	LocalPreference int    `xml:"local-preference,omitempty" json:"local-preference,omitempty"`
	LearnedFrom     string `xml:"learned-from,omitempty"     json:"learned-from,omitempty"`
	AsPath          string `xml:"as-path,omitempty"          json:"as-path,omitempty"`
	ValidationState string `xml:"validation-state,omitempty" json:"validation-state,omitempty"`
	NH              []NH   `xml:"nh,omitempty"               json:"nh,omitempty"`
}

type RouteTable

type RouteTable struct {
	TableName          string `xml:"table-name,omitempty"           json:"table-name,omitempty"`
	DestinationCount   int    `xml:"destination-count,omitempty"    json:"destination-count,omitempty"`
	TotalRouteCount    int    `xml:"total-route-count,omitempty"    json:"total-route-count,omitempty"`
	ActiveRouteCount   int    `xml:"active-route-count,omitempty"   json:"active-route-count,omitempty"`
	HoldDownRouteCount int    `xml:"holddown-route-count"           json:"holddown-route-count"`
	HiddenRouteCount   int    `xml:"hidden-route-count,omitempty"   json:"hidden-route-count,omitempty"`
	RT                 []RT   `xml:"rt,omitempty"                   json:"rt,omitempty"`
}

Jump to

Keyboard shortcuts

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