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