Package onep :: Package policy :: Module L2Acl :: Class L2Acl
[frames] | no frames]

Class L2Acl


L2 Access Control List (ACL) Class.

It is a list of L2 Access Control Elements(ACE) that define attributes for matching a packet.

Instance Methods
 
__init__(self, element, lifetime)
Constructor of class L2Acl.
 
delete_acl(self)
Delete L2 Access Control List(ACL).
 
add_ace(self, ace)
Add a L2 Access Control Element(ACE) to the L2 Access Control List(ACL).
 
remove_ace(self, ace)
Remove a L2 Access Control Element(ACE) from L2 Access Control List(ACL).
str
__str__(self)
Returns a string representation of the L2 Access Control List(ACL) instance.

Inherited from Acl.Acl: apply_to_interface, remove_from_interface

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables
Enum OnepLifetime = enum('ONEP_TRANSIENT', 'ONEP_PERSISTENT')
Enumeration of lifetime of an Acl.

Inherited from Acl.Acl: AclType, Direction

Properties

Inherited from object: __class__

Method Details

__init__(self, element, lifetime)
(Constructor)

 

Constructor of class L2Acl.

Instantiate a new L2 Access Control List(ACL).

Parameters:
Raises:
Overrides: object.__init__

delete_acl(self)

 

Delete L2 Access Control List(ACL).

Attempt to delete L2-ACL which is already applied to the network interface raises exception.

Raises:

add_ace(self, ace)

 

Add a L2 Access Control Element(ACE) to the L2 Access Control List(ACL).

Already added L2-ACE cannot be added in the same L2-ACL again.

Parameters:
  • ace (L2Ace) - L2 ACE instance to be added in L2 ACL.
Raises:

remove_ace(self, ace)

 

Remove a L2 Access Control Element(ACE) from L2 Access Control List(ACL).

Attempt to remove an ace which is not added to the L2 ACL raises no exception.

Parameters:
  • ace (L2Ace) - L2 ACE instance to be removed from L2 ACL.
Raises:

__str__(self)
(Informal representation operator)

 

Returns a string representation of the L2 Access Control List(ACL) instance.

Returns: str
String representation of the L2 ACL object.
Overrides: object.__str__

Class Variable Details

OnepLifetime

Enumeration of lifetime of an Acl.

ONEP_TRANSIENT: Transient Acl

ONEP_PERSISTENT: Persistent Acl

Type:
Enum
Value:
enum('ONEP_TRANSIENT', 'ONEP_PERSISTENT')