3 * $Id: rule.h,v 1.3 1997/08/20 16:22:49 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.3 1997/08/20 16:22:49 mdw
33 * Rename `rule_reinit' to `rule_end' for more sensible restart.
35 * Revision 1.2 1997/08/04 10:24:25 mdw
36 * Sources placed under CVS control.
38 * Revision 1.1 1997/07/21 13:47:45 mdw
50 /*----- Required headers --------------------------------------------------*/
52 #include <sys/types.h>
53 #include <sys/socket.h>
54 #include <netinet/in.h>
55 #include <arpa/inet.h>
65 /*----- Functions provided ------------------------------------------------*/
67 /* --- @rule_init@ --- *
73 * Use: Intialises the rule database.
76 extern void rule_init(void);
78 /* --- @rule_end@ --- *
84 * Use: Empties the rule database.
87 extern void rule_end(void);
89 /* --- @rule_add@ --- *
91 * Arguments: @classdef *host@ = class of hosts this rule applies to
92 * @classdef *from@ = class of users allowed to change
93 * @classdef *to@ = class of users allowed to be changed to
94 * @classdef *cmd@ = class of commands allowed
98 * Use: Registers another rule.
101 extern void rule_add(classdef */
*host*/
, classdef */
*from*/
,
102 classdef */
*to*/
, classdef */
*cmd*/
);
104 /* --- @rule_check@ --- *
106 * Arguments: @request *r@ = pointer to a request block
108 * Returns: Zero if disallowed, nonzero if allowed.
110 * Use: Checks a request to see if it's allowed.
113 extern int rule_check(request */
*r*/
);
115 /* --- @rule_dump@ --- *
121 * Use: Dumps a map of the current ruleset to the trace output.
124 extern void rule_dump(void);
126 /*----- That's all, folks -------------------------------------------------*/