]> andersk Git - moira.git/blob - dbck/dbck.h
check printservers
[moira.git] / dbck / dbck.h
1 /* $Header$
2  *
3  * Declarations for Moira database consistancy checker
4  *
5  *  (c) Copyright 1988 by the Massachusetts Institute of Technology.
6  *  For copying and distribution information, please see the file
7  *  <mit-copyright.h>.
8  */
9
10 #include <mit-copyright.h>
11 #include <moira_site.h>
12 #include <moira_schema.h>
13
14 #define MODE_ASK 1
15 #define MODE_NO 2
16 #define MODE_PREEN 3
17 #define MODE_YES 4
18
19 extern int debug, mode, fast, dcmenable, warn;
20 extern struct hash *users, *machines, *clusters, *lists, *printservers;
21 extern struct hash *filesys, *nfsphys, *strings, *subnets, *string_dups;
22
23 #define MAX_ID_VALUE 32765
24 #define MIN_ID_VALUE 100
25
26 #define dprintf if (debug) printf
27
28 struct user {
29   char login[USERS_LOGIN_SIZE];
30   char potype;
31   char *fullname;
32   int status;
33   int users_id;
34   int pobox_id;
35   int comment;
36   int modby;
37   int fmodby;
38   int pmodby;
39   int sigwho;
40 };
41
42 struct machine {
43   char name[MACHINE_NAME_SIZE];
44   char owner_type;
45   int owner_id;
46   int snet_id;
47   int mach_id;
48   int clucount;
49   int acomment;
50   int ocomment;
51   int creator;
52   int modby;
53 };
54
55 struct subnet {
56   char name[SUBNET_NAME_SIZE];
57   char owner_type;
58   int owner_id;
59   int snet_id;
60   int modby;
61 };
62
63 struct cluster {
64   char name[CLUSTERS_NAME_SIZE];
65   int clu_id;
66   int modby;
67 };
68
69 struct list {
70   char name[LIST_NAME_SIZE];
71   char acl_type;
72   int list_id;
73   int acl_id;
74   int modby;
75   int members;
76 };
77
78 struct string {
79   char *name;
80   int string_id;
81   int refc;
82 };
83
84 struct filesys {
85   char name[FILESYS_LABEL_SIZE];
86   char dir[FILESYS_NAME_SIZE];
87   char type;
88   int filsys_id;
89   int mach_id;
90   int owner;
91   int owners;
92   int phys_id;
93 };
94
95 struct nfsphys {
96   char dir[NFSPHYS_DIR_SIZE];
97   int mach_id;
98   int nfsphys_id;
99   int allocated;
100   int modby;
101   int count;
102 };
103
104 struct printserver {
105   int mach_id;
106   int printer_types;
107   char owner_type;
108   int owner_id;
109   int lpc_acl;
110   int modby;
111 };
112
113 void dbmserr(void);
114 void out_of_mem(char *msg);
115 void cleanup(void);
116
117 void modified(char *table);
118
119 void phase1(void);
120 void phase2(void);
121 void phase3(void);
122 void phase4(void);
123 void count_only_setup(void);
124
125 /* prototypes from fix.pc */
126 void generic_delete(struct save_queue *sq, int (*pfunc)(void *), char *table,
127                     char *idfield, int preen);
128 void single_delete(char *table, char *idfield, int id);
129 void zero_fix(char *tbl, char *zrfield, char *idfield, int id);
130 int single_fix(char *msg, int preen);
131 void generic_fix(struct save_queue *sq, int (*pfunc)(void *), char *msg,
132                  void (*ffunc)(void *), int preen);
133 int prompt(char *msg);
134 int set_next_object_id(char *object, char *tablename);
135 int generic_fix_id(char *tbl, char *idfield, char *txtfield,
136                    int oldid, char *name);
137
138 /* prototypes from phase3.pc */
139 struct string *string_check(int id);
This page took 0.952626 seconds and 5 git commands to generate.