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
- type ACLDetails
- type ACLMeta
- type ACLToInterface
- type ACLVppAPI
- type ACLVppHandler
- func (h *ACLVppHandler) AddACL(rules []*acl.ACL_Rule, aclName string) (uint32, error)
- func (h *ACLVppHandler) AddACLToInterfaceAsEgress(aclIndex uint32, ifName string) error
- func (h *ACLVppHandler) AddACLToInterfaceAsIngress(aclIndex uint32, ifName string) error
- func (h *ACLVppHandler) AddMACIPACL(rules []*acl.ACL_Rule, aclName string) (uint32, error)
- func (h *ACLVppHandler) AddMACIPACLToInterface(aclIndex uint32, ifName string) error
- func (h *ACLVppHandler) DeleteACL(aclIndex uint32) error
- func (h *ACLVppHandler) DeleteACLFromInterfaceAsEgress(aclIndex uint32, ifName string) error
- func (h *ACLVppHandler) DeleteACLFromInterfaceAsIngress(aclIndex uint32, ifName string) error
- func (h *ACLVppHandler) DeleteMACIPACL(aclIndex uint32) error
- func (h *ACLVppHandler) DeleteMACIPACLFromInterface(aclIndex uint32, ifName string) error
- func (h *ACLVppHandler) DumpACL() ([]*ACLDetails, error)
- func (h *ACLVppHandler) DumpACLInterfaces(indices []uint32) (map[uint32]*acl.ACL_Interfaces, error)
- func (h *ACLVppHandler) DumpIPAcls() (map[ACLMeta][]acl_api.ACLRule, error)
- func (h *ACLVppHandler) DumpInterfaceACLList(swIndex uint32) (*acl_api.ACLInterfaceListDetails, error)
- func (h *ACLVppHandler) DumpInterfaceACLs(swIndex uint32) (acls []*acl.ACL, err error)
- func (h *ACLVppHandler) DumpInterfaceMACIPACLList(swIndex uint32) (*acl_api.MacipACLInterfaceListDetails, error)
- func (h *ACLVppHandler) DumpInterfaceMACIPACLs(swIndex uint32) (acls []*acl.ACL, err error)
- func (h *ACLVppHandler) DumpInterfacesLists() ([]*acl_api.ACLInterfaceListDetails, []*acl_api.MacipACLInterfaceListDetails, ...)
- func (h *ACLVppHandler) DumpMACIPACL() ([]*ACLDetails, error)
- func (h *ACLVppHandler) DumpMACIPACLInterfaces(indices []uint32) (map[uint32]*acl.ACL_Interfaces, error)
- func (h *ACLVppHandler) DumpMacIPAcls() (map[ACLMeta][]acl_api.MacipACLRule, error)
- func (h *ACLVppHandler) ModifyACL(aclIndex uint32, rules []*acl.ACL_Rule, aclName string) error
- func (h *ACLVppHandler) ModifyMACIPACL(aclIndex uint32, rules []*acl.ACL_Rule, aclName string) error
- func (h *ACLVppHandler) RemoveACLFromInterfacesAsEgress(ACLIndex uint32, ifIndices []uint32) error
- func (h *ACLVppHandler) RemoveACLFromInterfacesAsIngress(ACLIndex uint32, ifIndices []uint32) error
- func (h *ACLVppHandler) RemoveMACIPACLFromInterfaces(removedACLIndex uint32, ifIndices []uint32) error
- func (h *ACLVppHandler) SetACLToInterfacesAsEgress(ACLIndex uint32, ifIndices []uint32) error
- func (h *ACLVppHandler) SetACLToInterfacesAsIngress(ACLIndex uint32, ifIndices []uint32) error
- func (h *ACLVppHandler) SetMACIPACLToInterfaces(aclIndex uint32, ifIndices []uint32) error
- type ACLVppRead
- type ACLVppWrite
Constants ¶
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 ¶ added in v1.8.1
ACLDetails is combination of proto-modelled ACL data and VPP provided metadata
type ACLToInterface ¶ added in v1.8.1
ACLToInterface is definition of interface and all ACLs which are bound to the interface either as ingress or egress
type ACLVppAPI ¶ added in v1.8.1
type ACLVppAPI interface { ACLVppWrite ACLVppRead }
ACLVppAPI provides read/write methods required to handle VPP access lists
type ACLVppHandler ¶ added in v1.8.1
type ACLVppHandler struct {
// contains filtered or unexported fields
}
ACLVppHandler is accessor for acl-related vppcalls methods
func NewACLVppHandler ¶ added in v1.8.1
func NewACLVppHandler(callsChan, dumpChan govppapi.Channel, ifIndexes ifaceidx.IfaceMetadataIndex) *ACLVppHandler
NewACLVppHandler creates new instance of acl vppcalls 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 ¶
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 ¶ added in v1.8.1
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 ¶ added in v1.8.1
func (h *ACLVppHandler) DumpInterfaceMACIPACLs(swIndex uint32) (acls []*acl.ACL, err error)
DumpInterfaceMACIPACLs implements ACL handler.
func (*ACLVppHandler) DumpInterfacesLists ¶
func (h *ACLVppHandler) DumpInterfacesLists() ([]*acl_api.ACLInterfaceListDetails, []*acl_api.MacipACLInterfaceListDetails, error)
DumpInterfacesLists implements ACL handler.
func (*ACLVppHandler) DumpMACIPACL ¶ added in v1.8.1
func (h *ACLVppHandler) DumpMACIPACL() ([]*ACLDetails, error)
DumpMACIPACL implements ACL handler.
func (*ACLVppHandler) DumpMACIPACLInterfaces ¶ added in v1.8.1
func (h *ACLVppHandler) DumpMACIPACLInterfaces(indices []uint32) (map[uint32]*acl.ACL_Interfaces, error)
DumpMACIPACLInterfaces implements ACL handler.
func (*ACLVppHandler) DumpMacIPAcls ¶ added in v1.8.1
func (h *ACLVppHandler) DumpMacIPAcls() (map[ACLMeta][]acl_api.MacipACLRule, error)
DumpMacIPAcls implements ACL handler.
func (*ACLVppHandler) ModifyMACIPACL ¶ added in v1.8.1
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 ¶ added in v1.8.1
func (h *ACLVppHandler) SetACLToInterfacesAsEgress(ACLIndex uint32, ifIndices []uint32) error
SetACLToInterfacesAsEgress implements ACL handler.
func (*ACLVppHandler) SetACLToInterfacesAsIngress ¶ added in v1.8.1
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 ¶ added in v1.8.1
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 ¶ added in v1.8.1
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