* @param[in] tag The der tag to check.
* @return true if the type can be encoded as the given tag.
*/
-bool fr_type_to_der_tag_valid(fr_type_t type, fr_der_tag_num_t tag)
+bool fr_type_to_der_tag_valid(fr_type_t type, fr_der_tag_t tag)
{
return fr_type_to_der_tags[type][tag];
}
static int dict_flag_der_type(fr_dict_attr_t **da_p, char const *value, UNUSED fr_dict_flag_parser_rule_t const *rules)
{
fr_der_attr_flags_t *flags = fr_dict_attr_ext(*da_p, FR_DICT_ATTR_EXT_PROTOCOL_SPECIFIC);
- fr_der_tag_num_t der_type;
+ fr_der_tag_t der_type;
der_type = fr_table_value_by_str(tag_name_to_number, value, UINT8_MAX);
if (der_type == UINT8_MAX) {
static int dict_flag_sequence_of(fr_dict_attr_t **da_p, char const *value, UNUSED fr_dict_flag_parser_rule_t const *rules)
{
fr_der_attr_flags_t *flags = fr_dict_attr_ext(*da_p, FR_DICT_ATTR_EXT_PROTOCOL_SPECIFIC);
- fr_der_tag_num_t type;
+ fr_der_tag_t type;
type = fr_table_value_by_str(tag_name_to_number, value, UINT8_MAX);
if (type == UINT8_MAX) {
static int dict_flag_set_of(fr_dict_attr_t **da_p, char const *value, UNUSED fr_dict_flag_parser_rule_t const *rules)
{
fr_der_attr_flags_t *flags = fr_dict_attr_ext(*da_p, FR_DICT_ATTR_EXT_PROTOCOL_SPECIFIC);
- fr_der_tag_num_t type;
+ fr_der_tag_t type;
type = fr_table_value_by_str(tag_name_to_number, value, UINT8_MAX);
if (type == UINT8_MAX) {
static size_t der_tag_table_len = NUM_ELEMENTS(der_tag_table);
fr_der_attr_flags_t *flags = fr_dict_attr_ext(*da_p, FR_DICT_ATTR_EXT_PROTOCOL_SPECIFIC);
- fr_der_tag_num_t der_type;
+ fr_der_tag_t der_type;
fr_type_t fr_type;
/*
return true;
}
-static const fr_der_tag_num_t fr_type_to_der_tag_defaults[FR_TYPE_MAX + 1] = {
+static const fr_der_tag_t fr_type_to_der_tag_defaults[FR_TYPE_MAX + 1] = {
[FR_TYPE_BOOL] = FR_DER_TAG_BOOLEAN,
[FR_TYPE_UINT8] = FR_DER_TAG_INTEGER,
[FR_TYPE_UINT16] = FR_DER_TAG_INTEGER,
[FR_TYPE_GROUP] = FR_DER_TAG_SEQUENCE,
};
-fr_der_tag_num_t fr_type_to_der_tag_default(fr_type_t type)
+fr_der_tag_t fr_type_to_der_tag_default(fr_type_t type)
{
return fr_type_to_der_tag_defaults[type];
}
/*
* This is a set-of, meaning there are restrictions on the types which can be present
*/
- fr_der_tag_num_t restriction_type = fr_der_flag_set_of(parent);
+ fr_der_tag_t restriction_type = fr_der_flag_set_of(parent);
while (fr_dbuff_remaining(&our_in) > 0) {
fr_dbuff_marker_t current_value_marker;
FR_DER_TAG_CHOICE = 0x23, //!< A choice of types. Techically not a DER tag, but used to represent a choice.
FR_DER_TAG_MAX = UINT8_MAX
-} fr_der_tag_num_t;
+} fr_der_tag_t;
typedef enum {
FR_DER_TAG_PRIMITIVE = 0x00, //!< This is a leaf value, it contains no children.
typedef struct {
uint8_t tagnum;
fr_der_tag_class_t class;
- fr_der_tag_num_t der_type;
- fr_der_tag_num_t sequence_of;
- fr_der_tag_num_t set_of;
+ fr_der_tag_t der_type;
+ fr_der_tag_t sequence_of;
+ fr_der_tag_t set_of;
int64_t max;
bool is_sequence_of;
bool is_set_of;
/*
* base.c
*/
-fr_der_tag_num_t fr_type_to_der_tag_default(fr_type_t type);
-bool fr_type_to_der_tag_valid(fr_type_t type, fr_der_tag_num_t tag);
+fr_der_tag_t fr_type_to_der_tag_default(fr_type_t type);
+bool fr_type_to_der_tag_valid(fr_type_t type, fr_der_tag_t tag);
int fr_der_global_init(void);
void fr_der_global_free(void);
static ssize_t fr_der_encode_len(fr_dbuff_t *dbuff, fr_dbuff_marker_t *length_start) CC_HINT(nonnull);
static inline CC_HINT(always_inline) ssize_t
- fr_der_encode_tag(fr_dbuff_t *dbuff, fr_der_tag_num_t tag_num, fr_der_tag_class_t tag_class,
+ fr_der_encode_tag(fr_dbuff_t *dbuff, fr_der_tag_t tag_num, fr_der_tag_class_t tag_class,
fr_der_tag_constructed_t constructed) CC_HINT(nonnull);
static ssize_t encode_value(fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsigned int depth, fr_dcursor_t *cursor,
void *encode_ctx);
* @return The number of bytes written to the buffer
*/
static inline CC_HINT(always_inline) ssize_t
- fr_der_encode_tag(fr_dbuff_t *dbuff, fr_der_tag_num_t tag_num, fr_der_tag_class_t tag_class,
+ fr_der_encode_tag(fr_dbuff_t *dbuff, fr_der_tag_t tag_num, fr_der_tag_class_t tag_class,
fr_der_tag_constructed_t constructed)
{
fr_dbuff_t our_dbuff = FR_DBUFF(dbuff);
fr_dbuff_t our_dbuff = FR_DBUFF(dbuff);
fr_dbuff_marker_t marker;
fr_der_tag_encode_t *tag_encode;
- fr_der_tag_num_t tag_num;
+ fr_der_tag_t tag_num;
fr_der_tag_class_t tag_class;
fr_der_encode_ctx_t *uctx = encode_ctx;
ssize_t slen = 0;