vppcalls

package
v1.8.0-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package vppcalls contains wrappers over VPP binary APIs for ARPs, proxy ARPs, L3 FIBs and helpers for dumping them.

Index

Constants

View Source
const (
	// NextHopViaLabelUnset constant has to be assigned into the field next hop
	// via label in ip_add_del_route binary message if next hop via label is not defined.
	// Equals to MPLS_LABEL_INVALID defined in VPP
	NextHopViaLabelUnset uint32 = 0xfffff + 1

	// ClassifyTableIndexUnset is a default value for field classify_table_index in ip_add_del_route binary message.
	ClassifyTableIndexUnset = ^uint32(0)

	// NextHopOutgoingIfUnset constant has to be assigned into the field next_hop_outgoing_interface
	// in ip_add_del_route binary message if outgoing interface for next hop is not defined.
	NextHopOutgoingIfUnset = ^uint32(0)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ArpDetails added in v1.8.1

type ArpDetails struct {
	Arp  *l3.ArpTable_ArpEntry
	Meta *ArpMeta
}

ArpDetails holds info about ARP entry as a proto model

type ArpEntry

type ArpEntry struct {
	Interface  uint32
	IPAddress  net.IP
	MacAddress string
	Static     bool
}

ArpEntry represents ARP entry for interface

type ArpMeta added in v1.8.1

type ArpMeta struct {
	SwIfIndex uint32
}

ArpMeta contains interface index of the ARP interface

type ArpVppAPI added in v1.8.1

type ArpVppAPI interface {
	ArpVppWrite
	ArpVppRead
}

ArpVppAPI provides methods for managing ARP entries

type ArpVppHandler added in v1.8.1

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

ArpVppHandler is accessor for ARP-related vppcalls methods

func NewArpVppHandler added in v1.8.1

func NewArpVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.SwIfIndex, log logging.Logger) *ArpVppHandler

NewArpVppHandler creates new instance of IPsec vppcalls handler

func (*ArpVppHandler) DumpArpEntries added in v1.8.1

func (h *ArpVppHandler) DumpArpEntries() ([]*ArpDetails, error)

DumpArpEntries implements arp handler.

func (*ArpVppHandler) VppAddArp added in v1.8.1

func (h *ArpVppHandler) VppAddArp(entry *ArpEntry) error

VppAddArp implements arp handler.

func (*ArpVppHandler) VppDelArp added in v1.8.1

func (h *ArpVppHandler) VppDelArp(entry *ArpEntry) error

VppDelArp implements arp handler.

type ArpVppRead added in v1.8.1

type ArpVppRead interface {
	// DumpArpEntries dumps ARPs from VPP and fills them into the provided static route map.
	DumpArpEntries() ([]*ArpDetails, error)
}

ArpVppRead provides read methods for ARPs

type ArpVppWrite added in v1.8.1

type ArpVppWrite interface {
	// VppAddArp adds ARP entry according to provided input
	VppAddArp(entry *ArpEntry) error
	// VppDelArp removes old ARP entry according to provided input
	VppDelArp(entry *ArpEntry) error
}

ArpVppWrite provides write methods for ARPs

type IPNeighHandler added in v1.8.1

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

IPNeighHandler is accessor for ip-neighbor-related vppcalls methods

func NewIPNeighVppHandler added in v1.8.1

func NewIPNeighVppHandler(callsChan govppapi.Channel, log logging.Logger) *IPNeighHandler

NewIPNeighVppHandler creates new instance of ip neighbor vppcalls handler

func (*IPNeighHandler) SetIPScanNeighbor added in v1.8.1

func (h *IPNeighHandler) SetIPScanNeighbor(data *l3.IPScanNeighbor) error

SetIPScanNeighbor implements ip neigh handler.

type IPNeighVppAPI added in v1.8.1

type IPNeighVppAPI interface {
	// SetIPScanNeighbor configures IP scan neighbor to the VPP
	SetIPScanNeighbor(data *l3.IPScanNeighbor) error
}

IPNeighVppAPI provides methods for managing IP scan neighbor configuration

type ProxyArpInterfaceDetails added in v1.8.1

type ProxyArpInterfaceDetails struct {
	Interface *l3.ProxyArpInterfaces_InterfaceList_Interface
	Meta      *ProxyArpInterfaceMeta
}

ProxyArpInterfaceDetails holds info about proxy ARP interfaces as a proto modeled data

type ProxyArpInterfaceMeta added in v1.8.1

type ProxyArpInterfaceMeta struct {
	SwIfIndex uint32
}

ProxyArpInterfaceMeta contains interface vpp index

type ProxyArpRangesDetails added in v1.8.1

type ProxyArpRangesDetails struct {
	Range *l3.ProxyArpRanges_RangeList_Range
}

ProxyArpRangesDetails holds info about proxy ARP range as a proto modeled data

type ProxyArpVppAPI added in v1.8.1

type ProxyArpVppAPI interface {
	ProxyArpVppWrite
	ProxyArpVppRead
}

ProxyArpVppAPI provides methods for managing proxy ARP entries

type ProxyArpVppHandler added in v1.8.1

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

ProxyArpVppHandler is accessor for proxy ARP-related vppcalls methods

func NewProxyArpVppHandler added in v1.8.1

func NewProxyArpVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.SwIfIndex, log logging.Logger) *ProxyArpVppHandler

NewProxyArpVppHandler creates new instance of proxy ARP vppcalls handler

func (*ProxyArpVppHandler) AddProxyArpRange added in v1.8.1

func (h *ProxyArpVppHandler) AddProxyArpRange(firstIP, lastIP []byte) error

AddProxyArpRange implements proxy arp handler.

func (*ProxyArpVppHandler) DeleteProxyArpRange added in v1.8.1

func (h *ProxyArpVppHandler) DeleteProxyArpRange(firstIP, lastIP []byte) error

DeleteProxyArpRange implements proxy arp handler.

func (*ProxyArpVppHandler) DisableProxyArpInterface added in v1.8.1

func (h *ProxyArpVppHandler) DisableProxyArpInterface(swIfIdx uint32) error

DisableProxyArpInterface implements proxy arp handler.

func (*ProxyArpVppHandler) DumpProxyArpInterfaces added in v1.8.1

func (h *ProxyArpVppHandler) DumpProxyArpInterfaces() (pArpIfs []*ProxyArpInterfaceDetails, err error)

DumpProxyArpInterfaces implements proxy arp handler.

func (*ProxyArpVppHandler) DumpProxyArpRanges added in v1.8.1

func (h *ProxyArpVppHandler) DumpProxyArpRanges() (pArpRngs []*ProxyArpRangesDetails, err error)

DumpProxyArpRanges implements proxy arp handler.

func (*ProxyArpVppHandler) EnableProxyArpInterface added in v1.8.1

func (h *ProxyArpVppHandler) EnableProxyArpInterface(swIfIdx uint32) error

EnableProxyArpInterface implements proxy arp handler.

type ProxyArpVppRead added in v1.8.1

type ProxyArpVppRead interface {
	// DumpProxyArpRanges returns configured proxy ARP ranges
	DumpProxyArpRanges() ([]*ProxyArpRangesDetails, error)
	// DumpProxyArpRanges returns configured proxy ARP interfaces
	DumpProxyArpInterfaces() ([]*ProxyArpInterfaceDetails, error)
}

ProxyArpVppRead provides read methods for proxy ARPs

type ProxyArpVppWrite added in v1.8.1

type ProxyArpVppWrite interface {
	// EnableProxyArpInterface enables interface for proxy ARP
	EnableProxyArpInterface(swIfIdx uint32) error
	// DisableProxyArpInterface disables interface for proxy ARP
	DisableProxyArpInterface(swIfIdx uint32) error
	// AddProxyArpRange adds new IP range for proxy ARP
	AddProxyArpRange(firstIP, lastIP []byte) error
	// DeleteProxyArpRange removes proxy ARP IP range
	DeleteProxyArpRange(firstIP, lastIP []byte) error
}

ProxyArpVppWrite provides write methods for proxy ARPs

type RouteDetails added in v1.8.1

type RouteDetails struct {
	Route *l3.StaticRoutes_Route
	Meta  *RouteMeta
}

RouteDetails is object returned as a VPP dump. It contains static route data in proto format, and VPP-specific metadata

type RouteHandler added in v1.8.1

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

RouteHandler is accessor for route-related vppcalls methods

func NewRouteVppHandler added in v1.8.1

func NewRouteVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.SwIfIndex, log logging.Logger) *RouteHandler

NewRouteVppHandler creates new instance of route vppcalls handler

func (*RouteHandler) DumpStaticRoutes added in v1.8.1

func (h *RouteHandler) DumpStaticRoutes() ([]*RouteDetails, error)

DumpStaticRoutes implements route handler.

func (*RouteHandler) VppAddRoute added in v1.8.1

func (h *RouteHandler) VppAddRoute(ifHandler ifvppcalls.IfVppWrite, route *l3.StaticRoutes_Route, rtIfIdx uint32) error

VppAddRoute implements route handler.

func (*RouteHandler) VppDelRoute added in v1.8.1

func (h *RouteHandler) VppDelRoute(route *l3.StaticRoutes_Route, rtIfIdx uint32) error

VppDelRoute implements route handler.

type RouteMeta added in v1.8.1

type RouteMeta struct {
	TableName         string
	OutgoingIfIdx     uint32
	IsIPv6            bool
	Afi               uint8
	IsLocal           bool
	IsUDPEncap        bool
	IsUnreach         bool
	IsProhibit        bool
	IsResolveHost     bool
	IsResolveAttached bool
	IsDvr             bool
	IsSourceLookup    bool
	NextHopID         uint32
	RpfID             uint32
	LabelStack        []l3binapi.FibMplsLabel
}

RouteMeta holds fields returned from the VPP as details which are not in the model

type RouteVppAPI added in v1.8.1

type RouteVppAPI interface {
	RouteVppWrite
	RouteVppRead
}

RouteVppAPI provides methods for managing routes

type RouteVppRead added in v1.8.1

type RouteVppRead interface {
	// DumpStaticRoutes dumps l3 routes from VPP and fills them into the provided static route map.
	DumpStaticRoutes() ([]*RouteDetails, error)
}

RouteVppRead provides read methods for routes

type RouteVppWrite added in v1.8.1

type RouteVppWrite interface {
	// VppAddRoute adds new route, according to provided input. Every route has to contain VRF ID (default is 0).
	VppAddRoute(ifHandler vppcalls.IfVppWrite, route *l3.StaticRoutes_Route, rtIfIdx uint32) error
	// VppDelRoute removes old route, according to provided input. Every route has to contain VRF ID (default is 0).
	VppDelRoute(route *l3.StaticRoutes_Route, rtIfIdx uint32) error
}

RouteVppWrite provides write methods for routes

Jump to

Keyboard shortcuts

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