Documentation
¶
Overview ¶
Package engine contains funcs for interacting with the forwarding engine.
Index ¶
- func IntfNameToTapName(name string) string
- func IsTap(name string) bool
- func TapNameToIntfName(name string) string
- type Engine
- func (e *Engine) AddIPRoute(ctx context.Context, v4 bool, ip, mask []byte, vrf uint64, ...) error
- func (e *Engine) AddLayer3PuntRule(ctx context.Context, portName string, ip []byte) error
- func (e *Engine) AddNeighbor(ctx context.Context, ip, mac []byte) error
- func (e *Engine) CreateExternalPort(ctx context.Context, name string) error
- func (e *Engine) CreateLocalPort(ctx context.Context, name string, fd int) error
- func (e *Engine) DeleteIPRoute(ctx context.Context, v4 bool, ip, mask []byte, vrf uint64) error
- func (e *Engine) GetCounters(ctx context.Context, name string) (*fwdpb.ObjectCountersReply, error)
- func (e *Engine) RemoveNeighbor(ctx context.Context, ip []byte) error
- func (e *Engine) UpdatePortSrcMAC(ctx context.Context, portName string, mac []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IntfNameToTapName ¶
IntfNameToTapName returns the connected tap interface of an interface.
func TapNameToIntfName ¶
TapNameToIntfName returns connected external interface from a tap interface.
Types ¶
type Engine ¶ added in v0.2.0
type Engine struct {
// contains filtered or unexported fields
}
Engine contains a routing context and methods to manage it.
func (*Engine) AddIPRoute ¶ added in v0.2.0
func (e *Engine) AddIPRoute(ctx context.Context, v4 bool, ip, mask []byte, vrf uint64, nextHops []*dpb.NextHop) error
AddIPRoute adds a route to the FIB with the input next hops.
func (*Engine) AddLayer3PuntRule ¶ added in v0.2.0
AddLayer3PuntRule adds rule to output packets to a corresponding port based on the destination IP and input port.
func (*Engine) AddNeighbor ¶ added in v0.2.0
AddNeighbor adds a neighbor to the neighbor table.
func (*Engine) CreateExternalPort ¶ added in v0.2.0
CreateExternalPort creates an external port (connected to other devices).
func (*Engine) CreateLocalPort ¶ added in v0.2.0
CreateLocalPort creates an local (ie TAP) port for the given linux device name.
func (*Engine) DeleteIPRoute ¶ added in v0.2.0
DeleteIPRoute deletes a route from the FIB.
func (*Engine) GetCounters ¶ added in v0.2.0
CreateLocalPort returns the counters for the object by name.
func (*Engine) RemoveNeighbor ¶ added in v0.2.0
RemoveNeighbor removes a neighbor from the neighbor table.