3 * $Id: rule.h,v 1.4 1997/09/17 10:27:17 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.4 1997/09/17 10:27:17 mdw
33 * Use rewritten class handler.
35 * Revision 1.3 1997/08/20 16:22:49 mdw
36 * Rename `rule_reinit' to `rule_end' for more sensible restart.
38 * Revision 1.2 1997/08/04 10:24:25 mdw
39 * Sources placed under CVS control.
41 * Revision 1.1 1997/07/21 13:47:45 mdw
53 /*----- Required headers --------------------------------------------------*/
55 #include <sys/types.h>
56 #include <sys/socket.h>
57 #include <netinet/in.h>
58 #include <arpa/inet.h>
68 /*----- Functions provided ------------------------------------------------*/
70 /* --- @rule_init@ --- *
76 * Use: Intialises the rule database.
79 extern void rule_init(void);
81 /* --- @rule_end@ --- *
87 * Use: Empties the rule database.
90 extern void rule_end(void);
92 /* --- @rule_add@ --- *
94 * Arguments: @class_node *host@ = class of hosts this rule applies to
95 * @class_node *from@ = class of users allowed to change
96 * @class_node *to@ = class of users allowed to be changed to
97 * @class_node *cmd@ = class of commands allowed
101 * Use: Registers another rule.
104 extern void rule_add(class_node */
*host*/
, class_node */
*from*/
,
105 class_node */
*to*/
, class_node */
*cmd*/
);
107 /* --- @rule_check@ --- *
109 * Arguments: @request *r@ = pointer to a request block
111 * Returns: Zero if disallowed, nonzero if allowed.
113 * Use: Checks a request to see if it's allowed.
116 extern int rule_check(request */
*r*/
);
118 /* --- @rule_dump@ --- *
124 * Use: Dumps a map of the current ruleset to the trace output.
127 extern void rule_dump(void);
129 /*----- That's all, folks -------------------------------------------------*/