Documentation
¶
Index ¶
- type Backend
- type ClassifierError
- type ClassifierField
- type Config
- type FlowRuleMatchError
- type IPv4Entry
- type IPv4FormattingError
- type NoChangeSpecifiedError
- type OutInterfaceIdxError
- type UnknownFlowRuleDeleteError
- type UnrecognizedFlowUpdateOperationError
- type UnsupportedActionTypeError
- type UnsupportedUpdateError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
func New ¶
New is a constructor function which allows you to supply the Config as well as a map of any already implemented FlowRules\ Before it starts managing routes, it flushes the route table <rtTableID> which is dedicated to Spacetime activities
func (*Backend) Apply ¶
func (b *Backend) Apply(ctx context.Context, req *apipb.ScheduledControlUpdate) (*apipb.ControlPlaneState, error)
type ClassifierError ¶
type ClassifierError struct {
// contains filtered or unexported fields
}
func (ClassifierError) Error ¶
func (e ClassifierError) Error() string
func (ClassifierError) Is ¶
func (e ClassifierError) Is(err error) bool
type ClassifierField ¶
type ClassifierField string
ClassifierError indicates an erroneously supplied outbound network interface
const ( IpHeader_Field ClassifierField = "IpHeader" Protocol_Field ClassifierField = "Protocol" SrcIpRange_Field ClassifierField = "SrcIpRange" DstIpRange_Field ClassifierField = "DstIpRange" )
type Config ¶
type Config struct { // Clock to support repeatable unit or container testing Clock clockwork.Clock // The route table number in which destination routes will be managed. RtTableID int // The Linux PBR priority to use for the lookup into |RtTableID|. RtTableLookupPriority int // GetLinkIDByName returns the ID of the provided interface. GetLinkIDByName func(interfaceID string) (int, error) // RouteList fetches a list of installed routes. // TODO: Evaluate whether this is still needed RouteList func() ([]vnl.Route, error) // RouteListFiltered fetches a list of installed routes matching a filter. RouteListFiltered func(int, *vnl.Route, uint64) ([]vnl.Route, error) // RouteAdd inserts new routes. RouteAdd func(*vnl.Route) error // RouteDel removes the provided route. RouteDel func(*vnl.Route) error // RuleAdd is called during the backend Init() process. RuleAdd func(*vnl.Rule) error }
Config provides configuration and dependency injection parameters for backend
func DefaultConfig ¶
func DefaultConfig(ctx context.Context, nlHandle *vnl.Handle, rtTableID int, rtTableLookupPriority int) Config
DefaultConfig generates a nominal Config for New(). Pass in a Netlink *Handle with the specified namespace, like so: nlHandle, err := vnl.NewHandle(vnl.FAMILY_V4) config := DefaultConfig(nlHandle)
type FlowRuleMatchError ¶
type FlowRuleMatchError struct {
// contains filtered or unexported fields
}
FlowRuleMatchError indicates a case where the supplied FlowRule src/dstIpRange and those implemented by Netlink don't match
func (FlowRuleMatchError) Error ¶
func (e FlowRuleMatchError) Error() string
func (FlowRuleMatchError) Is ¶
func (e FlowRuleMatchError) Is(err error) bool
type IPv4Entry ¶
type IPv4Entry string
IPv4FormattingError indicates an erroneously formatted IPv4 address was passed
type IPv4FormattingError ¶
type IPv4FormattingError struct {
// contains filtered or unexported fields
}
func (IPv4FormattingError) Error ¶
func (e IPv4FormattingError) Error() string
func (IPv4FormattingError) Is ¶
func (e IPv4FormattingError) Is(err error) bool
type NoChangeSpecifiedError ¶
type NoChangeSpecifiedError struct {
// contains filtered or unexported fields
}
NoChangeSpecifiedError indicates that there is no Change supplied in the apipb.SCU
func (*NoChangeSpecifiedError) Error ¶
func (e *NoChangeSpecifiedError) Error() string
func (*NoChangeSpecifiedError) Is ¶
func (e *NoChangeSpecifiedError) Is(err error) bool
type OutInterfaceIdxError ¶
type OutInterfaceIdxError struct {
// contains filtered or unexported fields
}
OutInterfaceIdxError indicates an erroneously supplied outbound network interface
func (OutInterfaceIdxError) Error ¶
func (e OutInterfaceIdxError) Error() string
func (OutInterfaceIdxError) Is ¶
func (e OutInterfaceIdxError) Is(err error) bool
func (OutInterfaceIdxError) Unwrap ¶
func (e OutInterfaceIdxError) Unwrap() error
type UnknownFlowRuleDeleteError ¶
type UnknownFlowRuleDeleteError struct {
// contains filtered or unexported fields
}
UnknownFlowRuleDeleteError indicates an unknown FlowRule is attempted to be deleted
func (*UnknownFlowRuleDeleteError) Error ¶
func (e *UnknownFlowRuleDeleteError) Error() string
func (*UnknownFlowRuleDeleteError) Is ¶
func (e *UnknownFlowRuleDeleteError) Is(err error) bool
type UnrecognizedFlowUpdateOperationError ¶
type UnrecognizedFlowUpdateOperationError struct {
// contains filtered or unexported fields
}
UnrecognizedFlowUpdateOperationError indicates an unrecognized FlowUpdate Operation is attempted to be applied Dec7: apipb.FlowUpdate_ADD and apipb.FlowUpdate_DELETE are supported
func (*UnrecognizedFlowUpdateOperationError) Error ¶
func (e *UnrecognizedFlowUpdateOperationError) Error() string
func (*UnrecognizedFlowUpdateOperationError) Is ¶
func (e *UnrecognizedFlowUpdateOperationError) Is(err error) bool
type UnsupportedActionTypeError ¶
type UnsupportedActionTypeError struct{}
UnsupportedActionTypeError indicates an unsupported ActionType is attempted to be applied Dec7: FlowRule_ActionBucket_Action_Forward_ is supported
TO DO: Expand error and code in netlink.go to return errors if unsupported Action Types such as PopHeader are passed
func (*UnsupportedActionTypeError) Error ¶
func (e *UnsupportedActionTypeError) Error() string
func (*UnsupportedActionTypeError) Is ¶
func (e *UnsupportedActionTypeError) Is(err error) bool
type UnsupportedUpdateError ¶
type UnsupportedUpdateError struct {
// contains filtered or unexported fields
}
UnsupportedUpdateError indicates the UpdateType specified in the apipb.SCU is unsupported Dec7: apipb.ControlPlaneUpdate_FlowUpdate is supported
func (*UnsupportedUpdateError) Error ¶
func (e *UnsupportedUpdateError) Error() string
func (*UnsupportedUpdateError) Is ¶
func (e *UnsupportedUpdateError) Is(err error) bool