Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

saimeta: Add sai_acl_bind_point_t and SAI_ACL_TABLE_ATTR_BIND_POINT #144

Merged
merged 1 commit into from
Jan 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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