Documentation
¶
Overview ¶
Package vppcalls contains wrappers over VPP binary APIs for ARPs, proxy ARPs, L3 FIBs and helpers for dumping them.
Index ¶
- Constants
- type ArpDetails
- type ArpEntry
- type ArpMeta
- type ArpVppAPI
- type ArpVppHandler
- type ArpVppRead
- type ArpVppWrite
- type IPNeighHandler
- type IPNeighVppAPI
- type ProxyArpInterfaceDetails
- type ProxyArpInterfaceMeta
- type ProxyArpRangesDetails
- type ProxyArpVppAPI
- type ProxyArpVppHandler
- func (h *ProxyArpVppHandler) AddProxyArpRange(firstIP, lastIP []byte) error
- func (h *ProxyArpVppHandler) DeleteProxyArpRange(firstIP, lastIP []byte) error
- func (h *ProxyArpVppHandler) DisableProxyArpInterface(swIfIdx uint32) error
- func (h *ProxyArpVppHandler) DumpProxyArpInterfaces() (pArpIfs []*ProxyArpInterfaceDetails, err error)
- func (h *ProxyArpVppHandler) DumpProxyArpRanges() (pArpRngs []*ProxyArpRangesDetails, err error)
- func (h *ProxyArpVppHandler) EnableProxyArpInterface(swIfIdx uint32) error
- type ProxyArpVppRead
- type ProxyArpVppWrite
- type RouteDetails
- type RouteHandler
- type RouteMeta
- type RouteVppAPI
- type RouteVppRead
- type RouteVppWrite
Constants ¶
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 ¶
type ArpDetails struct { Arp *l3.ArpTable_ArpEntry Meta *ArpMeta }
ArpDetails holds info about ARP entry as a proto model
type ArpEntry ¶
ArpEntry represents ARP entry for interface
type ArpMeta ¶
type ArpMeta struct {
SwIfIndex uint32
}
ArpMeta contains interface index of the ARP interface
type ArpVppAPI ¶
type ArpVppAPI interface { ArpVppWrite ArpVppRead }
ArpVppAPI provides methods for managing ARP entries
type ArpVppHandler ¶
type ArpVppHandler struct {
// contains filtered or unexported fields
}
ArpVppHandler is accessor for ARP-related vppcalls methods
func NewArpVppHandler ¶
func NewArpVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.SwIfIndex, log logging.Logger) *ArpVppHandler
NewArpVppHandler creates new instance of IPsec vppcalls handler
func (*ArpVppHandler) DumpArpEntries ¶
func (h *ArpVppHandler) DumpArpEntries() ([]*ArpDetails, error)
DumpArpEntries implements arp handler.
func (*ArpVppHandler) VppAddArp ¶
func (h *ArpVppHandler) VppAddArp(entry *ArpEntry) error
VppAddArp implements arp handler.
func (*ArpVppHandler) VppDelArp ¶
func (h *ArpVppHandler) VppDelArp(entry *ArpEntry) error
VppDelArp implements arp handler.
type ArpVppRead ¶
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 ¶
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 ¶
type IPNeighHandler struct {
// contains filtered or unexported fields
}
IPNeighHandler is accessor for ip-neighbor-related vppcalls methods
func NewIPNeighVppHandler ¶
func NewIPNeighVppHandler(callsChan govppapi.Channel, log logging.Logger) *IPNeighHandler
NewIPNeighVppHandler creates new instance of ip neighbor vppcalls handler
func (*IPNeighHandler) SetIPScanNeighbor ¶
func (h *IPNeighHandler) SetIPScanNeighbor(data *l3.IPScanNeighbor) error
SetIPScanNeighbor implements ip neigh handler.
type IPNeighVppAPI ¶
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 ¶
type ProxyArpInterfaceDetails struct { Interface *l3.ProxyArpInterfaces_InterfaceList_Interface Meta *ProxyArpInterfaceMeta }
ProxyArpInterfaceDetails holds info about proxy ARP interfaces as a proto modeled data
type ProxyArpInterfaceMeta ¶
type ProxyArpInterfaceMeta struct {
SwIfIndex uint32
}
ProxyArpInterfaceMeta contains interface vpp index
type ProxyArpRangesDetails ¶
type ProxyArpRangesDetails struct {
Range *l3.ProxyArpRanges_RangeList_Range
}
ProxyArpRangesDetails holds info about proxy ARP range as a proto modeled data
type ProxyArpVppAPI ¶
type ProxyArpVppAPI interface { ProxyArpVppWrite ProxyArpVppRead }
ProxyArpVppAPI provides methods for managing proxy ARP entries
type ProxyArpVppHandler ¶
type ProxyArpVppHandler struct {
// contains filtered or unexported fields
}
ProxyArpVppHandler is accessor for proxy ARP-related vppcalls methods
func NewProxyArpVppHandler ¶
func NewProxyArpVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.SwIfIndex, log logging.Logger) *ProxyArpVppHandler
NewProxyArpVppHandler creates new instance of proxy ARP vppcalls handler
func (*ProxyArpVppHandler) AddProxyArpRange ¶
func (h *ProxyArpVppHandler) AddProxyArpRange(firstIP, lastIP []byte) error
AddProxyArpRange implements proxy arp handler.
func (*ProxyArpVppHandler) DeleteProxyArpRange ¶
func (h *ProxyArpVppHandler) DeleteProxyArpRange(firstIP, lastIP []byte) error
DeleteProxyArpRange implements proxy arp handler.
func (*ProxyArpVppHandler) DisableProxyArpInterface ¶
func (h *ProxyArpVppHandler) DisableProxyArpInterface(swIfIdx uint32) error
DisableProxyArpInterface implements proxy arp handler.
func (*ProxyArpVppHandler) DumpProxyArpInterfaces ¶
func (h *ProxyArpVppHandler) DumpProxyArpInterfaces() (pArpIfs []*ProxyArpInterfaceDetails, err error)
DumpProxyArpInterfaces implements proxy arp handler.
func (*ProxyArpVppHandler) DumpProxyArpRanges ¶
func (h *ProxyArpVppHandler) DumpProxyArpRanges() (pArpRngs []*ProxyArpRangesDetails, err error)
DumpProxyArpRanges implements proxy arp handler.
func (*ProxyArpVppHandler) EnableProxyArpInterface ¶
func (h *ProxyArpVppHandler) EnableProxyArpInterface(swIfIdx uint32) error
EnableProxyArpInterface implements proxy arp handler.
type ProxyArpVppRead ¶
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 ¶
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 ¶
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 ¶
type RouteHandler struct {
// contains filtered or unexported fields
}
RouteHandler is accessor for route-related vppcalls methods
func NewRouteVppHandler ¶
func NewRouteVppHandler(callsChan govppapi.Channel, ifIndexes ifaceidx.SwIfIndex, log logging.Logger) *RouteHandler
NewRouteVppHandler creates new instance of route vppcalls handler
func (*RouteHandler) DumpStaticRoutes ¶
func (h *RouteHandler) DumpStaticRoutes() ([]*RouteDetails, error)
DumpStaticRoutes implements route handler.
func (*RouteHandler) VppAddRoute ¶
func (h *RouteHandler) VppAddRoute(ifHandler ifvppcalls.IfVppWrite, route *l3.StaticRoutes_Route, rtIfIdx uint32) error
VppAddRoute implements route handler.
func (*RouteHandler) VppDelRoute ¶
func (h *RouteHandler) VppDelRoute(route *l3.StaticRoutes_Route, rtIfIdx uint32) error
VppDelRoute implements route handler.
type RouteMeta ¶
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 ¶
type RouteVppAPI interface { RouteVppWrite RouteVppRead }
RouteVppAPI provides methods for managing routes
type RouteVppRead ¶
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 ¶
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
Source Files
¶
- api_vppcalls.go
- arp_dump.go
- arp_vppcalls.go
- doc.go
- ipneigh_vppcalls.go
- proxyarp_dump.go
- proxyarp_vppcalls.go
- route_dump.go
- route_vppcalls.go