vppcalls

package
v2.0.0-alpha+incompatible Latest Latest
Warning

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

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

Documentation

Overview

Package vppcalls contains wrappers over VPP ACL binary APIs and helpers to dump ACLs configured in VPP - per interface and total.

Index

Constants

View Source
const (
	ICMPv4Proto = 1
	TCPProto    = 6
	UDPProto    = 17
	ICMPv6Proto = 58
)

Protocol types that can occur in ACLs

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLDetails

type ACLDetails struct {
	ACL  *acl.Acl `json:"acl"`
	Meta *ACLMeta `json:"acl_meta"`
}

ACLDetails is combination of proto-modelled ACL data and VPP provided metadata

type ACLMeta

type ACLMeta struct {
	Index uint32 `json:"acl_index"`
	Tag   string `json:"acl_tag"`
}

ACLMeta holds VPP-specific metadata

type ACLToInterface

type ACLToInterface struct {
	SwIfIdx    uint32
	IngressACL []uint32
	EgressACL  []uint32
}

ACLToInterface is definition of interface and all ACLs which are bound to the interface either as ingress or egress

type ACLVppAPI

type ACLVppAPI interface {
	ACLVppWrite
	ACLVppRead
}

ACLVppAPI provides read/write methods required to handle VPP access lists

type ACLVppHandler

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

ACLVppHandler is accessor for acl-related vppcalls methods

func NewACLVppHandler

func NewACLVppHandler(callsChan, dumpChan govppapi.Channel, ifIndexes ifaceidx.IfaceMetadataIndex) *ACLVppHandler

NewACLVppHandler creates new instance of acl vppcalls handler

func (*ACLVppHandler) AddACL

func (h *ACLVppHandler) AddACL(rules []*acl.Acl_Rule, aclName string) (uint32, error)

AddACL implements ACL handler.

func (*ACLVppHandler) AddACLToInterfaceAsEgress

func (h *ACLVppHandler) AddACLToInterfaceAsEgress(aclIndex uint32, ifName string) error

AddACLToInterfaceAsEgress implements ACL handler.

func (*ACLVppHandler) AddACLToInterfaceAsIngress

func (h *ACLVppHandler) AddACLToInterfaceAsIngress(aclIndex uint32, ifName string) error

AddACLToInterfaceAsIngress implements ACL handler.

func (*ACLVppHandler) AddMACIPACL

func (h *ACLVppHandler) AddMACIPACL(rules []*acl.Acl_Rule, aclName string) (uint32, error)

AddMACIPACL implements ACL handler.

func (*ACLVppHandler) AddMACIPACLToInterface

func (h *ACLVppHandler) AddMACIPACLToInterface(aclIndex uint32, ifName string) error

AddMACIPACLToInterface implements ACL handler.

func (*ACLVppHandler) DeleteACL

func (h *ACLVppHandler) DeleteACL(aclIndex uint32) error

DeleteACL implements ACL handler.

func (*ACLVppHandler) DeleteACLFromInterfaceAsEgress

func (h *ACLVppHandler) DeleteACLFromInterfaceAsEgress(aclIndex uint32, ifName string) error

DeleteACLFromInterfaceAsEgress implements ACL handler.

func (*ACLVppHandler) DeleteACLFromInterfaceAsIngress

func (h *ACLVppHandler) DeleteACLFromInterfaceAsIngress(aclIndex uint32, ifName string) error

DeleteACLFromInterfaceAsIngress implements ACL handler.

func (*ACLVppHandler) DeleteMACIPACL

func (h *ACLVppHandler) DeleteMACIPACL(aclIndex uint32) error

DeleteMACIPACL implements ACL handler.

func (*ACLVppHandler) DeleteMACIPACLFromInterface

func (h *ACLVppHandler) DeleteMACIPACLFromInterface(aclIndex uint32, ifName string) error

DeleteMACIPACLFromInterface implements ACL handler.

func (*ACLVppHandler) DumpACL

func (h *ACLVppHandler) DumpACL() ([]*ACLDetails, error)

DumpACL implements ACL handler.

func (*ACLVppHandler) DumpACLInterfaces

func (h *ACLVppHandler) DumpACLInterfaces(indices []uint32) (map[uint32]*acl.Acl_Interfaces, error)

DumpACLInterfaces implements ACL handler.

func (*ACLVppHandler) DumpIPAcls

func (h *ACLVppHandler) DumpIPAcls() (map[ACLMeta][]acl_api.ACLRule, error)

DumpIPAcls implements ACL handler.

func (*ACLVppHandler) DumpInterfaceACLList

func (h *ACLVppHandler) DumpInterfaceACLList(swIndex uint32) (*acl_api.ACLInterfaceListDetails, error)

DumpInterfaceACLList implements ACL handler.

func (*ACLVppHandler) DumpInterfaceACLs

func (h *ACLVppHandler) DumpInterfaceACLs(swIndex uint32) (acls []*acl.Acl, err error)

DumpInterfaceACLs implements ACL handler.

func (*ACLVppHandler) DumpInterfaceMACIPACLList

func (h *ACLVppHandler) DumpInterfaceMACIPACLList(swIndex uint32) (*acl_api.MacipACLInterfaceListDetails, error)

DumpInterfaceMACIPACLList implements ACL handler.

func (*ACLVppHandler) DumpInterfaceMACIPACLs

func (h *ACLVppHandler) DumpInterfaceMACIPACLs(swIndex uint32) (acls []*acl.Acl, err error)

DumpInterfaceMACIPACLs implements ACL handler.

func (*ACLVppHandler) DumpInterfacesLists

DumpInterfacesLists implements ACL handler.

func (*ACLVppHandler) DumpMACIPACL

func (h *ACLVppHandler) DumpMACIPACL() ([]*ACLDetails, error)

DumpMACIPACL implements ACL handler.

func (*ACLVppHandler) DumpMACIPACLInterfaces

func (h *ACLVppHandler) DumpMACIPACLInterfaces(indices []uint32) (map[uint32]*acl.Acl_Interfaces, error)

DumpMACIPACLInterfaces implements ACL handler.

func (*ACLVppHandler) DumpMacIPAcls

func (h *ACLVppHandler) DumpMacIPAcls() (map[ACLMeta][]acl_api.MacipACLRule, error)

DumpMacIPAcls implements ACL handler.

func (*ACLVppHandler) ModifyACL

func (h *ACLVppHandler) ModifyACL(aclIndex uint32, rules []*acl.Acl_Rule, aclName string) error

ModifyACL implements ACL handler.

func (*ACLVppHandler) ModifyMACIPACL

func (h *ACLVppHandler) ModifyMACIPACL(aclIndex uint32, rules []*acl.Acl_Rule, aclName string) error

ModifyMACIPACL implements ACL handler.

func (*ACLVppHandler) RemoveACLFromInterfacesAsEgress

func (h *ACLVppHandler) RemoveACLFromInterfacesAsEgress(ACLIndex uint32, ifIndices []uint32) error

RemoveACLFromInterfacesAsEgress implements ACL handler.

func (*ACLVppHandler) RemoveACLFromInterfacesAsIngress

func (h *ACLVppHandler) RemoveACLFromInterfacesAsIngress(ACLIndex uint32, ifIndices []uint32) error

RemoveACLFromInterfacesAsIngress implements ACL handler.

func (*ACLVppHandler) RemoveMACIPACLFromInterfaces

func (h *ACLVppHandler) RemoveMACIPACLFromInterfaces(removedACLIndex uint32, ifIndices []uint32) error

RemoveMACIPACLFromInterfaces implements ACL handler.

func (*ACLVppHandler) SetACLToInterfacesAsEgress

func (h *ACLVppHandler) SetACLToInterfacesAsEgress(ACLIndex uint32, ifIndices []uint32) error

SetACLToInterfacesAsEgress implements ACL handler.

func (*ACLVppHandler) SetACLToInterfacesAsIngress

func (h *ACLVppHandler) SetACLToInterfacesAsIngress(ACLIndex uint32, ifIndices []uint32) error

SetACLToInterfacesAsIngress implements ACL handler.

func (*ACLVppHandler) SetMACIPACLToInterfaces

func (h *ACLVppHandler) SetMACIPACLToInterfaces(aclIndex uint32, ifIndices []uint32) error

SetMACIPACLToInterfaces implements ACL handler.

type ACLVppRead

type ACLVppRead interface {
	// DumpACL dumps all ACLs (L3/L4).
	DumpACL() ([]*ACLDetails, error)
	// DumpMACIPACL dumps all MACIP ACLs (L2).
	DumpMACIPACL() ([]*ACLDetails, error)
	// DumpACLInterfaces dumps all ACLs (L3/L4) for given ACL indexes. Returns map of ACL indexes with assigned interfaces.
	DumpACLInterfaces(indices []uint32) (map[uint32]*acl.Acl_Interfaces, error)
	// DumpMACIPACLInterfaces dumps all ACLs (L2) for given ACL indexes. Returns map of MACIP ACL indexes with assigned interfaces.
	DumpMACIPACLInterfaces(indices []uint32) (map[uint32]*acl.Acl_Interfaces, error)
	// DumpInterfaceAcls finds interface in VPP and returns its ACL (L3/L4) configuration.
	DumpInterfaceACLs(ifIdx uint32) ([]*acl.Acl, error)
	// DumpInterfaceMACIPACLs finds interface in VPP and returns its MACIP ACL (L2) configuration.
	DumpInterfaceMACIPACLs(ifIdx uint32) ([]*acl.Acl, error)
}

ACLVppRead provides read methods for ACL plugin

type ACLVppWrite

type ACLVppWrite interface {
	// AddACL create new ACL (L3/L4). Returns ACL index provided by VPP.
	AddACL(rules []*acl.Acl_Rule, aclName string) (aclIdx uint32, err error)
	// AddMACIPACL creates new MACIP ACL (L2). Returns ACL index provided by VPP.
	AddMACIPACL(rules []*acl.Acl_Rule, aclName string) (aclIdx uint32, err error)
	// ModifyACL modifies ACL (L3/L4) by updating its rules. It uses ACL index to identify ACL.
	ModifyACL(aclIdx uint32, rules []*acl.Acl_Rule, aclName string) error
	// ModifyACL modifies MACIP ACL (L2) by updating its rules. It uses ACL index to identify ACL.
	ModifyMACIPACL(aclIdx uint32, rules []*acl.Acl_Rule, aclName string) error
	// DeleteACL removes ACL (L3/L4).
	DeleteACL(aclIdx uint32) error
	// DeleteMACIPACL removes MACIP ACL (L2).
	DeleteMACIPACL(aclIdx uint32) error
	// SetACLToInterfacesAsIngress sets ACL to interfaces as ingress.
	SetACLToInterfacesAsIngress(ACLIndex uint32, ifIndices []uint32) error
	// RemoveACLFromInterfacesAsIngress removes ACL from interfaces as ingress.
	RemoveACLFromInterfacesAsIngress(ACLIndex uint32, ifIndices []uint32) error
	// SetACLToInterfacesAsEgress sets ACL to interfaces as egress.
	SetACLToInterfacesAsEgress(ACLIndex uint32, ifIndices []uint32) error
	// RemoveACLFromInterfacesAsEgress removes ACL from interfaces as egress.
	RemoveACLFromInterfacesAsEgress(ACLIndex uint32, ifIndices []uint32) error
	// SetMACIPACLToInterfaces sets MACIP ACL to interfaces.
	SetMACIPACLToInterfaces(aclIndex uint32, ifIndices []uint32) error
	// RemoveMACIPACLFromInterfaces removes MACIP ACL from interfaces.
	RemoveMACIPACLFromInterfaces(removedACLIndex uint32, ifIndices []uint32) error
	// AddACLToInterfaceAsIngress adds ACL (L3/L4) to single interface as ingress.
	AddACLToInterfaceAsIngress(aclIndex uint32, ifName string) error
	// AddACLToInterfaceAsEgress adds ACL (L3/L4) to single interface as egress.
	AddACLToInterfaceAsEgress(aclIndex uint32, ifName string) error
	// AddACLToInterfaceAsIngress deletes ACL (L3/L4) from single interface as ingress.
	DeleteACLFromInterfaceAsIngress(aclIndex uint32, ifName string) error
	// AddACLToInterfaceAsEgress deletes ACL (L3/L4) from single interface as egress.
	DeleteACLFromInterfaceAsEgress(aclIndex uint32, ifName string) error
	// AddACLToInterfaceAsIngress adds MACIP ACL (L2) to single interface.
	AddMACIPACLToInterface(aclIndex uint32, ifName string) error
	// AddACLToInterfaceAsEgress deletes MACIP ACL (L2) from single interface.
	DeleteMACIPACLFromInterface(aclIndex uint32, ifName string) error
}

ACLVppWrite provides write methods for ACL plugin

Jump to

Keyboard shortcuts

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