vppcalls

package
v2.0.0-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: Apache-2.0 Imports: 12 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.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"`
}

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.IfaceMetadataIndex, log logging.Logger) *BridgeDomainVppHandler

NewBridgeDomainVppHandler creates new instance of bridge domain vppcalls handler.

func (*BridgeDomainVppHandler) AddArpTerminationTableEntry

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

AddArpTerminationTableEntry creates ARP termination entry for bridge domain.

func (*BridgeDomainVppHandler) AddBridgeDomain

func (h *BridgeDomainVppHandler) AddBridgeDomain(bdIdx uint32, bd *l2.BridgeDomain) error

AddBridgeDomain adds new bridge domain.

func (*BridgeDomainVppHandler) AddInterfaceToBridgeDomain

func (h *BridgeDomainVppHandler) AddInterfaceToBridgeDomain(bdIdx uint32, ifaceCfg *l2.BridgeDomain_Interface) error

AddInterfaceToBridgeDomain puts interface into bridge domain.

func (*BridgeDomainVppHandler) DeleteBridgeDomain

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

DeleteBridgeDomain removes existing bridge domain.

func (*BridgeDomainVppHandler) DeleteInterfaceFromBridgeDomain

func (h *BridgeDomainVppHandler) DeleteInterfaceFromBridgeDomain(bdIdx uint32, ifaceCfg *l2.BridgeDomain_Interface) error

DeleteInterfaceFromBridgeDomain removes interface from bridge domain.

func (*BridgeDomainVppHandler) DumpBridgeDomains

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

DumpBridgeDomains implements bridge domain handler.

func (*BridgeDomainVppHandler) RemoveArpTerminationTableEntry

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

RemoveArpTerminationTableEntry removes ARP termination entry from bridge domain.

type BridgeDomainVppRead

type BridgeDomainVppRead interface {
	// 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 {
	// AddBridgeDomain adds new bridge domain.
	AddBridgeDomain(bdIdx uint32, bd *l2.BridgeDomain) error
	// DeleteBridgeDomain removes existing bridge domain.
	DeleteBridgeDomain(bdIdx uint32) error
	// AddInterfaceToBridgeDomain puts interface into bridge domain.
	AddInterfaceToBridgeDomain(bdIdx uint32, ifaceCfg *l2.BridgeDomain_Interface) error
	// DeleteInterfaceFromBridgeDomain removes interface from bridge domain.
	DeleteInterfaceFromBridgeDomain(bdIdx uint32, ifaceCfg *l2.BridgeDomain_Interface) error
	// AddArpTerminationTableEntry creates ARP termination entry for bridge domain.
	AddArpTerminationTableEntry(bdID uint32, mac string, ip string) error
	// RemoveArpTerminationTableEntry removes ARP termination entry from bridge domain.
	RemoveArpTerminationTableEntry(bdID uint32, mac string, ip string) error
}

BridgeDomainVppWrite provides write methods for bridge domains.

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(callsChan govppapi.Channel, ifIndexes ifaceidx.IfaceMetadataIndex, bdIndexes idxvpp2.NameToIndex,
	log logging.Logger) *FIBVppHandler

NewFIBVppHandler creates new instance of FIB vppcalls handler.

func (*FIBVppHandler) AddL2FIB

func (h *FIBVppHandler) AddL2FIB(fib *l2nb.FIBEntry) error

AddL2FIB creates L2 FIB table entry.

func (*FIBVppHandler) DeleteL2FIB

func (h *FIBVppHandler) DeleteL2FIB(fib *l2nb.FIBEntry) error

DeleteL2FIB removes existing L2 FIB table entry.

func (*FIBVppHandler) DumpL2FIBs

func (h *FIBVppHandler) DumpL2FIBs() (map[string]*FibTableDetails, error)

DumpL2FIBs dumps VPP L2 FIB table entries into the northbound API data structure map indexed by destination MAC address.

type FIBVppRead

type FIBVppRead interface {
	// DumpL2FIBs dumps VPP L2 FIB table entries into the northbound API
	// data structure map indexed by destination MAC address.
	DumpL2FIBs() (map[string]*FibTableDetails, error)
}

FIBVppRead provides read methods for FIBs.

type FIBVppWrite

type FIBVppWrite interface {
	// AddL2FIB creates L2 FIB table entry.
	AddL2FIB(fib *l2.FIBEntry) error
	// DeleteL2FIB removes existing L2 FIB table entry.
	DeleteL2FIB(fib *l2.FIBEntry) error
}

FIBVppWrite provides write methods for FIBs.

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.FIBEntry `json:"fib"`
	Meta *FibMeta       `json:"fib_meta"`
}

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

type XConnectDetails

type XConnectDetails struct {
	Xc   *l2nb.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.IfaceMetadataIndex, log logging.Logger) *XConnectVppHandler

NewXConnectVppHandler creates new instance of cross connect vppcalls handler.

func (*XConnectVppHandler) AddL2XConnect

func (h *XConnectVppHandler) AddL2XConnect(rxIface, txIface string) error

AddL2XConnect creates xConnect between two existing interfaces.

func (*XConnectVppHandler) DeleteL2XConnect

func (h *XConnectVppHandler) DeleteL2XConnect(rxIface, txIface string) error

DeleteL2XConnect removes xConnect between two interfaces.

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(rxIface, txIface string) error
	// DeleteL2XConnect removes xConnect between two interfaces.
	DeleteL2XConnect(rxIface, txIface string) 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