ipa_hbac
1.9.92
Main Page
Modules
Data Structures
Files
File List
src
providers
ipa
ipa_hbac.h
1
/*
2
SSSD
3
4
IPA Backend Module -- Access control
5
6
Authors:
7
Sumit Bose <sbose@redhat.com>
8
Stephen Gallagher <sgallagh@redhat.com>
9
10
Copyright (C) 2009 Red Hat
11
12
This program is free software; you can redistribute it and/or modify
13
it under the terms of the GNU General Public License as published by
14
the Free Software Foundation; either version 3 of the License, or
15
(at your option) any later version.
16
17
This program is distributed in the hope that it will be useful,
18
but WITHOUT ANY WARRANTY; without even the implied warranty of
19
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
GNU General Public License for more details.
21
22
You should have received a copy of the GNU General Public License
23
along with this program. If not, see <http://www.gnu.org/licenses/>.
24
*/
25
26
#ifndef IPA_HBAC_H_
27
#define IPA_HBAC_H_
28
40
#include <stdint.h>
41
#include <stdbool.h>
42
44
enum
hbac_eval_result
{
48
HBAC_EVAL_ERROR
= -1,
49
51
HBAC_EVAL_ALLOW
,
52
54
HBAC_EVAL_DENY
,
55
59
HBAC_EVAL_OOM
60
};
61
65
#define HBAC_CATEGORY_NULL 0x0000
66
70
#define HBAC_CATEGORY_ALL 0x0001
71
75
struct
hbac_time_rules;
76
83
struct
hbac_rule_element
{
91
uint32_t
category
;
92
100
const
char
**
names
;
101
109
const
char
**
groups
;
110
};
111
115
struct
hbac_rule
{
116
const
char
*name;
117
bool
enabled;
118
123
struct
hbac_rule_element
*
services
;
124
129
struct
hbac_rule_element
*
users
;
130
134
struct
hbac_rule_element
*
targethosts
;
135
139
struct
hbac_rule_element
*
srchosts
;
140
144
struct
hbac_time_rules *
timerules
;
145
};
146
150
struct
hbac_request_element
{
158
const
char
*
name
;
159
167
const
char
**
groups
;
168
};
169
175
struct
hbac_eval_req
{
181
struct
hbac_request_element
*
service
;
182
188
struct
hbac_request_element
*
user
;
189
195
struct
hbac_request_element
*
targethost
;
196
202
struct
hbac_request_element
*
srchost
;
203
205
time_t
request_time
;
206
};
207
211
enum
hbac_error_code
{
213
HBAC_ERROR_UNKNOWN
= -1,
214
216
HBAC_SUCCESS
,
217
219
HBAC_ERROR_NOT_IMPLEMENTED
,
220
222
HBAC_ERROR_OUT_OF_MEMORY
,
223
225
HBAC_ERROR_UNPARSEABLE_RULE
226
};
227
229
struct
hbac_info
{
235
enum
hbac_error_code
code
;
236
241
char
*
rule_name
;
242
};
243
244
258
enum
hbac_eval_result
hbac_evaluate
(
struct
hbac_rule
**rules,
259
struct
hbac_eval_req
*hbac_req,
260
struct
hbac_info
**info);
261
267
const
char
*
hbac_result_string
(
enum
hbac_eval_result
result);
268
274
const
char
*
hbac_error_string
(
enum
hbac_error_code
code);
275
280
void
hbac_free_info
(
struct
hbac_info
*info);
281
283
#define HBAC_RULE_ELEMENT_USERS 0x01
284
286
#define HBAC_RULE_ELEMENT_SERVICES 0x02
287
289
#define HBAC_RULE_ELEMENT_TARGETHOSTS 0x04
290
292
#define HBAC_RULE_ELEMENT_SOURCEHOSTS 0x08
293
309
bool
hbac_rule_is_complete
(
struct
hbac_rule
*rule, uint32_t *missing_attrs);
310
311
315
#endif
/* IPA_HBAC_H_ */
Generated by
1.8.3.1