53#ifdef HAVE_FUNCTION_ATTRIBUTE_FORMAT
54#define HBAC_ATTRIBUTE_PRINTF(a1, a2) __attribute__((format(printf, a1, a2)))
56#define HBAC_ATTRIBUTE_PRINTF(a1, a2)
65 ...) HBAC_ATTRIBUTE_PRINTF(5, 6);
95#define HBAC_CATEGORY_NULL 0x0000
100#define HBAC_CATEGORY_ALL 0x0001
105struct hbac_time_rules;
313#define HBAC_RULE_ELEMENT_USERS 0x01
316#define HBAC_RULE_ELEMENT_SERVICES 0x02
319#define HBAC_RULE_ELEMENT_TARGETHOSTS 0x04
322#define HBAC_RULE_ELEMENT_SOURCEHOSTS 0x08
enum hbac_eval_result hbac_evaluate(struct hbac_rule **rules, struct hbac_eval_req *hbac_req, struct hbac_info **info)
Evaluate an authorization request against a set of HBAC rules.
const char * hbac_result_string(enum hbac_eval_result result)
Display result of hbac evaluation in human-readable form.
void(* hbac_debug_fn_t)(const char *file, int line, const char *function, enum hbac_debug_level, const char *format,...) HBAC_ATTRIBUTE_PRINTF(5
Function pointer to HBAC external debugging function.
Definition ipa_hbac.h:62
hbac_error_code
Error code returned by the evaluator.
Definition ipa_hbac.h:241
hbac_eval_result
Result of HBAC evaluation.
Definition ipa_hbac.h:74
const char * hbac_error_string(enum hbac_error_code code)
Display error description.
hbac_debug_level
Debug levels for HBAC.
Definition ipa_hbac.h:45
void void hbac_enable_debug(hbac_debug_fn_t external_debug_fn)
HBAC uses external_debug_fn for logging messages.
Definition ipa_hbac.h:71
bool hbac_rule_is_complete(struct hbac_rule *rule, uint32_t *missing_attrs)
Evaluate whether an HBAC rule contains all necessary elements.
void hbac_free_info(struct hbac_info *info)
Function to safely free hbac_info returned by hbac_evaluate.
@ HBAC_ERROR_UNPARSEABLE_RULE
Parse error while evaluating rule.
Definition ipa_hbac.h:255
@ HBAC_ERROR_NOT_IMPLEMENTED
Function is not yet implemented.
Definition ipa_hbac.h:249
@ HBAC_ERROR_OUT_OF_MEMORY
Ran out of memory during processing.
Definition ipa_hbac.h:252
@ HBAC_ERROR_UNKNOWN
Unexpected error.
Definition ipa_hbac.h:243
@ HBAC_SUCCESS
Successful evaluation.
Definition ipa_hbac.h:246
@ HBAC_EVAL_OOM
Evaluation failed due to lack of memory hbac_info is not available.
Definition ipa_hbac.h:89
@ HBAC_EVAL_ALLOW
Evaluation grants access.
Definition ipa_hbac.h:81
@ HBAC_EVAL_DENY
Evaluation denies access.
Definition ipa_hbac.h:84
@ HBAC_EVAL_ERROR
An error occurred See the hbac_info for more details.
Definition ipa_hbac.h:78
@ HBAC_DBG_INFO
Warnings (not used).
Definition ipa_hbac.h:49
@ HBAC_DBG_ERROR
Fatal failure (not used).
Definition ipa_hbac.h:47
@ HBAC_DBG_TRACE
HBAC allow/disallow info.
Definition ipa_hbac.h:50
@ HBAC_DBG_WARNING
Serious failure (out of memory, for example).
Definition ipa_hbac.h:48
Request object for an HBAC rule evaluation.
Definition ipa_hbac.h:205
struct hbac_request_element * srchost
This is a list of source hosts to check, it must consist of the actual source host requested,...
Definition ipa_hbac.h:232
struct hbac_request_element * targethost
This is a list of target hosts to check, it must consist of the actual target host requested,...
Definition ipa_hbac.h:225
struct hbac_request_element * user
This is a list of user DNs to check, it must consist of the actual user requested,...
Definition ipa_hbac.h:218
time_t request_time
For future use.
Definition ipa_hbac.h:235
struct hbac_request_element * service
This is a list of service DNs to check, it must consist of the actual service requested,...
Definition ipa_hbac.h:211
Extended information.
Definition ipa_hbac.h:259
char * rule_name
Specify the name of the rule that matched or threw an error.
Definition ipa_hbac.h:271
enum hbac_error_code code
If the hbac_eval_result was HBAC_EVAL_ERROR, this will be an error code.
Definition ipa_hbac.h:265
Component of an HBAC request.
Definition ipa_hbac.h:180
const char * name
List of explicit members of this request component.
Definition ipa_hbac.h:188
const char ** groups
List of group members of this request component.
Definition ipa_hbac.h:197
Component of an HBAC rule.
Definition ipa_hbac.h:113
const char ** groups
List of group members of this rule component.
Definition ipa_hbac.h:139
uint32_t category
Category for this element.
Definition ipa_hbac.h:121
const char ** names
List of explicit members of this rule component.
Definition ipa_hbac.h:130
HBAC rule object for evaluation.
Definition ipa_hbac.h:145
struct hbac_time_rules * timerules
For future use.
Definition ipa_hbac.h:174
struct hbac_rule_element * users
Users and groups for which this rule applies.
Definition ipa_hbac.h:159
struct hbac_rule_element * targethosts
Target hosts for which this rule apples.
Definition ipa_hbac.h:164
struct hbac_rule_element * srchosts
Source hosts for which this rule applies.
Definition ipa_hbac.h:169
struct hbac_rule_element * services
Services and service groups for which this rule applies.
Definition ipa_hbac.h:153