ipa_hbac
1.9.6
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
#include <time.h>
43
45
enum
hbac_eval_result
{
49
HBAC_EVAL_ERROR
= -1,
50
52
HBAC_EVAL_ALLOW
,
53
55
HBAC_EVAL_DENY
,
56
60
HBAC_EVAL_OOM
61
};
62
66
#define HBAC_CATEGORY_NULL 0x0000
67
71
#define HBAC_CATEGORY_ALL 0x0001
72
76
struct
hbac_time_rules;
77
84
struct
hbac_rule_element
{
92
uint32_t
category
;
93
101
const
char
**
names
;
102
110
const
char
**
groups
;
111
};
112
116
struct
hbac_rule
{
117
const
char
*name;
118
bool
enabled;
119
124
struct
hbac_rule_element
*
services
;
125
130
struct
hbac_rule_element
*
users
;
131
135
struct
hbac_rule_element
*
targethosts
;
136
140
struct
hbac_rule_element
*
srchosts
;
141
145
struct
hbac_time_rules *
timerules
;
146
};
147
151
struct
hbac_request_element
{
159
const
char
*
name
;
160
168
const
char
**
groups
;
169
};
170
176
struct
hbac_eval_req
{
182
struct
hbac_request_element
*
service
;
183
189
struct
hbac_request_element
*
user
;
190
196
struct
hbac_request_element
*
targethost
;
197
203
struct
hbac_request_element
*
srchost
;
204
206
time_t
request_time
;
207
};
208
212
enum
hbac_error_code
{
214
HBAC_ERROR_UNKNOWN
= -1,
215
217
HBAC_SUCCESS
,
218
220
HBAC_ERROR_NOT_IMPLEMENTED
,
221
223
HBAC_ERROR_OUT_OF_MEMORY
,
224
226
HBAC_ERROR_UNPARSEABLE_RULE
227
};
228
230
struct
hbac_info
{
236
enum
hbac_error_code
code
;
237
242
char
*
rule_name
;
243
};
244
245
259
enum
hbac_eval_result
hbac_evaluate
(
struct
hbac_rule
**rules,
260
struct
hbac_eval_req
*hbac_req,
261
struct
hbac_info
**info);
262
268
const
char
*
hbac_result_string
(
enum
hbac_eval_result
result);
269
275
const
char
*
hbac_error_string
(
enum
hbac_error_code
code);
276
281
void
hbac_free_info
(
struct
hbac_info
*info);
282
284
#define HBAC_RULE_ELEMENT_USERS 0x01
285
287
#define HBAC_RULE_ELEMENT_SERVICES 0x02
288
290
#define HBAC_RULE_ELEMENT_TARGETHOSTS 0x04
291
293
#define HBAC_RULE_ELEMENT_SOURCEHOSTS 0x08
294
310
bool
hbac_rule_is_complete
(
struct
hbac_rule
*rule, uint32_t *missing_attrs);
311
312
316
#endif
/* IPA_HBAC_H_ */
Generated by
1.8.3.1