From: Arran Cudbard-Bell Date: Fri, 28 Jan 2022 21:09:37 +0000 (-0600) Subject: re-arrange structures to help with packing X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e147777c9c401d9aaa76b7bc14a27297849bffe7;p=thirdparty%2Ffreeradius-server.git re-arrange structures to help with packing --- diff --git a/src/lib/server/tmpl.h b/src/lib/server/tmpl.h index 818ad7ead8..8e98b1d058 100644 --- a/src/lib/server/tmpl.h +++ b/src/lib/server/tmpl.h @@ -285,38 +285,38 @@ struct tmpl_attr_rules_s { fr_dict_t const *dict_def; //!< Default dictionary to use ///< with unqualified attribute references. + fr_dict_attr_t const *parent; //!< Point in dictionary tree to resume parsing + ///< from. If this is provided then dict_def + ///< request_def and list_def will be ignored + ///< and the presence of any of those qualifiers + ///< will be treated as an error. + tmpl_request_ref_t request_def; //!< Default request to use with ///< unqualified attribute references. tmpl_pair_list_t list_def; //!< Default list to use with unqualified ///< attribute reference. - fr_dict_attr_t const *parent; //!< Point in dictionary tree to resume parsing - ///< from. If this is provided then dict_def - ///< request_def and list_def will be ignored - ///< and the presence of any of those qualifiers - ///< will be treated as an error. + tmpl_attr_prefix_t prefix; //!< Whether the attribute reference requires + ///< a prefix. - bool allow_unknown; //!< Allow unknown attributes i.e. attributes + uint8_t allow_unknown:1; //!< Allow unknown attributes i.e. attributes ///< defined by OID string. - bool allow_unresolved; //!< Allow attributes that look valid but were + uint8_t allow_unresolved:1; //!< Allow attributes that look valid but were ///< not found in the dictionaries. ///< This should be used as part of a multi-pass ///< approach to parsing. - bool allow_foreign; //!< Allow arguments not found in dict_def. + uint8_t allow_foreign:1; //!< Allow arguments not found in dict_def. - bool disallow_internal; //!< Allow/fallback to internal attributes. + uint8_t disallow_internal:1; //!< Allow/fallback to internal attributes. - bool disallow_qualifiers; //!< disallow request / list qualifiers + uint8_t disallow_qualifiers:1; //!< disallow request / list qualifiers - bool disallow_filters; //!< disallow filters. + uint8_t disallow_filters:1; //!< disallow filters. - bool list_as_attr; //!< return #TMPL_TYPE_ATTR for lists, and not #TMPL_TYPE_LIST - - tmpl_attr_prefix_t prefix; //!< Whether the attribute reference requires - ///< a prefix. + uint8_t list_as_attr:1; //!< return #TMPL_TYPE_ATTR for lists, and not #TMPL_TYPE_LIST }; struct tmpl_data_rules_s { @@ -521,14 +521,13 @@ struct tmpl_s { _CONST struct { bool ref_prefix; //!< true if the reference was prefixed ///< with a '&'. + bool was_oid; //!< Was originally a numeric OID. tmpl_pair_list_t list; //!< List to search or insert in. ///< deprecated. FR_DLIST_HEAD(tmpl_request_list) rr; //!< Request to search or insert in. FR_DLIST_HEAD(tmpl_attr_list) ar; //!< Head of the attribute reference list. - - bool was_oid; //!< Was originally a numeric OID. } attribute; /* diff --git a/src/lib/unlang/xlat_priv.h b/src/lib/unlang/xlat_priv.h index 3fa717e55b..b6ebb36eb7 100644 --- a/src/lib/unlang/xlat_priv.h +++ b/src/lib/unlang/xlat_priv.h @@ -100,12 +100,12 @@ typedef struct { ///< nodes by the time they were created. xlat_t const *func; //!< The xlat expansion to expand format with. - bool ephemeral; //!< Instance data is ephemeral (not inserted) - ///< into the instance tree. xlat_inst_t *inst; //!< Instance data for the #xlat_t. xlat_thread_inst_t *thread_inst; //!< Thread specific instance. ///< ONLY USED FOR EPHEMERAL XLATS. + bool ephemeral; //!< Instance data is ephemeral (not inserted) + ///< into the instance tree. xlat_input_type_t input_type; //!< The input type used inferred from the ///< bracketing style. } xlat_call_t;