fb6f816df8d16546bcf0c4dee8ae80877639b570
3 * $Id: rule.h,v 1.5 1998/01/12 16:46:26 mdw Exp $
10 /*----- Licensing notice --------------------------------------------------*
12 * This file is part of `become'
14 * `Become' is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * `Become' is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with `become'; if not, write to the Free Software Foundation,
26 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 /*----- Revision history --------------------------------------------------*
32 * Revision 1.5 1998/01/12 16:46:26 mdw
35 * Revision 1.4 1997/09/17 10:27:17 mdw
36 * Use rewritten class handler.
38 * Revision 1.3 1997/08/20 16:22:49 mdw
39 * Rename `rule_reinit' to `rule_end' for more sensible restart.
41 * Revision 1.2 1997/08/04 10:24:25 mdw
42 * Sources placed under CVS control.
44 * Revision 1.1 1997/07/21 13:47:45 mdw
56 /*----- Required headers --------------------------------------------------*/
58 #include <sys/types.h>
59 #include <sys/socket.h>
60 #include <netinet/in.h>
61 #include <arpa/inet.h>
71 /*----- Functions provided ------------------------------------------------*/
73 /* --- @rule_init@ --- *
79 * Use: Intialises the rule database.
82 extern void rule_init(void);
84 /* --- @rule_end@ --- *
90 * Use: Empties the rule database.
93 extern void rule_end(void);
95 /* --- @rule_add@ --- *
97 * Arguments: @class_node *host@ = class of hosts this rule applies to
98 * @class_node *from@ = class of users allowed to change
99 * @class_node *to@ = class of users allowed to be changed to
100 * @class_node *cmd@ = class of commands allowed
104 * Use: Registers another rule.
107 extern void rule_add(class_node */
*host*/
, class_node */
*from*/
,
108 class_node */
*to*/
, class_node */
*cmd*/
);
110 /* --- @rule_check@ --- *
112 * Arguments: @request *r@ = pointer to a request block
114 * Returns: Zero if disallowed, nonzero if allowed.
116 * Use: Checks a request to see if it's allowed.
119 extern int rule_check(request */
*r*/
);
121 /* --- @rule_dump@ --- *
127 * Use: Dumps a map of the current ruleset to the trace output.
130 extern void rule_dump(void);
132 /*----- That's all, folks -------------------------------------------------*/