#define SQL_AUTZ_STAGE_GROUP 0x20
#define SQL_AUTZ_STAGE_PROFILE 0x40
+/** Context for group membership query evaluation
+ */
+typedef struct {
+ rlm_sql_t const *inst; //!< Module instance.
+ fr_value_box_t *query; //!< Query string used for evaluating group membership.
+ fr_sql_query_t *query_ctx; //!< Query context.
+ rlm_sql_grouplist_t *groups; //!< List of groups retrieved.
+ int num_groups; //!< How many groups have been retrieved.
+} sql_group_ctx_t;
+
/** Context for SQL authorization
*/
typedef struct {
rlm_sql_grouplist_t *group; //!< Current group being processed.
fr_pair_t *sql_group; //!< Pair to update with group being processed.
fr_pair_t *profile; //!< Current profile being processed.
+ fr_sql_map_ctx_t *map_ctx; //!< Context used for retrieving attribute value pairs as a map list.
+ sql_group_ctx_t *group_ctx; //!< Context used for retrieving user group membership.
} sql_autz_ctx_t;
typedef struct {
rlm_sql_row_t row; //!< Row data from the last query.
} fr_sql_query_t;
+/** Context used when fetching attribute value pairs as a map list
+ */
+typedef struct {
+ TALLOC_CTX *ctx; //!< To allocate map entries in.
+ rlm_sql_t const *inst; //!< Module instance data.
+ fr_value_box_t *query; //!< Query string used for fetching pairs.
+ fr_sql_query_t *query_ctx; //!< Query context.
+ fr_dict_attr_t const *list; //!< Default list for pair evaluation.
+ map_list_t *out; //!< List to append entries to.
+ int rows; //!< How many rows the query returned.
+} fr_sql_map_ctx_t;
+
extern fr_table_num_sorted_t const sql_rcode_description_table[];
extern size_t sql_rcode_description_table_len;
extern fr_table_num_sorted_t const sql_rcode_table[];