3 * $Id: rule.h,v 1.2 1997/08/04 10:24:25 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.2 1997/08/04 10:24:25 mdw
33 * Sources placed under CVS control.
35 * Revision 1.1 1997/07/21 13:47:45 mdw
47 /*----- Required headers --------------------------------------------------*/
49 #include <sys/types.h>
50 #include <sys/socket.h>
51 #include <netinet/in.h>
52 #include <arpa/inet.h>
62 /*----- Functions provided ------------------------------------------------*/
64 /* --- @rule_init@ --- *
70 * Use: Intialises the rule database.
73 extern void rule_init(void);
75 /* --- @rule_reinit@ --- *
81 * Use: Reinitialises the rule database.
84 extern void rule_reinit(void);
86 /* --- @rule_add@ --- *
88 * Arguments: @classdef *host@ = class of hosts this rule applies to
89 * @classdef *from@ = class of users allowed to change
90 * @classdef *to@ = class of users allowed to be changed to
91 * @classdef *cmd@ = class of commands allowed
95 * Use: Registers another rule.
98 extern void rule_add(classdef */
*host*/
, classdef */
*from*/
,
99 classdef */
*to*/
, classdef */
*cmd*/
);
101 /* --- @rule_check@ --- *
103 * Arguments: @request *r@ = pointer to a request block
105 * Returns: Zero if disallowed, nonzero if allowed.
107 * Use: Checks a request to see if it's allowed.
110 extern int rule_check(request */
*r*/
);
112 /* --- @rule_dump@ --- *
118 * Use: Dumps a map of the current ruleset to the trace output.
121 extern void rule_dump(void);
123 /*----- That's all, folks -------------------------------------------------*/