source: trunk/third/moira/server/queries2.c @ 25455

Revision 25455, 194.4 KB checked in by jdreed, 13 years ago (diff)
In moira: * Re-snapshot moira at r4073 to pick up new changes to clients; the eunice issue described in the previous entry is no longer relevant
Line 
1/* $Id: queries2.c 4072 2012-02-08 19:57:50Z zacheiss $
2 *
3 * This file defines the query dispatch table
4 *
5 * Copyright (C) 1987-1998 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 "mr_server.h"
12#include "query.h"
13
14#include "mr_et.h"
15
16RCSID("$HeadURL: svn+ssh://svn.mit.edu/moira/trunk/moira/server/queries2.c $ $Id: queries2.c 4072 2012-02-08 19:57:50Z zacheiss $");
17
18/* VALOBJS
19 * These are commonly used validation objects, defined here so that they
20 * can be shared.
21 */
22
23static struct valobj VOuser0[] = {
24  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
25};
26
27static struct valobj VOmach0[] = {
28  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
29};
30
31static struct valobj VOclu0[] = {
32  {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
33};
34
35static struct valobj VOsnet0[] = {
36  {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
37};
38
39static struct valobj VOlist0[] = {
40  {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
41};
42
43static struct valobj VOfilesys0[] = {
44  {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
45};
46
47static struct valobj VOcon0[] = {
48  {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
49};
50
51static struct valobj VOnum0[] = {
52  {V_NUM, 0},
53};
54
55/* Validations
56 * Commonly used validation records defined here so that they may
57 * be shared.
58 */
59
60static struct validate VDmach = { VOmach0, 1 };
61
62static struct validate VDfix_modby = {
63  0,
64  0,
65  0,
66  0,
67  0,
68  0,
69  0,
70  0,
71  followup_fix_modby,
72};
73
74/* Query data */
75
76static char *galo2_fields[] = {
77  "login", "unix_uid", "shell", "last", "first", "middle",
78};
79
80static char *galo_fields[] = {
81  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
82};
83
84static char *gual2_fields[] = {
85  "login",
86  "login", "unix_uid", "shell", "last", "first", "middle", "status",
87  "clearid", "class", "comments", "signature", "secure",
88  "modtime", "modby", "modwith",
89};
90
91static char *gual3_fields[] = {
92  "login",
93  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
94  "status", "clearid", "class", "comments", "signature", "secure", "modtime",
95  "modby", "modwith", "created", "creator",
96};
97
98static char *gual11_fields[] = {
99  "login",
100  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
101  "status", "clearid", "class", "comments", "signature", "secure",
102  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
103  "creator",
104};
105
106static char *gual12_fields[] = {
107  "login",
108  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
109  "status", "clearid", "class", "comments", "signature", "secure",
110  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
111  "modtime", "modby", "modwith", "created", "creator",
112};
113
114static char *gual_fields[] = {
115  "login",
116  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
117  "status", "clearid", "class", "comments", "signature", "secure",
118  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
119  "alternate_email", "alternate_phone", "modtime", "modby", "modwith", "created", "creator",
120};
121
122static char *gubl2_fields[] = {
123  "login",
124  "login", "unix_uid", "shell", "last", "first", "middle", "status",
125  "clearid", "class", "modtime", "modby", "modwith",
126};
127
128static char *gubl_fields[] = {
129  "login",
130  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
131  "status", "clearid", "class", "modtime", "modby", "modwith", "created",
132  "creator",
133};
134
135static struct validate gubl2_validate =
136{
137  0,
138  0,
139  0,
140  0,
141  0,
142  0,
143  access_login,
144  0,
145  followup_fix_modby,
146};
147
148static struct validate gubl_validate =
149{
150  0,
151  0,
152  0,
153  0,
154  0,
155  0,
156  access_login,
157  0,
158  followup_get_user,
159};
160
161static char *guau2_fields[] = {
162  "unix_uid",
163  "login", "unix_uid", "shell", "last", "first", "middle", "status",
164  "clearid", "class", "comments", "signature", "secure",
165  "modtime", "modby", "modwith",
166};
167
168static char *guau3_fields[] = {
169  "unix_uid",
170  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
171  "status", "clearid", "class", "comments", "signature", "secure",
172  "modtime", "modby", "modwith", "created", "creator",
173};
174
175static char *guau11_fields[] = {
176  "unix_uid",
177  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
178  "status", "clearid", "class", "comments", "signature", "secure",
179  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
180  "creator",
181};
182
183static char *guau12_fields[] = {
184  "unix_uid",
185  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
186  "status", "clearid", "class", "comments", "signature", "secure",
187  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
188  "modtime", "modby", "modwith", "created", "creator",
189};
190
191static char *guau_fields[] = {
192  "unix_uid",
193  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
194  "status", "clearid", "class", "comments", "signature", "secure",
195  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
196  "alternate_email", "alternate_phone", "modtime", "modby", "modwith", "created", "creator",
197};
198
199static char *guan2_fields[] = {
200  "first", "last",
201  "login", "unix_uid", "shell", "last", "first", "middle", "status",
202  "clearid", "class", "comments", "signature", "secure",
203  "modtime", "modby", "modwith",
204};
205
206static char *guan3_fields[] = {
207  "first", "last",
208  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
209  "status", "clearid", "class", "comments", "signature", "secure",
210  "modtime", "modby", "modwith", "created", "creator",
211};
212
213static char *guan11_fields[] = {
214  "first", "last",
215  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
216  "status", "clearid", "class", "comments", "signature", "secure",
217  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
218  "creator",
219};
220
221static char *guan12_fields[] = {
222  "first", "last",
223  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
224  "status", "clearid", "class", "comments", "signature", "secure",
225  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
226  "modtime", "modby", "modwith", "created", "creator",
227};
228
229static char *guan_fields[] = {
230  "first", "last",
231  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
232  "status", "clearid", "class", "comments", "signature", "secure",
233  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
234  "alternate_email", "alternate_phone", "modtime", "modby", "modwith", "created", "creator",
235};
236
237static struct validate guan2_validate =
238{
239  0,
240  0,
241  0,
242  0,
243  0,
244  0,
245  0,
246  0,
247  followup_fix_modby,
248};
249
250static struct validate guan_validate =
251{
252  0,
253  0,
254  0,
255  0,
256  0,
257  0,
258  0,
259  0,
260  followup_get_user,
261};
262
263static char *guac2_fields[] = {
264  "class",
265  "login", "unix_uid", "shell", "last", "first", "middle", "status",
266  "clearid", "class", "comments", "signature", "secure",
267  "modtime", "modby", "modwith",
268};
269
270static char *guac3_fields[] = {
271  "class",
272  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
273  "status", "clearid", "class", "comments", "signature", "secure",
274  "modtime", "modby", "modwith", "created", "creator",
275};
276
277static char *guac11_fields[] = {
278  "class",
279  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
280  "status", "clearid", "class", "comments", "signature", "secure",
281  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
282  "creator",
283};
284
285static char *guac12_fields[] = {
286  "class",
287  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
288  "status", "clearid", "class", "comments", "signature", "secure",
289  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
290  "modtime", "modby", "modwith", "created", "creator",
291};
292
293static char *guac_fields[] = {
294  "class",
295  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
296  "status", "clearid", "class", "comments", "signature", "secure",
297  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
298  "alternate_email", "alternate_phone", "modtime", "modby", "modwith", "created", "creator",
299};
300
301static char *guam2_fields[] = {
302  "clearid",
303  "login", "unix_uid", "shell", "last", "first", "middle", "status",
304  "clearid", "class", "comments", "signature", "secure",
305  "modtime", "modby", "modwith",
306};
307
308static char *guam3_fields[] = {
309  "clearid",
310  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
311  "status", "clearid", "class", "comments", "signature", "secure",
312  "modtime", "modby", "modwith", "created", "creator",
313};
314
315static char *guam11_fields[] = {
316  "clearid",
317  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
318  "status", "clearid", "class", "comments", "signature", "secure",
319  "winhomedir", "winprofiledir", "modtime", "modby", "modwith", "created",
320  "creator",
321};
322
323static char *guam12_fields[] = {
324  "clearid",
325  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
326  "status", "clearid", "class", "comments", "signature", "secure",
327  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
328  "modtime", "modby", "modwith", "created", "creator",
329};
330
331static char *guam_fields[] = {
332  "clearid",
333  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
334  "status", "clearid", "class", "comments", "signature", "secure",
335  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
336  "alternate_email", "alternate_phone", "modtime", "modby", "modwith", "created", "creator",
337};
338
339static char *guas_fields[] = {
340  "sponsor_type", "sponsor_name",
341  "login",
342};
343
344static struct valobj guas_valobj[] = {
345  {V_TYPE, 0, 0, "gaus", 0, MR_TYPE},
346  {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
347};
348
349static struct validate guas_validate = {
350  guas_valobj,
351  2,
352  0,
353  0,
354  0,
355  0,
356  access_member,
357  0,
358  get_user_account_by_sponsor,
359};
360
361static char *gubu2_fields[] = {
362  "unix_uid",
363  "login", "unix_uid", "shell", "last", "first", "middle", "status",
364  "clearid", "class", "modtime", "modby", "modwith",
365};
366
367static char *gubu_fields[] = {
368  "unix_uid",
369  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
370  "status", "clearid", "class", "modtime", "modby", "modwith", "created",
371  "creator",
372};
373
374static struct validate gubu2_validate =
375{
376  VOnum0,
377  1,
378  0,
379  0,
380  0,
381  0,
382  access_login,
383  0,
384  followup_fix_modby,
385};
386
387static struct validate gubu_validate =
388{
389  VOnum0,
390  1,
391  0,
392  0,
393  0,
394  0,
395  access_login,
396  0,
397  followup_get_user,
398};
399
400static char *gubn2_fields[] = {
401  "first", "last",
402  "login", "unix_uid", "shell", "last", "first", "middle", "status",
403  "clearid", "class", "modtime", "modby", "modwith",
404};
405
406static char *gubn_fields[] = {
407  "first", "last",
408  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
409  "status", "clearid", "class", "modtime", "modby", "modwith", "created",
410  "creator",
411};
412
413static struct validate gubn2_validate =
414{
415  0,
416  0,
417  0,
418  0,
419  0,
420  0,
421  0,
422  0,
423  followup_fix_modby,
424};
425
426static struct validate gubn_validate =
427{
428  0,
429  0,
430  0,
431  0,
432  0,
433  0,
434  0,
435  0,
436  followup_get_user,
437};
438
439static char *gubc2_fields[] = {
440  "class",
441  "login", "unix_uid", "shell", "last", "first", "middle", "status",
442  "clearid", "class", "modtime", "modby", "modwith",
443};
444
445static char *gubc_fields[] = {
446  "class",
447  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
448  "status", "clearid", "class", "modtime", "modby", "modwith",
449  "created", "creator",
450};
451
452static char *gubm2_fields[] = {
453  "clearid",
454  "login", "unix_uid", "shell", "last", "first", "middle", "status",
455  "clearid", "class", "modtime", "modby", "modwith",
456};
457
458static char *gubm_fields[] = {
459  "clearid",
460  "login", "unix_uid", "shell", "winconsoleshell", "last", "first",
461  "middle", "status", "clearid", "class", "modtime", "modby", "modwith",
462  "created", "creator",
463};
464
465static char *auac2_fields[] = {
466  "login", "unix_uid", "shell", "last", "first", "middle", "status",
467  "clearid", "class", "comments", "signature", "secure",
468};
469
470static char *auac3_fields[] = {
471  "login", "unix_uid", "shell", "winconsoleshell", "last", "first",
472  "middle", "status", "clearid", "class", "comments", "signature", "secure",
473};
474
475static char *auac11_fields[] = {
476  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
477  "status", "clearid", "class", "comments", "signature", "secure",
478  "winhomedir", "winprofiledir",
479};
480
481static char *auac12_fields[] = {
482  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
483  "status", "clearid", "class", "comments", "signature", "secure",
484  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
485};
486
487static char *auac_fields[] = {
488  "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
489  "status", "clearid", "class", "comments", "signature", "secure",
490  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
491  "alternate_email", "alternate_phone",
492};
493
494static struct valobj auac2_valobj[] = {
495  {V_CHAR, 0, USERS_TABLE, "login"},
496  {V_NUM, 1},
497  {V_CHAR, 2, USERS_TABLE, "shell"},
498  {V_CHAR, 3, USERS_TABLE, "last"},
499  {V_CHAR, 4, USERS_TABLE, "first"},
500  {V_CHAR, 5, USERS_TABLE, "middle"},
501  {V_NUM, 6},
502  {V_CHAR, 7, USERS_TABLE, "clearid"},
503  {V_TYPE, 8, 0, "class", 0, MR_BAD_CLASS},
504  {V_ID, 9, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
505  {V_NUM, 11},
506};
507
508static struct valobj auac3_valobj[] = {
509  {V_CHAR, 0, USERS_TABLE, "login"},
510  {V_NUM, 1},
511  {V_CHAR, 2, USERS_TABLE, "shell"},
512  {V_CHAR, 3, USERS_TABLE, "winconsoleshell"},
513  {V_CHAR, 4, USERS_TABLE, "last"},
514  {V_CHAR, 5, USERS_TABLE, "first"},
515  {V_CHAR, 6, USERS_TABLE, "middle"},
516  {V_NUM, 7},
517  {V_CHAR, 8, USERS_TABLE, "clearid"},
518  {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
519  {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
520  {V_NUM, 12},
521};
522
523static struct valobj auac11_valobj[] = {
524  {V_CHAR, 0, USERS_TABLE, "login"},
525  {V_NUM, 1},
526  {V_CHAR, 2, USERS_TABLE, "shell"},
527  {V_CHAR, 3, USERS_TABLE, "winconsoleshell"},
528  {V_CHAR, 4, USERS_TABLE, "last"},
529  {V_CHAR, 5, USERS_TABLE, "first"},
530  {V_CHAR, 6, USERS_TABLE, "middle"},
531  {V_NUM, 7},
532  {V_CHAR, 8, USERS_TABLE, "clearid"},
533  {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
534  {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
535  {V_NUM, 12},
536  {V_LEN, 13, USERS_TABLE, "winhomedir"},
537  {V_LEN, 14, USERS_TABLE, "winprofiledir"},
538};
539
540static struct valobj auac12_valobj[] = {
541  {V_CHAR, 0, USERS_TABLE, "login"},
542  {V_NUM, 1},
543  {V_CHAR, 2, USERS_TABLE, "shell"},
544  {V_CHAR, 3, USERS_TABLE, "winconsoleshell"},
545  {V_CHAR, 4, USERS_TABLE, "last"},
546  {V_CHAR, 5, USERS_TABLE, "first"},
547  {V_CHAR, 6, USERS_TABLE, "middle"},
548  {V_NUM, 7},
549  {V_CHAR, 8, USERS_TABLE, "clearid"},
550  {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
551  {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
552  {V_NUM, 12},
553  {V_LEN, 13, USERS_TABLE, "winhomedir"},
554  {V_LEN, 14, USERS_TABLE, "winprofiledir"},
555  {V_TYPE, 15, 0, "ace_type", 0, MR_ACE},
556  {V_TYPEDATA, 16, 0, 0, "list_id", MR_ACE},
557  {V_CHAR, 17, USERS_TABLE, "expiration"},
558};
559
560static struct valobj auac_valobj[] = {
561  {V_CHAR, 0, USERS_TABLE, "login"},
562  {V_NUM, 1},
563  {V_CHAR, 2, USERS_TABLE, "shell"},
564  {V_CHAR, 3, USERS_TABLE, "winconsoleshell"},
565  {V_CHAR, 4, USERS_TABLE, "last"},
566  {V_CHAR, 5, USERS_TABLE, "first"},
567  {V_CHAR, 6, USERS_TABLE, "middle"},
568  {V_NUM, 7},
569  {V_CHAR, 8, USERS_TABLE, "clearid"},
570  {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
571  {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
572  {V_NUM, 12},
573  {V_LEN, 13, USERS_TABLE, "winhomedir"},
574  {V_LEN, 14, USERS_TABLE, "winprofiledir"},
575  {V_TYPE, 15, 0, "ace_type", 0, MR_ACE},
576  {V_TYPEDATA, 16, 0, 0, "list_id", MR_ACE},
577  {V_CHAR, 17, USERS_TABLE, "expiration"},
578  {V_CHAR, 18, USERS_TABLE, "alternate_email"},
579  {V_CHAR, 19, USERS_TABLE, "alternate_phone"},
580};
581
582static struct validate auac2_validate = {
583  auac2_valobj,
584  11,
585  "login",
586  "login = '%s'",
587  1,
588  "users_id",
589  0,
590  setup_ausr,
591  followup_ausr,
592};
593
594static struct validate auac3_validate = {
595  auac3_valobj,
596  12,
597  "login",
598  "login = '%s'",
599  1,
600  "users_id",
601  0,
602  setup_ausr,
603  followup_ausr,
604};
605
606static struct validate auac11_validate = {
607  auac11_valobj,
608  14,
609  "login",
610  "login = '%s'",
611  1,
612  "users_id",
613  0,
614  setup_ausr,
615  followup_ausr,
616};
617
618static struct validate auac12_validate = {
619  auac12_valobj,
620  17,
621  "login",
622  "login = '%s'",
623  1,
624  "users_id",
625  0,
626  setup_ausr,
627  followup_ausr,
628};
629
630static struct validate auac_validate = {
631  auac_valobj,
632  19,
633  "login",
634  "login = '%s'",
635  1,
636  "users_id",
637  0,
638  setup_ausr,
639  followup_ausr,
640};
641
642static struct validate ausr2_validate = {
643  auac2_valobj,
644  9,
645  "login",
646  "login = '%s'",
647  1,
648  "users_id",
649  0,
650  setup_ausr,
651  followup_ausr,
652};
653
654static struct validate ausr3_validate = {
655  auac3_valobj,
656  10,
657  "login",
658  "login = '%s'",
659  1,
660  "users_id",
661  0,
662  setup_ausr,
663  followup_ausr,
664};
665
666static struct validate ausr11_validate = {
667  auac11_valobj,
668  12,
669  "login",
670  "login = '%s'",
671  1,
672  "users_id",
673  0,
674  setup_ausr,
675  followup_ausr,
676};
677
678static struct validate ausr12_validate = {
679  auac12_valobj,
680  15,
681  "login",
682  "login = '%s'",
683  1,
684  "users_id",
685  0,
686  setup_ausr,
687  followup_ausr,
688};
689
690static struct validate ausr_validate = {
691  auac_valobj,
692  17,
693  "login",
694  "login = '%s'",
695  1,
696  "users_id",
697  0,
698  setup_ausr,
699  followup_ausr,
700};
701
702static char *rusr_fields[] = {
703  "unix_uid", "login", "pobox_type"
704};
705
706static struct valobj rusr_valobj[] = {
707  {V_NUM, 0},
708  {V_CHAR, 1, USERS_TABLE, "login"},
709};
710
711static struct validate rusr_validate = {
712  rusr_valobj,
713  2,
714  0,
715  0,
716  0,
717  0,
718  0,
719  register_user,
720  0,
721};
722
723static char *uuac2_fields[] = {
724  "login",
725  "newlogin", "unix_uid", "shell", "last", "first", "middle", "status",
726  "clearid", "class", "comments", "signature", "secure",
727};
728
729static char *uuac3_fields[] = {
730  "login",
731  "newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first",
732  "middle", "status", "clearid", "class", "comments", "signature", "secure",
733};
734
735static char *uuac11_fields[] = {
736  "login",
737  "newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first",
738  "middle", "status", "clearid", "class", "comments", "signature", "secure",
739  "winhomedir", "winprofiledir",
740};
741
742static char *uuac12_fields[] = {
743  "login",
744  "newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first",
745  "middle", "status", "clearid", "class", "comments", "signature", "secure",
746  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
747};
748
749static char *uuac_fields[] = {
750  "login",
751  "newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first",
752  "middle", "status", "clearid", "class", "comments", "signature", "secure",
753  "winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
754  "alternate_email", "alternate_phone",
755};
756
757static struct valobj uuac2_valobj[] = {
758  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
759  {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
760  {V_NUM, 2},
761  {V_CHAR, 3, USERS_TABLE, "shell"},
762  {V_CHAR, 4, USERS_TABLE, "first"},
763  {V_CHAR, 5, USERS_TABLE, "last"},
764  {V_CHAR, 6, USERS_TABLE, "middle"},
765  {V_NUM, 7},
766  {V_CHAR, 8, USERS_TABLE, "clearid"},
767  {V_TYPE, 9, 0, "class", 0, MR_BAD_CLASS},
768  {V_ID, 10, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
769  {V_NUM, 12},
770};
771 
772static struct valobj uuac3_valobj[] = {
773  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
774  {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
775  {V_NUM, 2},
776  {V_CHAR, 3, USERS_TABLE, "shell"},
777  {V_CHAR, 4, USERS_TABLE, "winconsoleshell"},
778  {V_CHAR, 5, USERS_TABLE, "first"},
779  {V_CHAR, 6, USERS_TABLE, "last"},
780  {V_CHAR, 7, USERS_TABLE, "middle"},
781  {V_NUM, 8},
782  {V_CHAR, 9, USERS_TABLE, "clearid"},
783  {V_TYPE, 10, 0, "class", 0, MR_BAD_CLASS},
784  {V_ID, 11, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
785  {V_NUM, 13},
786};
787
788static struct valobj uuac11_valobj[] = {
789  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
790  {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
791  {V_NUM, 2},
792  {V_CHAR, 3, USERS_TABLE, "shell"},
793  {V_CHAR, 4, USERS_TABLE, "winconsoleshell"},
794  {V_CHAR, 5, USERS_TABLE, "first"},
795  {V_CHAR, 6, USERS_TABLE, "last"},
796  {V_CHAR, 7, USERS_TABLE, "middle"},
797  {V_NUM, 8},
798  {V_CHAR, 9, USERS_TABLE, "clearid"},
799  {V_TYPE, 10, 0, "class", 0, MR_BAD_CLASS},
800  {V_ID, 11, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
801  {V_NUM, 13},
802  {V_LEN, 14, USERS_TABLE, "winhomedir"},
803  {V_LEN, 15, USERS_TABLE, "winprofiledir"},
804};
805
806static struct valobj uuac12_valobj[] = {
807  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
808  {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
809  {V_NUM, 2},
810  {V_CHAR, 3, USERS_TABLE, "shell"},
811  {V_CHAR, 4, USERS_TABLE, "winconsoleshell"},
812  {V_CHAR, 5, USERS_TABLE, "first"},
813  {V_CHAR, 6, USERS_TABLE, "last"},
814  {V_CHAR, 7, USERS_TABLE, "middle"},
815  {V_NUM, 8},
816  {V_CHAR, 9, USERS_TABLE, "clearid"},
817  {V_TYPE, 10, 0, "class", 0, MR_BAD_CLASS},
818  {V_ID, 11, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
819  {V_NUM, 13},
820  {V_LEN, 14, USERS_TABLE, "winhomedir"},
821  {V_LEN, 15, USERS_TABLE, "winprofiledir"},
822  {V_TYPE, 16, 0, "ace_type", 0, MR_ACE},
823  {V_TYPEDATA, 17, 0, 0, "list_id", MR_ACE},
824  {V_CHAR, 18, USERS_TABLE, "expiration"},
825};
826
827static struct valobj uuac_valobj[] = {
828  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
829  {V_RENAME, 1, USERS_TABLE, "login", "users_id", MR_NOT_UNIQUE},
830  {V_NUM, 2},
831  {V_CHAR, 3, USERS_TABLE, "shell"},
832  {V_CHAR, 4, USERS_TABLE, "winconsoleshell"},
833  {V_CHAR, 5, USERS_TABLE, "first"},
834  {V_CHAR, 6, USERS_TABLE, "last"},
835  {V_CHAR, 7, USERS_TABLE, "middle"},
836  {V_NUM, 8},
837  {V_CHAR, 9, USERS_TABLE, "clearid"},
838  {V_TYPE, 10, 0, "class", 0, MR_BAD_CLASS},
839  {V_ID, 11, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
840  {V_NUM, 13},
841  {V_LEN, 14, USERS_TABLE, "winhomedir"},
842  {V_LEN, 15, USERS_TABLE, "winprofiledir"},
843  {V_TYPE, 16, 0, "ace_type", 0, MR_ACE},
844  {V_TYPEDATA, 17, 0, 0, "list_id", MR_ACE},
845  {V_CHAR, 18, USERS_TABLE, "expiration"},
846  {V_CHAR, 19, USERS_TABLE, "alternate_email"},
847  {V_CHAR, 20, USERS_TABLE, "alternate_phone"},
848};
849
850static struct validate uuac2_validate = {
851  uuac2_valobj,
852  12,
853  0,
854  0,
855  0,
856  "users_id",
857  0,
858  setup_ausr,
859  set_modtime_by_id,
860};
861
862static struct validate uuac3_validate = {
863  uuac3_valobj,
864  13,
865  0,
866  0,
867  0,
868  "users_id",
869  0,
870  setup_ausr,
871  set_modtime_by_id,
872};
873
874static struct validate uuac11_validate = {
875  uuac11_valobj,
876  15,
877  0,
878  0,
879  0,
880  "users_id",
881  access_update_user,
882  setup_ausr,
883  set_modtime_by_id,
884};
885
886static struct validate uuac12_validate = {
887  uuac12_valobj,
888  18,
889  0,
890  0,
891  0,
892  "users_id",
893  access_update_user,
894  setup_ausr,
895  set_modtime_by_id,
896};
897
898static struct validate uuac_validate = {
899  uuac_valobj,
900  20,
901  0,
902  0,
903  0,
904  "users_id",
905  access_update_user,
906  setup_ausr,
907  set_modtime_by_id,
908};
909
910static struct validate uusr2_validate = {
911  uuac2_valobj,
912  10,
913  0,
914  0,
915  0,
916  "users_id",
917  0,
918  setup_ausr,
919  set_modtime_by_id,
920};
921
922static struct validate uusr3_validate = {
923  uuac3_valobj,
924  11,
925  0,
926  0,
927  0,
928  "users_id",
929  0,
930  setup_ausr,
931  set_modtime_by_id,
932};
933
934static struct validate uusr11_validate = {
935  uuac11_valobj,
936  13,
937  0,
938  0,
939  0,
940  "users_id",
941  0,
942  setup_ausr,
943  set_modtime_by_id,
944};
945
946static struct validate uusr12_validate = {
947  uuac12_valobj,
948  16,
949  0,
950  0,
951  0,
952  "users_id",
953  0,
954  setup_ausr,
955  set_modtime_by_id,
956};
957
958static struct validate uusr_validate = {
959  uuac_valobj,
960  18,
961  0,
962  0,
963  0,
964  "users_id",
965  0,
966  setup_ausr,
967  set_modtime_by_id,
968};
969
970static char *uush_fields[] = {
971  "login",
972  "shell",
973};
974
975static struct valobj uush_valobj[] = {
976  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
977  {V_CHAR, 1, USERS_TABLE, "shell"},
978};
979
980static struct validate uush_validate = {
981  uush_valobj,
982  2,
983  0,
984  0,
985  0,
986  "users_id",
987  access_user,
988  0,
989  set_finger_modtime,
990};
991
992static char *uuws_fields[] = {
993  "login",
994  "winconsoleshell",
995};
996
997static struct valobj uuws_valobj[] = {
998  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
999  {V_CHAR, 1, USERS_TABLE, "winconsoleshell"},
1000};
1001
1002static struct validate uuws_validate = {
1003  uuws_valobj,
1004  2,
1005  0,
1006  0,
1007  0,
1008  "users_id",
1009  access_user,
1010  0,
1011  set_finger_modtime,
1012};
1013
1014static char *uust_fields[] = {
1015  "login",
1016  "status",
1017};
1018
1019static char *uuss_fields[] = {
1020  "login",
1021  "secure",
1022};
1023
1024static struct valobj uust_valobj[] = {
1025  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
1026  {V_NUM, 1},
1027  {V_NUM, 2},
1028};
1029
1030static struct validate uust_validate = {
1031  uust_valobj,
1032  2,
1033  0,
1034  0,
1035  0,
1036  "users_id",
1037  0,
1038  0,
1039  set_modtime_by_id,
1040};
1041
1042static char *dusr_fields[] = {
1043  "login",
1044};
1045
1046static struct validate dusr_validate = {
1047  VOuser0,
1048  1,
1049  0,
1050  0,
1051  0,
1052  0,
1053  0,
1054  setup_dusr,
1055  0,
1056};
1057
1058static char *aurv_fields[] = {
1059  "login", "reservation",
1060};
1061
1062static struct validate aurv_validate = {
1063  VOuser0,
1064  1,
1065  0,
1066  0,
1067  0,
1068  "users_id",
1069  0,
1070  0,
1071  do_user_reservation,
1072};
1073
1074static char *gurv_fields[] = {
1075  "login",
1076  "reservation",
1077};
1078
1079static struct validate gurv_validate = {
1080  VOuser0,
1081  1,
1082  0,
1083  0,
1084  0,
1085  0,
1086  0,
1087  0,
1088  get_user_reservations,
1089};
1090
1091static char *gubr_fields[] = {
1092  "reservation",
1093  "login",
1094};
1095
1096static struct validate gubr_validate = {
1097  0,
1098  0,
1099  0,
1100  0,
1101  0,
1102  0,
1103  0,
1104  0,
1105  get_user_by_reservation,
1106};
1107
1108static char *gkum_fields[] = { "login", "kerberos",
1109                                   "login", "kerberos" };
1110
1111static char *akum_fields[] = { "login", "kerberos" };
1112
1113static struct valobj akum_valobj[] =
1114{
1115  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
1116  {V_ID, 1, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1117};
1118
1119static struct validate akum_validate =
1120{
1121  akum_valobj,
1122  2,
1123  "users_id",
1124  "users_id = %d or string_id = %d",
1125  2,
1126  "users_id",
1127  access_user,
1128  0,
1129  0,
1130};
1131
1132static struct validate dkum_validate =
1133{
1134  akum_valobj,
1135  2,
1136  "users_id",
1137  "users_id = %d and string_id = %d",
1138  2,
1139  "users_id",
1140  access_user,
1141  0,
1142  0,
1143};
1144
1145static char *gfbl_fields[] = {
1146  "login",
1147  "login", "fullname", "nickname", "home_addr",
1148  "home_phone", "office_addr", "office_phone", "department",
1149  "affiliation", "modtime", "modby", "modwith",
1150};
1151
1152static struct validate gfbl_validate = {
1153  VOuser0,
1154  1,
1155  0,
1156  0,
1157  0,
1158  0,
1159  access_user,
1160  0,
1161  followup_fix_modby,
1162};
1163
1164static char *ufbl_fields[] = {
1165  "login",
1166  "fullname", "nickname", "home_addr",
1167  "home_phone", "office_addr", "office_phone", "department",
1168  "affiliation",
1169};
1170
1171static struct valobj ufbl_valobj[] = {
1172  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
1173  {V_LEN, 1, USERS_TABLE, "fullname"},
1174  {V_LEN, 2, USERS_TABLE, "nickname"},
1175  {V_LEN, 3, USERS_TABLE, "home_addr"},
1176  {V_LEN, 4, USERS_TABLE, "home_phone"},
1177  {V_LEN, 5, USERS_TABLE, "office_addr"},
1178  {V_LEN, 6, USERS_TABLE, "office_phone"},
1179  {V_LEN, 7, USERS_TABLE, "department"},
1180  {V_LEN, 8, USERS_TABLE, "affiliation"},
1181};
1182
1183static struct validate ufbl_validate = {
1184  ufbl_valobj,
1185  9,
1186  0,
1187  0,
1188  0,
1189  0,
1190  access_user,
1191  0,
1192  set_finger_modtime,
1193};
1194
1195static char *gpob_fields[] = {
1196  "login",
1197  "login", "type", "box", "address", "modtime", "modby", "modwith",
1198};
1199
1200static struct validate gpob_validate = {
1201  VOuser0,
1202  1,
1203  "potype",
1204  "potype != 'NONE' and users_id = %d",
1205  1,
1206  0,
1207  access_user,
1208  0,
1209  followup_gpob,
1210};
1211
1212static char *gpox_fields[] = {
1213  "login", "type", "box",
1214};
1215
1216static struct validate gpox_validate = {
1217  0,
1218  0,
1219  0,
1220  0,
1221  0,
1222  0,
1223  0,
1224  0,
1225  followup_gpob,
1226};
1227
1228static char *spob_fields[] = {
1229  "login", "type", "box",
1230};
1231
1232static struct valobj spob_valobj[] = {
1233  {V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
1234  {V_TYPE, 1, 0, "pobox", 0, MR_TYPE},
1235};
1236
1237static struct validate spob_validate =  /* SET_POBOX */
1238{
1239  spob_valobj,
1240  2,
1241  0,
1242  0,
1243  0,
1244  0,
1245  access_spob,
1246  0,
1247  set_pobox,
1248};
1249
1250static struct validate spop_validate =  /* SET_POBOX_POP */
1251{
1252  VOuser0,
1253  1,
1254  0,
1255  0,
1256  0,
1257  0,
1258  access_user,
1259  0,
1260  set_pobox_pop,
1261};
1262
1263static struct validate dpob_validate =  /* DELETE_POBOX */
1264{
1265  VOuser0,
1266  1,
1267  0,
1268  0,
1269  0,
1270  0,
1271  access_user,
1272  setup_dpob,
1273  set_pobox_modtime,
1274};
1275
1276static char *gmac_fields[] = {
1277  "name",
1278  "name", "type", "modtime", "modby", "modwith",
1279};
1280
1281static char *ghst2_fields[] = {
1282  "name", "address", "location", "network",
1283  "name", "vendor", "model", "os", "location", "contact", "use",
1284  "status", "status_change", "network", "address", "ace_type",
1285  "ace_name", "admin_comment", "ops_comment", "created", "creator",
1286  "inuse", "modtime", "modby", "modwith",
1287};
1288
1289static char *ghbh2_fields[] = {
1290  "hwaddr",
1291  "name", "vendor", "model", "os", "location", "contact", "use",
1292  "status", "status_change", "network", "address", "ace_type",
1293  "ace_name", "admin_comment", "ops_comment", "created", "creator",
1294  "inuse", "modtime", "modby", "modwith",
1295};
1296
1297static char *ghst6_fields[] = {
1298  "name", "address", "location", "network",
1299  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
1300  "use", "status", "status_change", "network", "address", "ace_type",
1301  "ace_name", "admin_comment", "ops_comment", "created", "creator",
1302  "inuse", "modtime", "modby", "modwith",
1303};
1304
1305static char *ghbh6_fields[] = {
1306  "hwaddr",
1307  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
1308  "use", "status", "status_change", "network", "address", "ace_type",
1309  "ace_name", "admin_comment", "ops_comment", "created", "creator",
1310  "inuse", "modtime", "modby", "modwith",
1311};
1312
1313static char *ghst_fields[] = {
1314  "name", "address", "location", "network",
1315  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
1316  "account_number", "use", "status", "status_change", "network", "address",
1317  "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
1318  "inuse", "modtime", "modby", "modwith",
1319};
1320
1321static char *ghbh_fields[] = {
1322  "hwaddr",
1323  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
1324  "account_number", "use", "status", "status_change", "network", "address",
1325  "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
1326  "inuse", "modtime", "modby", "modwith",
1327};
1328
1329static char *ghba_fields[] = {
1330  "account_number",
1331  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
1332  "account_number", "use", "status", "status_change", "network", "address",
1333  "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
1334  "inuse", "modtime", "modby", "modwith",
1335};
1336
1337static struct validate ghst_validate = {
1338  0,
1339  0,
1340  0,
1341  0,
1342  0,
1343  0,
1344  0,
1345  setup_ghst,
1346  followup_ghst,
1347};
1348
1349static char *ghha_fields[] = {
1350  "name",
1351  "hwaddr",
1352};
1353
1354static char *ghhm_fields[] = {
1355  "name",
1356  "name", "hwaddr",
1357};
1358
1359static char *ahst2_fields[] = {
1360  "name", "vendor", "model", "os", "location", "contact", "use",
1361  "status", "subnet", "address", "ace_type", "ace_name",
1362  "admin_comment", "ops_comment",
1363};
1364
1365static struct valobj ahst2_valobj[] = {
1366  {V_CHAR, 0, MACHINE_TABLE, "name"},
1367  {V_CHAR, 1, MACHINE_TABLE, "vendor"},
1368  {V_CHAR, 2, MACHINE_TABLE, "model"},
1369  {V_CHAR, 3, MACHINE_TABLE, "os"},
1370  {V_CHAR, 4, MACHINE_TABLE, "location"},
1371  {V_CHAR, 5, MACHINE_TABLE, "contact"},
1372  {V_NUM, 6},
1373  {V_NUM, 7},
1374  {V_ID, 8, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
1375  {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
1376  {V_TYPEDATA, 11, 0, 0, 0, MR_ACE},
1377  {V_ID, 12, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1378  {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1379};
1380
1381static struct validate ahst2_validate = {
1382  ahst2_valobj,
1383  13,
1384  "name",
1385  "name = UPPER('%s')",
1386  1,
1387  "mach_id",
1388  access_host,
1389  setup_ahst,
1390  set_uppercase_modtime,
1391};
1392
1393static char *ahst6_fields[] = {
1394  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
1395  "use", "status", "subnet", "address", "ace_type", "ace_name",
1396  "admin_comment", "ops_comment",
1397};
1398
1399static struct valobj ahst6_valobj[] = {
1400  {V_CHAR, 0, MACHINE_TABLE, "name"},
1401  {V_CHAR, 1, MACHINE_TABLE, "vendor"},
1402  {V_CHAR, 2, MACHINE_TABLE, "model"},
1403  {V_CHAR, 3, MACHINE_TABLE, "os"},
1404  {V_CHAR, 4, MACHINE_TABLE, "location"},
1405  {V_CHAR, 5, MACHINE_TABLE, "contact"},
1406  {V_CHAR, 6, MACHINE_TABLE, "billing_contact"},
1407  {V_NUM, 7},
1408  {V_NUM, 8},
1409  {V_ID, 9, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
1410  {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
1411  {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
1412  {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1413  {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1414};
1415
1416static struct validate ahst6_validate = {
1417  ahst6_valobj,
1418  14,
1419  "name",
1420  "name = UPPER('%s')",
1421  1,
1422  "mach_id",
1423  access_host,
1424  setup_ahst,
1425  set_uppercase_modtime,
1426};
1427
1428static char *ahst_fields[] = {
1429  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
1430  "account_number", "use", "status", "subnet", "address", "ace_type",
1431  "ace_name", "admin_comment", "ops_comment",
1432};
1433
1434static struct valobj ahst_valobj[] = {
1435  {V_CHAR, 0, MACHINE_TABLE, "name"},
1436  {V_CHAR, 1, MACHINE_TABLE, "vendor"},
1437  {V_CHAR, 2, MACHINE_TABLE, "model"},
1438  {V_CHAR, 3, MACHINE_TABLE, "os"},
1439  {V_CHAR, 4, MACHINE_TABLE, "location"},
1440  {V_CHAR, 5, MACHINE_TABLE, "contact"},
1441  {V_CHAR, 6, MACHINE_TABLE, "billing_contact"},
1442  {V_CHAR, 7, MACHINE_TABLE, "account_number"},
1443  {V_NUM, 8},
1444  {V_NUM, 9},
1445  {V_ID, 10, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
1446  {V_TYPE, 12, 0, "ace_type", 0, MR_ACE},
1447  {V_TYPEDATA, 13, 0, 0, 0, MR_ACE},
1448  {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1449  {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1450};
1451
1452static struct validate ahst_validate = {
1453  ahst_valobj,
1454  15,
1455  "name",
1456  "name = UPPER('%s')",
1457  1,
1458  "mach_id",
1459  access_host,
1460  setup_ahst,
1461  set_uppercase_modtime,
1462};
1463
1464static char *uhst2_fields[] = {
1465  "name",
1466  "newname", "vendor", "model", "os", "location", "contact", "use",
1467  "status", "subnet", "address", "ace_type", "ace_name",
1468  "admin_comment", "ops_comment",
1469};
1470
1471static struct valobj uhst2_valobj[] = {
1472  {V_CHAR, 0, MACHINE_TABLE, "name"},
1473  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1474  {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
1475  {V_CHAR, 2, MACHINE_TABLE, "vendor"},
1476  {V_CHAR, 3, MACHINE_TABLE, "model"},
1477  {V_CHAR, 4, MACHINE_TABLE, "os"},
1478  {V_CHAR, 5, MACHINE_TABLE, "location"},
1479  {V_CHAR, 6, MACHINE_TABLE, "contact"},
1480  {V_NUM, 7},
1481  {V_NUM, 8},
1482  {V_ID, 9, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
1483  {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
1484  {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
1485  {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1486  {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1487};
1488
1489static struct validate uhst2_validate = {
1490  uhst2_valobj,
1491  15,
1492  0,
1493  0,
1494  0,
1495  "mach_id",
1496  access_host,
1497  setup_ahst,
1498  set_modtime_by_id,
1499};
1500
1501static char *uhst6_fields[] = {
1502  "name",
1503  "newname", "vendor", "model", "os", "location", "contact", "billing_contact",
1504  "use", "status", "subnet", "address", "ace_type", "ace_name",
1505  "admin_comment", "ops_comment",
1506};
1507
1508static struct valobj uhst6_valobj[] = {
1509  {V_CHAR, 0, MACHINE_TABLE, "name"},
1510  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1511  {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
1512  {V_CHAR, 2, MACHINE_TABLE, "vendor"},
1513  {V_CHAR, 3, MACHINE_TABLE, "model"},
1514  {V_CHAR, 4, MACHINE_TABLE, "os"},
1515  {V_CHAR, 5, MACHINE_TABLE, "location"},
1516  {V_CHAR, 6, MACHINE_TABLE, "contact"},
1517  {V_CHAR, 7, MACHINE_TABLE, "billing_contact"},
1518  {V_NUM, 8},
1519  {V_NUM, 9},
1520  {V_ID, 10, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
1521  {V_TYPE, 12, 0, "ace_type", 0, MR_ACE},
1522  {V_TYPEDATA, 13, 0, 0, 0, MR_ACE},
1523  {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1524  {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1525};
1526
1527static struct validate uhst6_validate = {
1528  uhst6_valobj,
1529  16,
1530  0,
1531  0,
1532  0,
1533  "mach_id",
1534  access_host,
1535  setup_ahst,
1536  set_modtime_by_id,
1537};
1538
1539static char *uhst_fields[] = {
1540  "name",
1541  "newname", "vendor", "model", "os", "location", "contact", "billing_contact",
1542  "account_number", "use", "status", "subnet", "address", "ace_type",
1543  "ace_name", "admin_comment", "ops_comment",
1544};
1545
1546static struct valobj uhst_valobj[] = {
1547  {V_CHAR, 0, MACHINE_TABLE, "name"},
1548  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1549  {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
1550  {V_CHAR, 2, MACHINE_TABLE, "vendor"},
1551  {V_CHAR, 3, MACHINE_TABLE, "model"},
1552  {V_CHAR, 4, MACHINE_TABLE, "os"},
1553  {V_CHAR, 5, MACHINE_TABLE, "location"},
1554  {V_CHAR, 6, MACHINE_TABLE, "contact"},
1555  {V_CHAR, 7, MACHINE_TABLE, "billing_contact"},
1556  {V_CHAR, 8, MACHINE_TABLE, "account_number"},
1557  {V_NUM, 9},
1558  {V_NUM, 10},
1559  {V_ID, 11, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
1560  {V_TYPE, 13, 0, "ace_type", 0, MR_ACE},
1561  {V_TYPEDATA, 14, 0, 0, 0, MR_ACE},
1562  {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1563  {V_ID, 16, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
1564};
1565
1566static struct validate uhst_validate = {
1567  uhst_valobj,
1568  17,
1569  0,
1570  0,
1571  0,
1572  "mach_id",
1573  access_host,
1574  setup_ahst,
1575  set_modtime_by_id,
1576};
1577
1578static char *ahha_fields[] = {
1579  "name", "hwaddr",
1580};
1581
1582static struct valobj ahha_valobj[] = {
1583  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1584  {V_CHAR, 1, HWADDRMAP_TABLE, "hwaddr"},
1585};
1586
1587static struct validate ahha_validate = {
1588  ahha_valobj,
1589  2,
1590  0,
1591  0,
1592  0,
1593  "mach_id",
1594  0,
1595  setup_ahha,
1596  set_mach_modtime_by_id,
1597};
1598
1599static char *dhha_fields[] = {
1600  "name", "hwaddr",
1601};
1602
1603static struct valobj dhha_valobj[] = {
1604  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1605  {V_CHAR, 1, HWADDRMAP_TABLE, "hwaddr"},
1606};
1607
1608static struct validate dhha_validate = {
1609  dhha_valobj,
1610  2,
1611  0,
1612  0,
1613  0,
1614  "mach_id",
1615  0,
1616  0,
1617  set_mach_modtime_by_id,
1618};
1619
1620static char *dhst_fields[] = {
1621  "name",
1622};
1623
1624static struct validate dhst_validate = {
1625  VOmach0,
1626  1,
1627  0,
1628  0,
1629  0,
1630  0,
1631  0,
1632  setup_dmac,
1633  0,
1634};
1635
1636static char *ghal_fields[] = {
1637  "alias", "canonical_hostname",
1638  "alias", "canonical_hostname"
1639};
1640
1641static struct validate ghal_validate = {
1642  0,
1643  0,
1644  0,
1645  0,
1646  0,
1647  0,
1648  access_ahal,
1649  0,
1650  0,
1651};
1652
1653static struct valobj ahal_valobj[] = {
1654  {V_CHAR, 0, HOSTALIAS_TABLE, "name"},
1655  {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1656};
1657
1658static struct validate ahal_validate = {
1659  ahal_valobj,
1660  2,
1661  "name",
1662  "name = UPPER('%s')",
1663  1,
1664  "mach_id",
1665  access_ahal,
1666  setup_ahal,
1667  0,
1668};
1669
1670static struct valobj dhal_valobj[] = {
1671  {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1672};
1673
1674static struct validate dhal_validate = {
1675  dhal_valobj,
1676  1,
1677  "name",
1678  "name = UPPER('%s') AND mach_id = %d",
1679  2,
1680  "mach_id",
1681  access_ahal,
1682  0,
1683  0,
1684};
1685
1686static char *gsnt2_fields[] = {
1687  "name",
1688  "name", "description", "address", "mask", "low", "high", "prefix",
1689  "ace_type", "ace_name", "modtime", "modby", "modwith"
1690};
1691
1692static char *gsnt_fields[] = {
1693  "name",
1694  "name", "description", "status", "contact", "account_number", "address",
1695  "mask", "low", "high", "prefix", "ace_type", "ace_name", "modtime",
1696  "modby", "modwith"
1697};
1698
1699static struct validate gsnt_validate = {
1700  0,
1701  0,
1702  0,
1703  0,
1704  0,
1705  0,
1706  access_snt,
1707  0,
1708  followup_gsnt,
1709};
1710
1711static char *asnt2_fields[] = {
1712  "name", "description", "address", "mask", "low", "high", "prefix",
1713  "ace_type", "ace_name",
1714};
1715
1716static struct valobj asnt2_valobj[] = {
1717  {V_CHAR, 0, SUBNET_TABLE, "name"},
1718  {V_LEN, 1, SUBNET_TABLE, "description"},
1719  {V_NUM, 2},
1720  {V_NUM, 3},
1721  {V_NUM, 4},
1722  {V_NUM, 5},
1723  {V_LEN, 6, SUBNET_TABLE, "prefix"},
1724  {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
1725  {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
1726};
1727
1728static struct validate asnt2_validate =
1729{
1730  asnt2_valobj,
1731  9,
1732  "name",
1733  "name = UPPER('%s')",
1734  1,
1735  "snet_id",
1736  0,
1737  prefetch_value,
1738  set_uppercase_modtime,
1739};
1740
1741static char *asnt_fields[] = {
1742  "name", "description", "status", "contact", "account_number", "address",
1743  "mask", "low", "high", "prefix", "ace_type", "ace_name",
1744};
1745
1746static struct valobj asnt_valobj[] = {
1747  {V_CHAR, 0, SUBNET_TABLE, "name"},
1748  {V_LEN, 1, SUBNET_TABLE, "description"},
1749  {V_NUM, 2},
1750  {V_CHAR, 3, SUBNET_TABLE, "contact"},
1751  {V_CHAR, 4, SUBNET_TABLE, "account_number"},
1752  {V_NUM, 5},
1753  {V_NUM, 6},
1754  {V_NUM, 7},
1755  {V_NUM, 8},
1756  {V_LEN, 9, SUBNET_TABLE, "prefix"},
1757  {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
1758  {V_TYPEDATA, 11, 0, 0, 0, MR_ACE},
1759};
1760
1761static struct validate asnt_validate =
1762{
1763  asnt_valobj,
1764  12,
1765  "name",
1766  "name = UPPER('%s')",
1767  1,
1768  "snet_id",
1769  0,
1770  setup_asnt,
1771  set_uppercase_modtime,
1772};
1773
1774static char *usnt2_fields[] = {
1775  "name",
1776  "newname", "description", "address", "mask", "low", "high", "prefix",
1777  "ace_type", "ace_name",
1778};
1779
1780static struct valobj usnt2_valobj[] = {
1781  {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
1782  {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
1783  {V_LEN, 2, SUBNET_TABLE, "description"},
1784  {V_NUM, 3},
1785  {V_NUM, 4},
1786  {V_NUM, 5},
1787  {V_NUM, 6},
1788  {V_LEN, 7, SUBNET_TABLE, "prefix"},
1789  {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
1790  {V_TYPEDATA, 9, 0, 0, 0, MR_ACE},
1791};
1792
1793static struct validate usnt2_validate =
1794{
1795  usnt2_valobj,
1796  10,
1797  "name",
1798  "snet_id = %d",
1799  1,
1800  "snet_id",
1801  0,
1802  0,
1803  set_modtime_by_id,
1804};
1805
1806static char *usnt_fields[] = {
1807  "name",
1808  "newname", "description", "status", "contact", "account_number", "address",
1809  "mask", "low", "high", "prefix", "ace_type", "ace_name",
1810};
1811
1812static struct valobj usnt_valobj[] = {
1813  {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
1814  {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
1815  {V_LEN, 2, SUBNET_TABLE, "description"},
1816  {V_NUM, 3},
1817  {V_CHAR, 4, SUBNET_TABLE, "contact"},
1818  {V_CHAR, 5, SUBNET_TABLE, "account_number"},
1819  {V_NUM, 6},
1820  {V_NUM, 7},
1821  {V_NUM, 8},
1822  {V_NUM, 9},
1823  {V_LEN, 10, SUBNET_TABLE, "prefix"},
1824  {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
1825  {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
1826};
1827
1828static struct validate usnt_validate =
1829{
1830  usnt_valobj,
1831  13,
1832  "name",
1833  "snet_id = %d",
1834  1,
1835  "snet_id",
1836  0,
1837  setup_asnt,
1838  set_modtime_by_id,
1839};
1840
1841static char *dsnt_fields[] = {
1842  "name",
1843};
1844
1845static struct validate dsnt_validate = {
1846  VOsnet0,
1847  1,
1848  0,
1849  0,
1850  0,
1851  0,
1852  0,
1853  setup_dsnt,
1854  0,
1855};
1856
1857static char *gclu_fields[] = {
1858  "name",
1859  "name", "description", "location", "modtime", "modby", "modwith",
1860};
1861
1862static char *aclu_fields[] = {
1863  "name", "description", "location",
1864};
1865
1866static struct valobj aclu_valobj[] = {
1867  {V_CHAR, 0, CLUSTERS_TABLE, "name"},
1868  {V_LEN, 1, CLUSTERS_TABLE, "description"},
1869  {V_LEN, 2, CLUSTERS_TABLE, "location"},
1870};
1871
1872static struct validate aclu_validate =
1873{
1874  aclu_valobj,
1875  3,
1876  "name",
1877  "name = '%s'",
1878  1,
1879  "clu_id",
1880  0,
1881  prefetch_value,
1882  set_modtime,
1883};
1884
1885static char *uclu_fields[] = {
1886  "name",
1887  "newname", "description", "location",
1888};
1889
1890static struct valobj uclu_valobj[] = {
1891  {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1892  {V_RENAME, 1, CLUSTERS_TABLE, "name", "clu_id", MR_NOT_UNIQUE},
1893  {V_LEN, 2, CLUSTERS_TABLE, "description"},
1894  {V_LEN, 3, CLUSTERS_TABLE, "location"},
1895};
1896
1897static struct validate uclu_validate = {
1898  uclu_valobj,
1899  4,
1900  0,
1901  0,
1902  0,
1903  "clu_id",
1904  0,
1905  0,
1906  set_modtime_by_id,
1907};
1908
1909static char *dclu_fields[] = {
1910  "name",
1911};
1912
1913static struct validate dclu_validate = {
1914  VOclu0,
1915  1,
1916  0,
1917  0,
1918  0,
1919  0,
1920  0,
1921  setup_dclu,
1922  0,
1923};
1924
1925static char *gmcm_fields[] = {
1926  "machine", "cluster",
1927  "machine", "cluster",
1928};
1929
1930static struct valobj amtc_valobj[] =    /* ADD_MACHINE_TO_CLUSTER */
1931{                                       /* DELETE_MACHINE_FROM_CLUSTER */
1932  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
1933  {V_ID, 1, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1934};
1935
1936static struct validate amtc_validate = /* for amtc and dmfc */
1937{
1938  amtc_valobj,
1939  2,
1940  "mach_id",
1941  "mach_id = %d and clu_id = %d",
1942  2,
1943  0,
1944  0,
1945  0,
1946  set_mach_modtime_by_id,
1947};
1948
1949static char *gcld_fields[] = {
1950  "cluster", "serv_label",
1951  "cluster", "serv_label", "serv_cluster",
1952};
1953
1954static char *acld_fields[] = {
1955  "cluster", "serv_label", "serv_cluster",
1956};
1957
1958static struct valobj acld_valobj[] =
1959{
1960  {V_ID, 0, CLUSTERS_TABLE, "name", "clu_id", MR_CLUSTER},
1961  {V_CHAR, 1, SVC_TABLE, "serv_label"},
1962  {V_CHAR, 2, SVC_TABLE, "serv_cluster"}
1963};
1964
1965static struct validate acld_validate =
1966{
1967  acld_valobj,
1968  3,
1969  "clu_id",
1970  "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
1971  3,
1972  0,
1973  0,
1974  0,
1975  set_cluster_modtime_by_id,
1976};
1977
1978static struct validate dcld_validate =
1979{
1980  VOclu0,
1981  1,
1982  "clu_id",
1983  "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
1984  3,
1985  0,
1986  0,
1987  0,
1988  set_cluster_modtime_by_id,
1989};
1990
1991static char *glin2_fields[] = {
1992  "name",
1993  "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
1994  "ace_type", "ace_name", "description", "modtime", "modby", "modwith",
1995};
1996
1997static char *glin3_fields[] = {
1998  "name",
1999  "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
2000  "nfsgroup", "ace_type", "ace_name", "description", "modtime", "modby",
2001  "modwith",
2002};
2003
2004static char *glin4_fields[] = {
2005  "name",
2006  "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
2007  "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name",
2008  "description", "modtime", "modby", "modwith",
2009};
2010
2011static char *glin_fields[] = {
2012  "name",
2013  "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
2014  "nfsgroup", "mailman", "mailman_server", "ace_type", "ace_name",
2015  "memace_type", "memace_name", "description", "modtime", "modby", "modwith",
2016};
2017
2018static struct validate glin_validate = {
2019  0,
2020  0,
2021  0,
2022  0,
2023  0,
2024  0,
2025  access_vis_list_by_name,
2026  0,
2027  followup_glin,
2028};
2029
2030static char *alis2_fields[] = {
2031  "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
2032  "ace_type", "ace_name", "description",
2033};
2034
2035static struct valobj alis2_valobj[] = {
2036  {V_CHAR, 0, LIST_TABLE, "name"},
2037  {V_NUM, 1},
2038  {V_NUM, 2},
2039  {V_NUM, 3},
2040  {V_NUM, 4},
2041  {V_NUM, 5},
2042  {V_NUM, 6},
2043  {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
2044  {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
2045  {V_LEN, 9, LIST_TABLE, "description"},
2046};
2047
2048static struct validate alis2_validate = {
2049  alis2_valobj,
2050  10,
2051  "name",
2052  "name = '%s'",
2053  1,
2054  "list_id",
2055  0,
2056  setup_alis,
2057  set_modtime,
2058};
2059
2060static char *alis3_fields[] = {
2061  "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
2062  "nfsgroup", "ace_type", "ace_name", "description",
2063};
2064
2065static struct valobj alis3_valobj[] = {
2066  {V_CHAR, 0, LIST_TABLE, "name"},
2067  {V_NUM, 1},
2068  {V_NUM, 2},
2069  {V_NUM, 3},
2070  {V_NUM, 4},
2071  {V_NUM, 5},
2072  {V_NUM, 6},
2073  {V_NUM, 7},
2074  {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
2075  {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
2076  {V_LEN, 10, LIST_TABLE, "description"},
2077};
2078
2079static struct validate alis3_validate = {
2080  alis3_valobj,
2081  11,
2082  "name",
2083  "name = '%s'",
2084  1,
2085  "list_id",
2086  0,
2087  setup_alis,
2088  set_modtime,
2089};
2090
2091static char *alis4_fields[] = {
2092  "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
2093  "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name",
2094  "description",
2095};
2096
2097static struct valobj alis4_valobj[] = {
2098  {V_CHAR, 0, LIST_TABLE, "name"},
2099  {V_NUM, 1},
2100  {V_NUM, 2},
2101  {V_NUM, 3},
2102  {V_NUM, 4},
2103  {V_NUM, 5},
2104  {V_NUM, 6},
2105  {V_NUM, 7},
2106  {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
2107  {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
2108  {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
2109  {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE},
2110  {V_LEN, 12, LIST_TABLE, "description"},
2111};
2112
2113static struct validate alis4_validate = {
2114  alis4_valobj,
2115  13,
2116  "name",
2117  "name = '%s'",
2118  1,
2119  "list_id",
2120  0,
2121  setup_alis,
2122  set_modtime,
2123};
2124
2125static char *alis_fields[] = {
2126  "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
2127  "nfsgroup", "mailman", "mailman_server", "ace_type", "ace_name",
2128  "memace_type", "memace_name", "description",
2129};
2130
2131static struct valobj alis_valobj[] = {
2132  {V_CHAR, 0, LIST_TABLE, "name"},
2133  {V_NUM, 1},
2134  {V_NUM, 2},
2135  {V_NUM, 3},
2136  {V_NUM, 4},
2137  {V_NUM, 5},
2138  {V_NUM, 6},
2139  {V_NUM, 7},
2140  {V_NUM, 8},
2141  {V_ID, 9, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2142  {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
2143  {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE},
2144  {V_TYPE, 12, 0, "ace_type", 0, MR_ACE},
2145  {V_TYPEDATA, 13, 0, 0, "list_id", MR_ACE},
2146  {V_LEN, 14, LIST_TABLE, "description"},
2147};
2148
2149static struct validate alis_validate = {
2150  alis_valobj,
2151  15,
2152  "name",
2153  "name = '%s'",
2154  1,
2155  "list_id",
2156  0,
2157  setup_alis,
2158  set_modtime,
2159};
2160
2161static char *ulis2_fields[] = {
2162  "name",
2163  "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
2164  "ace_type", "ace_name", "description",
2165};
2166
2167static struct valobj ulis2_valobj[] = {
2168  {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
2169  {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
2170  {V_NUM, 2},
2171  {V_NUM, 3},
2172  {V_NUM, 4},
2173  {V_NUM, 5},
2174  {V_NUM, 6},
2175  {V_NUM, 7},
2176  {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
2177  {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
2178  {V_LEN, 10, LIST_TABLE, "description"},
2179};
2180
2181static struct validate ulis2_validate = {
2182  ulis2_valobj,
2183  11,
2184  "name",
2185  "list_id = %d",
2186  1,
2187  "list_id",
2188  access_list,
2189  setup_alis,
2190  set_modtime_by_id,
2191};
2192
2193static char *ulis3_fields[] = {
2194  "name",
2195  "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
2196  "nfsgroup", "ace_type", "ace_name", "description",
2197};
2198
2199static struct valobj ulis3_valobj[] = {
2200  {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
2201  {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
2202  {V_NUM, 2},
2203  {V_NUM, 3},
2204  {V_NUM, 4},
2205  {V_NUM, 5},
2206  {V_NUM, 6},
2207  {V_NUM, 7},
2208  {V_NUM, 8},
2209  {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
2210  {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
2211  {V_LEN, 11, LIST_TABLE, "description"},
2212};
2213
2214static struct validate ulis3_validate = {
2215  ulis3_valobj,
2216  12,
2217  "name",
2218  "list_id = %d",
2219  1,
2220  "list_id",
2221  access_list,
2222  setup_alis,
2223  set_modtime_by_id,
2224};
2225
2226static char *ulis4_fields[] = {
2227  "name",
2228  "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
2229  "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name",
2230  "description",
2231};
2232
2233static struct valobj ulis4_valobj[] = {
2234  {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
2235  {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
2236  {V_NUM, 2},
2237  {V_NUM, 3},
2238  {V_NUM, 4},
2239  {V_NUM, 5},
2240  {V_NUM, 6},
2241  {V_NUM, 7},
2242  {V_NUM, 8},
2243  {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
2244  {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
2245  {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
2246  {V_TYPEDATA, 12, 0, 0, "list_id", MR_ACE},
2247  {V_LEN, 13, LIST_TABLE, "description"},
2248};
2249
2250static struct validate ulis4_validate = {
2251  ulis4_valobj,
2252  14,
2253  "name",
2254  "list_id = %d",
2255  1,
2256  "list_id",
2257  access_list,
2258  setup_alis,
2259  set_modtime_by_id,
2260};
2261
2262static char *ulis_fields[] = {
2263  "name",
2264  "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
2265  "nfsgroup", "mailman", "mailman_server", "ace_type", "ace_name",
2266  "memace_type", "memace_name", "description",
2267};
2268
2269static struct valobj ulis_valobj[] = {
2270  {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
2271  {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
2272  {V_NUM, 2},
2273  {V_NUM, 3},
2274  {V_NUM, 4},
2275  {V_NUM, 5},
2276  {V_NUM, 6},
2277  {V_NUM, 7},
2278  {V_NUM, 8},
2279  {V_NUM, 9},
2280  {V_ID, 10, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2281  {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
2282  {V_TYPEDATA, 12, 0, 0, "list_id", MR_ACE},
2283  {V_TYPE, 13, 0, "ace_type", 0, MR_ACE},
2284  {V_TYPEDATA, 14, 0, 0, "list_id", MR_ACE},
2285  {V_LEN, 15, LIST_TABLE, "description"},
2286};
2287
2288static struct validate ulis_validate = {
2289  ulis_valobj,
2290  16,
2291  "name",
2292  "list_id = %d",
2293  1,
2294  "list_id",
2295  access_list,
2296  setup_alis,
2297  set_modtime_by_id,
2298};
2299
2300static char *dlis_fields[] = {
2301  "name",
2302};
2303
2304static struct validate dlis_validate = {
2305  VOlist0,
2306  1,
2307  "name",
2308  "list_id = %d",
2309  1,
2310  0,
2311  access_list,
2312  setup_dlis,
2313  0,
2314};
2315
2316static char *amtl_fields[] = {
2317  "list_name", "member_type", "member_name",
2318};
2319
2320static char *atml_fields[] = {
2321  "list_name", "member_type", "member_name", "tag",
2322};
2323
2324static struct valobj amtl_valobj[] = {
2325  {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
2326  {V_TYPE, 1, 0, "member", 0, MR_TYPE},
2327  {V_TYPEDATA, 2, 0, 0, 0, MR_NO_MATCH},
2328  {V_ID, 3, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
2329};
2330
2331static struct validate amtl_validate =
2332{
2333  amtl_valobj,
2334  3,
2335  0,
2336  0,
2337  0,
2338  0,
2339  access_list,
2340  0,
2341  add_member_to_list,
2342};
2343
2344static struct validate atml_validate =
2345{
2346  amtl_valobj,
2347  4,
2348  0,
2349  0,
2350  0,
2351  0,
2352  access_list,
2353  0,
2354  add_member_to_list,
2355};
2356
2357static struct validate tmol_validate =
2358{
2359  amtl_valobj,
2360  4,
2361  0,
2362  0,
2363  0,
2364  0,
2365  access_list,
2366  0,
2367  tag_member_of_list,
2368};
2369
2370static struct validate dmfl_validate =
2371{
2372  amtl_valobj,
2373  3,
2374  0,
2375  0,
2376  0,
2377  0,
2378  access_list,
2379  0,
2380  delete_member_from_list,
2381};
2382
2383static char *gaus_fields[] = {
2384  "ace_type", "ace_name",
2385  "use_type", "use_name",
2386};
2387
2388static struct valobj gaus_valobj[] = {
2389  {V_TYPE, 0, 0, "gaus", 0, MR_TYPE},
2390  {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
2391};
2392
2393static struct validate gaus_validate = {
2394  gaus_valobj,
2395  2,
2396  0,
2397  0,
2398  0,
2399  0,
2400  access_member,
2401  0,
2402  get_ace_use,
2403};
2404
2405static char *ghbo_fields[] = {
2406  "ace_type", "ace_name",
2407  "name",
2408};
2409
2410static struct valobj ghbo_valobj[] = {
2411  {V_TYPE, 0, 0, "gaus", 0, MR_TYPE},
2412  {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
2413};
2414
2415static struct validate ghbo_validate = {
2416  ghbo_valobj,
2417  2,
2418  0,
2419  0,
2420  0,
2421  0,
2422  access_member,
2423  0,
2424  get_host_by_owner,
2425};
2426
2427static char *qgli_fields[] = {
2428  "active", "publicflg", "hidden", "maillist", "grouplist",
2429  "list",
2430};
2431
2432static struct valobj qgli_valobj[] = {
2433  {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
2434  {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
2435  {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
2436  {V_TYPE, 3, 0, "boolean", 0, MR_TYPE},
2437  {V_TYPE, 4, 0, "boolean", 0, MR_TYPE},
2438};
2439
2440static struct validate qgli_validate = {
2441  qgli_valobj,
2442  5,
2443  0,
2444  0,
2445  0,
2446  0,
2447  access_qgli,
2448  0,
2449  qualified_get_lists,
2450};
2451
2452static char *gmol_fields[] = {
2453  "list_name",
2454  "member_type", "member_name",
2455};
2456
2457static char *gtml_fields[] = {
2458  "list_name",
2459  "member_type", "member_name", "tag",
2460};
2461
2462static struct validate gmol_validate = {
2463  VOlist0,
2464  1,
2465  0,
2466  0,
2467  0,
2468  0,
2469  access_visible_list,
2470  0,
2471  get_members_of_list,
2472};
2473
2474static char *glom_fields[] = {
2475  "member_type", "member_name",
2476  "list_name", "active", "publicflg", "hidden", "maillist", "grouplist",
2477};
2478
2479static struct valobj glom_valobj[] = {
2480  {V_TYPE, 0, 0, "rmember", 0, MR_TYPE},
2481  {V_TYPEDATA, 1, 0, 0, 0, MR_NO_MATCH},
2482};
2483
2484static struct validate glom_validate = {
2485  glom_valobj,
2486  2,
2487  0,
2488  0,
2489  0,
2490  0,
2491  access_member,
2492  0,
2493  get_lists_of_member,
2494};
2495
2496static char *cmol_fields[] = {
2497  "list_name",
2498  "count",
2499};
2500
2501static struct validate cmol_validate = {
2502  VOlist0,
2503  1,
2504  0,
2505  0,
2506  0,
2507  0,
2508  access_visible_list,
2509  0,
2510  count_members_of_list,
2511};
2512
2513static char *gsin_fields[] = {
2514  "service",
2515  "service", "update_int", "target_file", "script", "dfgen", "dfcheck",
2516  "type", "enable", "inprogress", "harderror", "errmsg",
2517  "ace_type", "ace_name", "modtime", "modby", "modwith",
2518};
2519
2520static struct validate gsin_validate =
2521{
2522  0,
2523  0,
2524  0,
2525  0,
2526  0,
2527  0,
2528  access_service,
2529  0,
2530  followup_gsin,
2531};
2532
2533static char *qgsv_fields[] = {
2534  "enable", "inprogress", "harderror",
2535  "service",
2536};
2537
2538static struct valobj qgsv_valobj[] = {
2539  {V_TYPE, 0, 0, "boolean", 0, MR_TYPE},
2540  {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
2541  {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
2542};
2543
2544static struct validate qgsv_validate = {
2545  qgsv_valobj,
2546  3,
2547  0,
2548  0,
2549  0,
2550  0,
2551  0,
2552  0,
2553  qualified_get_server,
2554};
2555
2556static char *asin_fields[] = {
2557  "service", "update_int", "target_file", "script", "type", "enable",
2558  "ace_type", "ace_name",
2559};
2560
2561static struct valobj asin_valobj[] = {
2562  {V_CHAR, 0, SERVERS_TABLE, "name"},
2563  {V_NUM, 1},
2564  {V_LEN, 2, SERVERS_TABLE, "target_file"},
2565  {V_LEN, 3, SERVERS_TABLE, "script"},
2566  {V_TYPE, 4, 0, "service", 0, MR_TYPE},
2567  {V_NUM, 5},
2568  {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
2569  {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
2570};
2571
2572static struct validate asin_validate =  /* for asin, usin */
2573{
2574  asin_valobj,
2575  8,
2576  "name",
2577  "name = UPPER('%s')",
2578  1,
2579  0,
2580  0,
2581  0,
2582  set_uppercase_modtime,
2583};
2584
2585static struct validate rsve_validate = {
2586  asin_valobj,
2587  1,
2588  "name",
2589  "name = UPPER('%s')",
2590  1,
2591  0,
2592  access_service,
2593  0,
2594  set_uppercase_modtime,
2595};
2596
2597static char *ssif_fields[] = {
2598  "service", "dfgen", "dfcheck", "inprogress", "harderror", "errmsg",
2599};
2600
2601static struct valobj ssif_valobj[] = {
2602  {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
2603  {V_NUM, 1},
2604  {V_NUM, 2},
2605  {V_NUM, 3},
2606  {V_NUM, 4},
2607  {V_LEN, 5, SERVERS_TABLE, "errmsg"},
2608};
2609
2610static struct validate ssif_validate = {
2611  ssif_valobj,
2612  6,
2613  "name",
2614  "name = UPPER('%s')",
2615  1,
2616  0,
2617  0,
2618  0,
2619  0,
2620};
2621
2622static char *dsin_fields[] = {
2623  "service",
2624};
2625
2626static struct validate dsin_validate = {
2627  asin_valobj,
2628  1,
2629  "name",
2630  "name = UPPER('%s')",
2631  1,
2632  0,
2633  0,
2634  setup_dsin,
2635  0,
2636};
2637
2638static char *gshi_fields[] = {
2639  "service", "machine",
2640  "service", "machine", "enable", "override", "success", "inprogress",
2641  "hosterror", "hosterrormsg", "ltt", "lts", "value1", "value2",
2642  "value3", "modtime", "modby", "modwith",
2643};
2644
2645static struct validate gshi_validate = {
2646  0,
2647  0,
2648  0,
2649  0,
2650  0,
2651  0,
2652  access_service,
2653  0,
2654  followup_fix_modby,
2655};
2656
2657static char *qgsh_fields[] = {
2658  "service", "enable", "override", "success", "inprogress", "hosterror",
2659  "service", "machine",
2660};
2661
2662static struct valobj qgsh_valobj[] = {
2663  {V_TYPE, 1, 0, "boolean", 0, MR_TYPE},
2664  {V_TYPE, 2, 0, "boolean", 0, MR_TYPE},
2665  {V_TYPE, 3, 0, "boolean", 0, MR_TYPE},
2666  {V_TYPE, 4, 0, "boolean", 0, MR_TYPE},
2667  {V_TYPE, 5, 0, "boolean", 0, MR_TYPE},
2668};
2669
2670static struct validate qgsh_validate = {
2671  qgsh_valobj,
2672  5,
2673  0,
2674  0,
2675  0,
2676  0,
2677  0,
2678  0,
2679  qualified_get_serverhost,
2680};
2681
2682static char *ashi_fields[] = {
2683  "service", "machine", "enable", "value1", "value2", "value3",
2684};
2685
2686static struct valobj ashi_valobj[] = {
2687  {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
2688  {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2689  {V_NUM, 2},
2690  {V_NUM, 3},
2691  {V_NUM, 4},
2692  {V_LEN, 5, SERVERHOSTS_TABLE, "value3"},
2693};
2694
2695static struct validate ashi_validate = /* ashi & ushi */
2696{
2697  ashi_valobj,
2698  6,
2699  "service",
2700  "service = UPPER('%s') AND mach_id = %d",
2701  2,
2702  0,
2703  access_service,
2704  0,
2705  set_serverhost_modtime,
2706};
2707
2708static struct validate rshe_validate =
2709{
2710  ashi_valobj,
2711  2,
2712  "service",
2713  "service = UPPER('%s') AND mach_id = %d",
2714  2,
2715  0,
2716  access_service,
2717  0,
2718  set_serverhost_modtime,
2719};
2720
2721static struct validate ssho_validate =
2722{
2723  ashi_valobj,
2724  2,
2725  "service",
2726  "service = UPPER('%s') AND mach_id = %d",
2727  2,
2728  0,
2729  access_service,
2730  0,
2731  trigger_dcm,
2732};
2733
2734static char *sshi_fields[] = {
2735  "service", "machine", "override", "success", "inprogress",
2736  "hosterror", "errmsg", "ltt", "lts",
2737};
2738
2739static struct valobj sshi_valobj[] = {
2740  {V_NAME, 0, SERVERS_TABLE, "name", 0, MR_SERVICE},
2741  {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2742  {V_NUM, 2},
2743  {V_NUM, 3},
2744  {V_NUM, 4},
2745  {V_NUM, 5},
2746  {V_LEN, 6, SERVERHOSTS_TABLE, "hosterrmsg"},
2747  {V_NUM, 7},
2748  {V_NUM, 8},
2749};
2750
2751static struct validate sshi_validate =
2752{
2753  sshi_valobj,
2754  9,
2755  0,
2756  0,
2757  0,
2758  0,
2759  0,
2760  0,
2761  0,
2762};
2763
2764static char *dshi_fields[] = {
2765  "service", "machine",
2766};
2767
2768static struct validate dshi_validate =
2769{
2770  ashi_valobj,
2771  2,
2772  "service",
2773  "service = UPPER('%s') AND mach_id = %d",
2774  2,
2775  0,
2776  access_service,
2777  setup_dshi,
2778  0,
2779};
2780
2781static char *gslo_fields[] = {
2782  "server",
2783  "server", "machine",
2784};
2785
2786static char *gfsl_fields[] = {
2787  "label",
2788  "label", "type", "machine", "name", "mount", "access", "comments",
2789  "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2790};
2791
2792static struct validate gfsl_validate = {
2793  0,
2794  0,
2795  0,
2796  0,
2797  0,
2798  0,
2799  0,
2800  0,
2801  followup_fix_modby,
2802};
2803
2804static char *gfsm_fields[] = {
2805  "machine",
2806  "label", "type", "machine", "name", "mount", "access", "comments",
2807  "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2808};
2809
2810static struct validate gfsm_validate = {
2811  VOmach0,
2812  1,
2813  0,
2814  0,
2815  0,
2816  0,
2817  0,
2818  0,
2819  followup_fix_modby,
2820};
2821
2822static char *gfsn_fields[] = {
2823  "machine", "partition",
2824  "label", "type", "machine", "name", "mount", "access", "comments",
2825  "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2826};
2827
2828static struct validate gfsn_validate = {
2829  VOmach0,
2830  1,
2831  0,
2832  0,
2833  0,
2834  0,
2835  0,
2836  0,
2837  followup_fix_modby,
2838};
2839
2840static char *gfsp_fields[] = {
2841  "path",
2842  "label", "type", "machine", "name", "mount", "access", "comments",
2843  "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2844};
2845
2846static char *gfsg_fields[] = {
2847  "list",
2848  "label", "type", "machine", "name", "mount", "access", "comments",
2849  "owner", "owners", "create", "lockertype", "modtime", "modby", "modwith",
2850};
2851
2852static struct validate gfsg_validate = {
2853  VOlist0,
2854  1,
2855  0,
2856  0,
2857  0,
2858  0,
2859  access_list,
2860  0,
2861  followup_fix_modby,
2862};
2863
2864static char *afil_fields[] = {
2865  "label", "type", "machine", "name", "mount", "access", "comments",
2866  "owner", "owners", "create", "lockertype",
2867};
2868
2869static struct valobj afil_valobj[] = {
2870  {V_CHAR, 0, FILESYS_TABLE, "label"},
2871  {V_TYPE, 1, 0, "filesys", 0, MR_FSTYPE},
2872  {V_ID, 2, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2873  {V_CHAR, 3, FILESYS_TABLE, "name"},
2874  {V_LEN, 4, FILESYS_TABLE, "mount"},
2875  {V_LEN, 5, FILESYS_TABLE, "rwaccess"},
2876  {V_LEN, 6, FILESYS_TABLE, "comments"},
2877  {V_ID, 7, USERS_TABLE, "login", "users_id", MR_USER},
2878  {V_ID, 8, LIST_TABLE, "name", "list_id", MR_LIST},
2879  {V_NUM, 9},
2880  {V_TYPE, 10, 0, "lockertype", 0, MR_TYPE},
2881};
2882
2883static struct validate afil_validate = {
2884  afil_valobj,
2885  11,
2886  "label",
2887  "label = '%s'",
2888  1,
2889  "filsys_id",
2890  0,
2891  setup_afil,
2892  set_filesys_modtime,
2893};
2894
2895static char *ufil_fields[] = {
2896  "label", "newlabel", "type", "machine", "name", "mount", "access",
2897  "comments", "owner", "owners", "create", "lockertype",
2898};
2899
2900static struct valobj ufil_valobj[] = {
2901  {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2902  {V_RENAME, 1, FILESYS_TABLE, "label", "filsys_id", MR_NOT_UNIQUE},
2903  {V_TYPE, 2, 0, "filesys", 0, MR_FSTYPE},
2904  {V_ID, 3, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
2905  {V_CHAR, 4, FILESYS_TABLE, "name"},
2906  {V_LEN, 5, FILESYS_TABLE, "mount"},
2907  {V_LEN, 6, FILESYS_TABLE, "rwaccess"},
2908  {V_LEN, 7, FILESYS_TABLE, "comments"},
2909  {V_ID, 8, USERS_TABLE, "login", "users_id", MR_USER},
2910  {V_ID, 9, LIST_TABLE, "name", "list_id", MR_LIST},
2911  {V_NUM, 10},
2912  {V_TYPE, 11, 0, "lockertype", 0, MR_TYPE},
2913};
2914
2915static struct validate ufil_validate = {
2916  ufil_valobj,
2917  12,
2918  "label",
2919  "filsys_id = %d",
2920  1,
2921  "filsys_id",
2922  0,
2923  setup_ufil,
2924  set_filesys_modtime,
2925};
2926
2927static char *dfil_fields[] = {
2928  "label",
2929};
2930
2931static struct validate dfil_validate = {
2932  VOfilesys0,
2933  1,
2934  "label",
2935  "filsys_id = %d",
2936  1,
2937  0,
2938  0,
2939  setup_dfil,
2940  0,
2941};
2942
2943static char *gfgm_fields[] = {
2944  "fsgroup", "filesys", "sortkey"
2945};
2946
2947static struct validate gfgm_validate = {
2948  VOfilesys0,
2949  1,
2950  0,
2951  0,
2952  0,
2953  0,
2954  0,
2955  0,
2956  0,
2957};
2958
2959static struct valobj aftg_valobj[] = {
2960  {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2961  {V_ID, 1, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
2962};
2963
2964static struct validate aftg_validate = {
2965  aftg_valobj,
2966  2,
2967  "group_id",
2968  "group_id = %d and filsys_id = %d",
2969  2,
2970  0,
2971  0,
2972  0,
2973  0,
2974};
2975
2976static char *ganf_fields[] = {
2977  "machine", "dir", "device", "status", "allocated", "size",
2978  "modtime", "modby", "modwith",
2979};
2980
2981static char *gnfp_fields[] = {
2982  "machine", "dir",
2983  "machine", "dir", "device", "status", "allocated", "size",
2984  "modtime", "modby", "modwith",
2985};
2986
2987static struct validate gnfp_validate = {
2988  VOmach0,
2989  1,
2990  0,
2991  0,
2992  0,
2993  0,
2994  0,
2995  0,
2996  followup_fix_modby,
2997};
2998
2999static struct valobj anfp_valobj[] = {
3000  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3001  {V_CHAR, 1, NFSPHYS_TABLE, "dir"},
3002  {V_LEN, 2, NFSPHYS_TABLE, "device"},
3003  {V_NUM, 3},
3004  {V_NUM, 4},
3005  {V_NUM, 5},
3006};
3007
3008static struct validate anfp_validate = {
3009  anfp_valobj,
3010  6,
3011  "dir",
3012  "mach_id = %d and dir = '%s'",
3013  2,
3014  "nfsphys_id",
3015  0,
3016  prefetch_value,
3017  set_nfsphys_modtime,
3018};
3019
3020static struct validate unfp_validate = {
3021  anfp_valobj,
3022  6,
3023  "dir",
3024  "mach_id = %d and dir = '%s'",
3025  2,
3026  "nfsphys_id",
3027  0,
3028  0,
3029  set_nfsphys_modtime,
3030};
3031
3032static char *ajnf_fields[] = {
3033  "machine", "dir", "adjustment",
3034};
3035
3036static struct valobj ajnf_valobj[] = {
3037  {V_ID, 0, MACHINE_TABLE, NAME, "mach_id", MR_MACHINE},
3038  {V_CHAR, 1, NFSPHYS_TABLE, "dir"},
3039  {V_NUM, 2},
3040};
3041
3042static struct validate ajnf_validate = {
3043  ajnf_valobj,
3044  3,
3045  "dir",
3046  "mach_id = %d and dir = '%s'",
3047  2,
3048  "nfsphys_id",
3049  0,
3050  0,
3051  set_nfsphys_modtime,
3052};
3053
3054static char *dnfp_fields[] = {
3055  "machine", "dir",
3056};
3057
3058static struct validate dnfp_validate = {
3059  anfp_valobj,
3060  2,
3061  "dir",
3062  "mach_id = %d and dir = '%s'",
3063  2,
3064  "nfsphys_id",
3065  0,
3066  setup_dnfp,
3067  set_nfsphys_modtime,
3068};
3069
3070static char *gqot_fields[] = {
3071  "filesys", "type", "name",
3072  "filesys", "type", "name", "quota", "dir", "machine",
3073  "modtime", "modby", "modwith",
3074};
3075
3076static struct valobj gqot_valobj[] = {
3077  {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
3078  {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
3079};
3080
3081static struct validate gqot_validate = {
3082  gqot_valobj,
3083  2,
3084  0,
3085  0,
3086  0,
3087  0,
3088  0,
3089  0,
3090  followup_gqot,
3091};
3092
3093static char *gqbf_fields[] = {
3094  "filesys",
3095  "filesys", "type", "name", "quota", "dir", "machine",
3096  "modtime", "modby", "modwith",
3097};
3098
3099static struct validate gqbf_validate = {
3100  0,
3101  0,
3102  0,
3103  0,
3104  0,
3105  0,
3106  0,
3107  0,
3108  followup_gqot,
3109};
3110
3111static char *aqot_fields[] = {
3112  "filesys", "type", "name", "quota",
3113};
3114
3115static struct valobj aqot_valobj[] = {
3116  {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
3117  {V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
3118  {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
3119  {V_NUM, 3},
3120};
3121
3122static struct validate aqot_validate = {
3123  aqot_valobj,
3124  4,
3125  "filsys_id",
3126  "filsys_id = %d and type = '%s' and entity_id = %d",
3127  3,
3128  0,
3129  0,
3130  prefetch_filesys,
3131  followup_aqot,
3132};
3133
3134static struct validate uqot_validate = {
3135  aqot_valobj,
3136  4,
3137  "filsys_id",
3138  "filsys_id = %d AND type = '%s' AND entity_id = %d",
3139  3,
3140  0,
3141  0,
3142  setup_dqot,
3143  followup_aqot,
3144};
3145
3146static struct validate dqot_validate = {
3147  aqot_valobj,
3148  3,
3149  "filsys_id",
3150  "filsys_id = %d AND type = '%s' AND entity_id = %d",
3151  3,
3152  0,
3153  0,
3154  setup_dqot,
3155  followup_dqot,
3156};
3157
3158static char *gnfq_fields[] = {
3159  "filesys", "login",
3160  "filesys", "login", "quota", "dir", "machine",
3161  "modtime", "modby", "modwith",
3162};
3163
3164static struct validate gnfq_validate = {
3165  0,
3166  0,
3167  0,
3168  0,
3169  0,
3170  0,
3171  0,
3172  0,
3173  followup_gqot,
3174};
3175
3176static char *gnqp_fields[] = {
3177  "machine", "dir",
3178  "filesys", "login", "quota", "dir", "machine",
3179  "modtime", "modby", "modwith",
3180};
3181
3182static char *anfq_fields[] = {
3183  "filesys", "login", "quota",
3184};
3185
3186static struct valobj anfq_valobj[] = {
3187  {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
3188  {V_ID, 1, USERS_TABLE, "login", "users_id", MR_USER},
3189  {V_NUM, 2},
3190};
3191
3192static struct validate anfq_validate = {
3193  anfq_valobj,
3194  3,
3195  "filsys_id",
3196  "filsys_id = %d AND type = 'USER' AND entity_id = %d",
3197  2,
3198  0, /* object ? */
3199  0,
3200  prefetch_filesys,
3201  followup_aqot,
3202};
3203
3204static struct validate unfq_validate = {
3205  anfq_valobj,
3206  3,
3207  "filsys_id",
3208  "filsys_id = %d AND type = 'USER' AND entity_id = %d",
3209  2,
3210  0,
3211  0,
3212  setup_dqot,
3213  followup_aqot,
3214};
3215
3216static struct validate dnfq_validate = {
3217  anfq_valobj,
3218  3,
3219  "filsys_id",
3220  "filsys_id = %d AND entity_id = %d",
3221  2,
3222  0,
3223  0,
3224  setup_dqot,
3225  followup_dqot,
3226};
3227
3228static char *gzcl2_fields[] = {
3229  "class",
3230  "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
3231  "iws_type", "iws_name", "iui_type", "iui_name",
3232  "modtime", "modby", "modwith",
3233};
3234
3235static char *gzcl_fields[] = {
3236  "class",
3237  "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
3238  "iws_type", "iws_name", "iui_type", "iui_name", "owner_type",
3239  "owner_id", "modtime", "modby", "modwith",
3240};
3241
3242static struct validate gzcl_validate = {
3243  0,
3244  0,
3245  0,
3246  0,
3247  0,
3248  0,
3249  access_zephyr,
3250  0,
3251  followup_gzcl,
3252};
3253
3254static char *azcl2_fields[] = {
3255  "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
3256  "iws_type", "iws_name", "iui_type", "iui_name",
3257}; 
3258
3259static struct valobj azcl2_valobj[] = {
3260  {V_CHAR, 0, ZEPHYR_TABLE, "class"},
3261  {V_TYPE, 1, 0, "zace_type", 0, MR_ACE},
3262  {V_TYPEDATA, 2, 0, 0, "list_id", MR_ACE},
3263  {V_TYPE, 3, 0, "zace_type", 0, MR_ACE},
3264  {V_TYPEDATA, 4, 0, 0, "list_id", MR_ACE},
3265  {V_TYPE, 5, 0, "zace_type", 0, MR_ACE},
3266  {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
3267  {V_TYPE, 7, 0, "zace_type", 0, MR_ACE},
3268  {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
3269};
3270
3271static struct validate azcl2_validate = {
3272  azcl2_valobj,
3273  9,
3274  "class",
3275  "class = '%s'",
3276  1,
3277  0,
3278  0,
3279  0,
3280  set_zephyr_modtime,
3281};
3282
3283static char *azcl_fields[] = {
3284  "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
3285  "iws_type", "iws_name", "iui_type", "iui_name", "owner_type",
3286  "owner_id",
3287};
3288
3289static struct valobj azcl_valobj[] = {
3290  {V_CHAR, 0, ZEPHYR_TABLE, "class"},
3291  {V_TYPE, 1, 0, "zace_type", 0, MR_ACE},
3292  {V_TYPEDATA, 2, 0, 0, "list_id", MR_ACE},
3293  {V_TYPE, 3, 0, "zace_type", 0, MR_ACE},
3294  {V_TYPEDATA, 4, 0, 0, "list_id", MR_ACE},
3295  {V_TYPE, 5, 0, "zace_type", 0, MR_ACE},
3296  {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
3297  {V_TYPE, 7, 0, "zace_type", 0, MR_ACE},
3298  {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
3299  {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
3300  {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
3301};
3302
3303static struct validate azcl_validate = {
3304  azcl_valobj,
3305  11,
3306  "class",
3307  "class = '%s'",
3308  1,
3309  0,
3310  0,
3311  0,
3312  set_zephyr_modtime,
3313};
3314
3315static char *uzcl2_fields[] = {
3316  "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
3317  "iws_type", "iws_name", "iui_type", "iui_name",
3318};
3319
3320static struct valobj uzcl2_valobj[] = {
3321  {V_NAME, 0, ZEPHYR_TABLE, "class", 0, MR_BAD_CLASS},
3322  {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE},
3323  {V_TYPE, 2, 0, "zace_type", 0, MR_ACE},
3324  {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE},
3325  {V_TYPE, 4, 0, "zace_type", 0, MR_ACE},
3326  {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE},
3327  {V_TYPE, 6, 0, "zace_type", 0, MR_ACE},
3328  {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
3329  {V_TYPE, 8, 0, "zace_type", 0, MR_ACE},
3330  {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
3331};
3332
3333static struct validate uzcl2_validate = {
3334  uzcl2_valobj,
3335  10,
3336  "class",
3337  "class = '%s'",
3338  1,
3339  0,
3340  access_zephyr,
3341  0,
3342  set_zephyr_modtime,
3343};
3344
3345static char *uzcl_fields[] = {
3346  "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
3347  "iws_type", "iws_name", "iui_type", "iui_name", "owner_type", "owner_id",
3348};
3349
3350static struct valobj uzcl_valobj[] = {
3351  {V_NAME, 0, ZEPHYR_TABLE, "class", 0, MR_BAD_CLASS},
3352  {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE},
3353  {V_TYPE, 2, 0, "zace_type", 0, MR_ACE},
3354  {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE},
3355  {V_TYPE, 4, 0, "zace_type", 0, MR_ACE},
3356  {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE},
3357  {V_TYPE, 6, 0, "zace_type", 0, MR_ACE},
3358  {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
3359  {V_TYPE, 8, 0, "zace_type", 0, MR_ACE},
3360  {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
3361  {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
3362  {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE},
3363};
3364
3365static struct validate uzcl_validate = {
3366  uzcl_valobj,
3367  12,
3368  "class",
3369  "class = '%s'",
3370  1,
3371  0,
3372  access_zephyr,
3373  0,
3374  set_zephyr_modtime,
3375};
3376
3377static struct validate dzcl_validate = {
3378  0,
3379  0,
3380  "class",
3381  "class = '%s'",
3382  1,
3383  0,
3384  0,
3385  0,
3386  0,
3387};
3388
3389static char *gsha_fields[] = {
3390  "machine",
3391  "machine", "ace_type", "ace_name", "modtime", "modby", "modwith",
3392};
3393
3394static struct validate gsha_validate =
3395{
3396  0,
3397  0,
3398  0,
3399  0,
3400  0,
3401  0,
3402  0,
3403  0,
3404  followup_gsha,
3405};
3406
3407static char *asha_fields[] = {
3408  "machine", "ace_type", "ace_name",
3409};
3410
3411static struct valobj asha_valobj[] = {
3412  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3413  {V_TYPE, 1, 0, "ace_type", 0, MR_ACE},
3414  {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
3415};
3416
3417static struct validate asha_validate =
3418{
3419  asha_valobj,
3420  3,
3421  "mach_id",
3422  "mach_id = %d",
3423  1,
3424  "mach_id",
3425  0,
3426  0,
3427  set_modtime_by_id,
3428};
3429
3430static char *gacl_fields[] = {
3431  "machine", "target",
3432  "machine", "target", "kind", "list",
3433};
3434
3435static char *aacl_fields[] = {
3436  "machine", "target", "kind", "list",
3437};
3438
3439static char *dacl_fields[] = {
3440  "machine", "target",
3441};
3442
3443static struct valobj aacl_valobj[] = {
3444  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3445  {V_CHAR, 1, ACL_TABLE, "target"},
3446  {V_TYPE, 2, 0, "acl_kind", 0, MR_TYPE},
3447  {V_ID, 3, LIST_TABLE, "name", "list_id", MR_LIST},
3448};
3449
3450static struct validate gacl_validate =
3451{
3452  aacl_valobj,
3453  1,
3454  NULL,
3455  NULL,
3456  0,
3457  "mach_id",
3458  /* access_acl */ 0,
3459  0,
3460  0,
3461};
3462
3463static struct validate aacl_validate =
3464{
3465  aacl_valobj,
3466  4,
3467  "mach_id",
3468  "mach_id = %d AND target = '%s'",
3469  2,
3470  "mach_id",
3471  /* access_acl */ 0,
3472  0,
3473  0,
3474};
3475
3476static char *gsvc_fields[] = {
3477  "service", "protocol",
3478  "service", "protocol", "port", "description", "modtime", "modby", "modwith",
3479};
3480
3481static char *asvc_fields[] = {
3482  "service", "protocol", "port", "description",
3483};
3484
3485static char *dsvc_fields[] = {
3486  "service", "protocol",
3487};
3488
3489static struct valobj asvc_valobj[] = {
3490  {V_CHAR, 0, SERVICES_TABLE, "name"},
3491  {V_CHAR, 1, SERVICES_TABLE, "protocol"},
3492  {V_NUM, 2},
3493  {V_CHAR, 3, SERVICES_TABLE, "description"},
3494};
3495
3496static struct validate asvc_validate = {
3497  asvc_valobj,
3498  4,
3499  "name",
3500  "name = '%s' AND protocol = '%s'",
3501  2,
3502  0,
3503  0,
3504  0,
3505  set_service_modtime,
3506};
3507
3508static struct validate dsvc_validate = {
3509  asvc_valobj,
3510  2,
3511  "name",
3512  "name = '%s' AND protocol = '%s'",
3513  2,
3514  0,
3515  0,
3516  0,
3517  0,
3518};
3519
3520static char *gprn2_fields[] = {
3521  "name",
3522  "name", "type", "hwtype", "duplexname", "hostname",
3523  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
3524  "banner", "location", "contact", "modtime", "modby", "modwith"
3525};
3526
3527static char *gpbd2_fields[] = {
3528  "duplexname",
3529  "name", "type", "hwtype", "duplexname", "hostname",
3530  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
3531  "banner", "location", "contact", "modtime", "modby", "modwith"
3532};
3533
3534static char *gpbe2_fields[] = {
3535  "hwaddr",
3536  "name", "type", "hwtype", "duplexname", "hostname",
3537  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
3538  "banner", "location", "contact", "modtime", "modby", "modwith"
3539};
3540
3541static char *gpbh2_fields[] = {
3542  "hostname",
3543  "name", "type", "hwtype", "duplexname", "hostname",
3544  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
3545  "banner", "location", "contact", "modtime", "modby", "modwith"
3546};
3547
3548static char *gpbr2_fields[] = {
3549  "rm",
3550  "name", "type", "hwtype", "duplexname", "hostname",
3551  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
3552  "banner", "location", "contact", "modtime", "modby", "modwith"
3553};
3554
3555static char *gpbl2_fields[] = {
3556  "location",
3557  "name", "type", "hwtype", "duplexname", "hostname",
3558  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
3559  "banner", "location", "contact", "modtime", "modby", "modwith"
3560};
3561
3562static char *gpbc2_fields[] = {
3563  "contact",
3564  "name", "type", "hwtype", "duplexname", "hostname",
3565  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
3566  "banner", "location", "contact", "modtime", "modby", "modwith"
3567};
3568
3569static char *gprn_fields[] = {
3570  "name",
3571  "name", "type", "hwtype", "duplexname", "duplexdefault",
3572  "holddefault", "status", "hostname", "loghost", "rm", "rp",
3573  "rq", "ka", "pc", "ac", "lpc_acl", "report_list",  "banner",
3574  "location", "contact", "modtime", "modby", "modwith"
3575};
3576
3577static char *gpbd_fields[] = {
3578  "duplexname",
3579  "name", "type", "hwtype", "duplexname", "duplexdefault",
3580  "holddefault", "status", "hostname", "loghost", "rm", "rp",
3581  "rq", "ka", "pc", "ac", "lpc_acl", "report_list",  "banner",
3582  "location", "contact", "modtime", "modby", "modwith"
3583};
3584
3585static char *gpbe_fields[] = {
3586  "hwaddr",
3587  "name", "type", "hwtype", "duplexname", "duplexdefault",
3588  "holddefault", "status", "hostname", "loghost", "rm", "rp",
3589  "rq", "ka", "pc", "ac", "lpc_acl", "report_list",  "banner",
3590  "location", "contact", "modtime", "modby", "modwith"
3591};
3592
3593static char *gpbh_fields[] = {
3594  "hostname",
3595  "name", "type", "hwtype", "duplexname", "duplexdefault",
3596  "holddefault", "status", "hostname", "loghost", "rm", "rp",
3597  "rq", "ka", "pc", "ac", "lpc_acl", "report_list",  "banner",
3598  "location", "contact", "modtime", "modby", "modwith"
3599};
3600
3601static char *gpbr_fields[] = {
3602  "rm",
3603  "name", "type", "hwtype", "duplexname", "duplexdefault",
3604  "holddefault", "status", "hostname", "loghost", "rm", "rp",
3605  "rq", "ka", "pc", "ac", "lpc_acl", "report_list",  "banner",
3606  "location", "contact", "modtime", "modby", "modwith"
3607};
3608
3609static char *gpbl_fields[] = {
3610  "location",
3611  "name", "type", "hwtype", "duplexname", "duplexdefault",
3612  "holddefault", "status", "hostname", "loghost", "rm", "rp",
3613  "rq", "ka", "pc", "ac", "lpc_acl", "report_list",  "banner",
3614  "location", "contact", "modtime", "modby", "modwith"
3615
3616};
3617
3618static char *gpbc_fields[] = {
3619  "contact",
3620  "name", "type", "hwtype", "duplexname", "duplexdefault",
3621  "holddefault", "status", "hostname", "loghost", "rm", "rp",
3622  "rq", "ka", "pc", "ac", "lpc_acl", "report_list",  "banner",
3623  "location", "contact", "modtime", "modby", "modwith"
3624};
3625
3626static char *aprn2_fields[] = {
3627  "printer", "type", "hwtype", "duplexname", "hostname",
3628  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
3629  "banner", "location", "contact",
3630};
3631
3632static struct valobj aprn2_valobj[] = {
3633  {V_CHAR, 0, PRINTERS_TABLE, "name"},
3634  {V_TYPE, 1, 0, "printertype", 0, MR_TYPE},
3635  {V_TYPE, 2, 0, "printerhwtype", 0, MR_TYPE},
3636  {V_CHAR, 3, PRINTERS_TABLE, "duplexname"},
3637  {V_ID, 4, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3638  {V_ID, 5, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3639  {V_ID, 6, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3640  {V_CHAR, 7, PRINTERS_TABLE, "rp"},
3641  {V_ID, 8, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3642  {V_NUM, 9},
3643  {V_NUM, 10},
3644  {V_ID, 11, LIST_TABLE, "name", "list_id", MR_LIST},
3645  {V_ID, 12, LIST_TABLE, "name", "list_id", MR_LIST},
3646  {V_NUM, 13},
3647  {V_CHAR, 14, PRINTERS_TABLE, "location"},
3648  {V_CHAR, 15, PRINTERS_TABLE, "contact"},
3649};
3650
3651static struct validate aprn2_validate = {
3652  aprn2_valobj,
3653  16,
3654  "name",
3655  "name = '%s'",
3656  1,
3657  0,
3658  access_printer,
3659  setup_aprn,
3660  set_modtime,
3661};
3662
3663static char *aprn_fields[] = {
3664  "printer", "type", "hwtype", "duplexname", "duplexdefault",
3665  "holddefault", "status", "hostname", "loghost", "rm", "rp",
3666  "rq", "ka", "pc", "ac", "lpc_acl", "report_list", "banner",
3667  "location", "contact",
3668};
3669
3670static struct valobj aprn_valobj[] = {
3671  {V_CHAR, 0, PRINTERS_TABLE, "name"},
3672  {V_TYPE, 1, 0, "printertype", 0, MR_TYPE},
3673  {V_TYPE, 2, 0, "printerhwtype", 0, MR_TYPE},
3674  {V_CHAR, 3, PRINTERS_TABLE, "duplexname"},
3675  {V_NUM, 4},
3676  {V_NUM, 5},
3677  {V_NUM, 6},
3678  {V_ID, 7, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3679  {V_ID, 8, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3680  {V_ID, 9, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3681  {V_CHAR, 10, PRINTERS_TABLE, "rp"},
3682  {V_ID, 11, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3683  {V_NUM, 12},
3684  {V_NUM, 13},
3685  {V_ID, 14, LIST_TABLE, "name", "list_id", MR_LIST},
3686  {V_ID, 15, LIST_TABLE, "name", "list_id", MR_LIST},
3687  {V_ID, 16, LIST_TABLE, "name", "list_id", MR_LIST},
3688  {V_NUM, 17},
3689  {V_CHAR, 18, PRINTERS_TABLE, "location"},
3690  {V_CHAR, 19, PRINTERS_TABLE, "contact"},
3691};
3692
3693static struct validate aprn_validate = {
3694  aprn_valobj,
3695  20,
3696  "name",
3697  "name = '%s'",
3698  1,
3699  0,
3700  access_printer,
3701  setup_aprn,
3702  set_modtime,
3703};
3704
3705static char *uprn2_fields[] = {
3706  "printer",
3707  "printer", "type", "hwtype", "duplexname", "hostname",
3708  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
3709  "banner", "location", "contact",
3710};
3711
3712static struct valobj uprn2_valobj[] = {
3713  {V_CHAR, 0, PRINTERS_TABLE, "name"},
3714  {V_CHAR, 1, PRINTERS_TABLE, "name"},
3715  {V_TYPE, 2, 0, "printertype", 0, MR_TYPE},
3716  {V_TYPE, 3, 0, "printerhwtype", 0, MR_TYPE},
3717  {V_CHAR, 4, PRINTERS_TABLE, "duplexname"},
3718  {V_ID, 5, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3719  {V_ID, 6, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3720  {V_ID, 7, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3721  {V_CHAR, 8, PRINTERS_TABLE, "rp"},
3722  {V_ID, 9, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3723  {V_NUM, 10},
3724  {V_NUM, 11},
3725  {V_ID, 12, LIST_TABLE, "name", "list_id", MR_LIST},
3726  {V_ID, 13, LIST_TABLE, "name", "list_id", MR_LIST},
3727  {V_NUM, 14},
3728  {V_CHAR, 15, PRINTERS_TABLE, "location"},
3729  {V_CHAR, 16, PRINTERS_TABLE, "contact"},
3730};
3731
3732static struct validate uprn2_validate = {
3733  uprn2_valobj,
3734  16,
3735  "name",
3736  "name = '%s'",
3737  1,
3738  0,
3739  access_printer,
3740  setup_aprn,
3741  set_modtime,
3742};
3743
3744static char *uprn_fields[] = {
3745  "printer",
3746  "printer", "type", "hwtype", "duplexname", "duplexdefault",
3747  "holddefault", "status", "hostname", "loghost", "rm", "rp",
3748  "rq", "ka", "pc", "ac", "lpc_acl", "report_list", "banner",
3749  "location", "contact",
3750};
3751
3752static struct valobj uprn_valobj[] = {
3753  {V_CHAR, 0, PRINTERS_TABLE, "name"},
3754  {V_CHAR, 1, PRINTERS_TABLE, "name"},
3755  {V_TYPE, 2, 0, "printertype", 0, MR_TYPE},
3756  {V_TYPE, 3, 0, "printerhwtype", 0, MR_TYPE},
3757  {V_CHAR, 4, PRINTERS_TABLE, "duplexname"},
3758  {V_NUM, 5},
3759  {V_NUM, 6},
3760  {V_NUM, 7},
3761  {V_ID, 8, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3762  {V_ID, 9, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3763  {V_ID, 10, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3764  {V_CHAR, 11, PRINTERS_TABLE, "rp"},
3765  {V_ID, 12, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3766  {V_NUM, 13},
3767  {V_NUM, 14},
3768  {V_ID, 15, LIST_TABLE, "name", "list_id", MR_LIST},
3769  {V_ID, 16, LIST_TABLE, "name", "list_id", MR_LIST},
3770  {V_ID, 17, LIST_TABLE, "name", "list_id", MR_LIST},
3771  {V_NUM, 18},
3772  {V_CHAR, 19, PRINTERS_TABLE, "location"},
3773  {V_CHAR, 20, PRINTERS_TABLE, "contact"},
3774};
3775
3776static struct validate uprn_validate = {
3777  uprn_valobj,
3778  20,
3779  "name",
3780  "name = '%s'",
3781  1,
3782  0,
3783  access_printer,
3784  setup_aprn,
3785  set_modtime,
3786};
3787
3788static struct validate dprn_validate = {
3789  0,
3790  0,
3791  "name",
3792  "name = '%s'",
3793  1,
3794  0,
3795  access_printer,
3796  0,
3797  0,
3798};
3799
3800static char *gpsv_fields[] = {
3801  "host",
3802  "host", "kind", "printer_types", "owner_type", "owner_name",
3803  "lpc_acl", "modtime", "modby", "modwith"
3804};
3805
3806static struct valobj gpsv_valobj[] = {
3807  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3808};
3809
3810static struct validate gpsv_validate = {
3811  gpsv_valobj,
3812  1,
3813  0,
3814  0,
3815  0,
3816  0,
3817  0,
3818  0,
3819  followup_gpsv,
3820};
3821
3822static char *apsv_fields[] = {
3823  "host", "kind", "printer_types", "owner_type", "owner_name", "lpc_acl"
3824};
3825
3826static struct valobj apsv_valobj[] = {
3827  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
3828  {V_TYPE, 1, 0, "lpd_kind", 0, MR_TYPE},
3829  {V_ID, 2, STRINGS_TABLE, "string", "string_id", MR_STRING},
3830  {V_TYPE, 3, 0, "ace_type", 0, MR_ACE},
3831  {V_TYPEDATA, 4, 0, 0, 0, MR_ACE},
3832  {V_ID, 5, LIST_TABLE, "name", "list_id", MR_LIST},
3833};
3834
3835static struct validate apsv_validate = {
3836  apsv_valobj,
3837  6,
3838  "mach_id",
3839  "mach_id = %d",
3840  1,
3841  "mach_id",
3842  0,
3843  0,
3844  set_modtime_by_id,
3845};
3846
3847static char *dpsv_fields[] = {
3848  "host",
3849};
3850
3851static struct validate dpsv_validate = {
3852  gpsv_valobj,
3853  1,
3854  "mach_id",
3855  "mach_id = %d",
3856  1,
3857  0,
3858  0,
3859  setup_dpsv,
3860  0,
3861}; 
3862
3863static char *gali_fields[] = {
3864  "name", "type", "trans",
3865  "name", "type", "trans",
3866};
3867
3868static char *aali_fields[] = {
3869  "name", "type", "trans",
3870};
3871
3872static struct valobj aali_valobj[] = {
3873  {V_CHAR, 0, ALIAS_TABLE, "name"},
3874  {V_TYPE, 1, 0, "alias", 0, MR_TYPE},
3875  {V_CHAR, 2, ALIAS_TABLE, "trans"},
3876};
3877
3878static struct validate aali_validate = {
3879  aali_valobj,
3880  3,
3881  "trans",
3882  "name = '%s' and type = '%s' and trans = '%s'",
3883  3,
3884  0,
3885  0,
3886  setup_aali,
3887  0,
3888};
3889
3890static struct validate dali_validate =  /* DELETE_ALIAS */
3891{
3892  0,
3893  0,
3894  "trans",
3895  "name = '%s' and type = '%s' and trans = '%s'",
3896  3,
3897  0,
3898  0,
3899  0,
3900  0,
3901};
3902
3903static char *gval_fields[] = {
3904  "name", "value",
3905};
3906
3907static struct valobj gval_valobj[] = {
3908  {V_NAME, 0, NUMVALUES_TABLE, "name", 0, MR_NO_MATCH},
3909};
3910
3911static struct validate gval_validate = {
3912  gval_valobj,
3913  1,
3914  0,
3915  0,
3916  0,
3917  0,
3918  0,
3919  0,
3920  0,
3921};
3922
3923static char *aval_fields[] = {
3924  "name", "value",
3925};
3926
3927static struct valobj aval_valobj[] = {
3928  {V_CHAR, 0, NUMVALUES_TABLE, "name"},
3929  {V_NUM, 1},
3930};
3931
3932static struct validate aval_validate =  /* for aval, uval, and dval */
3933{
3934  aval_valobj,
3935  2,
3936  "name",
3937  "name = '%s'",
3938  1,
3939  0,
3940  0,
3941  0,
3942  0,
3943};
3944
3945static char *dval_fields[] = {
3946  "name",
3947};
3948
3949static char *gats_fields[] = {
3950  "table_name", "appends", "updates", "deletes",
3951  "modtime", "modby", "modwith",
3952};
3953
3954static char *_sdl_fields[] = {
3955  "level",
3956};
3957
3958static struct validate _sdl_validate =
3959{
3960  VOnum0,
3961  1,
3962  NULL,
3963  NULL,
3964  0,
3965  0,
3966  0,
3967  0,
3968  _sdl_followup,
3969};
3970
3971static char *gcon7_fields[] = {
3972  "name",
3973  "name", "description", "location", "contact",
3974  "ace_type", "ace_name", "memace_type", "memace_name", "modtime", "modby", "modwith",
3975};
3976
3977static struct validate gcon_validate = {
3978  0,
3979  0,
3980  0,
3981  0,
3982  0,
3983  0,
3984  0,
3985  0,
3986  followup_gcon,
3987};
3988
3989static char *gcon_fields[] = {
3990  "name",
3991  "name", "publicflg", "description", "location", "contact",
3992  "ace_type", "ace_name", "memace_type", "memace_name", "modtime", "modby", "modwith",
3993};
3994
3995static char *acon7_fields[] = {
3996  "name", "description", "location", "contact",
3997  "ace_type", "ace_name", "memace_type", "memace_name",
3998};
3999
4000static struct valobj acon7_valobj[] = {
4001  {V_CHAR, 0, CONTAINERS_TABLE, "name"},
4002  {V_LEN, 1, CONTAINERS_TABLE, "description"},
4003  {V_CHAR, 2, CONTAINERS_TABLE, "location"},
4004  {V_CHAR, 3, CONTAINERS_TABLE, "contact"},
4005  {V_TYPE, 4, 0, "ace_type", 0, MR_ACE},
4006  {V_TYPEDATA, 5, 0, 0, 0, MR_ACE},
4007  {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
4008  {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
4009};
4010
4011static struct validate acon7_validate =
4012{
4013  acon7_valobj,
4014  8,
4015  "name",
4016  "name = '%s'",
4017  1,
4018  "cnt_id",
4019  0,
4020  setup_acon,
4021  set_modtime,
4022};
4023
4024static char *acon_fields[] = {
4025  "name", "publicflg", "description", "location", "contact",
4026  "ace_type", "ace_name", "memace_type", "memace_name",
4027};
4028
4029static struct valobj acon_valobj[] = {
4030  {V_CHAR, 0, CONTAINERS_TABLE, "name"},
4031  {V_NUM, 1},
4032  {V_LEN, 2, CONTAINERS_TABLE, "description"},
4033  {V_CHAR, 3, CONTAINERS_TABLE, "location"},
4034  {V_CHAR, 4, CONTAINERS_TABLE, "contact"},
4035  {V_TYPE, 5, 0, "ace_type", 0, MR_ACE},
4036  {V_TYPEDATA, 6, 0, 0, 0, MR_ACE},
4037  {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
4038  {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
4039};
4040
4041static struct validate acon_validate =
4042{
4043  acon_valobj,
4044  9,
4045  "name",
4046  "name = '%s'",
4047  1,
4048  "cnt_id",
4049  0,
4050  setup_acon,
4051  set_modtime,
4052};
4053
4054static char *ucon7_fields[] = {
4055  "name",
4056  "newname", "description", "location", "contact",
4057  "ace_type", "ace_name", "memace_type", "memace_name",
4058};
4059
4060static struct valobj ucon7_valobj[] = {
4061  {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
4062  {V_RENAME, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_NOT_UNIQUE},
4063  {V_LEN, 2, CONTAINERS_TABLE, "description"},
4064  {V_CHAR, 3, CONTAINERS_TABLE, "location"},
4065  {V_CHAR, 4, CONTAINERS_TABLE, "contact"},
4066  {V_TYPE, 5, 0, "ace_type", 0, MR_ACE},
4067  {V_TYPEDATA, 6, 0, 0, 0, MR_ACE},
4068  {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
4069  {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
4070};
4071
4072static struct validate ucon7_validate =
4073{
4074  ucon7_valobj,
4075  9,
4076  0,
4077  0,
4078  0,
4079  0,
4080  access_container,
4081  0,
4082  update_container,
4083};
4084
4085static char *ucon_fields[] = {
4086  "name",
4087  "newname", "publicflg", "description", "location", "contact",
4088  "ace_type", "ace_name", "memace_type", "memace_name",
4089};
4090
4091static struct valobj ucon_valobj[] = {
4092  {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
4093  {V_RENAME, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_NOT_UNIQUE},
4094  {V_NUM, 2},
4095  {V_LEN, 3, CONTAINERS_TABLE, "description"},
4096  {V_CHAR, 4, CONTAINERS_TABLE, "location"},
4097  {V_CHAR, 5, CONTAINERS_TABLE, "contact"},
4098  {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
4099  {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
4100  {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
4101  {V_TYPEDATA, 9, 0, 0, 0, MR_ACE},
4102};
4103
4104static struct validate ucon_validate =
4105{
4106  ucon_valobj,
4107  10,
4108  0,
4109  0,
4110  0,
4111  0,
4112  access_container,
4113  0,
4114  update_container,
4115};
4116
4117static char *dcon_fields[] = {
4118  "name",
4119};
4120
4121static struct validate dcon_validate =
4122{
4123  VOcon0,
4124  1,
4125  0,
4126  0,
4127  0,
4128  0,
4129  0,
4130  setup_dcon,
4131  0,
4132};
4133
4134static char *amcn_fields[] = {
4135  "machine", "container",
4136};
4137
4138static struct valobj amcn_valobj[] =    /* ADD_MACHINE_TO_CONTAINER */
4139{                                       /* DELETE_MACHINE_FROM_CONTAINER */
4140  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
4141  {V_ID, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
4142};
4143
4144static struct validate amcn_validate = /* for amtn and dmfn */
4145{
4146  amcn_valobj,
4147  2,
4148  "mach_id",
4149  "mach_id = %d",
4150  1,
4151  0,
4152  access_container,
4153  0,
4154  set_mach_modtime_by_id,
4155};
4156
4157static struct validate dmcn_validate = /* for amtn and dmfn */
4158{
4159  amcn_valobj,
4160  2,
4161  "mach_id",
4162  "mach_id = %d and cnt_id = %d",
4163  2,
4164  0,
4165  access_container,
4166  0,
4167  set_mach_modtime_by_id,
4168};
4169
4170static char *gmnm_fields[] = {
4171  "machine",
4172  "machine", "container",
4173};
4174
4175static char *gmoc_fields[] = {
4176  "container",
4177  "isrecursive",
4178        "machine",
4179  "container",
4180};
4181
4182static struct validate gmoc_validate =
4183{
4184  VOcon0,
4185  1,
4186  0,
4187  0,
4188  0,
4189  0,
4190  0,
4191  0,
4192  get_machines_of_container,
4193};
4194
4195static char *gsoc_fields[] = {
4196  "container",
4197  "isrecursive",
4198        "subcontainer",
4199};
4200
4201static struct validate gsoc_validate =
4202{
4203  VOcon0,
4204  1,
4205  0,
4206  0,
4207  0,
4208  0,
4209  0,
4210  0,
4211  get_subcontainers_of_container,
4212};
4213
4214static char *gtlc_fields[] = {
4215  "name",
4216};
4217
4218static char *scli_fields[] = {
4219  "containername",
4220  "listname",
4221};
4222
4223static struct valobj scli_valobj[] = {
4224  {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
4225  {V_ID, 1, LIST_TABLE, "name", "list_id", MR_LIST},
4226};
4227
4228static struct validate scli_validate = {
4229  scli_valobj,
4230  2,
4231  0,
4232  0,
4233  0,
4234  0,
4235  0,
4236  setup_scli,
4237  set_container_list,
4238};
4239
4240static char *gcli_fields[] = {
4241  "containername",
4242  "containername", "listname",
4243};
4244
4245static struct validate glic_validate =
4246{
4247  VOlist0,
4248  1,
4249  NULL,
4250  NULL,
4251  0,
4252  0,
4253  0,
4254  0,
4255  0,
4256};
4257
4258static char *glic_fields[] = {
4259  "listname",
4260  "containername", "listname",
4261};
4262
4263/* Generalized Query Definitions */
4264
4265/* Multiple versions of the same query MUST be listed in ascending
4266 * order.
4267 */
4268
4269/* Note: For any query which uses prefetch_value, the vcnt should be
4270 * one less than the number of %-format specifiers in the tlist.
4271 */
4272
4273struct query Queries[] = {
4274  {
4275    /* Q_GALO - GET_ALL_LOGINS, v2 */
4276    "get_all_logins",
4277    "galo",
4278    2,
4279    MR_Q_RETRIEVE,
4280    "u",
4281    USERS_TABLE,
4282    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
4283    galo2_fields,
4284    6,
4285    "u.users_id != 0",
4286    0,
4287    "u.login",
4288    0,
4289  },
4290
4291  {
4292    /* Q_GALO - GET_ALL_LOGINS, v3 */
4293    "get_all_logins",
4294    "galo",
4295    3,
4296    MR_Q_RETRIEVE,
4297    "u",
4298    USERS_TABLE,
4299    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle FROM users u",
4300    galo_fields,
4301    7,
4302    "u.users_id != 0",
4303    0,
4304    "u.login",
4305    0,
4306  },
4307
4308  {
4309    /* Q_GAAL - GET_ALL_ACTIVE_LOGINS, v2 */
4310    "get_all_active_logins",
4311    "gaal",
4312    2,
4313    MR_Q_RETRIEVE,
4314    "u",
4315    USERS_TABLE,
4316    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle FROM users u",
4317    galo2_fields,
4318    6,
4319    "u.status = 1",
4320    0,
4321    "u.login",
4322    0,
4323  },
4324
4325  {
4326    /* Q_GAAL - GET_ALL_ACTIVE_LOGINS, v3 */
4327    "get_all_active_logins",
4328    "gaal",
4329    3,
4330    MR_Q_RETRIEVE,
4331    "u",
4332    USERS_TABLE,
4333    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle FROM users u",
4334    galo_fields,
4335    7,
4336    "u.status = 1",
4337    0,
4338    "u.login",
4339    0,
4340  },
4341
4342  {
4343    /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v2 */
4344    "get_user_account_by_login",
4345    "gual",
4346    2,
4347    MR_Q_RETRIEVE,
4348    "u",
4349    USERS_TABLE,
4350    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
4351    gual2_fields,
4352    15,
4353    "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
4354    1,
4355    "u.login",
4356    &gubl2_validate,
4357  },
4358
4359  {
4360    /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v3 */
4361    "get_user_account_by_login",
4362    "gual",
4363    3,
4364    MR_Q_RETRIEVE,
4365    "u",
4366    USERS_TABLE,
4367    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4368    gual3_fields,
4369    18,
4370    "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
4371    1,
4372    "u.login",
4373    &gubl_validate,
4374  },
4375
4376  {
4377    /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v11 */
4378    "get_user_account_by_login",
4379    "gual",
4380    11,
4381    MR_Q_RETRIEVE,
4382    "u",
4383    USERS_TABLE,
4384    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4385    gual11_fields,
4386    20,
4387    "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
4388    1,
4389    "u.login",
4390    &gubl_validate,
4391  },
4392
4393  {
4394    /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v12 */
4395    "get_user_account_by_login",
4396    "gual",
4397    12,
4398    MR_Q_RETRIEVE,
4399    "u",
4400    USERS_TABLE,
4401    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4402    gual12_fields,
4403    23,
4404    "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
4405    1,
4406    "u.login",
4407    &gubl_validate,
4408  },
4409
4410  {
4411    /* Q_GUAL - GET_USER_ACCOUNT_BY_LOGIN, v14 */
4412    "get_user_account_by_login",
4413    "gual",
4414    14,
4415    MR_Q_RETRIEVE,
4416    "u",
4417    USERS_TABLE,
4418    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4419    gual_fields,
4420    25,
4421    "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
4422    1,
4423    "u.login",
4424    &gubl_validate,
4425  },
4426
4427  {
4428    /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v2 */
4429    "get_user_account_by_uid",
4430    "guau",
4431    2,
4432    MR_Q_RETRIEVE,
4433    "u",
4434    USERS_TABLE,
4435    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
4436    guau2_fields,
4437    15,
4438    "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
4439    1,
4440    "u.login",
4441    &gubu2_validate,
4442  },
4443
4444  {
4445    /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v3 */
4446    "get_user_account_by_uid",
4447    "guau",
4448    3,
4449    MR_Q_RETRIEVE,
4450    "u",
4451    USERS_TABLE,
4452    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4453    guau3_fields,
4454    18,
4455    "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
4456    1,
4457    "u.login",
4458    &gubu_validate,
4459  },
4460
4461  {
4462    /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v11 */
4463    "get_user_account_by_uid",
4464    "guau",
4465    11,
4466    MR_Q_RETRIEVE,
4467    "u",
4468    USERS_TABLE,
4469    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4470    guau11_fields,
4471    20,
4472    "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
4473    1,
4474    "u.login",
4475    &gubu_validate,
4476  },
4477
4478  {
4479    /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v12 */
4480    "get_user_account_by_uid",
4481    "guau",
4482    12,
4483    MR_Q_RETRIEVE,
4484    "u",
4485    USERS_TABLE,
4486    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4487    guau12_fields,
4488    23,
4489    "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
4490    1,
4491    "u.login",
4492    &gubu_validate,
4493  },
4494
4495  {
4496    /* Q_GUAU - GET_USER_ACCOUNT_BY_UID, v14 */
4497    "get_user_account_by_uid",
4498    "guau",
4499    14,
4500    MR_Q_RETRIEVE,
4501    "u",
4502    USERS_TABLE,
4503    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4504    guau_fields,
4505    25,
4506    "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
4507    1,
4508    "u.login",
4509    &gubu_validate,
4510  },
4511
4512  {
4513    /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v2 */
4514    "get_user_account_by_name",
4515    "guan",
4516    2,
4517    MR_Q_RETRIEVE,
4518    "u",
4519    USERS_TABLE,
4520    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
4521    guan2_fields,
4522    15,
4523    "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
4524    2,
4525    "u.login",
4526    &guan2_validate,
4527  },
4528
4529  {
4530    /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v3 */
4531    "get_user_account_by_name",
4532    "guan",
4533    3,
4534    MR_Q_RETRIEVE,
4535    "u",
4536    USERS_TABLE,
4537    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4538    guan3_fields,
4539    18,
4540    "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
4541    2,
4542    "u.login",
4543    &guan_validate,
4544  },
4545
4546  {
4547    /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v11 */
4548    "get_user_account_by_name",
4549    "guan",
4550    11,
4551    MR_Q_RETRIEVE,
4552    "u",
4553    USERS_TABLE,
4554    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4555    guan11_fields,
4556    20,
4557    "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
4558    2,
4559    "u.login",
4560    &guan_validate,
4561  },
4562
4563  {
4564    /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v12 */
4565    "get_user_account_by_name",
4566    "guan",
4567    12,
4568    MR_Q_RETRIEVE,
4569    "u",
4570    USERS_TABLE,
4571    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4572    guan12_fields,
4573    23,
4574    "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
4575    2,
4576    "u.login",
4577    &guan_validate,
4578  },
4579
4580  {
4581    /* Q_GUAN - GET_USER_ACCOUNT_BY_NAME, v14 */
4582    "get_user_account_by_name",
4583    "guan",
4584    14,
4585    MR_Q_RETRIEVE,
4586    "u",
4587    USERS_TABLE,
4588    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4589    guan_fields,
4590    25,
4591    "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
4592    2,
4593    "u.login",
4594    &guan_validate,
4595  },
4596
4597  {
4598    /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v2 */
4599    "get_user_account_by_class",
4600    "guac",
4601    2,
4602    MR_Q_RETRIEVE,
4603    "u",
4604    USERS_TABLE,
4605    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
4606    guac2_fields,
4607    15,
4608    "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
4609    1,
4610    "u.login",
4611    &VDfix_modby,
4612  },
4613
4614  {
4615    /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v3 */
4616    "get_user_account_by_class",
4617    "guac",
4618    3,
4619    MR_Q_RETRIEVE,
4620    "u",
4621    USERS_TABLE,
4622    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4623    guac3_fields,
4624    18,
4625    "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
4626    1,
4627    "u.login",
4628    &guan_validate,
4629  },
4630
4631  {
4632    /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v11 */
4633    "get_user_account_by_class",
4634    "guac",
4635    11,
4636    MR_Q_RETRIEVE,
4637    "u",
4638    USERS_TABLE,
4639    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4640    guac11_fields,
4641    20,
4642    "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
4643    1,
4644    "u.login",
4645    &guan_validate,
4646  },
4647
4648  {
4649    /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v12 */
4650    "get_user_account_by_class",
4651    "guac",
4652    12,
4653    MR_Q_RETRIEVE,
4654    "u",
4655    USERS_TABLE,
4656    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4657    guac12_fields,
4658    23,
4659    "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
4660    1,
4661    "u.login",
4662    &guan_validate,
4663  },
4664
4665  {
4666    /* Q_GUAC - GET_USER_ACCOUNT_BY_CLASS, v14 */
4667    "get_user_account_by_class",
4668    "guac",
4669    14,
4670    MR_Q_RETRIEVE,
4671    "u",
4672    USERS_TABLE,
4673    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4674    guac_fields,
4675    25,
4676    "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
4677    1,
4678    "u.login",
4679    &guan_validate,
4680  },
4681
4682  {
4683    /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v2 */
4684    "get_user_account_by_id",
4685    "guai",
4686    2,
4687    MR_Q_RETRIEVE,
4688    "u",
4689    USERS_TABLE,
4690    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
4691    guam2_fields,
4692    15,
4693    "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
4694    1,
4695    "u.login",
4696    &VDfix_modby,
4697  },
4698
4699  {
4700    /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v3 */
4701    "get_user_account_by_id",
4702    "guai",
4703    3,
4704    MR_Q_RETRIEVE,
4705    "u",
4706    USERS_TABLE,
4707    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4708    guam_fields,
4709    18,
4710    "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
4711    1,
4712    "u.login",
4713    &guan_validate,
4714  },
4715
4716  {
4717    /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v11 */
4718    "get_user_account_by_id",
4719    "guai",
4720    11,
4721    MR_Q_RETRIEVE,
4722    "u",
4723    USERS_TABLE,
4724    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4725    guam11_fields,
4726    20,
4727    "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
4728    1,
4729    "u.login",
4730    &guan_validate,
4731  },
4732
4733  {
4734    /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v12 */
4735    "get_user_account_by_id",
4736    "guai",
4737    12,
4738    MR_Q_RETRIEVE,
4739    "u",
4740    USERS_TABLE,
4741    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4742    guam12_fields,
4743    23,
4744    "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
4745    1,
4746    "u.login",
4747    &guan_validate,
4748  },
4749
4750  {
4751    /* Q_GUAM - GET_USER_ACCOUNT_BY_MITID, v14 */
4752    "get_user_account_by_id",
4753    "guai",
4754    14,
4755    MR_Q_RETRIEVE,
4756    "u",
4757    USERS_TABLE,
4758    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
4759    guam_fields,
4760    25,
4761    "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
4762    1,
4763    "u.login",
4764    &guan_validate,
4765  },
4766
4767  {
4768    /* Q_GUAS - GET_USER_ACCOUNT_BY_SPONSOR, v12 */
4769    "get_user_account_by_sponsor",
4770    "guas",
4771    12,
4772    MR_Q_RETRIEVE,
4773    0,
4774    0,
4775    0,
4776    guas_fields,
4777    1,
4778    0,
4779    2,
4780    NULL,
4781    &guas_validate,
4782  },
4783
4784  {
4785    /* Q_GUBL - GET_USER_BY_LOGIN, v2 */
4786    "get_user_by_login",
4787    "gubl",
4788    2,
4789    MR_Q_RETRIEVE,
4790    "u",
4791    USERS_TABLE,
4792    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
4793    gubl2_fields,
4794    12,
4795    "u.login LIKE '%s' AND u.users_id != 0",
4796    1,
4797    "u.login",
4798    &gubl2_validate,
4799  },
4800
4801  {
4802    /* Q_GUBL - GET_USER_BY_LOGIN, v3 */
4803    "get_user_by_login",
4804    "gubl",
4805    3,
4806    MR_Q_RETRIEVE,
4807    "u",
4808    USERS_TABLE,
4809    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u",
4810    gubl_fields,
4811    15,
4812    "u.login LIKE '%s' AND u.users_id != 0",
4813    1,
4814    "u.login",
4815    &gubl_validate,
4816  },
4817
4818  {
4819    /* Q_GUBU - GET_USER_BY_UID, v2 */
4820    "get_user_by_uid",
4821    "gubu",
4822    2,
4823    MR_Q_RETRIEVE,
4824    "u",
4825    USERS_TABLE,
4826    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
4827    gubu2_fields,
4828    12,
4829    "u.unix_uid = %s AND u.users_id != 0",
4830    1,
4831    "u.login",
4832    &gubu2_validate,
4833  },
4834
4835  {
4836    /* Q_GUBU - GET_USER_BY_UID, v3 */
4837    "get_user_by_uid",
4838    "gubu",
4839    3,
4840    MR_Q_RETRIEVE,
4841    "u",
4842    USERS_TABLE,
4843    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u",
4844    gubu_fields,
4845    15,
4846    "u.unix_uid = %s AND u.users_id != 0",
4847    1,
4848    "u.login",
4849    &gubu_validate,
4850  },
4851
4852  {
4853    /* Q_GUBN - GET_USER_BY_NAME, v2 */
4854    "get_user_by_name",
4855    "gubn",
4856    2,
4857    MR_Q_RETRIEVE,
4858    "u",
4859    USERS_TABLE,
4860    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
4861    gubn2_fields,
4862    12,
4863    "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
4864    2,
4865    "u.login",
4866    &gubn2_validate,
4867  },
4868
4869  {
4870    /* Q_GUBN - GET_USER_BY_NAME, v3 */
4871    "get_user_by_name",
4872    "gubn",
4873    3,
4874    MR_Q_RETRIEVE,
4875    "u",
4876    USERS_TABLE,
4877    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u",
4878    gubn_fields,
4879    15,
4880    "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
4881    2,
4882    "u.login",
4883    &gubn_validate,
4884  },
4885
4886  {
4887    /* Q_GUBC - GET_USER_BY_CLASS, v2 */
4888    "get_user_by_class",
4889    "gubc",
4890    2,
4891    MR_Q_RETRIEVE,
4892    "u",
4893    USERS_TABLE,
4894    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
4895    gubc2_fields,
4896    12,
4897    "u.type = UPPER('%s') AND u.users_id != 0",
4898    1,
4899    "u.login",
4900    &VDfix_modby,
4901  },
4902
4903  {
4904    /* Q_GUBC - GET_USER_BY_CLASS, v3 */
4905    "get_user_by_class",
4906    "gubc",
4907    3,
4908    MR_Q_RETRIEVE,
4909    "u",
4910    USERS_TABLE,
4911    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS') FROM users u",
4912    gubc_fields,
4913    15,
4914    "u.type = UPPER('%s') AND u.users_id != 0",
4915    1,
4916    "u.login",
4917    &guan_validate,
4918  },
4919
4920  {
4921    /* Q_GUBM - GET_USER_BY_MITID, v2 */
4922    "get_user_by_mitid",
4923    "gubm",
4924    2,
4925    MR_Q_RETRIEVE,
4926    "u",
4927    USERS_TABLE,
4928    "u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
4929    gubm2_fields,
4930    12,
4931    "u.clearid LIKE '%s' AND u.users_id != 0",
4932    1,
4933    "u.login",
4934    &VDfix_modby,
4935  },
4936
4937  {
4938    /* Q_GUBM - GET_USER_BY_MITID, v3 */
4939    "get_user_by_mitid",
4940    "gubm",
4941    3,
4942    MR_Q_RETRIEVE,
4943    "u",
4944    USERS_TABLE,
4945    "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u",
4946    gubm_fields,
4947    15,
4948    "u.clearid LIKE '%s' AND u.users_id != 0",
4949    1,
4950    "u.login",
4951    &guan_validate,
4952  },
4953
4954  {
4955    /* Q_AUAC - ADD_USER_ACCOUNT, v2 */  /* uses prefetch_value() for users_id */
4956    "add_user_account",
4957    "auac",
4958    2,
4959    MR_Q_APPEND,
4960    "u",
4961    USERS_TABLE,
4962    /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
4963     * but using up one argv element.
4964     */
4965    "INTO users (login, unix_uid, shell, last, first, middle, status, clearid, type, comments, signature, secure, users_id) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, %s)",
4966    auac2_fields,
4967    12,
4968    NULL,
4969    0,
4970    NULL,
4971    &auac2_validate,
4972  },
4973
4974  {
4975    /* Q_AUAC - ADD_USER_ACCOUNT, v3 */  /* uses prefetch_value() for users_id */
4976    "add_user_account",
4977    "auac",
4978    3,
4979    MR_Q_APPEND,
4980    "u",
4981    USERS_TABLE,
4982    /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
4983     * but using up one argv element.
4984     */
4985    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, %s, SYSDATE, %s)",
4986    auac3_fields,
4987    13,
4988    NULL,
4989    0,
4990    NULL,
4991    &auac3_validate,
4992  },
4993
4994  {
4995    /* Q_AUAC - ADD_USER_ACCOUNT, v11 */  /* uses prefetch_value() for users_id */
4996    "add_user_account",
4997    "auac",
4998    11,
4999    MR_Q_APPEND,
5000    "u",
5001    USERS_TABLE,
5002    /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
5003     * but using up one argv element.
5004     */
5005    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, SYSDATE, %s)",
5006    auac11_fields,
5007    15,
5008    NULL,
5009    0,
5010    NULL,
5011    &auac11_validate,
5012  },
5013
5014  {
5015    /* Q_AUAC - ADD_USER_ACCOUNT, v12 */  /* uses prefetch_value() for users_id */
5016    "add_user_account",
5017    "auac",
5018    12,
5019    MR_Q_APPEND,
5020    "u",
5021    USERS_TABLE,
5022    /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
5023     * but using up one argv element.
5024     */
5025    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, sponsor_type, sponsor_id, expiration, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, NVL('%s', CHR(0)), %s, SYSDATE, %s)",
5026    auac12_fields,
5027    18,
5028    NULL,
5029    0,
5030    NULL,
5031    &auac12_validate,
5032  },
5033
5034  {
5035    /* Q_AUAC - ADD_USER_ACCOUNT, v14 */  /* uses prefetch_value() for users_id */
5036    "add_user_account",
5037    "auac",
5038    14,
5039    MR_Q_APPEND,
5040    "u",
5041    USERS_TABLE,
5042    /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
5043     * but using up one argv element.
5044     */
5045    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, sponsor_type, sponsor_id, expiration, alternate_email, alternate_phone, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, SYSDATE, %s)",
5046    auac_fields,
5047    20,
5048    NULL,
5049    0,
5050    NULL,
5051    &auac_validate,
5052  },
5053
5054  {
5055    /* Q_AUSR - ADD_USER, v2 */  /* uses prefetch_value() for users_id */
5056    "add_user",
5057    "ausr",
5058    2,
5059    MR_Q_APPEND,
5060    "u",
5061    USERS_TABLE,
5062    "INTO users (login, unix_uid, shell, last, first, middle, status, clearid, type, comments, signature, secure, users_id) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, %s)",
5063    auac2_fields,
5064    9,
5065    0,
5066    0,
5067    NULL,
5068    &ausr2_validate,
5069  },
5070
5071  {
5072    /* Q_AUSR - ADD_USER, v3 */  /* uses prefetch_value() for users_id */
5073    "add_user",
5074    "ausr",
5075    3,
5076    MR_Q_APPEND,
5077    "u",
5078    USERS_TABLE,
5079    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, %s, SYSDATE, %s)",
5080    auac3_fields,
5081    10,
5082    0,
5083    0,
5084    NULL,
5085    &ausr3_validate,
5086  },
5087
5088  {
5089    /* Q_AUSR - ADD_USER, v11 */  /* uses prefetch_value() for users_id */
5090    "add_user",
5091    "ausr",
5092    11,
5093    MR_Q_APPEND,
5094    "u",
5095    USERS_TABLE,
5096    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, SYSDATE, %s)",
5097    auac11_fields,
5098    12,
5099    0,
5100    0,
5101    NULL,
5102    &ausr11_validate,
5103  },
5104
5105  {
5106    /* Q_AUSR - ADD_USER, v12 */  /* uses prefetch_value() for users_id */
5107    "add_user",
5108    "ausr",
5109    12,
5110    MR_Q_APPEND,
5111    "u",
5112    USERS_TABLE,
5113    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, sponsor_type, sponsor_id, expiration, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, NVL('%s', CHR(0)), %s, SYSDATE, %s)",
5114    auac12_fields,
5115    15,
5116    0,
5117    0,
5118    NULL,
5119    &ausr12_validate,
5120  },
5121
5122  {
5123    /* Q_AUSR - ADD_USER, v14 */  /* uses prefetch_value() for users_id */
5124    "add_user",
5125    "ausr",
5126    14,
5127    MR_Q_APPEND,
5128    "u",
5129    USERS_TABLE,
5130    "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, sponsor_type, sponsor_id, expiration, alternate_email, alternate_phone, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, SYSDATE, %s)",
5131    auac_fields,
5132    17,
5133    0,
5134    0,
5135    NULL,
5136    &ausr_validate,
5137  },
5138
5139  {
5140    /* Q_RUSR - REGISTER_USER */
5141    "register_user",
5142    "rusr",
5143    2,
5144    MR_Q_APPEND,
5145    0,
5146    0,
5147    0,
5148    rusr_fields,
5149    3,
5150    0,
5151    0,
5152    NULL,
5153    &rusr_validate,
5154  },
5155
5156  {
5157    /* Q_UUAC - UPDATE_USER_ACCOUNT, v2 */
5158    "update_user_account",
5159    "uuac",
5160    2,
5161    MR_Q_UPDATE,
5162    "u",
5163    USERS_TABLE,
5164    /* See comment in auac about signature. */
5165    "users SET login = '%s', unix_uid = %s, shell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', comments = %d, signature = NVL(CHR(0), '%s'), secure = %s",
5166    uuac2_fields,
5167    12,
5168    "users_id = %d",
5169    1,
5170    NULL,
5171    &uuac2_validate,
5172  },
5173
5174  {
5175    /* Q_UUAC - UPDATE_USER_ACCOUNT, v3 */
5176    "update_user_account",
5177    "uuac",
5178    3,
5179    MR_Q_UPDATE,
5180    "u",
5181    USERS_TABLE,
5182    /* See comment in auac about signature. */
5183    "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', comments = %d, signature = NVL(CHR(0), '%s'), secure = %s",
5184    uuac3_fields,
5185    13,
5186    "users_id = %d",
5187    1,
5188    NULL,
5189    &uuac3_validate,
5190  },
5191
5192  {
5193    /* Q_UUAC - UPDATE_USER_ACCOUNT, v11 */
5194    "update_user_account",
5195    "uuac",
5196    11,
5197    MR_Q_UPDATE,
5198    "u",
5199    USERS_TABLE,
5200    /* See comment in auac about signature. */
5201    "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', comments = %d, signature = NVL(CHR(0), '%s'), secure = %s, winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0))",
5202    uuac11_fields,
5203    15,
5204    "users_id = %d",
5205    1,
5206    NULL,
5207    &uuac11_validate,
5208  },
5209
5210  {
5211    /* Q_UUAC - UPDATE_USER_ACCOUNT, v12 */
5212    "update_user_account",
5213    "uuac",
5214    12,
5215    MR_Q_UPDATE,
5216    "u",
5217    USERS_TABLE,
5218    /* See comment in auac about signature. */
5219    "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', comments = %d, signature = NVL(CHR(0), '%s'), secure = %s, winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d, expiration = NVL('%s', CHR(0))",
5220    uuac12_fields,
5221    18,
5222    "users_id = %d",
5223    1,
5224    NULL,
5225    &uuac12_validate,
5226  },
5227
5228  {
5229    /* Q_UUAC - UPDATE_USER_ACCOUNT, v14 */
5230    "update_user_account",
5231    "uuac",
5232    14,
5233    MR_Q_UPDATE,
5234    "u",
5235    USERS_TABLE,
5236    /* See comment in auac about signature. */
5237    "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', comments = %d, signature = NVL(CHR(0), '%s'), secure = %s, winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d, expiration = NVL('%s', CHR(0)), alternate_email = NVL('%s', CHR(0)), alternate_phone = NVL('%s', CHR(0))",
5238    uuac_fields,
5239    20,
5240    "users_id = %d",
5241    1,
5242    NULL,
5243    &uuac_validate,
5244  },
5245
5246  {
5247    /* Q_UUSR - UPDATE_USER, v2 */
5248    "update_user",
5249    "uusr",
5250    2,
5251    MR_Q_UPDATE,
5252    "u",
5253    USERS_TABLE,
5254    "users SET login = '%s', unix_uid = %s, shell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)),  type = '%s'",
5255    uuac2_fields,
5256    9,
5257    "users_id = %d",
5258    1,
5259    NULL,
5260    &uusr2_validate,
5261  },
5262
5263  {
5264    /* Q_UUSR - UPDATE_USER, v3 */
5265    "update_user",
5266    "uusr",
5267    3,
5268    MR_Q_UPDATE,
5269    "u",
5270    USERS_TABLE,
5271    "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)),  type = '%s'",
5272    uuac3_fields,
5273    10,
5274    "users_id = %d",
5275    1,
5276    NULL,
5277    &uusr3_validate,
5278  },
5279
5280  {
5281    /* Q_UUSR - UPDATE_USER, v11 */
5282    "update_user",
5283    "uusr",
5284    11,
5285    MR_Q_UPDATE,
5286    "u",
5287    USERS_TABLE,
5288    "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)),  type = '%s', winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)) ",
5289    uuac11_fields,
5290    12,
5291    "users_id = %d",
5292    1,
5293    NULL,
5294    &uusr11_validate,
5295  },
5296
5297  {
5298    /* Q_UUSR - UPDATE_USER, v12 */
5299    "update_user",
5300    "uusr",
5301    12,
5302    MR_Q_UPDATE,
5303    "u",
5304    USERS_TABLE,
5305    "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)),  type = '%s', winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d, expiration = NVL('%s', CHR(0)) ",
5306    uuac12_fields,
5307    15,
5308    "users_id = %d",
5309    1,
5310    NULL,
5311    &uusr12_validate,
5312  },
5313
5314  {
5315    /* Q_UUSR - UPDATE_USER, v14 */
5316    "update_user",
5317    "uusr",
5318    14,
5319    MR_Q_UPDATE,
5320    "u",
5321    USERS_TABLE,
5322    "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)),  type = '%s', winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d, expiration = NVL('%s', CHR(0)), alternate_email = NVL('%s', CHR(0)), alternate_phone = NVL('%s', CHR(0)) ",
5323    uuac_fields,
5324    17,
5325    "users_id = %d",
5326    1,
5327    NULL,
5328    &uusr_validate,
5329  },
5330
5331  {
5332    /* Q_UUSH - UPDATE_USER_SHELL */
5333    "update_user_shell",
5334    "uush",
5335    2,
5336    MR_Q_UPDATE,
5337    "u",
5338    USERS_TABLE,
5339    "users SET shell = '%s'",
5340    uush_fields,
5341    1,
5342    "users_id = %d",
5343    1,
5344    NULL,
5345    &uush_validate,
5346  },
5347
5348  {
5349    /* Q_UUWS - UPDATE_USER_WINDOWS_SHELL */
5350    "update_user_windows_shell",
5351    "uuws",
5352    2,
5353    MR_Q_UPDATE,
5354    "u",
5355    USERS_TABLE,
5356    "users SET winconsoleshell = '%s'",
5357    uuws_fields,
5358    1,
5359    "users_id = %d",
5360    1,
5361    NULL,
5362    &uuws_validate,
5363  },
5364
5365  {
5366    /* Q_UUST - UPDATE_USER_STATUS */
5367    "update_user_status",
5368    "uust",
5369    2,
5370    MR_Q_UPDATE,
5371    "u",
5372    USERS_TABLE,
5373    "users SET status = %s",
5374    uust_fields,
5375    1,
5376    "users_id = %d",
5377    1,
5378    NULL,
5379    &uust_validate,
5380  },
5381
5382  {
5383    /* Q_UUSS - UPDATE_USER_SECURITY_STATUS */
5384    "update_user_security_status",
5385    "uuss",
5386    2,
5387    MR_Q_UPDATE,
5388    "u",
5389    USERS_TABLE,
5390    "users SET secure = %s",
5391    uuss_fields,
5392    1,
5393    "users_id = %d",
5394    1,
5395    NULL,
5396    &uust_validate,
5397  },
5398
5399  {
5400    /* Q_DUSR - DELETE_USER */
5401    "delete_user",
5402    "dusr",
5403    2,
5404    MR_Q_DELETE,
5405    "u",
5406    USERS_TABLE,
5407    NULL,
5408    dusr_fields,
5409    0,
5410    "users_id = %d",
5411    1,
5412    NULL,
5413    &dusr_validate,
5414  },
5415
5416  {
5417    /* Q_AURV - ADD_USER_RESERVATION */
5418    "add_user_reservation",
5419    "aurv",
5420    2,
5421    MR_Q_UPDATE,
5422    0,
5423    USERS_TABLE,
5424    0,
5425    aurv_fields,
5426    2,
5427    0,
5428    0,
5429    NULL,
5430    &aurv_validate,
5431  },
5432
5433  {
5434    /* Q_GURV - GET_USER_RESERVATIONS */
5435    "get_user_reservations",
5436    "gurv",
5437    2,
5438    MR_Q_RETRIEVE,
5439    0,
5440    USERS_TABLE,
5441    0,
5442    gurv_fields,
5443    1,
5444    0,
5445    1,
5446    NULL,
5447    &gurv_validate,
5448  },
5449
5450  {
5451    /* Q_GUBR - GET_USER_BY_RESERVATION */
5452    "get_user_by_reservation",
5453    "gubr",
5454    2,
5455    MR_Q_RETRIEVE,
5456    0,
5457    USERS_TABLE,
5458    0,
5459    gubr_fields,
5460    1,
5461    0,
5462    1,
5463    NULL,
5464    &gubr_validate,
5465  },
5466
5467  {
5468    /* Q_DURV - DELETE_USER_RESERVATION */
5469    "delete_user_reservation",
5470    "durv",
5471    2,
5472    MR_Q_UPDATE,
5473    0,
5474    USERS_TABLE,
5475    0,
5476    aurv_fields,
5477    2,
5478    0,
5479    0,
5480    NULL,
5481    &aurv_validate,
5482  },
5483
5484  {
5485    /* Q_GKUM - GET_KERBEROS_USER_MAP */
5486    "get_kerberos_user_map",
5487    "gkum",
5488    2,
5489    MR_Q_RETRIEVE,
5490    "k",
5491    KRBMAP_TABLE,
5492    "u.login, str.string FROM krbmap km, users u, strings str",
5493    gkum_fields,
5494    2,
5495    "u.login LIKE '%s' AND str.string LIKE '%s' AND km.users_id = u.users_id AND km.string_id = str.string_id",
5496    2,
5497    "u.login, str.string",
5498    NULL,
5499  },
5500
5501  {
5502    /* Q_AKUM - ADD_KERBEROS_USER_MAP */
5503    "add_kerberos_user_map",
5504    "akum",
5505    2,
5506    MR_Q_APPEND,
5507    "k",
5508    KRBMAP_TABLE,
5509    "INTO krbmap (users_id, string_id) VALUES (%d, %d)",
5510    akum_fields,
5511    2,
5512    0,
5513    0,
5514    NULL,
5515    &akum_validate,
5516  },
5517
5518  {
5519    /* Q_DKUM - DELETE_KERBEROS_USER_MAP */
5520    "delete_kerberos_user_map",
5521    "dkum",
5522    2,
5523    MR_Q_DELETE,
5524    "k",
5525    KRBMAP_TABLE,
5526    0,
5527    akum_fields,
5528    0,
5529    "users_id = %d AND string_id = %d",
5530    2,
5531    NULL,
5532    &dkum_validate,
5533  },
5534
5535  {
5536    /* Q_GFBL - GET_FINGER_BY_LOGIN */
5537    "get_finger_by_login",
5538    "gfbl",
5539    2,
5540    MR_Q_RETRIEVE,
5541    "u",
5542    USERS_TABLE,
5543    "login, fullname, nickname, home_addr, home_phone, office_addr, office_phone, department, affiliation, TO_CHAR(fmodtime, 'DD-mon-YYYY HH24:MI:SS'), fmodby, fmodwith FROM users",
5544    gfbl_fields,
5545    12,
5546    "users_id = %d",
5547    1,
5548    "login",
5549    &gfbl_validate,
5550  },
5551
5552  {
5553    /* Q_UFBL - UPDATE_FINGER_BY_LOGIN */
5554    "update_finger_by_login",
5555    "ufbl",
5556    2,
5557    MR_Q_UPDATE,
5558    "u",
5559    USERS_TABLE,
5560    "users SET fullname= NVL('%s', CHR(0)), nickname= NVL('%s', CHR(0)), home_addr= NVL('%s', CHR(0)), home_phone= NVL('%s', CHR(0)), office_addr= NVL('%s', CHR(0)), office_phone= NVL('%s', CHR(0)), department= NVL('%s', CHR(0)), affiliation= NVL('%s', CHR(0))",
5561    ufbl_fields,
5562    8,
5563    "users_id = %d",
5564    1,
5565    NULL,
5566    &ufbl_validate,
5567  },
5568
5569  {
5570    /* Q_GPOB - GET_POBOX */
5571    "get_pobox",
5572    "gpob",
5573    2,
5574    MR_Q_RETRIEVE,
5575    "u",
5576    USERS_TABLE,
5577    "login, potype, users_id, CHR(0), TO_CHAR(pmodtime, 'DD-mon-YYYY HH24:MI:SS'), pmodby, pmodwith FROM users",
5578    gpob_fields,
5579    7,
5580    "users_id = %d",
5581    1,
5582    "login",
5583    &gpob_validate,
5584  },
5585
5586  {
5587    /* Q_GAPO - GET_ALL_POBOXES */
5588    "get_all_poboxes",
5589    "gapo",
5590    2,
5591    MR_Q_RETRIEVE,
5592    "u",
5593    USERS_TABLE,
5594    "login, potype, pop_id || ':' || box_id FROM users",
5595    gpox_fields,
5596    3,
5597    "potype != 'NONE'",
5598    0,
5599    "login",
5600    &gpox_validate,
5601  },
5602
5603  {
5604    /* Q_GPOP - GET_POBOXES_POP */
5605    "get_poboxes_pop",
5606    "gpop",
5607    2,
5608    MR_Q_RETRIEVE,
5609    "u",
5610    USERS_TABLE,
5611    "login, potype, users_id FROM users",
5612    gpox_fields,
5613    3,
5614    "potype = 'POP'",
5615    0,
5616    "login",
5617    &gpox_validate
5618  },
5619
5620  {
5621    /* Q_GPOF - GET_POBOXES_SMTP */
5622    "get_poboxes_smtp",
5623    "gpos",
5624    2,
5625    MR_Q_RETRIEVE,
5626    "u",
5627    USERS_TABLE,
5628    "login, potype, users_id FROM users",
5629    gpox_fields,
5630    3,
5631    "potype = 'SMTP'",
5632    0,
5633    "login",
5634    &gpox_validate
5635  },
5636
5637  {
5638    /* Q_SPOB - SET_POBOX */
5639    "set_pobox",
5640    "spob",
5641    2,
5642    MR_Q_UPDATE,
5643    0,
5644    USERS_TABLE,
5645    0,
5646    spob_fields,
5647    3,
5648    NULL,
5649    0,
5650    NULL,
5651    &spob_validate,
5652  },
5653
5654  {
5655    /* Q_SPOP - SET_POBOX_POP */
5656    "set_pobox_pop",
5657    "spop",
5658    2,
5659    MR_Q_UPDATE,
5660    0,
5661    USERS_TABLE,
5662    0,
5663    spob_fields,
5664    1,
5665    NULL,
5666    0,
5667    NULL,
5668    &spop_validate,
5669  },
5670
5671  {
5672    /* Q_DPOB - DELETE_POBOX */
5673    "delete_pobox",
5674    "dpob",
5675    2,
5676    MR_Q_UPDATE,
5677    "u",
5678    USERS_TABLE,
5679    "users SET potype = 'NONE'",
5680    spob_fields,
5681    0,
5682    "users_id = %d",
5683    1,
5684    NULL,
5685    &dpob_validate,
5686  },
5687
5688  {
5689    /* Q_GHST - GET_HOST, v2 */
5690    "get_host",
5691    "ghst",
5692    2,
5693    MR_Q_RETRIEVE,
5694    "m",
5695    MACHINE_TABLE,
5696    "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",
5697    ghst2_fields,
5698    21,
5699    "m.name LIKE UPPER('%s') AND m.address LIKE '%s' AND m.location LIKE UPPER('%s') AND s.name LIKE UPPER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
5700    4,
5701    "m.name",
5702    &ghst_validate,
5703  },
5704
5705  {
5706    /* Q_GHST - GET_HOST, v6 */
5707    "get_host",
5708    "ghst",
5709    6,
5710    MR_Q_RETRIEVE,
5711    "m",
5712    MACHINE_TABLE,
5713    "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",
5714    ghst6_fields,
5715    22,
5716    "m.name LIKE UPPER('%s') AND m.address LIKE '%s' AND m.location LIKE UPPER('%s') AND s.name LIKE UPPER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
5717    4,
5718    "m.name",
5719    &ghst_validate,
5720  },
5721
5722  {
5723    /* Q_GHST - GET_HOST, v8 */
5724    "get_host",
5725    "ghst",
5726    8,
5727    MR_Q_RETRIEVE,
5728    "m",
5729    MACHINE_TABLE,
5730    "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.account_number, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",
5731    ghst_fields,
5732    23,
5733    "m.name LIKE UPPER('%s') AND m.address LIKE '%s' AND m.location LIKE UPPER('%s') AND s.name LIKE UPPER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
5734    4,
5735    "m.name",
5736    &ghst_validate,
5737  },
5738
5739  {
5740    /* Q_GHBH - GET_HOST_BY_HWADDR, v2 */
5741    "get_host_by_hwaddr",
5742    "ghbh",
5743    2,
5744    MR_Q_RETRIEVE,
5745    "m",
5746    MACHINE_TABLE,
5747    "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s, hwaddrmap hw",
5748    ghbh2_fields,
5749    21,
5750    "hw.hwaddr LIKE LOWER('%s') AND hw.mach_id = m.mach_id AND m.mach_id != 0 AND s.snet_id = m.snet_id",
5751    1,
5752    "m.name",
5753    &ghst_validate,
5754  },
5755
5756  {
5757    /* Q_GHBH - GET_HOST_BY_HWADDR, v6 */
5758    "get_host_by_hwaddr",
5759    "ghbh",
5760    6,
5761    MR_Q_RETRIEVE,
5762    "m",
5763    MACHINE_TABLE,
5764    "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s, hwaddrmap hw",
5765    ghbh6_fields,
5766    22,
5767    "hw.hwaddr LIKE LOWER('%s') AND hw.mach_id = m.mach_id AND m.mach_id != 0 AND s.snet_id = m.snet_id",
5768    1,
5769    "m.name",
5770    &ghst_validate,
5771  },
5772
5773  {
5774    /* Q_GHBH - GET_HOST_BY_HWADDR, v8 */
5775    "get_host_by_hwaddr",
5776    "ghbh",
5777    8,
5778    MR_Q_RETRIEVE,
5779    "m",
5780    MACHINE_TABLE,
5781    "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.account_number, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s, hwaddrmap hw",
5782    ghbh_fields,
5783    23,
5784    "hw.hwaddr LIKE LOWER('%s') AND hw.mach_id = m.mach_id AND m.mach_id != 0 AND s.snet_id = m.snet_id",
5785    1,
5786    "m.name",
5787    &ghst_validate,
5788  },
5789
5790  {
5791    /* Q_GHBA - GET_HOST_BY_ACCOUNT_NUMBER, v8 */
5792    "get_host_by_account_number",
5793    "ghba",
5794    8,
5795    MR_Q_RETRIEVE,
5796    "m",
5797    MACHINE_TABLE,
5798    "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.account_number, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",   
5799    ghba_fields,
5800    23,
5801    "m.account_number LIKE '%s' AND m.mach_id != 0 and s.snet_id = m.snet_id",
5802    1,
5803    "m.name",
5804    &ghst_validate,
5805  },
5806
5807  {
5808    /* Q_GHHA - GET_HOST_HWADDR */
5809    "get_host_hwaddr",
5810    "ghha",
5811    2,
5812    MR_Q_RETRIEVE,
5813    "hw",
5814    HWADDRMAP_TABLE,
5815    "hw.hwaddr FROM machine m, hwaddrmap hw",
5816    ghha_fields,
5817    1,
5818    "m.name LIKE UPPER('%s') AND m.mach_id = hw.mach_id AND rownum < 2",
5819    1,
5820    "hw.hwaddr",
5821    NULL,
5822  },
5823
5824  {
5825    /* Q_GHHM - GET_HOST_HWADDR_MAPPING */
5826    "get_host_hwaddr_mapping",
5827    "ghhm",
5828    2,
5829    MR_Q_RETRIEVE,
5830    "hw",
5831    HWADDRMAP_TABLE,
5832    "m.name, hw.hwaddr FROM machine m, hwaddrmap hw",
5833    ghhm_fields,
5834    2,
5835    "m.name LIKE UPPER('%s') AND m.mach_id = hw.mach_id",
5836    1,
5837    "m.name",
5838    NULL,
5839  },
5840   
5841  { 
5842    /* Q_AHST - ADD_HOST, v2 */ /* uses prefetch_value() for mach_id */
5843    "add_host",
5844    "ahst",
5845    2,
5846    MR_Q_APPEND,
5847    "m",
5848    MACHINE_TABLE,
5849    "INTO machine (name, vendor, model, os, location, contact, use, status, statuschange, snet_id, address, owner_type, owner_id, acomment, ocomment, created, inuse, mach_id, creator) VALUES (UPPER('%s'), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %d, '%s', '%s', %d, %d, %d, SYSDATE, SYSDATE, %s, %s)",
5850    ahst2_fields,
5851    14,
5852    0,
5853    0,
5854    NULL,
5855    &ahst2_validate,
5856  },
5857
5858  {
5859    /* Q_AHST - ADD_HOST, v6 */ /* uses prefetch_value() for mach_id */
5860    "add_host",
5861    "ahst",
5862    6,
5863    MR_Q_APPEND,
5864    "m",
5865    MACHINE_TABLE,
5866    "INTO machine (name, vendor, model, os, location, contact, billing_contact, use, status, statuschange, snet_id, address, owner_type, owner_id, acomment, ocomment, created, inuse, mach_id, creator) VALUES (UPPER('%s'), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %d, '%s', '%s', %d, %d, %d, SYSDATE, SYSDATE, %s, %s)",
5867    ahst6_fields,
5868    15,
5869    0,
5870    0,
5871    NULL,
5872    &ahst6_validate,
5873  },
5874
5875  {
5876    /* Q_AHST - ADD_HOST, v8 */ /* Uses prefetch_value() for mach_id */
5877    "add_host",
5878    "ahst",
5879    8,
5880    MR_Q_APPEND,
5881    "m",
5882    MACHINE_TABLE,
5883    "INTO machine (name, vendor, model, os, location, contact, billing_contact, account_number, use, status, statuschange, snet_id, address, owner_type, owner_id, acomment, ocomment, created, inuse, mach_id, creator) VALUES (UPPER('%s'), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL(UPPER('%s'), CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %d, '%s', '%s', %d, %d, %d, SYSDATE, SYSDATE, %s, %s)",
5884    ahst_fields,
5885    16,
5886    0,
5887    0,
5888    NULL,
5889    &ahst_validate,
5890  },
5891
5892  {
5893    /* Q_UHST - UPDATE_HOST, v2 */
5894    "update_host",
5895    "uhst",
5896    2,
5897    MR_Q_UPDATE,
5898    "m",
5899    MACHINE_TABLE,
5900    "machine SET name = NVL(UPPER('%s'), CHR(0)), vendor = NVL(UPPER('%s'), CHR(0)), model = NVL(UPPER('%s'), CHR(0)), os = NVL(UPPER('%s'), CHR(0)), location = NVL(UPPER('%s'), CHR(0)), contact = NVL('%s', CHR(0)), use = %s, status = %s, snet_id = %d, address = '%s', owner_type = '%s', owner_id = %d, acomment = %d, ocomment = %d",
5901    uhst2_fields,
5902    14,
5903    "mach_id = %d",
5904    1,
5905    NULL,
5906    &uhst2_validate,
5907  },
5908
5909  {
5910    /* Q_UHST - UPDATE_HOST, v6 */
5911    "update_host",
5912    "uhst",
5913    6,
5914    MR_Q_UPDATE,
5915    "m",
5916    MACHINE_TABLE,
5917    "machine SET name = NVL(UPPER('%s'), CHR(0)), vendor = NVL(UPPER('%s'), CHR(0)), model = NVL(UPPER('%s'), CHR(0)), os = NVL(UPPER('%s'), CHR(0)), location = NVL(UPPER('%s'), CHR(0)), contact = NVL('%s', CHR(0)), billing_contact = NVL('%s', CHR(0)), use = %s, status = %s, snet_id = %d, address = '%s', owner_type = '%s', owner_id = %d, acomment = %d, ocomment = %d",
5918    uhst6_fields,
5919    15,
5920    "mach_id = %d",
5921    1,
5922    NULL,
5923    &uhst6_validate,
5924  },
5925
5926  {
5927    /* Q_UHST - UPDATE_HOST, v8 */
5928    "update_host",
5929    "uhst",
5930    8,
5931    MR_Q_UPDATE,
5932    "m",
5933    MACHINE_TABLE,
5934    "machine SET name = NVL(UPPER('%s'), CHR(0)), vendor = NVL(UPPER('%s'), CHR(0)), model = NVL(UPPER('%s'), CHR(0)), os = NVL(UPPER('%s'), CHR(0)), location = NVL(UPPER('%s'), CHR(0)), contact = NVL('%s', CHR(0)), billing_contact = NVL('%s', CHR(0)), account_number = NVL('%s', CHR(0)), use = %s, status = %s, snet_id = %d, address = '%s', owner_type = '%s', owner_id = %d, acomment = %d, ocomment = %d",
5935    uhst_fields,
5936    16,
5937    "mach_id = %d",
5938    1,
5939    NULL,
5940    &uhst_validate,
5941  },
5942
5943  {
5944    /* Q_UHHA - UPDATE_HOST_HWADDR */
5945    "update_host_hwaddr",
5946    "uhha",
5947    2,
5948    MR_Q_APPEND,
5949    "hw",
5950    HWADDRMAP_TABLE,
5951    "INTO hwaddrmap (mach_id, hwaddr) VALUES (%d, NVL('%s', CHR(0)))",
5952    ahha_fields,
5953    2,
5954    0,
5955    0,
5956    NULL,
5957    &ahha_validate,
5958  },
5959
5960  {
5961    /* Q_AHHA - ADD_HOST_HWADDR */
5962    "add_host_hwaddr",
5963    "ahha",
5964    2,
5965    MR_Q_APPEND,
5966    "hw",
5967    HWADDRMAP_TABLE,
5968    "INTO hwaddrmap (mach_id, hwaddr) VALUES (%d, NVL('%s', CHR(0)))",
5969    ahha_fields,
5970    2,
5971    0,
5972    0,
5973    NULL,
5974    &ahha_validate,
5975  },
5976
5977  {
5978    /* Q_DHHA - DELETE_HOST_HWADDR */
5979    "delete_host_hwaddr",
5980    "dhha",
5981    2,
5982    MR_Q_DELETE,
5983    "hw",
5984    HWADDRMAP_TABLE,
5985    0,
5986    dhha_fields,
5987    0,
5988    "mach_id = %d AND hwaddr = LOWER('%s')",
5989    2,
5990    NULL,
5991    &dhha_validate,
5992  },
5993
5994  {
5995    /* Q_DHST - DELETE_HOST */
5996    "delete_host",
5997    "dhst",
5998    2,
5999    MR_Q_DELETE,
6000    "m",
6001    MACHINE_TABLE,
6002    NULL,
6003    dhst_fields,
6004    0,
6005    "mach_id = %d",
6006    1,
6007    NULL,
6008    &dhst_validate,
6009  },
6010
6011  {
6012    /* Q_GMAC - GET_MACHINE */
6013    "get_machine",
6014    "gmac",
6015    2,
6016    MR_Q_RETRIEVE,
6017    "m",
6018    MACHINE_TABLE,
6019    "name, vendor, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM machine",
6020    gmac_fields,
6021    5,
6022    "name LIKE UPPER('%s') AND mach_id != 0",
6023    1,
6024    "name",
6025    &VDfix_modby,
6026  },
6027
6028  {
6029    /* Q_GHAL - GET_HOSTALIAS */
6030    "get_hostalias",
6031    "ghal",
6032    2,
6033    MR_Q_RETRIEVE,
6034    "a",
6035    HOSTALIAS_TABLE,
6036    "a.name, m.name FROM hostalias a, machine m",
6037    ghal_fields,
6038    2,
6039    "m.mach_id = a.mach_id and a.name LIKE UPPER('%s') AND m.name LIKE UPPER('%s')",
6040    2,
6041    "a.name",
6042    &ghal_validate,
6043  },
6044
6045  {
6046    /* Q_AHAL - ADD_HOSTALIAS */
6047    "add_hostalias",
6048    "ahal",
6049    2,
6050    MR_Q_APPEND,
6051    "a",
6052    HOSTALIAS_TABLE,
6053    "INTO hostalias (name, mach_id) VALUES (UPPER('%s'), %d)",
6054    ghal_fields,
6055    2,
6056    0,
6057    0,
6058    NULL,
6059    &ahal_validate,
6060  },
6061
6062  {
6063    /* Q_DHAL - DELETE_HOSTALIAS */
6064    "delete_hostalias",
6065    "dhal",
6066    2,
6067    MR_Q_DELETE,
6068    "a",
6069    HOSTALIAS_TABLE,
6070    NULL,
6071    ghal_fields,
6072    0,
6073    "name = UPPER('%s') AND mach_id = %d",
6074    2,
6075    NULL,
6076    &dhal_validate,
6077  },
6078
6079  {
6080    /* Q_GSNT - GET_SUBNET, v2 */
6081    "get_subnet",
6082    "gsnt",
6083    2,
6084    MR_Q_RETRIEVE,
6085    "s",
6086    SUBNET_TABLE,
6087    "name, description, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet",
6088    gsnt2_fields,
6089    12,
6090    "name LIKE UPPER('%s')",
6091    1,
6092    "name",
6093    &gsnt_validate,
6094  },
6095
6096  {
6097    /* Q_GSNT - GET_SUBNET, v8 */
6098    "get_subnet",
6099    "gsnt",
6100    8,
6101    MR_Q_RETRIEVE,
6102    "s",
6103    SUBNET_TABLE,
6104    "name, description, status, contact, account_number, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet",
6105    gsnt_fields,
6106    15,
6107    "name LIKE UPPER('%s')",
6108    1,
6109    "name",
6110    &gsnt_validate,
6111  },
6112
6113  {
6114    /* Q_ASNT - ADD_SUBNET, v2 */
6115    "add_subnet",
6116    "asnt",
6117    2,
6118    MR_Q_APPEND,
6119    "s",
6120    SUBNET_TABLE,
6121    "INTO subnet (name, description, saddr, mask, low, high, prefix, owner_type, owner_id, snet_id) VALUES (UPPER('%s'), NVL('%s', CHR(0)), %s, %s, %s, %s, NVL('%s', CHR(0)), '%s', %d, %s)",
6122    asnt2_fields,
6123    9,
6124    0,
6125    0,
6126    NULL,
6127    &asnt2_validate,
6128  },
6129
6130  {
6131    /* Q_ASNT - ADD_SUBNET, v8 */
6132    "add_subnet",
6133    "asnt",
6134    8,
6135    MR_Q_APPEND,
6136    "s",
6137    SUBNET_TABLE,
6138    "INTO subnet (name, description, status, contact, account_number, saddr, mask, low, high, prefix, owner_type, owner_id, snet_id) VALUES (UPPER('%s'), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, %s, %s, NVL('%s', CHR(0)), '%s', %d, %s)",
6139    asnt_fields,
6140    12,
6141    0,
6142    0,
6143    NULL,
6144    &asnt_validate,
6145  },
6146
6147  {
6148    /* Q_USNT - UPDATE_SUBNET, v2 */
6149    "update_subnet",
6150    "usnt",
6151    2,
6152    MR_Q_UPDATE,
6153    "s",
6154    SUBNET_TABLE,
6155    "subnet SET name = UPPER('%s'), description = NVL('%s', CHR(0)), saddr = %s, mask = %s, low = %s, high = %s, prefix = NVL('%s', CHR(0)), owner_type = '%s', owner_id = %d",
6156    usnt2_fields,
6157    9,
6158    "snet_id = %d",
6159    1,
6160    NULL,
6161    &usnt2_validate,
6162  },
6163
6164  {
6165    /* Q_USNT - UPDATE_SUBNET, v8 */
6166    "update_subnet",
6167    "usnt",
6168    8,
6169    MR_Q_UPDATE,
6170    "s",
6171    SUBNET_TABLE,
6172    "subnet SET name = UPPER('%s'), description = NVL('%s', CHR(0)), status = %s, contact = NVL('%s', CHR(0)), account_number = NVL('%s', CHR(0)), saddr = %s, mask = %s, low = %s, high = %s, prefix = NVL('%s', CHR(0)), owner_type = '%s', owner_id = %d",
6173    usnt_fields,
6174    12,
6175    "snet_id = %d",
6176    1,
6177    NULL,
6178    &usnt_validate,
6179  },
6180
6181  {
6182    /* Q_DSNT - DELETE_SUBNET */
6183    "delete_subnet",
6184    "dsnt",
6185    2,
6186    MR_Q_DELETE,
6187    "s",
6188    SUBNET_TABLE,
6189    NULL,
6190    dsnt_fields,
6191    0,
6192    "snet_id = %d",
6193    1,
6194    NULL,
6195    &dsnt_validate,
6196  },
6197
6198  {
6199    /* Q_GCLU - GET_CLUSTER */
6200    "get_cluster",
6201    "gclu",
6202    2,
6203    MR_Q_RETRIEVE,
6204    "c",
6205    CLUSTERS_TABLE,
6206    "name, description, location, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM clusters",
6207    gclu_fields,
6208    6,
6209    "name LIKE '%s' AND clu_id != 0",
6210    1,
6211    "name",
6212    &VDfix_modby,
6213  },
6214
6215  {
6216    /* Q_ACLU - ADD_CLUSTER */ /* uses prefetch_value() for clu_id */
6217    "add_cluster",
6218    "aclu",
6219    2,
6220    MR_Q_APPEND,
6221    "c",
6222    CLUSTERS_TABLE,
6223    "INTO clusters (name, description, location, clu_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s)",
6224    aclu_fields,
6225    3,
6226    0,
6227    0,
6228    NULL,
6229    &aclu_validate,
6230  },
6231
6232  {
6233    /* Q_UCLU - UPDATE_CLUSTER */
6234    "update_cluster",
6235    "uclu",
6236    2,
6237    MR_Q_UPDATE,
6238    "c",
6239    CLUSTERS_TABLE,
6240    "clusters SET name = '%s', description = NVL('%s', CHR(0)), location = NVL('%s', CHR(0))",
6241    uclu_fields,
6242    3,
6243    "clu_id = %d",
6244    1,
6245    NULL,
6246    &uclu_validate,
6247  },
6248
6249  {
6250    /* Q_DCLU - DELETE_CLUSTER */
6251    "delete_cluster",
6252    "dclu",
6253    2,
6254    MR_Q_DELETE,
6255    "c",
6256    CLUSTERS_TABLE,
6257    NULL,
6258    dclu_fields,
6259    0,
6260    "clu_id = %d",
6261    1,
6262    NULL,
6263    &dclu_validate,
6264  },
6265
6266  {
6267    /* Q_GMCM - GET_MACHINE_TO_CLUSTER_MAP */
6268    "get_machine_to_cluster_map",
6269    "gmcm",
6270    2,
6271    MR_Q_RETRIEVE,
6272    "mcm",
6273    MCMAP_TABLE,
6274    "m.name, c.name FROM machine m, clusters c, mcmap mcm",
6275    gmcm_fields,
6276    2,
6277    "m.name LIKE UPPER('%s') AND c.name LIKE '%s' AND mcm.clu_id = c.clu_id AND mcm.mach_id = m.mach_id",
6278    2,
6279    "m.name",
6280    NULL,
6281  },
6282
6283  {
6284    /* Q_AMTC - ADD_MACHINE_TO_CLUSTER */
6285    "add_machine_to_cluster",
6286    "amtc",
6287    2,
6288    MR_Q_APPEND,
6289    "mcm",
6290    MCMAP_TABLE,
6291    "INTO mcmap (mach_id, clu_id) VALUES (%d, %d)",
6292    gmcm_fields,
6293    2,
6294    0,
6295    0,
6296    NULL,
6297    &amtc_validate,
6298  },
6299
6300  {
6301    /* Q_DMFC - DELETE_MACHINE_FROM_CLUSTER */
6302    "delete_machine_from_cluster",
6303    "dmfc",
6304    2,
6305    MR_Q_DELETE,
6306    "mcm",
6307    MCMAP_TABLE,
6308    0,
6309    gmcm_fields,
6310    0,
6311    "mach_id = %d AND clu_id = %d",
6312    2,
6313    NULL,
6314    &amtc_validate,
6315  },
6316
6317  {
6318    /* Q_GCLD - GET_CLUSTER_DATA */
6319    "get_cluster_data",
6320    "gcld",
6321    2,
6322    MR_Q_RETRIEVE,
6323    "svc",
6324    SVC_TABLE,
6325    "c.name, svc.serv_label, svc.serv_cluster FROM svc svc, clusters c",
6326    gcld_fields,
6327    3,
6328    "c.clu_id = svc.clu_id AND c.name LIKE '%s' AND svc.serv_label LIKE '%s'",
6329    2,
6330    "c.name, svc.serv_label",
6331    NULL,
6332  },
6333
6334  {
6335    /* Q_ACLD - ADD_CLUSTER_DATA */
6336    "add_cluster_data",
6337    "acld",
6338    2,
6339    MR_Q_APPEND,
6340    "svc",
6341    SVC_TABLE,
6342    "INTO svc (clu_id, serv_label, serv_cluster) VALUES (%d, '%s', '%s')",
6343    acld_fields,
6344    3,
6345    NULL,
6346    0,
6347    NULL,
6348    &acld_validate,
6349  },
6350
6351  {
6352    /* Q_DCLD - DELETE_CLUSTER_DATA */
6353    "delete_cluster_data",
6354    "dcld",
6355    2,
6356    MR_Q_DELETE,
6357    "svc",
6358    SVC_TABLE,
6359    NULL,
6360    acld_fields,
6361    0,
6362    "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
6363    3,
6364    NULL,
6365    &dcld_validate,
6366  },
6367
6368  {
6369    /* Q_GLIN - GET_LIST_INFO, v2 */
6370    "get_list_info",
6371    "glin",
6372    2,
6373    MR_Q_RETRIEVE,
6374    "l",
6375    LIST_TABLE,
6376    "name, active, publicflg, hidden, maillist, grouplist, gid, acl_type, acl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list",
6377    glin2_fields,
6378    13,
6379    "name LIKE '%s'",
6380    1,
6381    "name",
6382    &glin_validate,
6383  },
6384
6385  {
6386    /* Q_GLIN - GET_LIST_INFO, v3 */
6387    "get_list_info",
6388    "glin",
6389    3,
6390    MR_Q_RETRIEVE,
6391    "l",
6392    LIST_TABLE,
6393    "name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list",
6394    glin3_fields,
6395    14,
6396    "name LIKE '%s'",
6397    1,
6398    "name",
6399    &glin_validate,
6400  },
6401
6402  {
6403    /* Q_GLIN - GET_LIST_INFO, v4 */
6404    "get_list_info",
6405    "glin",
6406    4,
6407    MR_Q_RETRIEVE,
6408    "l",
6409    LIST_TABLE,
6410    "name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, memacl_type, memacl_id, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM list",
6411    glin4_fields,
6412    16,
6413    "name LIKE '%s'",
6414    1,
6415    "name",
6416    &glin_validate,
6417  },
6418
6419  {
6420    /* Q_GLIN - GET_LIST_INFO, v10 */
6421    "get_list_info",
6422    "glin",
6423    10,
6424    MR_Q_RETRIEVE,
6425    "l",
6426    LIST_TABLE,
6427    "l.name, l.active, l.publicflg, l.hidden, l.maillist, l.grouplist, l.gid, l.nfsgroup, l.mailman, m.name, l.acl_type, l.acl_id, l.memacl_type, l.memacl_id, l.description, TO_CHAR(l.modtime, 'DD-mon-YYYY HH24:MI:SS'), l.modby, l.modwith FROM list l, machine m",
6428    glin_fields,
6429    18,
6430    "l.name LIKE '%s' AND m.mach_id = l.mailman_id",
6431    1,
6432    "l.name",
6433    &glin_validate,
6434  },
6435
6436  {
6437    /* Q_EXLN - EXPAND_LIST_NAMES */
6438    "expand_list_names",
6439    "exln",
6440    2,
6441    MR_Q_RETRIEVE,
6442    "l",
6443    LIST_TABLE,
6444    "name FROM list",
6445    glin_fields,
6446    1,
6447    "name LIKE '%s' AND list_id != 0",
6448    1,
6449    "name",
6450    NULL,
6451  },
6452
6453  {
6454    /* Q_ALIS - ADD_LIST, v2 */ /* uses prefetch_value() for list_id */
6455    "add_list",
6456    "alis",
6457    2,
6458    MR_Q_APPEND,
6459    "l",
6460    LIST_TABLE,
6461    "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, acl_type, acl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, '%s', %d, NVL('%s', CHR(0)), %s)",
6462    alis2_fields,
6463    10,
6464    0,
6465    0,
6466    NULL,
6467    &alis2_validate,
6468  },
6469
6470  {
6471    /* Q_ALIS - ADD_LIST, v3 */ /* uses prefetch_value() for list_id */
6472    "add_list",
6473    "alis",
6474    3,
6475    MR_Q_APPEND,
6476    "l",
6477    LIST_TABLE,
6478    "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, %s, '%s', %d, NVL('%s', CHR(0)), %s)",
6479    alis3_fields,
6480    11,
6481    0,
6482    0,
6483    NULL,
6484    &alis3_validate,
6485  },
6486
6487  {
6488    /* Q_ALIS - ADD_LIST, v4 */ /* uses prefetch_value() for list_id */
6489    "add_list",
6490    "alis",
6491    4,
6492    MR_Q_APPEND,
6493    "l",
6494    LIST_TABLE,
6495    "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, acl_type, acl_id, memacl_type, memacl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, %s, '%s', %d, '%s', %d, NVL('%s', CHR(0)), %s)",
6496    alis4_fields,
6497    13,
6498    0,
6499    0,
6500    NULL,
6501    &alis4_validate,
6502  },
6503
6504  {
6505    /* Q_ALIS - ADD_LIST, v10 */ /* uses prefetch_value() for list_id */
6506    "add_list",
6507    "alis",
6508    10,
6509    MR_Q_APPEND,
6510    "l",
6511    LIST_TABLE,
6512    "INTO list (name, active, publicflg, hidden, maillist, grouplist, gid, nfsgroup, mailman, mailman_id, acl_type, acl_id, memacl_type, memacl_id, description, list_id) VALUES ('%s', %s, %s, %s, %s, %s, %s, %s, %s, %d, '%s', %d, '%s', %d, NVL('%s', CHR(0)), %s)",
6513    alis_fields,
6514    15,
6515    0,
6516    0,
6517    NULL,
6518    &alis_validate,
6519  },
6520
6521  {
6522    /* Q_ULIS - UPDATE_LIST, v2 */
6523    "update_list",
6524    "ulis",
6525    2,
6526    MR_Q_UPDATE,
6527    "l",
6528    LIST_TABLE,
6529    "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, acl_type = '%s', acl_id = %d, description = NVL('%s', CHR(0))",
6530    ulis2_fields,
6531    10,
6532    "list_id = %d",
6533    1,
6534    NULL,
6535    &ulis2_validate,
6536  },
6537
6538  {
6539    /* Q_ULIS - UPDATE_LIST, v3 */
6540    "update_list",
6541    "ulis",
6542    3,
6543    MR_Q_UPDATE,
6544    "l",
6545    LIST_TABLE,
6546    "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, nfsgroup = %s, acl_type = '%s', acl_id = %d, description = NVL('%s', CHR(0))",
6547    ulis3_fields,
6548    11,
6549    "list_id = %d",
6550    1,
6551    NULL,
6552    &ulis3_validate,
6553  },
6554
6555  {
6556    /* Q_ULIS, UPDATE_LIST, v4 */
6557    "update_list",
6558    "ulis",
6559    4,
6560    MR_Q_UPDATE,
6561    "l",
6562    LIST_TABLE,
6563    "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, nfsgroup = %s, acl_type = '%s', acl_id = %d, memacl_type = '%s', memacl_id = %d, description = NVL('%s', CHR(0))",
6564    ulis4_fields,
6565    13,
6566    "list_id = %d",
6567    1,
6568    NULL,
6569    &ulis4_validate,
6570  },
6571
6572  {
6573    /* Q_ULIS, UPDATE_LIST, v10 */
6574    "update_list",
6575    "ulis",
6576    10,
6577    MR_Q_UPDATE,
6578    "l",
6579    LIST_TABLE,
6580    "list SET name = '%s', active = %s, publicflg = %s, hidden = %s, maillist = %s, grouplist = %s, gid = %s, nfsgroup = %s, mailman = %s, mailman_id = %d, acl_type = '%s', acl_id = %d, memacl_type = '%s', memacl_id = %d, description = NVL('%s', CHR(0))",
6581    ulis_fields,
6582    15,
6583    "list_id = %d",
6584    1,
6585    NULL,
6586    &ulis_validate,
6587  },
6588
6589  {
6590    /* Q_DLIS - DELETE_LIST */
6591    "delete_list",
6592    "dlis",
6593    2,
6594    MR_Q_DELETE,
6595    "l",
6596    LIST_TABLE,
6597    NULL,
6598    dlis_fields,
6599    0,
6600    "list_id = %d",
6601    1,
6602    NULL,
6603    &dlis_validate,
6604  },
6605
6606  {
6607    /* Q_AMTL - ADD_MEMBER_TO_LIST */
6608    "add_member_to_list",
6609    "amtl",
6610    2,
6611    MR_Q_APPEND,
6612    0,
6613    IMEMBERS_TABLE,
6614    0,
6615    amtl_fields,
6616    3,
6617    NULL,
6618    0,
6619    NULL,
6620    &amtl_validate,
6621  },
6622
6623  {
6624    /* Q_ATML - ADD_TAGGED_MEMBER_TO_LIST */
6625    "add_tagged_member_to_list",
6626    "atml",
6627    2,
6628    MR_Q_APPEND,
6629    0,
6630    IMEMBERS_TABLE,
6631    0,
6632    atml_fields,
6633    4,
6634    NULL,
6635    0,
6636    NULL,
6637    &atml_validate,
6638  },
6639
6640  {
6641    /* Q_TMOL - TAG_MEMBER_OF_LIST */
6642    "tag_member_of_list",
6643    "tmol",
6644    2,
6645    MR_Q_UPDATE,
6646    0,
6647    IMEMBERS_TABLE,
6648    0,
6649    atml_fields,
6650    1,
6651    0,
6652    3,
6653    NULL,
6654    &tmol_validate,
6655  },
6656
6657  {
6658    /* Q_DMFL - DELETE_MEMBER_FROM_LIST */
6659    "delete_member_from_list",
6660    "dmfl",
6661    2,
6662    MR_Q_DELETE,
6663    0,
6664    IMEMBERS_TABLE,
6665    NULL,
6666    amtl_fields,
6667    0,
6668    0,
6669    3,
6670    NULL,
6671    &dmfl_validate,
6672  },
6673
6674  {
6675    /* Q_GAUS - GET_ACE_USE */
6676    "get_ace_use",
6677    "gaus",
6678    2,
6679    MR_Q_RETRIEVE,
6680    0,
6681    0,
6682    0,
6683    gaus_fields,
6684    2,
6685    0,
6686    2,
6687    NULL,
6688    &gaus_validate,
6689  },
6690
6691  {
6692    /* Q_GHBO - GET_HOST_BY_OWNER */
6693    "get_host_by_owner",
6694    "ghbo",
6695    2,
6696    MR_Q_RETRIEVE,
6697    0,
6698    0,
6699    0,
6700    ghbo_fields,
6701    1,
6702    0,
6703    2,
6704    NULL,
6705    &ghbo_validate,
6706  },
6707
6708  {
6709    /* Q_QGLI - QUALIFIED_GET_LISTS */
6710    "qualified_get_lists",
6711    "qgli",
6712    2,
6713    MR_Q_RETRIEVE,
6714    0,
6715    LIST_TABLE,
6716    0,
6717    qgli_fields,
6718    1,
6719    0,
6720    5,
6721    NULL,
6722    &qgli_validate,
6723  },
6724
6725  {
6726    /* Q_GMOL - GET_MEMBERS_OF_LIST */
6727    "get_members_of_list",
6728    "gmol",
6729    2,
6730    MR_Q_RETRIEVE,
6731    NULL,
6732    IMEMBERS_TABLE,
6733    NULL,
6734    gmol_fields,
6735    2,
6736    NULL,
6737    1,
6738    NULL,
6739    &gmol_validate,
6740  },
6741
6742  {
6743    /* Q_GEML - GET_END_MEMBERS_OF_LIST */
6744    "get_end_members_of_list",
6745    "geml",
6746    2,
6747    MR_Q_RETRIEVE,
6748    NULL,
6749    IMEMBERS_TABLE,
6750    NULL,
6751    gmol_fields,
6752    2,
6753    NULL,
6754    1,
6755    NULL,
6756    &gmol_validate,
6757  },
6758
6759  {
6760    /* Q_GTML - GET_TAGGED_MEMBERS_OF_LIST */
6761    "get_tagged_members_of_list",
6762    "gtml",
6763    2,
6764    MR_Q_RETRIEVE,
6765    NULL,
6766    IMEMBERS_TABLE,
6767    NULL,
6768    gtml_fields,
6769    3,
6770    NULL,
6771    1,
6772    NULL,
6773    &gmol_validate,
6774  },
6775
6776  {
6777    /* Q_GLOM - GET_LISTS_OF_MEMBER */
6778    "get_lists_of_member",
6779    "glom",
6780    2,
6781    MR_Q_RETRIEVE,
6782    0,
6783    IMEMBERS_TABLE,
6784    0,
6785    glom_fields,
6786    6,
6787    0,
6788    2,
6789    NULL,
6790    &glom_validate,
6791  },
6792
6793  {
6794    /* Q_CMOL - COUNT_MEMBERS_OF_LIST */
6795    "count_members_of_list",
6796    "cmol",
6797    2,
6798    MR_Q_RETRIEVE,
6799    0,
6800    IMEMBERS_TABLE,
6801    0,
6802    cmol_fields,
6803    1,
6804    0,
6805    1,
6806    NULL,
6807    &cmol_validate,
6808  },
6809
6810  {
6811    /* Q_GSIN - GET_SERVER_INFO */
6812    "get_server_info",
6813    "gsin",
6814    2,
6815    MR_Q_RETRIEVE,
6816    "s",
6817    SERVERS_TABLE,
6818    "name, update_int, target_file, script, dfgen, dfcheck, type, enable, inprogress, harderror, errmsg, acl_type, acl_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM servers",
6819    gsin_fields,
6820    16,
6821    "name LIKE UPPER('%s')",
6822    1,
6823    "name",
6824    &gsin_validate,
6825  },
6826
6827  {
6828    /* Q_QGSV - QUALIFIED_GET_SERVER */
6829    "qualified_get_server",
6830    "qgsv",
6831    2,
6832    MR_Q_RETRIEVE,
6833    0,
6834    SERVERS_TABLE,
6835    0,
6836    qgsv_fields,
6837    1,
6838    0,
6839    3,
6840    NULL,
6841    &qgsv_validate,
6842  },
6843
6844  {
6845    /* Q_ASIN - ADD_SERVER_INFO */
6846    "add_server_info",
6847    "asin",
6848    2,
6849    MR_Q_APPEND,
6850    "s",
6851    SERVERS_TABLE,
6852    "INTO servers (name, update_int, target_file, script, type, enable, acl_type, acl_id) VALUES (UPPER('%s'), %s, '%s', '%s', '%s', %s, '%s', %d)",
6853    asin_fields,
6854    8,
6855    NULL,
6856    0,
6857    NULL,
6858    &asin_validate,
6859  },
6860
6861  {
6862    /* Q_USIN - UPDATE_SERVER_INFO */
6863    "update_server_info",
6864    "usin",
6865    2,
6866    MR_Q_UPDATE,
6867    "s",
6868    SERVERS_TABLE,
6869    "servers SET update_int = %s, target_file = '%s', script = '%s', type = '%s', enable = %s, acl_type = '%s', acl_id = %d",
6870    asin_fields,
6871    7,
6872    "name = UPPER('%s')",
6873    1,
6874    NULL,
6875    &asin_validate,
6876  },
6877
6878  {
6879    /* Q_RSVE - RESET_SERVER_ERROR */
6880    "reset_server_error",
6881    "rsve",
6882    2,
6883    MR_Q_UPDATE,
6884    "s",
6885    SERVERS_TABLE,
6886    "servers SET harderror = 0, dfcheck = dfgen",
6887    dsin_fields,
6888    0,
6889    "name = UPPER('%s')",
6890    1,
6891    NULL,
6892    &rsve_validate,
6893  },
6894
6895  {
6896    /* Q_SSIF - SET_SERVER_INTERNAL_FLAGS */
6897    "set_server_internal_flags",
6898    "ssif",
6899    2,
6900    MR_Q_UPDATE,
6901    "s",
6902    SERVERS_TABLE,
6903    "servers SET dfgen = %s, dfcheck = %s, inprogress = %s, harderror = %s, errmsg = NVL('%s', CHR(0))",
6904    ssif_fields,
6905    5,
6906    "name = UPPER('%s')",
6907    1,
6908    NULL,
6909    &ssif_validate,
6910  },
6911
6912  {
6913    /* Q_DSIN - DELETE_SERVER_INFO */
6914    "delete_server_info",
6915    "dsin",
6916    2,
6917    MR_Q_DELETE,
6918    "s",
6919    SERVERS_TABLE,
6920    NULL,
6921    dsin_fields,
6922    0,
6923    "name = UPPER('%s')",
6924    1,
6925    NULL,
6926    &dsin_validate,
6927  },
6928
6929  {
6930    /* Q_GSHI - GET_SERVER_HOST_INFO */
6931    "get_server_host_info",
6932    "gshi",
6933    2,
6934    MR_Q_RETRIEVE,
6935    "sh",
6936    SERVERHOSTS_TABLE,
6937    "sh.service, m.name, sh.enable, sh.override, sh.success, sh.inprogress, sh.hosterror, sh.hosterrmsg, sh.ltt, sh.lts, sh.value1, sh.value2, sh.value3, TO_CHAR(sh.modtime, 'DD-mon-YYYY HH24:MI:SS'), sh.modby, sh.modwith FROM serverhosts sh, machine m",
6938    gshi_fields,
6939    16,
6940    "sh.service LIKE UPPER('%s') AND m.name LIKE UPPER('%s') AND m.mach_id = sh.mach_id",
6941    2,
6942    "sh.service, m.name",
6943    &gshi_validate,
6944  },
6945
6946  {
6947    /* Q_QGSH - QUALIFIED_GET_SERVER_HOST */
6948    "qualified_get_server_host",
6949    "qgsh",
6950    2,
6951    MR_Q_RETRIEVE,
6952    0,
6953    SERVERHOSTS_TABLE,
6954    0,
6955    qgsh_fields,
6956    2,
6957    0,
6958    6,
6959    NULL,
6960    &qgsh_validate,
6961  },
6962
6963  {
6964    /* Q_ASHI - ADD_SERVER_HOST_INFO */
6965    "add_server_host_info",
6966    "ashi",
6967    2,
6968    MR_Q_APPEND,
6969    "sh",
6970    SERVERHOSTS_TABLE,
6971    "INTO serverhosts (service, mach_id, enable, value1, value2, value3) VALUES (UPPER('%s'), %d, %s, %s, %s, NVL('%s', CHR(0)))",
6972    ashi_fields,
6973    6,
6974    NULL,
6975    0,
6976    NULL,
6977    &ashi_validate,
6978  },
6979
6980  {
6981    /* Q_USHI - UPDATE_SERVER_HOST_INFO */
6982    "update_server_host_info",
6983    "ushi",
6984    2,
6985    MR_Q_UPDATE,
6986    "sh",
6987    SERVERHOSTS_TABLE,
6988    "serverhosts SET enable = %s, value1 = %s, value2 = %s, value3 = NVL('%s', CHR(0))",
6989    ashi_fields,
6990    4,
6991    "service = UPPER('%s') AND mach_id = %d",
6992    2,
6993    NULL,
6994    &ashi_validate,
6995  },
6996
6997  {
6998    /* Q_RSHE - RESET_SERVER_HOST_ERROR */
6999    "reset_server_host_error",
7000    "rshe",
7001    2,
7002    MR_Q_UPDATE,
7003    "sh",
7004    SERVERHOSTS_TABLE,
7005    "serverhosts SET hosterror = 0",
7006    dshi_fields,
7007    0,
7008    "service = UPPER('%s') AND mach_id = %d",
7009    2,
7010    NULL,
7011    &rshe_validate,
7012  },
7013
7014  {
7015    /* Q_SSHO - SET_SERVER_HOST_OVERRIDE */
7016    "set_server_host_override",
7017    "ssho",
7018    2,
7019    MR_Q_UPDATE,
7020    "sh",
7021    SERVERHOSTS_TABLE,
7022    "serverhosts SET override = 1",
7023    dshi_fields,
7024    0,
7025    "service = UPPER('%s') AND mach_id = %d",
7026    2,
7027    NULL,
7028    &ssho_validate,
7029  },
7030
7031  {
7032    /* Q_SSHI - SET_SERVER_HOST_INTERNAL */
7033    "set_server_host_internal",
7034    "sshi",
7035    2,
7036    MR_Q_UPDATE,
7037    "s",
7038    SERVERHOSTS_TABLE,
7039    "serverhosts SET override = %s, success = %s, inprogress = %s, hosterror = %s, hosterrmsg = NVL('%s', CHR(0)), ltt = %s, lts = %s",
7040    sshi_fields,
7041    7,
7042    "service = UPPER('%s') AND mach_id = %d",
7043    2,
7044    NULL,
7045    &sshi_validate,
7046  },
7047
7048  {
7049    /* Q_DSHI - DELETE_SERVER_HOST_INFO */
7050    "delete_server_host_info",
7051    "dshi",
7052    2,
7053    MR_Q_DELETE,
7054    "sh",
7055    SERVERHOSTS_TABLE,
7056    NULL,
7057    dshi_fields,
7058    0,
7059    "service = UPPER('%s') AND mach_id = %d",
7060    2,
7061    NULL,
7062    &dshi_validate,
7063  },
7064
7065  {
7066    /* Q_GSLO - GET_SERVER_LOCATIONS */
7067    "get_server_locations",
7068    "gslo",
7069    2,
7070    MR_Q_RETRIEVE,
7071    "sh",
7072    SERVERHOSTS_TABLE,
7073    "sh.service, m.name FROM serverhosts sh, machine m",
7074    gslo_fields,
7075    2,
7076    "sh.service LIKE UPPER('%s') AND sh.mach_id = m.mach_id",
7077    1,
7078    "sh.service, m.name",
7079    NULL,
7080  },
7081
7082  {
7083    /* Q_GFSL - GET_FILESYS_BY_LABEL */
7084    "get_filesys_by_label",
7085    "gfsl",
7086    2,
7087    MR_Q_RETRIEVE,
7088    "fs",
7089    FILESYS_TABLE,
7090    "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
7091    gfsl_fields,
7092    14,
7093    "fs.label LIKE '%s' AND fs.mach_id = m.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
7094    1,
7095    "fs.label",
7096    &gfsl_validate,
7097  },
7098
7099  {
7100    /* Q_GFSM - GET_FILESYS_BY_MACHINE */
7101    "get_filesys_by_machine",
7102    "gfsm",
7103    2,
7104    MR_Q_RETRIEVE,
7105    "fs",
7106    FILESYS_TABLE,
7107    "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
7108    gfsm_fields,
7109    14,
7110    "fs.mach_id = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
7111    1,
7112    "fs.label",
7113    &gfsm_validate,
7114  },
7115
7116  {
7117    /* Q_GFSN - GET_FILESYS_BY_NFSPHYS */
7118    "get_filesys_by_nfsphys",
7119    "gfsn",
7120    2,
7121    MR_Q_RETRIEVE,
7122    "fs",
7123    FILESYS_TABLE,
7124    "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l, nfsphys np",
7125    gfsn_fields,
7126    14,
7127    "fs.mach_id = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id AND np.nfsphys_id = fs.phys_id AND np.dir LIKE '%s'",
7128    2,
7129    "fs.label",
7130    &gfsn_validate,
7131  },
7132
7133  {
7134    /* Q_GFSG - GET_FILESYS_BY_GROUP */
7135    "get_filesys_by_group",
7136    "gfsg",
7137    2,
7138    MR_Q_RETRIEVE,
7139    "fs",
7140    FILESYS_TABLE,
7141    "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
7142    gfsg_fields,
7143    14,
7144    "fs.owners = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
7145    1,
7146    "fs.label",
7147    &gfsg_validate,
7148  },
7149
7150  {
7151    /* Q_GFSP - GET_FILESYS_BY_PATH */
7152    "get_filesys_by_path",
7153    "gfsp",
7154    2,
7155    MR_Q_RETRIEVE,
7156    "fs",
7157    FILESYS_TABLE,
7158    "fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
7159    gfsp_fields,
7160    14,
7161    "fs.name LIKE '%s' AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = list_id",
7162    1,
7163    "fs.label",
7164    &VDfix_modby,
7165  },
7166
7167  {
7168    /* Q_AFIL - ADD_FILESYS */ /* uses prefetch_value() for filsys_id */
7169    "add_filesys",
7170    "afil",
7171    2,
7172    MR_Q_APPEND,
7173    "fs",
7174    FILESYS_TABLE,
7175    "INTO filesys (label, type, mach_id, name, mount, rwaccess, comments, owner, owners, createflg, lockertype, filsys_id) VALUES ('%s', '%s', %d, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', NVL('%s', CHR(0)), %d, %d, %s, '%s', %s)",
7176    afil_fields,
7177    11,
7178    0,
7179    0,
7180    NULL,
7181    &afil_validate,
7182  },
7183
7184  {
7185    /* Q_UFIL - UPDATE_FILESYS */
7186    "update_filesys",
7187    "ufil",
7188    2,
7189    MR_Q_UPDATE,
7190    "fs",
7191    FILESYS_TABLE,
7192    "filesys SET label = '%s', type = '%s', mach_id = %d, name = NVL('%s', CHR(0)), mount = NVL('%s', CHR(0)), rwaccess = '%s', comments = NVL('%s', CHR(0)), owner = %d, owners = %d, createflg = %s, lockertype = '%s'",
7193    ufil_fields,
7194    11,
7195    "filsys_id = %d",
7196    1,
7197    NULL,
7198    &ufil_validate,
7199  },
7200
7201  {
7202    /* Q_DFIL - DELETE_FILESYS */
7203    "delete_filesys",
7204    "dfil",
7205    2,
7206    MR_Q_DELETE,
7207    "fs",
7208    FILESYS_TABLE,
7209    NULL,
7210    dfil_fields,
7211    0,
7212    "filsys_id = %d",
7213    1,
7214    NULL,
7215    &dfil_validate,
7216  },
7217
7218  {
7219    /* Q_GFGM - GET_FSGROUP_MEMBERS */
7220    "get_fsgroup_members",
7221    "gfgm",
7222    2,
7223    MR_Q_RETRIEVE,
7224    "fg",
7225    FSGROUP_TABLE,
7226    "fs.label, fg.key FROM fsgroup fg, filesys fs",
7227    gfgm_fields,
7228    2,
7229    "fg.group_id = %d AND fs.filsys_id = fg.filsys_id",
7230    1,
7231    "fs.label, fg.key",
7232    &gfgm_validate,
7233  },
7234
7235  {
7236    /* Q_AFTG - ADD_FILESYS_TO_FSGROUP */
7237    "add_filesys_to_fsgroup",
7238    "aftg",
7239    2,
7240    MR_Q_APPEND,
7241    "fg",
7242    FSGROUP_TABLE,
7243    "INTO fsgroup (group_id, filsys_id, key) VALUES (%d, %d, '%s')",
7244    gfgm_fields,
7245    3,
7246    NULL,
7247    0,
7248    NULL,
7249    &aftg_validate,
7250  },
7251
7252  {
7253    /* Q_RFFG - REMOVE_FILESYS_FROM_FSGROUP */
7254    "remove_filesys_from_fsgroup",
7255    "rffg",
7256    2,
7257    MR_Q_DELETE,
7258    "fg",
7259    FSGROUP_TABLE,
7260    NULL,
7261    gfgm_fields,
7262    0,
7263    "group_id = %d AND filsys_id = %d",
7264    2,
7265    NULL,
7266    &aftg_validate,
7267  },
7268
7269  {
7270    /* Q_GANF - GET_ALL_NFSPHYS */
7271    "get_all_nfsphys",
7272    "ganf",
7273    2,
7274    MR_Q_RETRIEVE,
7275    "np",
7276    NFSPHYS_TABLE,
7277    "m.name, np.dir, np.device, np.status, np.allocated, np.partsize, TO_CHAR(np.modtime, 'DD-mon-YYYY HH24:MI:SS'), np.modby, np.modwith FROM nfsphys np, machine m",
7278    ganf_fields,
7279    9,
7280    "m.mach_id = np.mach_id",
7281    0,
7282    "m.name, np.dir",
7283    &VDfix_modby,
7284  },
7285
7286  {
7287    /* Q_GNFP - GET_NFSPHYS */
7288    "get_nfsphys",
7289    "gnfp",
7290    2,
7291    MR_Q_RETRIEVE,
7292    "np",
7293    NFSPHYS_TABLE,
7294    "m.name, np.dir, np.device, np.status, np.allocated, np.partsize, TO_CHAR(np.modtime, 'DD-mon-YYYY HH24:MI:SS'), np.modby, np.modwith FROM nfsphys np, machine m",
7295    gnfp_fields,
7296    9,
7297    "np.mach_id = %d AND np.dir LIKE '%s' AND m.mach_id = np.mach_id",
7298    2,
7299    "m.name, np.dir",
7300    &gnfp_validate,
7301  },
7302
7303  {
7304    /* Q_ANFP - ADD_NFSPHYS */ /* uses prefetch_value() for nfsphys_id */
7305    "add_nfsphys",
7306    "anfp",
7307    2,
7308    MR_Q_APPEND,
7309    "np",
7310    NFSPHYS_TABLE,
7311    "INTO nfsphys (mach_id, dir, device, status, allocated, partsize, nfsphys_id) VALUES (%d, '%s', NVL('%s', CHR(0)), %s, %s, %s, %s)",
7312    ganf_fields,
7313    6,
7314    0,
7315    0,
7316    NULL,
7317    &anfp_validate,
7318  },
7319
7320  {
7321    /* Q_UNFP - UPDATE_NFSPHYS */
7322    "update_nfsphys",
7323    "unfp",
7324    2,
7325    MR_Q_UPDATE,
7326    "np",
7327    NFSPHYS_TABLE,
7328    "nfsphys SET device = NVL('%s', CHR(0)), status = %s, allocated = %s, partsize = %s",
7329    ganf_fields,
7330    4,
7331    "mach_id = %d AND dir = '%s'",
7332    2,
7333    NULL,
7334    &unfp_validate,
7335  },
7336
7337  {
7338    /* Q_AJNF - ADJUST_NFSPHYS_ALLOCATION */
7339    "adjust_nfsphys_allocation",
7340    "ajnf",
7341    2,
7342    MR_Q_UPDATE,
7343    "np",
7344    NFSPHYS_TABLE,
7345    "nfsphys SET allocated = allocated + %s",
7346    ajnf_fields,
7347    1,
7348    "mach_id = %d AND dir = '%s'",
7349    2,
7350    NULL,
7351    &ajnf_validate,
7352  },
7353
7354  {
7355    /* Q_DNFP - DELETE_NFSPHYS */
7356    "delete_nfsphys",
7357    "dnfp",
7358    2,
7359    MR_Q_DELETE,
7360    "np",
7361    NFSPHYS_TABLE,
7362    NULL,
7363    dnfp_fields,
7364    0,
7365    "mach_id = %d AND dir = '%s'",
7366    2,
7367    NULL,
7368    &dnfp_validate,
7369  },
7370
7371  {
7372    /* Q_GQOT - GET_QUOTA */
7373    "get_quota",
7374    "gqot",
7375    2,
7376    MR_Q_RETRIEVE,
7377    "q",
7378    QUOTA_TABLE,
7379    "fs.label, q.type, q.entity_id, q.quota, q.phys_id, m.name, TO_CHAR(q.modtime, 'DD-mon-YYYY HH24:MI:SS'), q.modby, q.modwith FROM quota q, filesys fs, machine m",
7380    gqot_fields,
7381    9,
7382    "fs.label LIKE '%s' AND q.type = '%s' AND q.entity_id = %d AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
7383    3,
7384    NULL,
7385    &gqot_validate,
7386  },
7387
7388  {
7389    /* Q_GQBF - GET_QUOTA_BY_FILESYS */
7390    "get_quota_by_filesys",
7391    "gqbf",
7392    2,
7393    MR_Q_RETRIEVE,
7394    "q",
7395    QUOTA_TABLE,
7396    "fs.label, q.type, q.entity_id, q.quota, q.phys_id, m.name, TO_CHAR(q.modtime, 'DD-mon-YYYY HH24:MI:SS'), q.modby, q.modwith FROM quota q, filesys fs, machine m",
7397    gqbf_fields,
7398    9,
7399    "fs.label LIKE '%s' AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
7400    1,
7401    "fs.label, q.type",
7402    &gqbf_validate,
7403  },
7404
7405  {
7406    /* Q_AQOT - ADD_QUOTA */ /* prefetch_filsys() gets last 1 value */
7407    "add_quota",
7408    "aqot",
7409    2,
7410    MR_Q_APPEND,
7411    0,
7412    QUOTA_TABLE,
7413    "INTO quota (filsys_id, type, entity_id, quota, phys_id) VALUES ('%s', %d, %d, %s, %s)",
7414    aqot_fields,
7415    4,
7416    NULL,
7417    0,
7418    NULL,
7419    &aqot_validate,
7420  },
7421
7422  {
7423    /* Q_UQOT - UPDATE_QUOTA */
7424    "update_quota",
7425    "uqot",
7426    2,
7427    MR_Q_UPDATE,
7428    0,
7429    QUOTA_TABLE,
7430    "quota SET quota = %s",
7431    aqot_fields,
7432    1,
7433    0,
7434    3,
7435    NULL,
7436    &uqot_validate,
7437  },
7438
7439  {
7440    /* Q_DQOT - DELETE_QUOTA */
7441    "delete_quota",
7442    "dqot",
7443    2,
7444    MR_Q_DELETE,
7445    0,
7446    QUOTA_TABLE,
7447    NULL,
7448    aqot_fields,
7449    0,
7450    0,
7451    3,
7452    NULL,
7453    &dqot_validate,
7454  },
7455
7456  {
7457    /* Q_GNFQ - GET_NFS_QUOTAS */
7458    "get_nfs_quota",
7459    "gnfq",
7460    2,
7461    MR_Q_RETRIEVE,
7462    "q",
7463    QUOTA_TABLE,
7464    "fs.label, u.login, q.quota, q.phys_id, m.name, TO_CHAR(q.modtime, 'DD-mon-YYYY HH24:MI:SS'), q.modby, q.modwith FROM quota q, filesys fs, users u, machine m",
7465    gnfq_fields,
7466    8,
7467    "fs.label LIKE '%s' AND q.type = 'USER' AND q.entity_id = u.users_id AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id AND u.login = '%s'",
7468    2,
7469    "fs.label, u.login",
7470    &gnfq_validate,
7471  },
7472
7473  {
7474    /* Q_GNQP - GET_NFS_QUOTAS_BY_PARTITION */
7475    "get_nfs_quotas_by_partition",
7476    "gnqp",
7477    2,
7478    MR_Q_RETRIEVE,
7479    "q",
7480    QUOTA_TABLE,
7481    "fs.label, u.login, q.quota, np.dir, m.name FROM quota q, filesys fs, users u, nfsphys np, machine m",
7482    gnqp_fields,
7483    5,
7484    "np.mach_id = %d AND np.dir LIKE '%s' AND q.phys_id = np.nfsphys_id AND fs.filsys_id = q.filsys_id AND q.type = 'USER' AND u.users_id = q.entity_id AND m.mach_id = np.mach_id",
7485    2,
7486    "fs.label",
7487    NULL,
7488  },
7489
7490  {
7491    /* Q_ANFQ - ADD_NFS_QUOTA */ /* prefetch_filsys() gets last 1 value */
7492    "add_nfs_quota",
7493    "anfq",
7494    2,
7495    MR_Q_APPEND,
7496    0,
7497    QUOTA_TABLE,
7498    "INTO quota (type, filsys_id, entity_id, quota, phys_id ) VALUES ('USER', %d, %d, %s, %s)",
7499    anfq_fields,
7500    3,
7501    NULL,
7502    0,
7503    NULL,
7504    &anfq_validate,
7505  },
7506
7507  {
7508    /* Q_UNFQ - UPDATE_NFS_QUOTA */
7509    "update_nfs_quota",
7510    "unfq",
7511    2,
7512    MR_Q_UPDATE,
7513    0,
7514    QUOTA_TABLE,
7515    "quota SET quota = %s",
7516    anfq_fields,
7517    1,
7518    0,
7519    2,
7520    NULL,
7521    &unfq_validate,
7522  },
7523
7524  {
7525    /* Q_DNFQ - DELETE_NFS_QUOTA */
7526    "delete_nfs_quota",
7527    "dnfq",
7528    2,
7529    MR_Q_DELETE,
7530    0,
7531    QUOTA_TABLE,
7532    NULL,
7533    anfq_fields,
7534    0,
7535    0,
7536    2,
7537    NULL,
7538    &dnfq_validate,
7539  },
7540
7541  {
7542    /* Q_GZCL - GET_ZEPHYR_CLASS, v2 */
7543    "get_zephyr_class",
7544    "gzcl",
7545    2,
7546    MR_Q_RETRIEVE,
7547    "z",
7548    ZEPHYR_TABLE,
7549    "class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM zephyr",
7550    gzcl2_fields,
7551    12,
7552    "class LIKE '%s'",
7553    1,
7554    "class",
7555    &gzcl_validate,
7556  },
7557
7558  {
7559    /* Q_GZCL - GET_ZEPHYR_CLASS, v5 */
7560    "get_zephyr_class",
7561    "gzcl",
7562    5,
7563    MR_Q_RETRIEVE,
7564    "z",
7565    ZEPHYR_TABLE,
7566    "class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM zephyr",
7567    gzcl_fields,
7568    14,
7569    "class LIKE '%s'",
7570    1,
7571    "class",
7572    &gzcl_validate,
7573  },
7574
7575  {
7576    /* Q_AZCL - ADD_ZEPHYR_CLASS, v2 */
7577    "add_zephyr_class",
7578    "azcl",
7579    2,
7580    MR_Q_APPEND,
7581    "z",
7582    ZEPHYR_TABLE,
7583    "INTO zephyr (class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id) VALUES ('%s', '%s', %d, '%s', %d, '%s', %d, '%s', %d)",
7584    azcl2_fields,
7585    9,
7586    0,
7587    0,
7588    NULL,
7589    &azcl2_validate,
7590  },
7591
7592  {
7593    /* Q_AZCL - ADD_ZEPHYR_CLASS, v5 */
7594    "add_zephyr_class",
7595    "azcl",
7596    5,
7597    MR_Q_APPEND,
7598    "z",
7599    ZEPHYR_TABLE,
7600    "INTO zephyr (class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, owner_type, owner_id) VALUES ('%s', '%s', %d, '%s', %d, '%s', %d, '%s', %d, '%s', %d)",
7601    azcl_fields,
7602    11,
7603    0,
7604    0,
7605    NULL,
7606    &azcl_validate,
7607  },
7608
7609  {
7610    /* Q_UZCL - UPDATE_ZEPHYR_CLASS, v2 */
7611    "update_zephyr_class",
7612    "uzcl",
7613    2,
7614    MR_Q_UPDATE,
7615    "z",
7616    ZEPHYR_TABLE,
7617    "zephyr SET class = '%s', xmt_type = '%s', xmt_id = %d, sub_type = '%s', sub_id = %d, iws_type = '%s', iws_id = %d, iui_type = '%s', iui_id = %d",
7618    uzcl2_fields,
7619    9,
7620    "class = '%s'",
7621    1,
7622    NULL,
7623    &uzcl2_validate,
7624  },
7625
7626  {
7627    /* Q_UZCL - UPDATE_ZEPHYR_CLASS, v5 */
7628    "update_zephyr_class",
7629    "uzcl",
7630    5,
7631    MR_Q_UPDATE,
7632    "z",
7633    ZEPHYR_TABLE,
7634    "zephyr SET class = '%s', xmt_type = '%s', xmt_id = %d, sub_type = '%s', sub_id = %d, iws_type = '%s', iws_id = %d, iui_type = '%s', iui_id = %d, owner_type = '%s', owner_id = %d",
7635    uzcl_fields,
7636    11,
7637    "class = '%s'",
7638    1,
7639    NULL,
7640    &uzcl_validate,
7641  },
7642
7643  {
7644    /* Q_DZCL - DELETE_ZEPHYR_CLASS */
7645    "delete_zephyr_class",
7646    "dzcl",
7647    2,
7648    MR_Q_DELETE,
7649    "z",
7650    ZEPHYR_TABLE,
7651    0,
7652    uzcl_fields,
7653    0,
7654    "class = '%s'",
7655    1,
7656    NULL,
7657    &dzcl_validate,
7658  },
7659
7660  {
7661    /* Q_GSHA - GET_SERVER_HOST_ACCESS */
7662    "get_server_host_access",
7663    "gsha",
7664    2,
7665    MR_Q_RETRIEVE,
7666    "ha",
7667    HOSTACCESS_TABLE,
7668    "m.name, ha.acl_type, ha.acl_id, TO_CHAR(ha.modtime, 'DD-mon-YYYY HH24:MI:SS'), ha.modby, ha.modwith FROM hostaccess ha, machine m",
7669    gsha_fields,
7670    6,
7671    "m.name LIKE UPPER('%s') AND ha.mach_id = m.mach_id",
7672    1,
7673    "m.name",
7674    &gsha_validate,
7675  },
7676
7677  {
7678    /* Q_ASHA - ADD_SERVER_HOST_ACCESS */
7679    "add_server_host_access",
7680    "asha",
7681    2,
7682    MR_Q_APPEND,
7683    "ha",
7684    HOSTACCESS_TABLE,
7685    "INTO hostaccess (mach_id, acl_type, acl_id) VALUES (%d, '%s', %d)",
7686    asha_fields,
7687    3,
7688    0,
7689    0,
7690    NULL,
7691    &asha_validate,
7692  },
7693
7694  {
7695    /* Q_USHA - UPDATE_SERVER_HOST_ACCESS */
7696    "update_server_host_access",
7697    "usha",
7698    2,
7699    MR_Q_UPDATE,
7700    "ha",
7701    HOSTACCESS_TABLE,
7702    "hostaccess SET acl_type = '%s', acl_id = %d",
7703    asha_fields,
7704    2,
7705    "mach_id = %d",
7706    1,
7707    NULL,
7708    &asha_validate,
7709  },
7710
7711  {
7712    /* Q_DSHA - DELETE_SERVER_HOST_ACCESS */
7713    "delete_server_host_access",
7714    "dsha",
7715    2,
7716    MR_Q_DELETE,
7717    "ha",
7718    HOSTACCESS_TABLE,
7719    0,
7720    asha_fields,
7721    0,
7722    "mach_id = %d",
7723    1,
7724    NULL,
7725    &VDmach,
7726  },
7727
7728  {
7729    /* Q_GACL - GET_ACL */
7730    "get_acl",
7731    "gacl",
7732    2,
7733    MR_Q_RETRIEVE,
7734    "ac",
7735    ACL_TABLE,
7736    "m.name, ac.target, ac.kind, l.name FROM acl ac, machine m, list l",
7737    gacl_fields,
7738    4,
7739    "m.mach_id = %d AND m.mach_id = ac.mach_id AND ac.target LIKE '%s' AND l.list_id = ac.list_id",
7740    2,
7741    "m.name, ac.target, ac.kind",
7742    &gacl_validate,
7743  },
7744
7745  {
7746    /* Q_AACL - ADD_ACL */
7747    "add_acl",
7748    "aacl",
7749    2,
7750    MR_Q_APPEND,
7751    "ac",
7752    ACL_TABLE,
7753    "INTO acl (mach_id, target, kind, list_id) VALUES (%d, '%s', '%s', %d)",
7754    aacl_fields,
7755    4,
7756    0,
7757    0,
7758    NULL,
7759    &aacl_validate,
7760  },
7761
7762  {
7763    /* Q_DACL - DELETE_ACL */
7764    "delete_acl",
7765    "dacl",
7766    2,
7767    MR_Q_DELETE,
7768    "ac",
7769    ACL_TABLE,
7770    0,
7771    dacl_fields,
7772    0,
7773    "mach_id = %d AND target = '%s'",
7774    2,
7775    NULL,
7776    &gacl_validate,
7777  },
7778
7779  {
7780    /* Q_GSVC - GET_SERVICE */
7781    "get_service",
7782    "gsvc",
7783    2,
7784    MR_Q_RETRIEVE,
7785    "ss",
7786    SERVICES_TABLE,
7787    "name, protocol, port, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM services",
7788    gsvc_fields,
7789    7,
7790    "name LIKE '%s' AND protocol LIKE '%s'",
7791    2,
7792    "name",
7793    &VDfix_modby,
7794  },
7795
7796  {
7797    /* Q_ASVC - ADD_SERVICE */
7798    "add_service",
7799    "asvc",
7800    2,
7801    MR_Q_APPEND,
7802    "ss",
7803    SERVICES_TABLE,
7804    "INTO services (name, protocol, port, description) VALUES ('%s', '%s', %s, NVL('%s', CHR(0)))",
7805    asvc_fields,
7806    4,
7807    NULL,
7808    0,
7809    NULL,
7810    &asvc_validate,
7811  },
7812
7813  {
7814    /* Q_DSVC - DELETE_SERVICE */
7815    "delete_service",
7816    "dsvc",
7817    2,
7818    MR_Q_DELETE,
7819    "ss",
7820    SERVICES_TABLE,
7821    0,
7822    dsvc_fields,
7823    0,
7824    "name = '%s' AND protocol = '%s'",
7825    2,
7826    NULL,
7827    &dsvc_validate,
7828  },
7829
7830  {
7831    /* Q_GPRN - GET_PRINTER, v2 */
7832    "get_printer",
7833    "gprn",
7834    2,
7835    MR_Q_RETRIEVE,
7836    "pr",
7837    PRINTERS_TABLE,
7838    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
7839    gprn2_fields,
7840    19,
7841    "pr.name LIKE '%s' AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
7842    1,
7843    "pr.name",
7844    &VDfix_modby,
7845  },
7846
7847  {
7848    /* Q_GPRN - GET_PRINTER, v13 */
7849    "get_printer",
7850    "gprn",
7851    13,
7852    MR_Q_RETRIEVE,
7853    "pr",
7854    PRINTERS_TABLE,
7855    "pr.name, pr.type, pr.hwtype, pr.duplexname, pr.duplexdefault, pr.holddefault, pr.status, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, l3.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2, list l3",
7856    gprn_fields,
7857    23,
7858    "pr.name LIKE '%s' AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl AND l3.list_id = pr.report_list",
7859    1,
7860    "pr.name",
7861    &VDfix_modby,
7862  },
7863
7864  {
7865    /* Q_GPBD - GET_PRINTER_BY_DUPLEXNAME, v2 */
7866    "get_printer_by_duplexname",
7867    "gpbd",
7868    2,
7869    MR_Q_RETRIEVE,
7870    "pr",
7871    PRINTERS_TABLE,
7872    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
7873    gpbd2_fields,
7874    19,
7875    "pr.duplexname LIKE '%s' AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
7876    1,
7877    "pr.name",
7878    &VDfix_modby,
7879  },
7880
7881  {
7882    /* Q_GPBD - GET_PRINTER_BY_DUPLEXNAME, v13 */
7883    "get_printer_by_duplexname",
7884    "gpbd",
7885    13,
7886    MR_Q_RETRIEVE,
7887    "pr",
7888    PRINTERS_TABLE,
7889    "pr.name, pr.type, pr.hwtype, pr.duplexname, pr.duplexdefault, pr.holddefault, pr.status, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, l3.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2, list l3",
7890    gpbd_fields,
7891   23,
7892    "pr.duplexname LIKE '%s' AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl AND l3.list_id = pr.report_list",
7893    1,
7894    "pr.name",
7895    &VDfix_modby,
7896  },
7897
7898  {
7899    /* Q_GPBE - GET_PRINTER_BY_ETHERNET, v2 */
7900    "get_printer_by_ethernet",
7901    "gpbe",
7902    2,
7903    MR_Q_RETRIEVE,
7904    "pr",
7905    PRINTERS_TABLE,
7906    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2, hwaddrmap hw",
7907    gpbd2_fields,
7908    19,
7909    "hw.hwaddr LIKE LOWER('%s') AND hw.mach_id = m1.mach_id AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
7910    1,
7911    "pr.name",
7912    &VDfix_modby,
7913  },
7914
7915  {
7916    /* Q_GPBE - GET_PRINTER_BY_ETHERNET, v13 */
7917    "get_printer_by_ethernet",
7918    "gpbe",
7919    13,
7920    MR_Q_RETRIEVE,
7921    "pr",
7922    PRINTERS_TABLE,
7923    "pr.name, pr.type, pr.hwtype, pr.duplexname, pr.duplexdefault, pr.holddefault, pr.status, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, l3.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2, list l3",
7924    gpbd_fields,
7925    23,
7926    "hw.hwaddr LIKE LOWER('%s') AND hw.mach_id = m1.mach_id AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl AND l3.list_id = pr.report_list",
7927    1,
7928    "pr.name",
7929    &VDfix_modby,
7930  },
7931
7932  {
7933    /* Q_GPBH - GET_PRINTER_BY_HOSTNAME, v2 */
7934    "get_printer_by_hostname",
7935    "gpbh",
7936    2,
7937    MR_Q_RETRIEVE,
7938    "pr",
7939    PRINTERS_TABLE,
7940    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
7941    gpbh2_fields,
7942    19,
7943    "m1.name LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
7944    1,
7945    "pr.name",
7946    &VDfix_modby,
7947  },
7948
7949  {
7950    /* Q_GPBH - GET_PRINTER_BY_HOSTNAME, v13 */
7951    "get_printer_by_hostname",
7952    "gpbh",
7953    13,
7954    MR_Q_RETRIEVE,
7955    "pr",
7956    PRINTERS_TABLE,
7957    "pr.name, pr.type, pr.hwtype, pr.duplexname, pr.duplexdefault, pr.holddefault, pr.status, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, l3.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2, list l3",
7958    gpbh_fields,
7959    23,
7960    "m1.name LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl AND l3.list_id = pr.report_list",
7961    1,
7962    "pr.name",
7963    &VDfix_modby,
7964  },
7965
7966  {
7967    /* Q_GPBR - GET_PRINTER_BY_RM, v2 */
7968    "get_printer_by_rm",
7969    "gpbr",
7970    2,
7971    MR_Q_RETRIEVE,
7972    "pr",
7973    PRINTERS_TABLE,
7974    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
7975    gpbr2_fields,
7976    19,
7977    "m3.name LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
7978    1,
7979    "pr.name",
7980    &VDfix_modby,
7981  },
7982
7983  {
7984    /* Q_GPBR - GET_PRINTER_BY_RM, v13 */
7985    "get_printer_by_rm",
7986    "gpbr",
7987    13,
7988    MR_Q_RETRIEVE,
7989    "pr",
7990    PRINTERS_TABLE,
7991    "pr.name, pr.type, pr.hwtype, pr.duplexname, pr.duplexdefault, pr.holddefault, pr.status, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, l3.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2, list l3",
7992    gpbr_fields,
7993    23,
7994    "m3.name LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl AND l3.list_id = pr.report_list",
7995    1,
7996    "pr.name",
7997    &VDfix_modby,
7998  },
7999
8000  {
8001    /* Q_GPBL - GET_PRINTER_BY_LOCATION, v2 */
8002    "get_printer_by_location",
8003    "gpbl",
8004    2,
8005    MR_Q_RETRIEVE,
8006    "pr",
8007    PRINTERS_TABLE,
8008    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
8009    gpbl2_fields,
8010    19,
8011    "UPPER(pr.location) LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
8012    1,
8013    "pr.name",
8014    &VDfix_modby,
8015  },
8016
8017  {
8018    /* Q_GPBL - GET_PRINTER_BY_LOCATION, v13 */
8019    "get_printer_by_location",
8020    "gpbl",
8021    13,
8022    MR_Q_RETRIEVE,
8023    "pr",
8024    PRINTERS_TABLE,
8025    "pr.name, pr.type, pr.hwtype, pr.duplexname, pr.duplexdefault, pr.holddefault, pr.status, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, l3.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2, list l3",
8026    gpbl_fields,
8027    23,
8028    "UPPER(pr.location) LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl AND l3.list_id = pr.report_list",
8029    1,
8030    "pr.name",
8031    &VDfix_modby,
8032  },
8033
8034  {
8035    /* Q_GPBC - GET_PRINTER_BY_CONTACT, v2 */
8036    "get_printer_by_contact",
8037    "gpbc",
8038    2,
8039    MR_Q_RETRIEVE,
8040    "pr",
8041    PRINTERS_TABLE,
8042    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
8043    gpbc2_fields,
8044    19,
8045    "UPPER(pr.contact) LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
8046    1,
8047    "pr.name",
8048    &VDfix_modby,
8049  },
8050
8051  {
8052    /* Q_GPBC - GET_PRINTER_BY_CONTACT, v13 */
8053    "get_printer_by_contact",
8054    "gpbc",
8055    13,
8056    MR_Q_RETRIEVE,
8057    "pr",
8058    PRINTERS_TABLE,
8059    "pr.name, pr.type, pr.hwtype, pr.duplexname, pr.duplexdefault, pr.holddefault, pr.status, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, l3.name, pr.banner, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2, list l3",
8060    gpbc_fields,
8061    23,
8062    "UPPER(pr.contact) LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl AND l3.list_id = pr.report_list",
8063    1,
8064    "pr.name",
8065    &VDfix_modby,
8066  },
8067
8068  {
8069    /* Q_APRN - ADD_PRINTER, v2 */
8070    "add_printer",
8071    "aprn",
8072    2,
8073    MR_Q_APPEND,
8074    "pr",
8075    PRINTERS_TABLE,
8076    "INTO printers (name, type, hwtype, duplexname, mach_id, loghost, rm, rp, rq, ka, pc, ac, lpc_acl, banner, location, contact) VALUES ('%s', '%s', '%s', NVL('%s', CHR(0)), %d, %d, %d, NVL('%s', CHR(0)), %d, %s, %s, %d, %d, %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)))",
8077    aprn2_fields,
8078    16,
8079    0,
8080    0,
8081    NULL,
8082    &aprn2_validate,
8083  },
8084
8085  {
8086    /* Q_APRN - ADD_PRINTER, v13 */
8087    "add_printer",
8088    "aprn",
8089    13,
8090    MR_Q_APPEND,
8091    "pr",
8092    PRINTERS_TABLE,
8093    "INTO printers (name, type, hwtype, duplexname, duplexdefault, holddefault, status, mach_id, loghost, rm, rp, rq, ka, pc, ac, lpc_acl, report_list, banner, location, contact) VALUES ('%s', '%s', '%s', NVL('%s', CHR(0)), %s, %s, %s, %d, %d, %d, NVL('%s', CHR(0)), %d, %s, %s, %d, %d, %d, %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)))",
8094    aprn_fields,
8095    20,
8096    0,
8097    0,
8098    NULL,
8099    &aprn_validate,
8100  },
8101
8102  {
8103    /* Q_UPRN - UPDATE_PRINTER, v2 */
8104    "update_printer",
8105    "uprn",
8106    2,
8107    MR_Q_UPDATE,
8108    "pr",
8109    PRINTERS_TABLE,
8110    "printers SET name = '%s', type = '%s', hwtype = '%s', duplexname = NVL('%s', CHR(0)), mach_id = %d, loghost = %d, rm = %d, rp = NVL('%s', CHR(0)), rq = %d, ka = %s, pc = %s, ac = %d, lpc_acl = %d, banner = %s, location = NVL('%s', CHR(0)), contact = NVL('%s', CHR(0))",
8111    uprn2_fields,
8112    16,
8113    "name = '%s'",
8114    1,
8115    NULL,
8116    &uprn2_validate,
8117  },
8118
8119  {
8120    /* Q_UPRN - UPDATE_PRINTER, v13 */
8121    "update_printer",
8122    "uprn",
8123    13,
8124    MR_Q_UPDATE,
8125    "pr",
8126    PRINTERS_TABLE,
8127    "printers SET name = '%s', type = '%s', hwtype = '%s', duplexname = NVL('%s', CHR(0)), duplexdefault = %s, holddefault = %s, status = %s, mach_id = %d, loghost = %d, rm = %d, rp = NVL('%s', CHR(0)), rq = %d, ka = %s, pc = %s, ac = %d, lpc_acl = %d, report_list = %d, banner = %s, location = NVL('%s', CHR(0)), contact = NVL('%s', CHR(0))",
8128    uprn_fields,
8129    20,
8130    "name = '%s'",
8131    1,
8132    NULL,
8133    &uprn_validate,
8134  },
8135
8136  {
8137    /* Q_DPRN - DELETE_PRINTER */
8138    "delete_printer",
8139    "dprn",
8140    2,
8141    MR_Q_DELETE,
8142    "pr",
8143    PRINTERS_TABLE,
8144    0,
8145    aprn_fields,
8146    0,
8147    "name = '%s'",
8148    1,
8149    NULL,
8150    &dprn_validate,
8151  },
8152
8153  {
8154    /* Q_GPSV - GET_PRINT_SERVER */
8155    "get_print_server",
8156    "gpsv",
8157    2,
8158    MR_Q_RETRIEVE,
8159    "ps",
8160    PRINTSERVERS_TABLE,
8161    "m.name, ps.kind, s.string, ps.owner_type, ps.owner_id, l.name, TO_CHAR(ps.modtime, 'DD-mon-YYYY HH24:MI:SS'), ps.modby, ps.modwith FROM printservers ps, machine m, strings s, list l",
8162    gpsv_fields,
8163    9,
8164    "ps.mach_id = %d AND m.mach_id = ps.mach_id AND s.string_id = ps.printer_types AND l.list_id = ps.lpc_acl",
8165    1,
8166    NULL,
8167    &gpsv_validate,
8168  },
8169
8170  {
8171    /* Q_APSV - ADD_PRINT_SERVER */
8172    "add_print_server",
8173    "apsv",
8174    2,
8175    MR_Q_APPEND,
8176    "ps",
8177    PRINTSERVERS_TABLE,
8178    "INTO printservers (mach_id, kind, printer_types, owner_type, owner_id, lpc_acl) VALUES (%d, '%s', %d, '%s', %d, %d)",
8179    apsv_fields,
8180    6,
8181    0,
8182    0,
8183    NULL,
8184    &apsv_validate,
8185  },
8186
8187  {
8188    /* Q_UPSV - UPDATE_PRINT_SERVER */
8189    "update_print_server",
8190    "upsv",
8191    2,
8192    MR_Q_UPDATE,
8193    "ps",
8194    PRINTSERVERS_TABLE,
8195    "printservers SET kind = '%s', printer_types = %d, owner_type = '%s', owner_id = %d, lpc_acl = %d",
8196    apsv_fields,
8197    5,
8198    "mach_id = %d",
8199    1,
8200    NULL,
8201    &apsv_validate,
8202  },
8203
8204  {
8205    /* Q_DPSV - DELETE_PRINT_SERVER */
8206    "delete_print_server",
8207    "dpsv",
8208    2,
8209    MR_Q_DELETE,
8210    "ps",
8211    PRINTSERVERS_TABLE,
8212    0,
8213    dpsv_fields,
8214    0,
8215    "mach_id = %d",
8216    1,
8217    NULL,
8218    &dpsv_validate,
8219  },
8220
8221  {
8222    /* Q_GALI - GET_ALIAS */
8223    "get_alias",
8224    "gali",
8225    2,
8226    MR_Q_RETRIEVE,
8227    "a",
8228    ALIAS_TABLE,
8229    "name, type, trans FROM alias",
8230    gali_fields,
8231    3,
8232    "name LIKE '%s' AND type LIKE '%s' AND trans LIKE '%s'",
8233    3,
8234    "type, name, trans",
8235    NULL,
8236  },
8237
8238  {
8239    /* Q_AALI - ADD_ALIAS */
8240    "add_alias",
8241    "aali",
8242    2,
8243    MR_Q_APPEND,
8244    "a",
8245    ALIAS_TABLE,
8246    "INTO alias (name, type, trans) VALUES ('%s', '%s', '%s')",
8247    aali_fields,
8248    3,
8249    NULL,
8250    0,
8251    NULL,
8252    &aali_validate,
8253  },
8254
8255  {
8256    /* Q_DALI - DELETE_ALIAS */
8257    "delete_alias",
8258    "dali",
8259    2,
8260    MR_Q_DELETE,
8261    "a",
8262    ALIAS_TABLE,
8263    NULL,
8264    aali_fields,
8265    0,
8266    "name = '%s' AND type = '%s' AND  trans = '%s'",
8267    3,
8268    NULL,
8269    &dali_validate,
8270  },
8271
8272  {
8273    /* Q_GVAL - GET_VALUE */
8274    "get_value",
8275    "gval",
8276    2,
8277    MR_Q_RETRIEVE,
8278    "val",
8279    NUMVALUES_TABLE,
8280    "value FROM numvalues",
8281    gval_fields,
8282    1,
8283    "name = '%s'",
8284    1,
8285    NULL,
8286    &gval_validate,
8287  },
8288
8289  {
8290    /* Q_AVAL - ADD_VALUE */
8291    "add_value",
8292    "aval",
8293    2,
8294    MR_Q_APPEND,
8295    "val",
8296    NUMVALUES_TABLE,
8297    "INTO numvalues (name, value) VALUES ('%s', %s)",
8298    aval_fields,
8299    2,
8300    NULL,
8301    0,
8302    NULL,
8303    &aval_validate,
8304  },
8305
8306  {
8307    /* Q_UVAL - UPDATE_VALUE */
8308    "update_value",
8309    "uval",
8310    2,
8311    MR_Q_UPDATE,
8312    "val",
8313    NUMVALUES_TABLE,
8314    "numvalues SET value = %s",
8315    aval_fields,
8316    1,
8317    "name = '%s'",
8318    1,
8319    NULL,
8320    &aval_validate,
8321  },
8322
8323  {
8324    /* Q_DVAL - DELETE_VALUE */
8325    "delete_value",
8326    "dval",
8327    2,
8328    MR_Q_DELETE,
8329    "val",
8330    NUMVALUES_TABLE,
8331    NULL,
8332    dval_fields,
8333    0,
8334    "name = '%s'",
8335    1,
8336    NULL,
8337    &aval_validate,
8338  },
8339
8340  {
8341    /* Q_GATS - GET_ALL_TABLE_STATS */
8342    "get_all_table_stats",
8343    "gats",
8344    2,
8345    MR_Q_RETRIEVE,
8346    "tbs",
8347    TBLSTATS_TABLE,
8348    "table_name, appends, updates, deletes, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS') FROM tblstats",
8349    gats_fields,
8350    5,
8351    NULL,
8352    0,
8353    "table_name",
8354    0,
8355  },
8356
8357  {
8358    /* Q__SDL - _SET_DEBUG_LEVEL */
8359    "_set_debug_level",
8360    "_sdl",
8361    2,
8362    MR_Q_UPDATE,
8363    NULL,
8364    0,
8365    NULL,
8366    _sdl_fields,
8367    1,
8368    NULL,
8369    0,
8370    NULL,
8371    &_sdl_validate,
8372  },
8373
8374  {
8375    /* Q_GCON - GET_CONTAINER, v7 */
8376    "get_container",
8377    "gcon",
8378    7,
8379    MR_Q_RETRIEVE,
8380    "c",
8381    CONTAINERS_TABLE,
8382    "name, description, location, contact, acl_type, acl_id, memacl_type, memacl_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM containers",
8383    gcon7_fields,
8384    11,
8385    "LOWER(name) LIKE LOWER('%s') AND cnt_id != 0",
8386    1,
8387    NULL,
8388    &gcon_validate,
8389  },
8390
8391  {
8392    /* Q_GCON - GET_CONTAINER, v9 */
8393    "get_container",
8394    "gcon",
8395    9,
8396    MR_Q_RETRIEVE,
8397    "c",
8398    CONTAINERS_TABLE,
8399    "name, publicflg, description, location, contact, acl_type, acl_id, memacl_type, memacl_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM containers",
8400    gcon_fields,
8401    12,
8402    "LOWER(name) LIKE LOWER('%s') AND cnt_id != 0",
8403    1,
8404    NULL,
8405    &gcon_validate,
8406  },
8407
8408  {
8409    /* Q_ACON - ADD_CONTAINER, v7 */ /* uses prefetch_value() for cnt_id */
8410    "add_container",
8411    "acon",
8412    7,
8413    MR_Q_APPEND,
8414    "c",
8415    CONTAINERS_TABLE,
8416    "INTO containers (name, description, location, contact, acl_type, acl_id, memacl_type, memacl_id, cnt_id) VALUES ('%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, '%s', %d, %s)",
8417    acon7_fields,
8418    8,
8419    0,
8420    0,
8421    NULL,
8422    &acon7_validate,
8423  },
8424
8425  {
8426    /* Q_ACON - ADD_CONTAINER, v9 */ /* uses prefetch_value() for cnt_id */
8427    "add_container",
8428    "acon",
8429    9,
8430    MR_Q_APPEND,
8431    "c",
8432    CONTAINERS_TABLE,
8433    "INTO containers (name, publicflg, description, location, contact, acl_type, acl_id, memacl_type, memacl_id, cnt_id) VALUES ('%s', %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, '%s', %d, %s)",
8434    acon_fields,
8435    9,
8436    0,
8437    0,
8438    NULL,
8439    &acon_validate,
8440  },
8441
8442  {
8443    /* Q_UCON - UPDATE_CONTAINER, v7 */
8444    "update_container",
8445    "ucon",
8446    7,
8447    MR_Q_UPDATE,
8448    0,
8449    CONTAINERS_TABLE,
8450    0,
8451    ucon7_fields,
8452    8,
8453    0,
8454    1,
8455    NULL,
8456    &ucon7_validate,
8457  },
8458
8459  {
8460    /* Q_UCON - UPDATE_CONTAINER, v9 */
8461    "update_container",
8462    "ucon",
8463    9,
8464    MR_Q_UPDATE,
8465    0,
8466    CONTAINERS_TABLE,
8467    0,
8468    ucon_fields,
8469    9,
8470    0,
8471    1,
8472    NULL,
8473    &ucon_validate,
8474  },
8475
8476  {
8477    /* Q_DCON - DELETE_CONTAINER, v7 */
8478    "delete_container",
8479    "dcon",
8480    7,
8481    MR_Q_DELETE,
8482    "c",
8483    CONTAINERS_TABLE,
8484    NULL,
8485    dcon_fields,
8486    0,
8487    "cnt_id = %d",
8488    1,
8489    NULL,
8490    &dcon_validate,
8491  },
8492
8493  {
8494    /* Q_AMCN - ADD_MACHINE_TO_CONTAINER, v7 */
8495    "add_machine_to_container",
8496    "amcn",
8497    7,
8498    MR_Q_APPEND,
8499    "mcn",
8500    MCNTMAP_TABLE,
8501    "INTO mcntmap (mach_id, cnt_id) VALUES (%d, %d)",
8502    amcn_fields,
8503    2,
8504    0,
8505    0,
8506    NULL,
8507    &amcn_validate,
8508  },
8509
8510  {
8511    /* Q_DMCN - DELETE_MACHINE_FROM_CONTAINER, v7 */
8512    "delete_machine_from_container",
8513    "dmcn",
8514    7,
8515    MR_Q_DELETE,
8516    "mcn",
8517    MCNTMAP_TABLE,
8518    0,
8519    amcn_fields,
8520    0,
8521    "mach_id = %d AND cnt_id = %d",
8522    2,
8523    NULL,
8524    &dmcn_validate,
8525  },
8526
8527  {
8528    /* Q_GMNM - GET_MACHINE_TO_CONTAINER_MAP, v7 */
8529    "get_machine_to_container_map",
8530    "gmnm",
8531    7,
8532    MR_Q_RETRIEVE,
8533    "mcn",
8534    MCNTMAP_TABLE,
8535    "m.name, c.name FROM machine m, containers c, mcntmap mcn",
8536    gmnm_fields,
8537    2,
8538    "m.name LIKE UPPER('%s') AND mcn.cnt_id = c.cnt_id AND mcn.mach_id = m.mach_id",
8539    1,
8540    NULL,
8541    NULL,
8542  },
8543
8544  {
8545    /* Q_GMOC - GET_MACHINES_OF_CONTAINER, v7 */
8546    "get_machines_of_container",
8547    "gmoc",
8548    7,
8549    MR_Q_RETRIEVE,
8550    NULL,
8551    MCNTMAP_TABLE,
8552    NULL,
8553    gmoc_fields,
8554    2,
8555    NULL,
8556    2,
8557    NULL,
8558    &gmoc_validate,
8559  },
8560
8561  {
8562    /* Q_GSOC - GET_SUBCONTAINERS_OF_CONTAINER, v7 */
8563    "get_subcontainers_of_container",
8564    "gsoc",
8565    7,
8566    MR_Q_RETRIEVE,
8567    NULL,
8568    CONTAINERS_TABLE,
8569    NULL,
8570    gsoc_fields,
8571    1,
8572    NULL,
8573    2,
8574    NULL,
8575    &gsoc_validate,
8576  },
8577
8578  {
8579    /* Q_GTLC - GET_TOPLEVEL_CONTAINERS, v7 */
8580    "get_toplevel_containers",
8581    "gtlc",
8582    7,
8583    MR_Q_RETRIEVE,
8584    "c",
8585    CONTAINERS_TABLE,
8586    "name FROM containers",
8587    gtlc_fields,
8588    1,
8589    "name NOT LIKE '%%/%%'",
8590    0,
8591    "name",
8592    NULL,
8593  },
8594
8595  {
8596    /* Q_SCLI - SET_CONTAINER_LIST, v9 */
8597    "set_container_list",
8598    "scli",
8599    9,
8600    MR_Q_UPDATE,
8601    0,
8602    CONTAINERS_TABLE,
8603    0,
8604    scli_fields,
8605    1,
8606    0,
8607    1,
8608    NULL,
8609    &scli_validate,
8610  },
8611
8612  {
8613    /* Q_GCLI - GET_CONTAINER_LIST, v9 */
8614    "get_container_list",
8615    "gcli",
8616    9,
8617    MR_Q_RETRIEVE,
8618    "c",
8619    CONTAINERS_TABLE,
8620    "c.name, l.name FROM containers c, list l",
8621    gcli_fields,
8622    2,
8623    "LOWER(c.name) = LOWER('%s') AND c.list_id = l.list_id AND c.list_id != 0",
8624    1,
8625    NULL,
8626    NULL,
8627  },
8628
8629  {
8630    /* G_GLIC - GET_LIST_CONTAINER, v9 */
8631    "get_list_container",
8632    "glic",
8633    9,
8634    MR_Q_RETRIEVE,
8635    "c",
8636    CONTAINERS_TABLE,
8637    "c.name, l.name FROM containers c, list l",
8638    glic_fields,
8639    2,
8640    "l.list_id = %d AND l.list_id = c.list_id and c.list_id != 0",
8641    1,
8642    NULL,
8643    &glic_validate,
8644  },
8645
8646};
8647
8648int QueryCount = (sizeof(Queries) / sizeof(struct query));
Note: See TracBrowser for help on using the repository browser.