This structure has the following members:
A function that compares the policy_res_name and resource_name and returns a resource match result.
Inputs:
rsrc_traits - the resource traits structure to use.
policy_res_name - name of a resource in the policy tree.
resource_name - name of the resource in policy evaluation.
use_patterns - whether to use or recognize patterns when comparing resources.
Returns:
Return one of AM_SUB_RESOURCE_MATCH, AM_EXACT_MATCH , AM_SUPER_RESOURCE_MATCH, AM_NO_MATCH, or AM_EXACT_PATTERN_MATCH.
Example:
am_policy_compare_urls() can be used for URL resources.
A function to determine whether a resource has patterns.
Inputs:
resource_name - name of the resource.
Returns:
True if resource_name has patterns and false otherwise.
Example:
am_policy_resource_has_patterns can be used for URL resources.
A function to get the root of a resource.
Inputs:
Resource_name - name of the resource.
Root_resource_name - a buffer to contain the name of the resource root.
Buflength - length of the root_resource_name buffer passed to this function.
Returns:
True if the name of the resource root was successfully inserted into the given root_resource_name buffer, false otherwise.
Examples:
am_policy_get_url_resource_root() can be used for URL resources.
Whether case should be ignored for all functions in this structure.
Resource separator. For URLs ’/’ should be used as the separator.
A function to canonicalize a resource name.
Inputs:
resource - the resource name.
Outputs:
c_resource - the canonicalized resource name. Memory for the canonicalized name must be allocated by the caller. A function to free the memory allocated for the canonicalized must be set in the str_free field.
A function to free the c_resource string returned in the canonicalize function above, after policy results have been evaluated by am_policy_evaluate().
This field cannot be set to null.
Inputs:
The resource_str - the string to be freed.
Examples:
Method free() should be used if the canonicalize field is set to the am_policy_resource_canonicalize() function.