Expunge revision histories in files.
[become] / src / rule.h
index 7e337f6..1c5c02f 100644 (file)
@@ -1,13 +1,13 @@
 /* -*-c-*-
  *
- * $Id: rule.h,v 1.1 1997/07/21 13:47:45 mdw Exp $
+ * $Id: rule.h,v 1.7 2004/04/08 01:36:20 mdw Exp $
  *
  * Managing rule sets
  *
- * (c) 1997 EBI
+ * (c) 1998 EBI
  */
 
-/*----- Licencing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
  *
  * This file is part of `become'
  *
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with `become'; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: rule.h,v $
- * Revision 1.1  1997/07/21 13:47:45  mdw
- * Initial revision
- *
+ * along with `become'; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
 #ifndef RULE_H
 #  include "class.h"
 #endif
 
+/*----- Type definitions --------------------------------------------------*/
+
+/* --- Rule block --- */
+
+typedef struct rule {
+  struct rule *next;                   /* Next rule in the list */
+  class_node *host;                    /* Hosts this rule applies to */
+  class_node *from;                    /* From users in this class */
+  class_node *to;                      /* To users in this class */
+  class_node *cmd;                     /* To run commands in this class */
+} rule;
+
 /*----- Functions provided ------------------------------------------------*/
 
 /* --- @rule_init@ --- *
 
 extern void rule_init(void);
 
-/* --- @rule_reinit@ --- *
+/* --- @rule_end@ --- *
  *
  * Arguments:  ---
  *
  * Returns:    ---
  *
- * Use:                Reinitialises the rule database.
+ * Use:                Empties the rule database.
+ */
+
+extern void rule_end(void);
+
+/* --- @rule_list@ --- *
+ *
+ * Arguments:  ---
+ *
+ * Returns:    The list of rules.
+ *
+ * Use:                Returns the address of the first node in the rule list.
  */
 
-extern void rule_reinit(void);
+extern rule *rule_list(void);
 
 /* --- @rule_add@ --- *
  *
- * Arguments:  @classdef *host@ = class of hosts this rule applies to
- *             @classdef *from@ = class of users allowed to change
- *             @classdef *to@ = class of users allowed to be changed to
- *             @classdef *cmd@ = class of commands allowed
+ * Arguments:  @class_node *host@ = class of hosts this rule applies to
+ *             @class_node *from@ = class of users allowed to change
+ *             @class_node *to@ = class of users allowed to be changed to
+ *             @class_node *cmd@ = class of commands allowed
  *
  * Returns:    ---
  *
  * Use:                Registers another rule.
  */
 
-extern void rule_add(classdef */*host*/, classdef */*from*/,
-                    classdef */*to*/, classdef */*cmd*/);
+extern void rule_add(class_node */*host*/, class_node */*from*/,
+                    class_node */*to*/, class_node */*cmd*/);
 
 /* --- @rule_check@ --- *
  *
@@ -106,6 +121,17 @@ extern void rule_add(classdef */*host*/, classdef */*from*/,
 
 extern int rule_check(request */*r*/);
 
+/* --- @rule_dump@ --- *
+ *
+ * Arguments:  ---
+ *
+ * Returns:    ---
+ *
+ * Use:                Dumps a map of the current ruleset to the trace output.
+ */
+
+extern void rule_dump(void);
+
 /*----- That's all, folks -------------------------------------------------*/
 
 #ifdef __cplusplus