vppcalls

package
v1.9.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package vppcalls contains wrappers over VPP binary APIs for bridge-domains, and L2 FIBs and XConnect pairs and helpers for dumping them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BridgeDomainDetails

type BridgeDomainDetails struct {
	Bd   *l2nb.BridgeDomains_BridgeDomain `json:"bridge_domain"`
	Meta *BridgeDomainMeta                `json:"bridge_domain_meta"`
}

BridgeDomainDetails is the wrapper structure for the bridge domain northbound API structure. NOTE: Interfaces in BridgeDomains_BridgeDomain is overridden by the local Interfaces member.

type BridgeDomainMeta

type BridgeDomainMeta struct {
	BdID          uint32            `json:"bridge_domain_id"`
	BdIfIdxToName map[uint32]string `json:"bridge_domain_id_to_name"`
}

BridgeDomainMeta contains bridge domain interface name/index map

type BridgeDomainVppAPI

type BridgeDomainVppAPI interface {
	BridgeDomainVppWrite
	BridgeDomainVppRead
}

BridgeDomainVppAPI provides methods for managing bridge domains

type BridgeDomainVppHandler

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

BridgeDomainVppHandler is accessor for bridge domain-related vppcalls methods

func NewBridgeDomainVppHandler

func NewBridgeDomainVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.SwIfIndex, log logging.Logger) *BridgeDomainVppHandler

NewBridgeDomainVppHandler creates new instance of bridge domain vppcalls handler

func (*BridgeDomainVppHandler) DumpBridgeDomainIDs

func (h *BridgeDomainVppHandler) DumpBridgeDomainIDs() ([]uint32, error)

DumpBridgeDomainIDs implements bridge domain handler.

func (*BridgeDomainVppHandler) DumpBridgeDomains

func (h *BridgeDomainVppHandler) DumpBridgeDomains() (map[uint32]*BridgeDomainDetails, error)

DumpBridgeDomains implements bridge domain handler.

func (*BridgeDomainVppHandler) SetInterfaceToBridgeDomain

func (h *BridgeDomainVppHandler) SetInterfaceToBridgeDomain(bdName string, bdIdx uint32, bdIf *l2.BridgeDomains_BridgeDomain_Interfaces,
	swIfIndices ifaceidx.SwIfIndex) (string, error)

SetInterfaceToBridgeDomain implements bridge domain handler. Returns an interface configured to the BD.

func (*BridgeDomainVppHandler) SetInterfacesToBridgeDomain

func (h *BridgeDomainVppHandler) SetInterfacesToBridgeDomain(bdName string, bdIdx uint32, bdIfs []*l2.BridgeDomains_BridgeDomain_Interfaces,
	swIfIndices ifaceidx.SwIfIndex) ([]string, error)

SetInterfacesToBridgeDomain implements bridge domain handler. Returns a list of interfaces configured to the BD.

func (*BridgeDomainVppHandler) UnsetInterfacesFromBridgeDomain

func (h *BridgeDomainVppHandler) UnsetInterfacesFromBridgeDomain(bdName string, bdIdx uint32, bdIfs []*l2.BridgeDomains_BridgeDomain_Interfaces,
	swIfIndices ifaceidx.SwIfIndex) (ifs []string, wasErr error)

UnsetInterfacesFromBridgeDomain implements bridge domain handler. Returns a list of interfaces removed from the BD.

func (*BridgeDomainVppHandler) VppAddArpTerminationTableEntry

func (h *BridgeDomainVppHandler) VppAddArpTerminationTableEntry(bdID uint32, mac string, ip string) error

VppAddArpTerminationTableEntry implements bridge domain handler.

func (*BridgeDomainVppHandler) VppAddBridgeDomain

func (h *BridgeDomainVppHandler) VppAddBridgeDomain(bdIdx uint32, bd *l2.BridgeDomains_BridgeDomain) error

VppAddBridgeDomain implements bridge domain handler.

func (*BridgeDomainVppHandler) VppDeleteBridgeDomain

func (h *BridgeDomainVppHandler) VppDeleteBridgeDomain(bdIdx uint32) error

VppDeleteBridgeDomain implements bridge domain handler.

func (*BridgeDomainVppHandler) VppRemoveArpTerminationTableEntry

func (h *BridgeDomainVppHandler) VppRemoveArpTerminationTableEntry(bdID uint32, mac string, ip string) error

VppRemoveArpTerminationTableEntry implements bridge domain handler.

type BridgeDomainVppRead

type BridgeDomainVppRead interface {
	// DumpBridgeDomainIDs lists all configured bridge domains. Auxiliary method for LookupFIBEntries.
	// returns list of bridge domain IDs (BD IDs). First element of returned slice is 0. It is default BD to which all
	// interfaces belong
	DumpBridgeDomainIDs() ([]uint32, error)
	// DumpBridgeDomains dumps VPP bridge domain data into the northbound API data structure
	// map indexed by bridge domain ID.
	//
	// LIMITATIONS:
	// - not able to dump ArpTerminationTable - missing binary API
	//
	DumpBridgeDomains() (map[uint32]*BridgeDomainDetails, error)
}

BridgeDomainVppRead provides read methods for bridge domains

type BridgeDomainVppWrite

type BridgeDomainVppWrite interface {
	// VppAddBridgeDomain adds new bridge domain.
	VppAddBridgeDomain(bdIdx uint32, bd *l2.BridgeDomains_BridgeDomain) error
	// VppDeleteBridgeDomain removes existing bridge domain.
	VppDeleteBridgeDomain(bdIdx uint32) error
	// SetInterfaceToBridgeDomain sets single interface to bridge domain. Interface name is returned if configured.
	SetInterfaceToBridgeDomain(bdName string, bdIdx uint32, bdIf *l2.BridgeDomains_BridgeDomain_Interfaces,
		swIfIndices ifaceidx.SwIfIndex) (iface string, wasErr error)
	// SetInterfacesToBridgeDomain attempts to set all provided interfaces to bridge domain. It returns a list of interfaces
	// which were successfully set.
	SetInterfacesToBridgeDomain(bdName string, bdIdx uint32, bdIfs []*l2.BridgeDomains_BridgeDomain_Interfaces,
		swIfIndices ifaceidx.SwIfIndex) (ifs []string, wasErr error)
	// UnsetInterfacesFromBridgeDomain removes all interfaces from bridge domain. It returns a list of interfaces
	// which were successfully unset.
	UnsetInterfacesFromBridgeDomain(bdName string, bdIdx uint32, bdIfs []*l2.BridgeDomains_BridgeDomain_Interfaces,
		swIfIndices ifaceidx.SwIfIndex) (ifs []string, wasErr error)
	// VppAddArpTerminationTableEntry creates ARP termination entry for bridge domain.
	VppAddArpTerminationTableEntry(bdID uint32, mac string, ip string) error
	// VppRemoveArpTerminationTableEntry removes ARP termination entry from bridge domain
	VppRemoveArpTerminationTableEntry(bdID uint32, mac string, ip string) error
}

BridgeDomainVppWrite provides write methods for bridge domains

type FibLogicalReq

type FibLogicalReq struct {
	IsAdd   bool
	MAC     string
	BDIdx   uint32
	SwIfIdx uint32
	BVI     bool
	Static  bool
	// contains filtered or unexported fields
}

FibLogicalReq groups multiple fields so that all of them do not enumerate in one function call (request, reply/callback).

type FibMeta

type FibMeta struct {
	BdID  uint32 `json:"bridge_domain_id"`
	IfIdx uint32 `json:"outgoing_interface_sw_if_idx"`
}

FibMeta contains FIB interface and bridge domain name/index map

type FibTableDetails

type FibTableDetails struct {
	Fib  *l2nb.FibTable_FibEntry `json:"fib"`
	Meta *FibMeta                `json:"fib_meta"`
}

FibTableDetails is the wrapper structure for the FIB table entry northbound API structure.

type FibVppAPI

type FibVppAPI interface {
	FibVppWrite
	FibVppRead
}

FibVppAPI provides methods for managing FIBs

type FibVppHandler

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

FibVppHandler is accessor for FIB-related vppcalls methods

func NewFibVppHandler

func NewFibVppHandler(syncChan, asyncChan govppapi.Channel, ifIndexes ifaceidx.SwIfIndex, bdIndexes l2idx.BDIndex,
	log logging.Logger) *FibVppHandler

NewFibVppHandler creates new instance of FIB vppcalls handler

func (*FibVppHandler) Add

func (h *FibVppHandler) Add(mac string, bdID uint32, ifIdx uint32, bvi bool, static bool, callback func(error)) error

Add implements fib handler.

func (*FibVppHandler) Delete

func (h *FibVppHandler) Delete(mac string, bdID uint32, ifIdx uint32, callback func(error)) error

Delete implements fib handler.

func (*FibVppHandler) DumpFIBTableEntries

func (h *FibVppHandler) DumpFIBTableEntries() (map[string]*FibTableDetails, error)

DumpFIBTableEntries implements fib handler.

func (*FibVppHandler) WatchFIBReplies

func (h *FibVppHandler) WatchFIBReplies()

WatchFIBReplies implements fib handler.

type FibVppRead

type FibVppRead interface {
	// DumpFIBTableEntries dumps VPP FIB table entries into the northbound API data structure
	// map indexed by destination MAC address.
	DumpFIBTableEntries() (map[string]*FibTableDetails, error)
	// WatchFIBReplies handles L2 FIB add/del requests
	WatchFIBReplies()
}

FibVppRead provides read methods for FIBs

type FibVppWrite

type FibVppWrite interface {
	// Add creates L2 FIB table entry.
	Add(mac string, bdID uint32, ifIdx uint32, bvi bool, static bool, callback func(error)) error
	// Delete removes existing L2 FIB table entry.
	Delete(mac string, bdID uint32, ifIdx uint32, callback func(error)) error
}

FibVppWrite provides write methods for FIBs

type XConnectDetails

type XConnectDetails struct {
	Xc   *l2nb.XConnectPairs_XConnectPair `json:"x_connect"`
	Meta *XcMeta                          `json:"x_connect_meta"`
}

XConnectDetails is the wrapper structure for the l2 xconnect northbound API structure.

type XConnectVppAPI

type XConnectVppAPI interface {
	XConnectVppWrite
	XConnectVppRead
}

XConnectVppAPI provides methods for managing cross connects

type XConnectVppHandler

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

XConnectVppHandler is accessor for cross-connect-related vppcalls methods

func NewXConnectVppHandler

func NewXConnectVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.SwIfIndex, log logging.Logger) *XConnectVppHandler

NewXConnectVppHandler creates new instance of cross connect vppcalls handler

func (*XConnectVppHandler) AddL2XConnect

func (h *XConnectVppHandler) AddL2XConnect(rxIfIdx uint32, txIfIdx uint32) error

AddL2XConnect implements xconnect handler.

func (*XConnectVppHandler) DeleteL2XConnect

func (h *XConnectVppHandler) DeleteL2XConnect(rxIfIdx uint32, txIfIdx uint32) error

DeleteL2XConnect implements xconnect handler.

func (*XConnectVppHandler) DumpXConnectPairs

func (h *XConnectVppHandler) DumpXConnectPairs() (map[uint32]*XConnectDetails, error)

DumpXConnectPairs implements xconnect handler.

type XConnectVppRead

type XConnectVppRead interface {
	// DumpXConnectPairs dumps VPP xconnect pair data into the northbound API data structure
	// map indexed by rx interface index.
	DumpXConnectPairs() (map[uint32]*XConnectDetails, error)
}

XConnectVppRead provides read methods for cross connects

type XConnectVppWrite

type XConnectVppWrite interface {
	// AddL2XConnect creates xConnect between two existing interfaces.
	AddL2XConnect(rxIfIdx uint32, txIfIdx uint32) error
	// DeleteL2XConnect removes xConnect between two interfaces.
	DeleteL2XConnect(rxIfIdx uint32, txIfIdx uint32) error
}

XConnectVppWrite provides write methods for cross connects

type XcMeta

type XcMeta struct {
	ReceiveInterfaceSwIfIdx  uint32 `json:"receive_interface_sw_if_idx"`
	TransmitInterfaceSwIfIdx uint32 `json:"transmit_interface_sw_if_idx"`
}

XcMeta contains cross connect rx/tx interface indexes

Jump to

Keyboard shortcuts

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