Skip to content

Commit

Permalink
saimeta: Add sai_acl_bind_point_t and SAI_ACL_TABLE_ATTR_BIND_POINT (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuotian Cheng authored Jan 11, 2017
1 parent 48bf638 commit 3bb1541
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 4 deletions.
50 changes: 50 additions & 0 deletions meta/sai_meta_acl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
.conditions = { },\
},

DEFINE_ENUM_VALUES(sai_acl_bind_point_t)
{
SAI_ACL_BIND_POINT_PORT,
SAI_ACL_BIND_POINT_LAG,
SAI_ACL_BIND_POINT_VLAN,
SAI_ACL_BIND_POINT_ROUTER_INTF,
SAI_ACL_BIND_POINT_SWITCH
};

DEFINE_ENUM_VALUES(sai_acl_stage_t)
{
SAI_ACL_STAGE_INGRESS,
Expand Down Expand Up @@ -94,6 +103,31 @@ const char* metadata_sai_packet_color_t_enum_values_short_names[] = {
const size_t metadata_sai_packet_color_t_enum_values_count = 3;
DEFINE_ENUM_METADATA(sai_packet_color_t, 3);

const char metadata_sai_acl_bind_point_t_enum_name[] = "sai_acl_bind_point_t";
const sai_acl_bind_point_t metadata_sai_acl_bind_point_t_enum_values[] = {
SAI_ACL_BIND_POINT_PORT,
SAI_ACL_BIND_POINT_LAG,
SAI_ACL_BIND_POINT_VLAN,
SAI_ACL_BIND_POINT_ROUTER_INTF,
SAI_ACL_BIND_POINT_SWITCH
};
const char* metadata_sai_acl_bind_point_t_enum_values_names[] = {
"SAI_ACL_BIND_POINT_PORT",
"SAI_ACL_BIND_POINT_LAG",
"SAI_ACL_BIND_POINT_VLAN",
"SAI_ACL_BIND_POINT_ROUTER_INTF",
"SAI_ACL_BIND_POINT_SWITCH"
};
const char* metadata_sai_acl_bind_point_t_enum_values_short_names[] = {
"PORT",
"LAG",
"VLAN",
"ROUTER_INTF",
"SWITCH"
};
const size_t metadata_sai_acl_bind_point_t_enum_values_count = 4;
DEFINE_ENUM_METADATA(sai_acl_bind_point_t, 4);

const char metadata_sai_acl_stage_t_enum_name[] = "sai_acl_stage_t";
const sai_acl_stage_t metadata_sai_acl_stage_t_enum_values[] = {
SAI_ACL_STAGE_INGRESS,
Expand Down Expand Up @@ -273,6 +307,22 @@ DEFINE_ENUM_METADATA(sai_acl_range_type_t, 5);

const sai_attr_metadata_t sai_acl_table_attr_metadata[] = {

{
.objecttype = SAI_OBJECT_TYPE_ACL_TABLE,
.attrid = SAI_ACL_TABLE_ATTR_BIND_POINT,
.attridname = "SAI_ACL_TABLE_ATTR_BIND_POINT",
.serializationtype = SAI_SERIALIZATION_TYPE_INT32,
.flags = SAI_ATTR_FLAGS_MANDATORY_ON_CREATE | SAI_ATTR_FLAGS_CREATE_ONLY,
.allowedobjecttypes = { },
.allownullobjectid = false,
.defaultvaluetype = SAI_DEFAULT_VALUE_TYPE_NONE,
.defaultvalue = { },
.enumtypestr = StringifyEnum ( sai_acl_bind_point_t ),
.enumallowedvalues = ENUM_VALUES ( sai_acl_bind_point_t ),
.enummetadata = &metadata_enum_sai_acl_bind_point_t,
.conditions = { },
},

{
.objecttype = SAI_OBJECT_TYPE_ACL_TABLE,
.attrid = SAI_ACL_TABLE_ATTR_STAGE,
Expand Down
5 changes: 1 addition & 4 deletions meta/sai_meta_sanity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,7 @@ std::unordered_map<int32_t, std::unordered_map<int32_t, std::string>> get_attr_n

// TODO must be generated from headers

ATTR_MAP_SET(ACL_TABLE,SAI_ACL_TABLE_ATTR_STAGE);
ATTR_MAP_SET(ACL_TABLE,SAI_ACL_TABLE_ATTR_PRIORITY);
ATTR_MAP_SET(ACL_TABLE,SAI_ACL_TABLE_ATTR_SIZE);
ATTR_MAP_SET(ACL_TABLE,SAI_ACL_TABLE_ATTR_GROUP_ID);
ATTR_MAP_SET(ACL_TABLE,SAI_ACL_TABLE_ATTR_BIND_POINT);
ATTR_MAP_SET(ACL_TABLE,SAI_ACL_TABLE_ATTR_STAGE);
ATTR_MAP_SET(ACL_TABLE,SAI_ACL_TABLE_ATTR_PRIORITY);
ATTR_MAP_SET(ACL_TABLE,SAI_ACL_TABLE_ATTR_SIZE);
Expand Down

0 comments on commit 3bb1541

Please sign in to comment.