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 ¶
- type BridgeDomainDetails
- type BridgeDomainMeta
- type BridgeDomainVppAPI
- type BridgeDomainVppHandler
- func (h *BridgeDomainVppHandler) DumpBridgeDomainIDs() ([]uint32, error)
- func (h *BridgeDomainVppHandler) DumpBridgeDomains() (map[uint32]*BridgeDomainDetails, error)
- func (h *BridgeDomainVppHandler) SetInterfaceToBridgeDomain(bdName string, bdIdx uint32, bdIf *l2.BridgeDomains_BridgeDomain_Interfaces, ...) (string, error)
- func (h *BridgeDomainVppHandler) SetInterfacesToBridgeDomain(bdName string, bdIdx uint32, bdIfs []*l2.BridgeDomains_BridgeDomain_Interfaces, ...) ([]string, error)
- func (h *BridgeDomainVppHandler) UnsetInterfacesFromBridgeDomain(bdName string, bdIdx uint32, bdIfs []*l2.BridgeDomains_BridgeDomain_Interfaces, ...) (ifs []string, wasErr error)
- func (h *BridgeDomainVppHandler) VppAddArpTerminationTableEntry(bdID uint32, mac string, ip string) error
- func (h *BridgeDomainVppHandler) VppAddBridgeDomain(bdIdx uint32, bd *l2.BridgeDomains_BridgeDomain) error
- func (h *BridgeDomainVppHandler) VppDeleteBridgeDomain(bdIdx uint32) error
- func (h *BridgeDomainVppHandler) VppRemoveArpTerminationTableEntry(bdID uint32, mac string, ip string) error
- type BridgeDomainVppRead
- type BridgeDomainVppWrite
- type FibLogicalReq
- type FibMeta
- type FibTableDetails
- type FibVppAPI
- type FibVppHandler
- func (h *FibVppHandler) Add(mac string, bdID uint32, ifIdx uint32, bvi bool, static bool, ...) error
- func (h *FibVppHandler) Delete(mac string, bdID uint32, ifIdx uint32, callback func(error)) error
- func (h *FibVppHandler) DumpFIBTableEntries() (map[string]*FibTableDetails, error)
- func (h *FibVppHandler) WatchFIBReplies()
- type FibVppRead
- type FibVppWrite
- type XConnectDetails
- type XConnectVppAPI
- type XConnectVppHandler
- type XConnectVppRead
- type XConnectVppWrite
- type XcMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BridgeDomainDetails ¶ added in v1.8.1
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 ¶ added in v1.8.1
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 ¶ added in v1.8.1
type BridgeDomainVppAPI interface { BridgeDomainVppWrite BridgeDomainVppRead }
BridgeDomainVppAPI provides methods for managing bridge domains
type BridgeDomainVppHandler ¶ added in v1.8.1
type BridgeDomainVppHandler struct {
// contains filtered or unexported fields
}
BridgeDomainVppHandler is accessor for bridge domain-related vppcalls methods
func NewBridgeDomainVppHandler ¶ added in v1.8.1
func NewBridgeDomainVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.SwIfIndex, log logging.Logger) *BridgeDomainVppHandler
NewBridgeDomainVppHandler creates new instance of bridge domain vppcalls handler
func (*BridgeDomainVppHandler) DumpBridgeDomainIDs ¶ added in v1.8.1
func (h *BridgeDomainVppHandler) DumpBridgeDomainIDs() ([]uint32, error)
DumpBridgeDomainIDs implements bridge domain handler.
func (*BridgeDomainVppHandler) DumpBridgeDomains ¶ added in v1.8.1
func (h *BridgeDomainVppHandler) DumpBridgeDomains() (map[uint32]*BridgeDomainDetails, error)
DumpBridgeDomains implements bridge domain handler.
func (*BridgeDomainVppHandler) SetInterfaceToBridgeDomain ¶ added in v1.8.1
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 ¶ added in v1.8.1
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 ¶ added in v1.8.1
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 ¶ added in v1.8.1
func (h *BridgeDomainVppHandler) VppAddArpTerminationTableEntry(bdID uint32, mac string, ip string) error
VppAddArpTerminationTableEntry implements bridge domain handler.
func (*BridgeDomainVppHandler) VppAddBridgeDomain ¶ added in v1.8.1
func (h *BridgeDomainVppHandler) VppAddBridgeDomain(bdIdx uint32, bd *l2.BridgeDomains_BridgeDomain) error
VppAddBridgeDomain implements bridge domain handler.
func (*BridgeDomainVppHandler) VppDeleteBridgeDomain ¶ added in v1.8.1
func (h *BridgeDomainVppHandler) VppDeleteBridgeDomain(bdIdx uint32) error
VppDeleteBridgeDomain implements bridge domain handler.
func (*BridgeDomainVppHandler) VppRemoveArpTerminationTableEntry ¶ added in v1.8.1
func (h *BridgeDomainVppHandler) VppRemoveArpTerminationTableEntry(bdID uint32, mac string, ip string) error
VppRemoveArpTerminationTableEntry implements bridge domain handler.
type BridgeDomainVppRead ¶ added in v1.8.1
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 ¶ added in v1.8.1
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 ¶ added in v1.8.1
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 ¶ added in v1.8.1
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 ¶ added in v1.8.1
type FibVppAPI interface { FibVppWrite FibVppRead }
FibVppAPI provides methods for managing FIBs
type FibVppHandler ¶ added in v1.8.1
type FibVppHandler struct {
// contains filtered or unexported fields
}
FibVppHandler is accessor for FIB-related vppcalls methods
func NewFibVppHandler ¶ added in v1.8.1
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 ¶ added in v1.8.1
func (h *FibVppHandler) Add(mac string, bdID uint32, ifIdx uint32, bvi bool, static bool, callback func(error)) error
Add implements fib handler.
func (*FibVppHandler) DumpFIBTableEntries ¶ added in v1.8.1
func (h *FibVppHandler) DumpFIBTableEntries() (map[string]*FibTableDetails, error)
DumpFIBTableEntries implements fib handler.
func (*FibVppHandler) WatchFIBReplies ¶ added in v1.8.1
func (h *FibVppHandler) WatchFIBReplies()
WatchFIBReplies implements fib handler.
type FibVppRead ¶ added in v1.8.1
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 ¶ added in v1.8.1
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 ¶ added in v1.8.1
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 ¶ added in v1.8.1
type XConnectVppAPI interface { XConnectVppWrite XConnectVppRead }
XConnectVppAPI provides methods for managing cross connects
type XConnectVppHandler ¶ added in v1.8.1
type XConnectVppHandler struct {
// contains filtered or unexported fields
}
XConnectVppHandler is accessor for cross-connect-related vppcalls methods
func NewXConnectVppHandler ¶ added in v1.8.1
func NewXConnectVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.SwIfIndex, log logging.Logger) *XConnectVppHandler
NewXConnectVppHandler creates new instance of cross connect vppcalls handler
func (*XConnectVppHandler) AddL2XConnect ¶ added in v1.8.1
func (h *XConnectVppHandler) AddL2XConnect(rxIfIdx uint32, txIfIdx uint32) error
AddL2XConnect implements xconnect handler.
func (*XConnectVppHandler) DeleteL2XConnect ¶ added in v1.8.1
func (h *XConnectVppHandler) DeleteL2XConnect(rxIfIdx uint32, txIfIdx uint32) error
DeleteL2XConnect implements xconnect handler.
func (*XConnectVppHandler) DumpXConnectPairs ¶ added in v1.8.1
func (h *XConnectVppHandler) DumpXConnectPairs() (map[uint32]*XConnectDetails, error)
DumpXConnectPairs implements xconnect handler.
type XConnectVppRead ¶ added in v1.8.1
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 ¶ added in v1.8.1
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