vrouter

package
v0.0.0-...-1d39891 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AddRoute event
	AddRoute routingTableUpdateType = iota
	// DelRoute event
	DelRoute
	// AddInterface event
	AddInterface
	// DelInterface event
	DelInterface
)
View Source
const RouteProtocol int64 = 200

RouteProtocol is the default protocol for contrail routes

Variables

This section is empty.

Functions

func MetadataDecoder

func MetadataDecoder(raw json.RawMessage) (common.Getter, error)

MetadataDecoder implements a json message raw decoder

Types

type Metadata

type Metadata struct {
	UUID         string   `json:",omitempty"`
	MAC          string   `json:",omitempty"`
	VRF          string   `json:",omitempty"`
	VRFID        int64    `json:",omitempty"`
	LocalIP      string   `json:",omitempty"`
	RoutingTable []*Route `json:",omitempty"`
}

Metadata defines the information stored about a Contrail interface easyjson:json gendecoder

func (*Metadata) GetField

func (obj *Metadata) GetField(key string) (interface{}, error)

func (*Metadata) GetFieldBool

func (obj *Metadata) GetFieldBool(key string) (bool, error)

func (*Metadata) GetFieldInt64

func (obj *Metadata) GetFieldInt64(key string) (int64, error)

func (*Metadata) GetFieldKeys

func (obj *Metadata) GetFieldKeys() []string

func (*Metadata) GetFieldString

func (obj *Metadata) GetFieldString(key string) (string, error)

func (*Metadata) MatchBool

func (obj *Metadata) MatchBool(key string, predicate common.BoolPredicate) bool

func (*Metadata) MatchInt64

func (obj *Metadata) MatchInt64(key string, predicate common.Int64Predicate) bool

func (*Metadata) MatchString

func (obj *Metadata) MatchString(key string, predicate common.StringPredicate) bool

type Probe

type Probe struct {
	sync.RWMutex
	graph.DefaultGraphListener
	Ctx tp.Context
	// contains filtered or unexported fields
}

Probe describes a probe that reads OpenContrail database and updates the graph

func (*Probe) Init

func (p *Probe) Init(ctx tp.Context, _ *probe.Bundle) (probe.Handler, error)

Init initializes a new OpenContrail probe based on configuration

func (*Probe) OnInterfaceAdded

func (p *Probe) OnInterfaceAdded(vrfID int, interfaceUUID string)

func (*Probe) OnInterfaceDeleted

func (p *Probe) OnInterfaceDeleted(interfaceUUID string)

func (*Probe) OnNodeAdded

func (p *Probe) OnNodeAdded(n *graph.Node)

OnNodeAdded event

func (*Probe) OnNodeDeleted

func (p *Probe) OnNodeDeleted(n *graph.Node)

OnNodeDeleted event

func (*Probe) OnNodeUpdated

func (p *Probe) OnNodeUpdated(*graph.Node)

OnNodeUpdated event

func (*Probe) Start

func (p *Probe) Start()

Start the probe

func (*Probe) Stop

func (p *Probe) Stop()

Stop the probe

type Route

type Route struct {
	Family   string `json:",omitempty"`
	Prefix   string `json:",omitempty"`
	NhID     int64  `json:"NhID,omitempty"`
	Protocol int64  `json:",omitempty"`
}

Route is the skydive representation of a Contrail route easyjson:json gendecoder

func (*Route) GetField

func (obj *Route) GetField(key string) (interface{}, error)

func (*Route) GetFieldBool

func (obj *Route) GetFieldBool(key string) (bool, error)

func (*Route) GetFieldInt64

func (obj *Route) GetFieldInt64(key string) (int64, error)

func (*Route) GetFieldKeys

func (obj *Route) GetFieldKeys() []string

func (*Route) GetFieldString

func (obj *Route) GetFieldString(key string) (string, error)

func (*Route) MatchBool

func (obj *Route) MatchBool(key string, predicate common.BoolPredicate) bool

func (*Route) MatchInt64

func (obj *Route) MatchInt64(key string, predicate common.Int64Predicate) bool

func (*Route) MatchString

func (obj *Route) MatchString(key string, predicate common.StringPredicate) bool

type RoutingTable

type RoutingTable struct {
	InterfacesUUID []string
	Routes         []*Route
}

RoutingTable describes a Contrail route. A VRF contains the list of interface that use this VRF in order to be able to garbage collect VRF: if a VRF is no longer associated to an interface, this VRF can be deleted. easyjson:json gendecoder

func (*RoutingTable) GetField

func (obj *RoutingTable) GetField(key string) (interface{}, error)

func (*RoutingTable) GetFieldBool

func (obj *RoutingTable) GetFieldBool(key string) (bool, error)

func (*RoutingTable) GetFieldInt64

func (obj *RoutingTable) GetFieldInt64(key string) (int64, error)

func (*RoutingTable) GetFieldKeys

func (obj *RoutingTable) GetFieldKeys() []string

func (*RoutingTable) GetFieldString

func (obj *RoutingTable) GetFieldString(key string) (string, error)

func (*RoutingTable) MatchBool

func (obj *RoutingTable) MatchBool(key string, predicate common.BoolPredicate) bool

func (*RoutingTable) MatchInt64

func (obj *RoutingTable) MatchInt64(key string, predicate common.Int64Predicate) bool

func (*RoutingTable) MatchString

func (obj *RoutingTable) MatchString(key string, predicate common.StringPredicate) bool

type RoutingTableUpdate

type RoutingTableUpdate struct {
	// contains filtered or unexported fields
}

RoutingTableUpdate describes the structure of messages being passed to updater chan

Jump to

Keyboard shortcuts

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