SAI Metadata
|
Functions | |
bool | sai_metadata_is_allowed_object_type (_In_ const sai_attr_metadata_t *metadata, _In_ sai_object_type_t object_type) |
Is allowed object type. | |
bool | sai_metadata_is_allowed_enum_value (_In_ const sai_attr_metadata_t *metadata, _In_ int value) |
Is allowed enum value. | |
const sai_attr_metadata_t * | sai_metadata_get_attr_metadata (_In_ sai_object_type_t object_type, _In_ sai_attr_id_t attr_id) |
Gets attribute metadata based on object type and attribute id. | |
const sai_attr_metadata_t * | sai_metadata_get_attr_metadata_by_attr_id_name (_In_ const char *attr_id_name) |
Gets attribute metadata based on attribute id name. | |
const sai_attr_metadata_t * | sai_metadata_get_attr_metadata_by_attr_id_name_ext (_In_ const char *attr_id_name) |
Gets attribute metadata based on attribute id name, supporting case of attribute id name is in deserialized buffer and terminated by characters listed in function sai_serialize_is_char_allowed. | |
const sai_attr_metadata_t * | sai_metadata_get_ignored_attr_metadata_by_attr_id_name (_In_ const char *attr_id_name) |
Gets ignored attribute metadata based on attribute id name. | |
const char * | sai_metadata_get_enum_value_name (_In_ const sai_enum_metadata_t *metadata, _In_ int value) |
Gets string representation of enum value. | |
const sai_attribute_t * | sai_metadata_get_attr_by_id (_In_ sai_attr_id_t id, _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list) |
Gets attribute from attribute list by attribute id. | |
const sai_object_type_info_t * | sai_metadata_get_object_type_info (_In_ sai_object_type_t object_type) |
Gets object type info. | |
bool | sai_metadata_is_object_type_valid (_In_ sai_object_type_t object_type) |
Checks if object type is valid. | |
bool | sai_metadata_is_object_type_oid (_In_ sai_object_type_t object_type) |
Checks whether object type is OID object type. | |
bool | sai_metadata_is_condition_met (_In_ const sai_attr_metadata_t *metadata, _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list) |
Check if condition met. | |
bool | sai_metadata_is_validonly_met (_In_ const sai_attr_metadata_t *metadata, _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list) |
Check if valid only condition is met. | |
sai_api_version_t | sai_metadata_query_api_version (void) |
Metadata query API version. | |
const sai_attribute_t * sai_metadata_get_attr_by_id | ( | _In_ sai_attr_id_t | id, |
_In_ uint32_t | attr_count, | ||
_In_ const sai_attribute_t * | attr_list | ||
) |
Gets attribute from attribute list by attribute id.
[in] | id | Attribute id to be found. |
[in] | attr_count | Total number of attributes. |
[in] | attr_list | List of attributes to search. |
const sai_attr_metadata_t * sai_metadata_get_attr_metadata | ( | _In_ sai_object_type_t | object_type, |
_In_ sai_attr_id_t | attr_id | ||
) |
Gets attribute metadata based on object type and attribute id.
[in] | object_type | Object type |
[in] | attr_id | Attribute Id |
const sai_attr_metadata_t * sai_metadata_get_attr_metadata_by_attr_id_name | ( | _In_ const char * | attr_id_name | ) |
Gets attribute metadata based on attribute id name.
[in] | attr_id_name | Attribute id name |
const sai_attr_metadata_t * sai_metadata_get_attr_metadata_by_attr_id_name_ext | ( | _In_ const char * | attr_id_name | ) |
Gets attribute metadata based on attribute id name, supporting case of attribute id name is in deserialized buffer and terminated by characters listed in function sai_serialize_is_char_allowed.
[in] | attr_id_name | Attribute id name |
const char * sai_metadata_get_enum_value_name | ( | _In_ const sai_enum_metadata_t * | metadata, |
_In_ int | value | ||
) |
Gets string representation of enum value.
[in] | metadata | Enum metadata |
[in] | value | Enum value to be converted to string |
const sai_attr_metadata_t * sai_metadata_get_ignored_attr_metadata_by_attr_id_name | ( | _In_ const char * | attr_id_name | ) |
Gets ignored attribute metadata based on attribute id name.
[in] | attr_id_name | Attribute id name |
const sai_object_type_info_t * sai_metadata_get_object_type_info | ( | _In_ sai_object_type_t | object_type | ) |
Gets object type info.
[in] | object_type | Object type |
bool sai_metadata_is_allowed_enum_value | ( | _In_ const sai_attr_metadata_t * | metadata, |
_In_ int | value | ||
) |
Is allowed enum value.
[in] | metadata | Attribute metadata |
[in] | value | Enum value to be checked |
bool sai_metadata_is_allowed_object_type | ( | _In_ const sai_attr_metadata_t * | metadata, |
_In_ sai_object_type_t | object_type | ||
) |
Is allowed object type.
[in] | metadata | Attribute metadata |
[in] | object_type | Object type to be checked |
bool sai_metadata_is_condition_met | ( | _In_ const sai_attr_metadata_t * | metadata, |
_In_ uint32_t | attr_count, | ||
_In_ const sai_attribute_t * | attr_list | ||
) |
Check if condition met.
List of attributes will be examined in terms of conditions. This is convenient since user can pass list when calling create API. If condition attribute is not on the list, then default value will be examined.
NOTE: When multiple attributes with the same ID are passed, sai_metadata_get_attr_by_id will select only first one. Function will not be able to handle duplicated attributes.
[in] | metadata | Metadata of attribute that we need to check. |
[in] | attr_count | Number of attributes. |
[in] | attr_list | Attribute list to check. All attributes must belong to the same object type as metadata parameter. |
bool sai_metadata_is_object_type_oid | ( | _In_ sai_object_type_t | object_type | ) |
Checks whether object type is OID object type.
[in] | object_type | Object type to be checked. |
bool sai_metadata_is_object_type_valid | ( | _In_ sai_object_type_t | object_type | ) |
Checks if object type is valid.
[in] | object_type | Object type |
bool sai_metadata_is_validonly_met | ( | _In_ const sai_attr_metadata_t * | metadata, |
_In_ uint32_t | attr_count, | ||
_In_ const sai_attribute_t * | attr_list | ||
) |
Check if valid only condition is met.
List of attributes will be examined in terms of valid only conditions. This is convenient since user can pass list when calling create API. If valid only condition attribute is not on the list, then default value will be examined.
NOTE: When multiple attributes with the same ID are passed, sai_metadata_get_attr_by_id will select only first one. Function will not be able to handle duplicated attributes.
[in] | metadata | Metadata of attribute that we need to check. |
[in] | attr_count | Number of attributes. |
[in] | attr_list | Attribute list to check. All attributes must belong to the same object type as metadata parameter. |
sai_api_version_t sai_metadata_query_api_version | ( | void | ) |
Metadata query API version.
Will return SAI version which was used to generate metadata.