Skip to content

Commit

Permalink
Add support for handling control plane ACLs (sonic-net#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleveque committed Dec 20, 2017
1 parent a043a55 commit fbe781d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ acl_rule_attr_lookup_t aclL3ActionLookup =

static acl_table_type_lookup_t aclTableTypeLookUp =
{
{ TABLE_TYPE_L3, ACL_TABLE_L3 },
{ TABLE_TYPE_MIRROR, ACL_TABLE_MIRROR }
{ TABLE_TYPE_L3, ACL_TABLE_L3 },
{ TABLE_TYPE_MIRROR, ACL_TABLE_MIRROR },
{ TABLE_TYPE_CTRLPLANE, ACL_TABLE_CTRLPLANE }
};

static acl_stage_type_lookup_t aclStageLookUp =
Expand Down Expand Up @@ -856,7 +857,8 @@ void AclRuleMirror::update(SubjectType type, void *cntx)

bool AclTable::validate()
{
if (type == ACL_TABLE_UNKNOWN) return false;
// Control plane ACLs are handled by a separate process
if (type == ACL_TABLE_UNKNOWN || type == ACL_TABLE_CTRLPLANE) return false;
if (ports.empty()) return false;
return true;
}
Expand Down
8 changes: 5 additions & 3 deletions orchagent/aclorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
#define TABLE_TYPE "TYPE"
#define TABLE_PORTS "PORTS"

#define TABLE_TYPE_L3 "L3"
#define TABLE_TYPE_MIRROR "MIRROR"
#define TABLE_TYPE_L3 "L3"
#define TABLE_TYPE_MIRROR "MIRROR"
#define TABLE_TYPE_CTRLPLANE "CTRLPLANE"

#define RULE_PRIORITY "PRIORITY"
#define MATCH_SRC_IP "SRC_IP"
Expand Down Expand Up @@ -63,7 +64,8 @@ typedef enum
{
ACL_TABLE_UNKNOWN,
ACL_TABLE_L3,
ACL_TABLE_MIRROR
ACL_TABLE_MIRROR,
ACL_TABLE_CTRLPLANE
} acl_table_type_t;

typedef map<string, acl_table_type_t> acl_table_type_lookup_t;
Expand Down

0 comments on commit fbe781d

Please sign in to comment.