3 * $Id: rule.h,v 1.1 1997/07/21 13:47:45 mdw Exp $
10 /*----- Licencing 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
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 /*----- Revision history --------------------------------------------------*
32 * Revision 1.1 1997/07/21 13:47:45 mdw
44 /*----- Required headers --------------------------------------------------*/
46 #include <sys/types.h>
47 #include <sys/socket.h>
48 #include <netinet/in.h>
49 #include <arpa/inet.h>
59 /*----- Functions provided ------------------------------------------------*/
61 /* --- @rule_init@ --- *
67 * Use: Intialises the rule database.
70 extern void rule_init(void);
72 /* --- @rule_reinit@ --- *
78 * Use: Reinitialises the rule database.
81 extern void rule_reinit(void);
83 /* --- @rule_add@ --- *
85 * Arguments: @classdef *host@ = class of hosts this rule applies to
86 * @classdef *from@ = class of users allowed to change
87 * @classdef *to@ = class of users allowed to be changed to
88 * @classdef *cmd@ = class of commands allowed
92 * Use: Registers another rule.
95 extern void rule_add(classdef */
*host*/
, classdef */
*from*/
,
96 classdef */
*to*/
, classdef */
*cmd*/
);
98 /* --- @rule_check@ --- *
100 * Arguments: @request *r@ = pointer to a request block
102 * Returns: Zero if disallowed, nonzero if allowed.
104 * Use: Checks a request to see if it's allowed.
107 extern int rule_check(request */
*r*/
);
109 /*----- That's all, folks -------------------------------------------------*/