]> andersk Git - moira.git/blobdiff - server/queries2.c
Double size of max_row_count.
[moira.git] / server / queries2.c
index e95279f5536b726bd6359f29d59bb0eba22bfc3d..4c7d7e9712a58b3d10acab4b7d15bfb7070df4a4 100644 (file)
@@ -42,6 +42,10 @@ static struct valobj VOfilesys0[] = {
   {V_ID, 0, FILESYS_TABLE, "label", "filsys_id", MR_FILESYS},
 };
 
+static struct valobj VOcon0[] = {
+       {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
+};
+
 static struct valobj VOnum0[] = {
   {V_NUM, 0},
 };
@@ -86,7 +90,7 @@ static char *gual_fields[] = {
   "login",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "comments", "signature", "secure",
-  "modtime", "modby", "modwith",
+  "modtime", "modby", "modwith", "created", "creator",
 };
 
 static char *gubl2_fields[] = {
@@ -98,10 +102,11 @@ static char *gubl2_fields[] = {
 static char *gubl_fields[] = {
   "login",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
-  "status", "clearid", "class", "modtime", "modby", "modwith",
+  "status", "clearid", "class", "modtime", "modby", "modwith", "created",
+  "creator", 
 };
 
-static struct validate gubl_validate =
+static struct validate gubl2_validate =
 {
   0,
   0,
@@ -114,6 +119,19 @@ static struct validate gubl_validate =
   followup_fix_modby,
 };
 
+static struct validate gubl_validate =
+{
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  access_login,
+  0,
+  followup_get_user,
+};
+
 static char *guau2_fields[] = {
   "unix_uid",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
@@ -125,7 +143,7 @@ static char *guau_fields[] = {
   "unix_uid",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "comments", "signature", "secure",
-  "modtime", "modby", "modwith",
+  "modtime", "modby", "modwith", "created", "creator",
 };
 
 static char *guan2_fields[] = {
@@ -139,10 +157,10 @@ static char *guan_fields[] = {
   "first", "last",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "comments", "signature", "secure",
-  "modtime", "modby", "modwith",
+  "modtime", "modby", "modwith", "created", "creator",
 };
 
-static struct validate guan_validate =
+static struct validate guan2_validate =
 {
   0,
   0,
@@ -155,6 +173,19 @@ static struct validate guan_validate =
   followup_fix_modby,
 };
 
+static struct validate guan_validate =
+{
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  followup_get_user,
+};
+
 static char *guac2_fields[] = {
   "class",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
@@ -166,7 +197,7 @@ static char *guac_fields[] = {
   "class",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "comments", "signature", "secure",
-  "modtime", "modby", "modwith",
+  "modtime", "modby", "modwith", "created", "creator",
 };
 
 static char *guam2_fields[] = {
@@ -180,7 +211,7 @@ static char *guam_fields[] = {
   "clearid",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "comments", "signature", "secure",
-  "modtime", "modby", "modwith",
+  "modtime", "modby", "modwith", "created", "creator", 
 };
 
 static char *gubu2_fields[] = {
@@ -192,10 +223,11 @@ static char *gubu2_fields[] = {
 static char *gubu_fields[] = {
   "unix_uid",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
-  "status", "clearid", "class", "modtime", "modby", "modwith",
+  "status", "clearid", "class", "modtime", "modby", "modwith", "created",
+  "creator",
 };
 
-static struct validate gubu_validate =
+static struct validate gubu2_validate =
 {
   VOnum0,
   1,
@@ -208,6 +240,19 @@ static struct validate gubu_validate =
   followup_fix_modby,
 };
 
+static struct validate gubu_validate =
+{
+  VOnum0,
+  1,
+  0,
+  0,
+  0,
+  0,
+  access_login,
+  0,
+  followup_get_user,
+};
+
 static char *gubn2_fields[] = {
   "first", "last",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
@@ -217,10 +262,11 @@ static char *gubn2_fields[] = {
 static char *gubn_fields[] = {
   "first", "last",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
-  "status", "clearid", "class", "modtime", "modby", "modwith",
+  "status", "clearid", "class", "modtime", "modby", "modwith", "created",
+  "creator",
 };
 
-static struct validate gubn_validate =
+static struct validate gubn2_validate =
 {
   0,
   0,
@@ -233,6 +279,19 @@ static struct validate gubn_validate =
   followup_fix_modby,
 };
 
+static struct validate gubn_validate =
+{
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  followup_get_user,
+};
+
 static char *gubc2_fields[] = {
   "class",
   "login", "unix_uid", "shell", "last", "first", "middle", "status",
@@ -243,6 +302,7 @@ static char *gubc_fields[] = {
   "class",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle", 
   "status", "clearid", "class", "modtime", "modby", "modwith",
+  "created", "creator",
 };
 
 static char *gubm2_fields[] = {
@@ -255,6 +315,7 @@ static char *gubm_fields[] = {
   "clearid",
   "login", "unix_uid", "shell", "winconsoleshell", "last", "first", 
   "middle", "status", "clearid", "class", "modtime", "modby", "modwith",
+  "created", "creator",
 };
 
 static char *auac2_fields[] = {
@@ -767,7 +828,7 @@ static char *gmac_fields[] = {
   "name", "type", "modtime", "modby", "modwith",
 };
 
-static char *ghst_fields[] = {
+static char *ghst2_fields[] = {
   "name", "address", "location", "network",
   "name", "vendor", "model", "os", "location", "contact", "use",
   "status", "status_change", "network", "address", "ace_type",
@@ -775,6 +836,54 @@ static char *ghst_fields[] = {
   "inuse", "modtime", "modby", "modwith",
 };
 
+static char *ghbh2_fields[] = {
+  "hwaddr",
+  "name", "vendor", "model", "os", "location", "contact", "use",
+  "status", "status_change", "network", "address", "ace_type",
+  "ace_name", "admin_comment", "ops_comment", "created", "creator",
+  "inuse", "modtime", "modby", "modwith",
+};
+
+static char *ghst6_fields[] = {
+  "name", "address", "location", "network",
+  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "use", "status", "status_change", "network", "address", "ace_type",
+  "ace_name", "admin_comment", "ops_comment", "created", "creator",
+  "inuse", "modtime", "modby", "modwith",
+};
+
+static char *ghbh6_fields[] = {
+  "hwaddr",
+  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "use", "status", "status_change", "network", "address", "ace_type",
+  "ace_name", "admin_comment", "ops_comment", "created", "creator",
+  "inuse", "modtime", "modby", "modwith",
+};
+
+static char *ghst_fields[] = {
+  "name", "address", "location", "network",
+  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "account_number", "use", "status", "status_change", "network", "address", 
+  "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
+  "inuse", "modtime", "modby", "modwith",
+};
+
+static char *ghbh_fields[] = {
+  "hwaddr",
+  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "account_number", "use", "status", "status_change", "network", "address", 
+  "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
+  "inuse", "modtime", "modby", "modwith",
+};
+
+static char *ghba_fields[] = {
+  "account_number",
+  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "account_number", "use", "status", "status_change", "network", "address", 
+  "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
+  "inuse", "modtime", "modby", "modwith",
+};
+
 static struct validate ghst_validate = {
   0,
   0,
@@ -792,13 +901,13 @@ static char *ghha_fields[] = {
   "hwaddr",
 };
 
-static char *ahst_fields[] = {
+static char *ahst2_fields[] = {
   "name", "vendor", "model", "os", "location", "contact", "use",
   "status", "subnet", "address", "ace_type", "ace_name",
   "admin_comment", "ops_comment",
 };
 
-static struct valobj ahst_valobj[] = {
+static struct valobj ahst2_valobj[] = {
   {V_CHAR, 0, MACHINE_TABLE, "name"},
   {V_CHAR, 1, MACHINE_TABLE, "vendor"},
   {V_CHAR, 2, MACHINE_TABLE, "model"},
@@ -814,9 +923,80 @@ static struct valobj ahst_valobj[] = {
   {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
 };
 
+static struct validate ahst2_validate = {
+  ahst2_valobj,
+  13,
+  "name",
+  "name = UPPER('%s')",
+  1,
+  "mach_id",
+  access_host,
+  setup_ahst,
+  set_uppercase_modtime,
+};
+
+static char *ahst6_fields[] = {
+  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "use", "status", "subnet", "address", "ace_type", "ace_name",
+  "admin_comment", "ops_comment",
+};
+
+static struct valobj ahst6_valobj[] = {
+  {V_CHAR, 0, MACHINE_TABLE, "name"},
+  {V_CHAR, 1, MACHINE_TABLE, "vendor"},
+  {V_CHAR, 2, MACHINE_TABLE, "model"},
+  {V_CHAR, 3, MACHINE_TABLE, "os"},
+  {V_CHAR, 4, MACHINE_TABLE, "location"},
+  {V_CHAR, 5, MACHINE_TABLE, "contact"},
+  {V_CHAR, 6, MACHINE_TABLE, "billing_contact"},
+  {V_NUM, 7},
+  {V_NUM, 8},
+  {V_ID, 9, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
+  {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
+  {V_ID, 13, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+  {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+};
+
+static struct validate ahst6_validate = {
+  ahst6_valobj,
+  14,
+  "name",
+  "name = UPPER('%s')",
+  1,
+  "mach_id",
+  access_host,
+  setup_ahst,
+  set_uppercase_modtime,
+};
+
+static char *ahst_fields[] = {
+  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "account_number", "use", "status", "subnet", "address", "ace_type", 
+  "ace_name", "admin_comment", "ops_comment",
+};
+
+static struct valobj ahst_valobj[] = {
+  {V_CHAR, 0, MACHINE_TABLE, "name"},
+  {V_CHAR, 1, MACHINE_TABLE, "vendor"},
+  {V_CHAR, 2, MACHINE_TABLE, "model"},
+  {V_CHAR, 3, MACHINE_TABLE, "os"},
+  {V_CHAR, 4, MACHINE_TABLE, "location"},
+  {V_CHAR, 5, MACHINE_TABLE, "contact"},
+  {V_CHAR, 6, MACHINE_TABLE, "billing_contact"},
+  {V_CHAR, 7, MACHINE_TABLE, "account_number"},
+  {V_NUM, 8},
+  {V_NUM, 9},
+  {V_ID, 10, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
+  {V_TYPE, 12, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 13, 0, 0, 0, MR_ACE},
+  {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+  {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+};
+
 static struct validate ahst_validate = {
   ahst_valobj,
-  13,
+  15,
   "name",
   "name = UPPER('%s')",
   1,
@@ -826,14 +1006,14 @@ static struct validate ahst_validate = {
   set_uppercase_modtime,
 };
 
-static char *uhst_fields[] = {
+static char *uhst2_fields[] = {
   "name",
   "newname", "vendor", "model", "os", "location", "contact", "use",
   "status", "subnet", "address", "ace_type", "ace_name",
   "admin_comment", "ops_comment",
 };
 
-static struct valobj uhst_valobj[] = {
+static struct valobj uhst2_valobj[] = {
   {V_CHAR, 0, MACHINE_TABLE, "name"},
   {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
   {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
@@ -851,9 +1031,86 @@ static struct valobj uhst_valobj[] = {
   {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
 };
 
+static struct validate uhst2_validate = {
+  uhst2_valobj,
+  15,
+  0,
+  0,
+  0,
+  "mach_id",
+  access_host,
+  setup_ahst,
+  set_modtime_by_id,
+};
+
+static char *uhst6_fields[] = {
+  "name",
+  "newname", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "use", "status", "subnet", "address", "ace_type", "ace_name",
+  "admin_comment", "ops_comment",
+};
+
+static struct valobj uhst6_valobj[] = {
+  {V_CHAR, 0, MACHINE_TABLE, "name"},
+  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+  {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
+  {V_CHAR, 2, MACHINE_TABLE, "vendor"},
+  {V_CHAR, 3, MACHINE_TABLE, "model"},
+  {V_CHAR, 4, MACHINE_TABLE, "os"},
+  {V_CHAR, 5, MACHINE_TABLE, "location"},
+  {V_CHAR, 6, MACHINE_TABLE, "contact"},
+  {V_CHAR, 7, MACHINE_TABLE, "billing_contact"},
+  {V_NUM, 8},
+  {V_NUM, 9},
+  {V_ID, 10, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
+  {V_TYPE, 12, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 13, 0, 0, 0, MR_ACE},
+  {V_ID, 14, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+  {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+};
+
+static struct validate uhst6_validate = {
+  uhst6_valobj,
+  16,
+  0,
+  0,
+  0,
+  "mach_id",
+  access_host,
+  setup_ahst,
+  set_modtime_by_id,
+};
+
+static char *uhst_fields[] = {
+  "name",
+  "newname", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "account_number", "use", "status", "subnet", "address", "ace_type", 
+  "ace_name", "admin_comment", "ops_comment",
+};
+
+static struct valobj uhst_valobj[] = {
+  {V_CHAR, 0, MACHINE_TABLE, "name"},
+  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+  {V_RENAME, 1, MACHINE_TABLE, "name", "mach_id", MR_NOT_UNIQUE},
+  {V_CHAR, 2, MACHINE_TABLE, "vendor"},
+  {V_CHAR, 3, MACHINE_TABLE, "model"},
+  {V_CHAR, 4, MACHINE_TABLE, "os"},
+  {V_CHAR, 5, MACHINE_TABLE, "location"},
+  {V_CHAR, 6, MACHINE_TABLE, "contact"},
+  {V_CHAR, 7, MACHINE_TABLE, "billing_contact"},
+  {V_CHAR, 8, MACHINE_TABLE, "account_number"},
+  {V_NUM, 9},
+  {V_NUM, 10},
+  {V_ID, 11, SUBNET_TABLE, "name", "snet_id", MR_SUBNET},
+  {V_TYPE, 13, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 14, 0, 0, 0, MR_ACE},
+  {V_ID, 15, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+  {V_ID, 16, STRINGS_TABLE, "string", "string_id", MR_NO_MATCH},
+};
+
 static struct validate uhst_validate = {
   uhst_valobj,
-  15,
+  17,
   0,
   0,
   0,
@@ -951,12 +1208,19 @@ static struct validate dhal_validate = {
   0,
 };
 
-static char *gsnt_fields[] = {
+static char *gsnt2_fields[] = {
   "name",
   "name", "description", "address", "mask", "low", "high", "prefix",
   "ace_type", "ace_name", "modtime", "modby", "modwith"
 };
 
+static char *gsnt_fields[] = {
+  "name",
+  "name", "description", "status", "contact", "account_number", "address", 
+  "mask", "low", "high", "prefix", "ace_type", "ace_name", "modtime", 
+  "modby", "modwith"
+};
+
 static struct validate gsnt_validate = {
   0,
   0,
@@ -969,12 +1233,12 @@ static struct validate gsnt_validate = {
   followup_gsnt,
 };
 
-static char *asnt_fields[] = {
+static char *asnt2_fields[] = {
   "name", "description", "address", "mask", "low", "high", "prefix",
   "ace_type", "ace_name",
 };
 
-static struct valobj asnt_valobj[] = {
+static struct valobj asnt2_valobj[] = {
   {V_CHAR, 0, SUBNET_TABLE, "name"},
   {V_LEN, 1, SUBNET_TABLE, "description"},
   {V_NUM, 2},
@@ -986,9 +1250,9 @@ static struct valobj asnt_valobj[] = {
   {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
 };
 
-static struct validate asnt_validate =
+static struct validate asnt2_validate =
 {
-  asnt_valobj,
+  asnt2_valobj,
   9,
   "name",
   "name = UPPER('%s')",
@@ -999,13 +1263,46 @@ static struct validate asnt_validate =
   set_uppercase_modtime,
 };
 
-static char *usnt_fields[] = {
+static char *asnt_fields[] = {
+  "name", "description", "status", "contact", "account_number", "address", 
+  "mask", "low", "high", "prefix", "ace_type", "ace_name",
+};
+
+static struct valobj asnt_valobj[] = {
+  {V_CHAR, 0, SUBNET_TABLE, "name"},
+  {V_LEN, 1, SUBNET_TABLE, "description"},
+  {V_NUM, 2},
+  {V_CHAR, 3, SUBNET_TABLE, "contact"},
+  {V_CHAR, 4, SUBNET_TABLE, "account_number"},
+  {V_NUM, 5},
+  {V_NUM, 6},
+  {V_NUM, 7},
+  {V_NUM, 8},
+  {V_LEN, 9, SUBNET_TABLE, "prefix"},
+  {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 11, 0, 0, 0, MR_ACE},
+};
+
+static struct validate asnt_validate =
+{
+  asnt_valobj,
+  12,
+  "name",
+  "name = UPPER('%s')",
+  1,
+  "snet_id",
+  0,
+  setup_asnt,
+  set_uppercase_modtime,
+};
+
+static char *usnt2_fields[] = {
   "name",
   "newname", "description", "address", "mask", "low", "high", "prefix",
   "ace_type", "ace_name",
 };
 
-static struct valobj usnt_valobj[] = {
+static struct valobj usnt2_valobj[] = {
   {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
   {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
   {V_LEN, 2, SUBNET_TABLE, "description"},
@@ -1018,9 +1315,9 @@ static struct valobj usnt_valobj[] = {
   {V_TYPEDATA, 9, 0, 0, 0, MR_ACE},
 };
 
-static struct validate usnt_validate =
+static struct validate usnt2_validate =
 {
-  usnt_valobj,
+  usnt2_valobj,
   10,
   "name",
   "snet_id = %d",
@@ -1031,6 +1328,41 @@ static struct validate usnt_validate =
   set_modtime_by_id,
 };
 
+static char *usnt_fields[] = {
+  "name",
+  "newname", "description", "status", "contact", "account_number", "address", 
+  "mask", "low", "high", "prefix", "ace_type", "ace_name",
+};
+
+static struct valobj usnt_valobj[] = {
+  {V_ID, 0, SUBNET_TABLE, "name", "snet_id", MR_NO_MATCH},
+  {V_RENAME, 1, SUBNET_TABLE, "name", "snet_id", MR_NOT_UNIQUE},
+  {V_LEN, 2, SUBNET_TABLE, "description"},
+  {V_NUM, 3},
+  {V_CHAR, 4, SUBNET_TABLE, "contact"},
+  {V_CHAR, 5, SUBNET_TABLE, "account_number"},
+  {V_NUM, 6},
+  {V_NUM, 7},
+  {V_NUM, 8},
+  {V_NUM, 9},
+  {V_LEN, 10, SUBNET_TABLE, "prefix"},
+  {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
+};
+
+static struct validate usnt_validate =
+{
+  usnt_valobj,
+  13,
+  "name",
+  "snet_id = %d",
+  1,
+  "snet_id",
+  0,
+  setup_asnt,
+  set_modtime_by_id,
+};
+
 static char *dsnt_fields[] = {
   "name",
 };
@@ -1187,13 +1519,20 @@ static char *glin2_fields[] = {
   "ace_type", "ace_name", "description", "modtime", "modby", "modwith",
 };
 
-static char *glin_fields[] = {
+static char *glin3_fields[] = {
   "name",
   "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
   "nfsgroup", "ace_type", "ace_name", "description", "modtime", "modby", 
   "modwith",
 };
 
+static char *glin_fields[] = {
+  "name",
+  "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
+  "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name", 
+  "description", "modtime", "modby", "modwith",
+};
+
 static struct validate glin_validate = {
   0,
   0,
@@ -1236,12 +1575,12 @@ static struct validate alis2_validate = {
   set_modtime,
 };
 
-static char *alis_fields[] = {
+static char *alis3_fields[] = {
   "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
   "nfsgroup", "ace_type", "ace_name", "description",
 };
 
-static struct valobj alis_valobj[] = {
+static struct valobj alis3_valobj[] = {
   {V_CHAR, 0, LIST_TABLE, "name"},
   {V_NUM, 1},
   {V_NUM, 2},
@@ -1255,9 +1594,43 @@ static struct valobj alis_valobj[] = {
   {V_LEN, 10, LIST_TABLE, "description"},
 };
 
+static struct validate alis3_validate = {
+  alis3_valobj,
+  11,
+  "name",
+  "name = '%s'",
+  1,
+  "list_id",
+  0,
+  setup_alis,
+  set_modtime,
+};
+
+static char *alis_fields[] = {
+  "name", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
+  "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name", 
+  "description",
+};
+
+static struct valobj alis_valobj[] = {
+  {V_CHAR, 0, LIST_TABLE, "name"},
+  {V_NUM, 1},
+  {V_NUM, 2},
+  {V_NUM, 3},
+  {V_NUM, 4},
+  {V_NUM, 5},
+  {V_NUM, 6},
+  {V_NUM, 7},
+  {V_TYPE, 8, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
+  {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE},
+  {V_LEN, 12, LIST_TABLE, "description"},
+};
+
 static struct validate alis_validate = {
   alis_valobj,
-  11,
+  13,
   "name",
   "name = '%s'",
   1,
@@ -1299,12 +1672,46 @@ static struct validate ulis2_validate = {
   set_modtime_by_id,
 };
 
-static char *ulis_fields[] = {
+static char *ulis3_fields[] = {
   "name",
   "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid", 
   "nfsgroup", "ace_type", "ace_name", "description",
 };
 
+static struct valobj ulis3_valobj[] = {
+  {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
+  {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
+  {V_NUM, 2},
+  {V_NUM, 3},
+  {V_NUM, 4},
+  {V_NUM, 5},
+  {V_NUM, 6},
+  {V_NUM, 7},
+  {V_NUM, 8},
+  {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
+  {V_LEN, 11, LIST_TABLE, "description"},
+};
+
+static struct validate ulis3_validate = {
+  ulis3_valobj,
+  12,
+  "name", 
+  "list_id = %d",
+  1,
+  "list_id",
+  access_list,
+  setup_alis,
+  set_modtime_by_id,
+};
+
+static char *ulis_fields[] = {
+  "name",
+  "newname", "active", "publicflg", "hidden", "maillist", "grouplist", "gid",
+  "nfsgroup", "ace_type", "ace_name", "memace_type", "memace_name",
+  "description",
+};
+
 static struct valobj ulis_valobj[] = {
   {V_ID, 0, LIST_TABLE, "name", "list_id", MR_LIST},
   {V_RENAME, 1, LIST_TABLE, "name", "list_id", MR_NOT_UNIQUE},
@@ -1317,13 +1724,15 @@ static struct valobj ulis_valobj[] = {
   {V_NUM, 8},
   {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
   {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
-  {V_LEN, 11, LIST_TABLE, "description"},
+  {V_TYPE, 11, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 12, 0, 0, "list_id", MR_ACE},
+  {V_LEN, 13, LIST_TABLE, "description"},
 };
 
 static struct validate ulis_validate = {
   ulis_valobj,
-  12,
-  "name", 
+  14,
+  "name",
   "list_id = %d",
   1,
   "list_id",
@@ -1562,7 +1971,7 @@ static struct validate gsin_validate =
   0,
   access_service,
   0,
-  followup_glin,
+  followup_gsin,
 };
 
 static char *qgsv_fields[] = {
@@ -2260,13 +2669,20 @@ static struct validate dnfq_validate = {
   followup_dqot,
 };
 
-static char *gzcl_fields[] = {
+static char *gzcl2_fields[] = {
   "class",
   "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
   "iws_type", "iws_name", "iui_type", "iui_name",
   "modtime", "modby", "modwith",
 };
 
+static char *gzcl_fields[] = {
+  "class",
+  "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
+  "iws_type", "iws_name", "iui_type", "iui_name", "owner_type",
+  "owner_id", "modtime", "modby", "modwith",
+};
+
 static struct validate gzcl_validate = {
   0,
   0,
@@ -2274,14 +2690,44 @@ static struct validate gzcl_validate = {
   0,
   0,
   0,
-  0,
+  access_zephyr,
   0,
   followup_gzcl,
 };
 
-static char *azcl_fields[] = {
+static char *azcl2_fields[] = {
   "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
   "iws_type", "iws_name", "iui_type", "iui_name",
+};  
+
+static struct valobj azcl2_valobj[] = {
+  {V_CHAR, 0, ZEPHYR_TABLE, "class"},
+  {V_TYPE, 1, 0, "zace_type", 0, MR_ACE},
+  {V_TYPEDATA, 2, 0, 0, "list_id", MR_ACE},
+  {V_TYPE, 3, 0, "zace_type", 0, MR_ACE},
+  {V_TYPEDATA, 4, 0, 0, "list_id", MR_ACE},
+  {V_TYPE, 5, 0, "zace_type", 0, MR_ACE},
+  {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
+  {V_TYPE, 7, 0, "zace_type", 0, MR_ACE},
+  {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
+};
+
+static struct validate azcl2_validate = {
+  azcl2_valobj,
+  9,
+  "class",
+  "class = '%s'",
+  1,
+  0,
+  0,
+  0,
+  set_zephyr_modtime,
+};
+
+static char *azcl_fields[] = {
+  "class", "xmt_type", "xmt_name", "sub_type", "sub_name",
+  "iws_type", "iws_name", "iui_type", "iui_name", "owner_type", 
+  "owner_id",
 };
 
 static struct valobj azcl_valobj[] = {
@@ -2294,11 +2740,13 @@ static struct valobj azcl_valobj[] = {
   {V_TYPEDATA, 6, 0, 0, "list_id", MR_ACE},
   {V_TYPE, 7, 0, "zace_type", 0, MR_ACE},
   {V_TYPEDATA, 8, 0, 0, "list_id", MR_ACE},
+  {V_TYPE, 9, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 10, 0, 0, "list_id", MR_ACE},
 };
 
 static struct validate azcl_validate = {
   azcl_valobj,
-  9,
+  11,
   "class",
   "class = '%s'",
   1,
@@ -2308,11 +2756,41 @@ static struct validate azcl_validate = {
   set_zephyr_modtime,
 };
 
-static char *uzcl_fields[] = {
+static char *uzcl2_fields[] = {
   "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
   "iws_type", "iws_name", "iui_type", "iui_name",
 };
 
+static struct valobj uzcl2_valobj[] = {
+  {V_NAME, 0, ZEPHYR_TABLE, "class", 0, MR_BAD_CLASS},
+  {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE},
+  {V_TYPE, 2, 0, "zace_type", 0, MR_ACE},
+  {V_TYPEDATA, 3, 0, 0, "list_id", MR_ACE},
+  {V_TYPE, 4, 0, "zace_type", 0, MR_ACE},
+  {V_TYPEDATA, 5, 0, 0, "list_id", MR_ACE},
+  {V_TYPE, 6, 0, "zace_type", 0, MR_ACE},
+  {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
+  {V_TYPE, 8, 0, "zace_type", 0, MR_ACE},
+  {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
+};
+
+static struct validate uzcl2_validate = {
+  uzcl2_valobj,
+  10,
+  "class",
+  "class = '%s'",
+  1,
+  0,
+  access_zephyr,
+  0,
+  set_zephyr_modtime,
+};
+
+static char *uzcl_fields[] = {
+  "class", "newclass", "xmt_type", "xmt_name", "sub_type", "sub_name",
+  "iws_type", "iws_name", "iui_type", "iui_name", "owner_type", "owner_id",
+};
+
 static struct valobj uzcl_valobj[] = {
   {V_NAME, 0, ZEPHYR_TABLE, "class", 0, MR_BAD_CLASS},
   {V_RENAME, 1, ZEPHYR_TABLE, "class", 0, MR_NOT_UNIQUE},
@@ -2324,16 +2802,18 @@ static struct valobj uzcl_valobj[] = {
   {V_TYPEDATA, 7, 0, 0, "list_id", MR_ACE},
   {V_TYPE, 8, 0, "zace_type", 0, MR_ACE},
   {V_TYPEDATA, 9, 0, 0, "list_id", MR_ACE},
+  {V_TYPE, 10, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 11, 0, 0, "list_id", MR_ACE},
 };
 
 static struct validate uzcl_validate = {
   uzcl_valobj,
-  10,
+  12,
   "class",
   "class = '%s'",
   1,
   0,
-  0,
+  access_zephyr,
   0,
   set_zephyr_modtime,
 };
@@ -2438,7 +2918,7 @@ static struct validate aacl_validate =
 };
 
 static char *gsvc_fields[] = {
-  "service",
+  "service", "protocol",
   "service", "protocol", "port", "description", "modtime", "modby", "modwith",
 };
 
@@ -2446,6 +2926,10 @@ static char *asvc_fields[] = {
   "service", "protocol", "port", "description",
 };
 
+static char *dsvc_fields[] = {
+  "service", "protocol",
+};
+
 static struct valobj asvc_valobj[] = {
   {V_CHAR, 0, SERVICES_TABLE, "name"},
   {V_CHAR, 1, SERVICES_TABLE, "protocol"},
@@ -2457,12 +2941,24 @@ static struct validate asvc_validate = {
   asvc_valobj,
   4,
   "name",
-  "name = '%s'",
-  1,
+  "name = '%s' AND protocol = '%s'",
+  2,
+  0,
+  0,
+  0,
+  set_service_modtime,
+};
+
+static struct validate dsvc_validate = {
+  asvc_valobj,
+  2,
+  "name",
+  "name = '%s' AND protocol = '%s'",
+  2,
+  0,
   0,
   0,
   0,
-  set_modtime,
 };
 
 static char *gprn_fields[] = {
@@ -2705,76 +3201,328 @@ static struct validate dali_validate = /* DELETE_ALIAS */
   0,
 };
 
-static char *gval_fields[] = {
-  "name", "value",
-};
-
-static struct valobj gval_valobj[] = {
-  {V_NAME, 0, NUMVALUES_TABLE, "name", 0, MR_NO_MATCH},
+static char *gval_fields[] = {
+  "name", "value",
+};
+
+static struct valobj gval_valobj[] = {
+  {V_NAME, 0, NUMVALUES_TABLE, "name", 0, MR_NO_MATCH},
+};
+
+static struct validate gval_validate = {
+  gval_valobj,
+  1,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+};
+
+static char *aval_fields[] = {
+  "name", "value",
+};
+
+static struct valobj aval_valobj[] = {
+  {V_CHAR, 0, NUMVALUES_TABLE, "name"},
+  {V_NUM, 1},
+};
+
+static struct validate aval_validate = /* for aval, uval, and dval */
+{
+  aval_valobj,
+  2,
+  "name",
+  "name = '%s'",
+  1,
+  0,
+  0,
+  0,
+  0,
+};
+
+static char *dval_fields[] = {
+  "name",
+};
+
+static char *gats_fields[] = {
+  "table_name", "appends", "updates", "deletes",
+  "modtime", "modby", "modwith",
+};
+
+static char *_sdl_fields[] = {
+  "level",
+};
+
+static struct validate _sdl_validate =
+{
+  VOnum0,
+  1,
+  NULL,
+  NULL,
+  0,
+  0,
+  0,
+  0,
+  _sdl_followup,
+};
+
+static char *gusl_fields[] = {
+  "login", "domain_sid", 
+  "login", "sid", "created",
+};
+
+static struct validate gusl_validate =
+{
+  VOuser0,
+  1,
+  NULL,
+  NULL,
+  0,
+  0,
+  0,
+  0,
+  0,
+};
+
+static char *glsn_fields[] = {
+  "name", "domain_sid",
+  "name", "sid", "created",
+};
+
+static struct validate glsn_validate = 
+{
+  VOlist0,
+  1,
+  NULL,
+  NULL,
+  0,
+  0,
+  0,
+  0,
+  0,
+};
+
+static char *ausl_fields[] = {
+  "login", "sid",
+};
+
+static struct validate ausl_validate =
+{
+  VOuser0,
+  1,
+  "sid",
+  "users_id = %d AND sid = '%s'",
+  2,
+  0,
+  0,
+  0,
+  0,
+};
+
+static char *alsn_fields[] = {
+  "name", "sid",
+};
+
+static struct validate alsn_validate =
+{
+  VOlist0,
+  1,
+  "sid",
+  "list_id = %d AND sid = '%s'",
+  2,
+  0,
+  0,
+  0,
+  0,
+};
+
+static char *gdds_fields[] = {
+  "sid",
+};
+
+static char *gcon_fields[] = {
+  "name",
+  "name", "description", "location", "contact",
+  "ace_type", "ace_name", "memace_type", "memace_name", "modtime", "modby", "modwith",
+};
+
+static struct validate gcon_validate = {
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  followup_gcon,
+};
+
+static char *acon_fields[] = {
+  "name", "description", "location", "contact",
+  "ace_type", "ace_name", "memace_type", "memace_name",
+};
+
+static struct valobj acon_valobj[] = {
+  {V_CHAR, 0, CONTAINERS_TABLE, "name"},
+  {V_LEN, 1, CONTAINERS_TABLE, "description"},
+  {V_CHAR, 2, CONTAINERS_TABLE, "location"},
+  {V_CHAR, 3, CONTAINERS_TABLE, "contact"},
+  {V_TYPE, 4, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 5, 0, 0, 0, MR_ACE},
+  {V_TYPE, 6, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 7, 0, 0, 0, MR_ACE},
+};
+
+static struct validate acon_validate =
+{
+  acon_valobj,
+  8,
+  "name",
+  "name = '%s'",
+  1,
+  "cnt_id",
+  0,
+  prefetch_value,
+  set_modtime,
+};
+
+static char *ucon_fields[] = {
+  "name",
+  "newname", "description", "location", "contact",
+  "ace_type", "ace_name", "memace_type", "memace_name",
+};
+
+static struct valobj ucon_valobj[] = {
+  {V_ID, 0, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
+  {V_RENAME, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_NOT_UNIQUE},
+  {V_LEN, 2, CONTAINERS_TABLE, "description"},
+  {V_CHAR, 3, CONTAINERS_TABLE, "location"},
+  {V_CHAR, 4, CONTAINERS_TABLE, "contact"},
+  {V_TYPE, 5, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 6, 0, 0, 0, MR_ACE},
+  {V_TYPE, 7, 0, "ace_type", 0, MR_ACE},
+  {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
+};
+
+static struct validate ucon_validate =
+{
+  ucon_valobj,
+  9,
+  0,
+  0,
+  0,
+  0,
+  access_container,
+  0,
+  update_container,
+};
+
+static char *dcon_fields[] = {
+  "name",
 };
 
-static struct validate gval_validate = {
-  gval_valobj,
+static struct validate dcon_validate =
+{
+  VOcon0,
   1,
   0,
   0,
   0,
   0,
   0,
-  0,
+  setup_dcon,
   0,
 };
 
-static char *aval_fields[] = {
-  "name", "value",
+static char *amcn_fields[] = {
+  "machine", "container",
 };
 
-static struct valobj aval_valobj[] = {
-  {V_CHAR, 0, NUMVALUES_TABLE, "name"},
-  {V_NUM, 1},
+static struct valobj amcn_valobj[] =   /* ADD_MACHINE_TO_CONTAINER */
+{                                      /* DELETE_MACHINE_FROM_CONTAINER */
+  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+  {V_ID, 1, CONTAINERS_TABLE, "name", "cnt_id", MR_CONTAINER},
 };
 
-static struct validate aval_validate = /* for aval, uval, and dval */
+static struct validate amcn_validate = /* for amtn and dmfn */
 {
-  aval_valobj,
+  amcn_valobj,
   2,
-  "name",
-  "name = '%s'",
+  "mach_id",
+  "mach_id = %d",
   1,
   0,
+  access_container,
   0,
+  set_mach_modtime_by_id,
+};
+
+static struct validate dmcn_validate = /* for amtn and dmfn */
+{
+  amcn_valobj,
+  2,
+  "mach_id",
+  "mach_id = %d and cnt_id = %d",
+  2,
   0,
+  access_container,
   0,
+  set_mach_modtime_by_id,
 };
 
-static char *dval_fields[] = {
-  "name",
+static char *gmnm_fields[] = {
+  "machine",
+  "machine", "container",
 };
 
-static char *gats_fields[] = {
-  "table_name", "appends", "updates", "deletes",
-  "modtime", "modby", "modwith",
+static char *gmoc_fields[] = {
+  "container",
+  "isrecursive",
+       "machine",
+  "container",
 };
 
-static char *_sdl_fields[] = {
-  "level",
+static struct validate gmoc_validate = 
+{
+  VOcon0,
+  1,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  get_machines_of_container,
 };
 
-static struct validate _sdl_validate =
+static char *gsoc_fields[] = {
+  "container",
+  "isrecursive",
+       "subcontainer",
+};
+
+static struct validate gsoc_validate = 
 {
-  VOnum0,
+  VOcon0,
   1,
-  NULL,
-  NULL,
   0,
   0,
   0,
   0,
-  _sdl_followup,
+  0,
+  0,
+  get_subcontainers_of_container,
+};
+
+static char *gtlc_fields[] = {
+  "name",
 };
 
 
-\f
 /* Generalized Query Definitions */
 
 /* Multiple versions of the same query MUST be listed in ascending
@@ -2868,7 +3616,7 @@ struct query Queries[] = {
     "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
     1,
     "u.login",
-    &gubl_validate,
+    &gubl2_validate,
   },
 
   {
@@ -2879,9 +3627,9 @@ struct query Queries[] = {
     RETRIEVE,
     "u",
     USERS_TABLE,
-    "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 FROM users u, strings str",
+    "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",
     gual_fields,
-    16,
+    18,
     "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
     1,
     "u.login",
@@ -2902,7 +3650,7 @@ struct query Queries[] = {
     "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
     1,
     "u.login",
-    &gubu_validate,
+    &gubu2_validate,
   },
 
   {
@@ -2913,9 +3661,9 @@ struct query Queries[] = {
     RETRIEVE,
     "u",
     USERS_TABLE,
-    "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 FROM users u, strings str",
+    "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",
     guau_fields,
-    16,
+    18,
     "u.unix_uid = %s AND u.users_id != 0 AND u.comments = str.string_id",
     1,
     "u.login",
@@ -2936,7 +3684,7 @@ struct query Queries[] = {
     "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
     2,
     "u.login",
-    &guan_validate,
+    &guan2_validate,
   },
 
   {
@@ -2947,9 +3695,9 @@ struct query Queries[] = {
     RETRIEVE,
     "u",
     USERS_TABLE,
-    "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 FROM users u, strings str",
+    "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",
     guan_fields,
-    16,
+    18,
     "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
     2,
     "u.login",
@@ -2981,13 +3729,13 @@ struct query Queries[] = {
     RETRIEVE,
     "u",
     USERS_TABLE,
-    "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 FROM users u, strings str",
+    "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",
     guac_fields,
-    16,
+    18,
     "u.type = UPPER('%s') AND u.users_id != 0 AND u.comments = str.string_id",
     1,
     "u.login",
-    &VDfix_modby,
+    &guan_validate,
   },
 
   {
@@ -3015,13 +3763,13 @@ struct query Queries[] = {
     RETRIEVE,
     "u",
     USERS_TABLE,
-    "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 FROM users u, strings str",
+    "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",
     guam_fields,
-    16,
+    18,
     "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
     1,
     "u.login",
-    &VDfix_modby,
+    &guan_validate,
   },
 
   {
@@ -3038,7 +3786,7 @@ struct query Queries[] = {
     "u.login LIKE '%s' AND u.users_id != 0",
     1,
     "u.login",
-    &gubl_validate,
+    &gubl2_validate,
   },
 
   {
@@ -3049,9 +3797,9 @@ struct query Queries[] = {
     RETRIEVE,
     "u",
     USERS_TABLE,
-    "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 FROM users u",
+    "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",
     gubl_fields,
-    13,
+    15,
     "u.login LIKE '%s' AND u.users_id != 0",
     1,
     "u.login",
@@ -3072,7 +3820,7 @@ struct query Queries[] = {
     "u.unix_uid = %s AND u.users_id != 0",
     1,
     "u.login",
-    &gubu_validate,
+    &gubu2_validate,
   },
 
   {
@@ -3083,9 +3831,9 @@ struct query Queries[] = {
     RETRIEVE,
     "u",
     USERS_TABLE,
-    "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 FROM users u",
+    "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",
     gubu_fields,
-    13,
+    15,
     "u.unix_uid = %s AND u.users_id != 0",
     1,
     "u.login",
@@ -3106,7 +3854,7 @@ struct query Queries[] = {
     "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
     2,
     "u.login",
-    &gubn_validate,
+    &gubn2_validate,
   },
 
   {
@@ -3117,9 +3865,9 @@ struct query Queries[] = {
     RETRIEVE,
     "u",
     USERS_TABLE,
-    "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 FROM users u",
+    "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",
     gubn_fields,
-    13,
+    15,
     "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
     2,
     "u.login",
@@ -3151,13 +3899,13 @@ struct query Queries[] = {
     RETRIEVE,
     "u",
     USERS_TABLE,
-    "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 FROM users u",
+    "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",
     gubc_fields,
-    13,
+    15,
     "u.type = UPPER('%s') AND u.users_id != 0",
     1,
     "u.login",
-    &VDfix_modby,
+    &guan_validate,
   },
 
   {
@@ -3185,13 +3933,13 @@ struct query Queries[] = {
     RETRIEVE,
     "u",
     USERS_TABLE,
-    "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 FROM users u",
+    "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",
     gubm_fields,
-    13,
+    15,
     "u.clearid LIKE '%s' AND u.users_id != 0",
     1,
     "u.login",
-    &VDfix_modby,
+    &guan_validate,
   },
 
   {
@@ -3225,7 +3973,7 @@ struct query Queries[] = {
     /* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
      * but using up one argv element.
      */
-    "INTO users (login, unix_uid, shell, winconsoleshell, 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)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, %s)",
+    "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)",
     auac_fields,
     13,
     NULL,
@@ -3259,7 +4007,7 @@ struct query Queries[] = {
     APPEND,
     "u",
     USERS_TABLE,
-    "INTO users (login, unix_uid, shell, winconsoleshell, 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)",
+    "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)",
     auac_fields,
     10,
     0,
@@ -3713,7 +4461,7 @@ struct query Queries[] = {
   },
 
   {
-    /* Q_GHST - GET_HOST */
+    /* Q_GHST - GET_HOST, v2 */
     "get_host",
     "ghst",
     2,
@@ -3721,7 +4469,7 @@ struct query Queries[] = {
     "m",
     MACHINE_TABLE,
     "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",
-    ghst_fields,
+    ghst2_fields,
     21,
     "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",
     4,
@@ -3730,7 +4478,41 @@ struct query Queries[] = {
   },
 
   {
-    /* Q_GHBH - GET_HOST_BY_HWADDR */
+    /* Q_GHST - GET_HOST, v6 */
+    "get_host",
+    "ghst",
+    6,
+    RETRIEVE,
+    "m",
+    MACHINE_TABLE,
+    "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",
+    ghst6_fields,
+    22,
+    "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",
+    4,
+    "m.name",
+    &ghst_validate,
+  },
+
+  {
+    /* Q_GHST - GET_HOST, v8 */
+    "get_host",
+    "ghst",
+    8,
+    RETRIEVE,
+    "m",
+    MACHINE_TABLE,
+    "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",
+    ghst_fields,
+    23,
+    "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",
+    4,
+    "m.name",
+    &ghst_validate,
+  },
+
+  {
+    /* Q_GHBH - GET_HOST_BY_HWADDR, v2 */
     "get_host_by_hwaddr",
     "ghbh",
     2,
@@ -3738,12 +4520,63 @@ struct query Queries[] = {
     "m",
     MACHINE_TABLE,
     "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",
-    ghst_fields,
+    ghbh2_fields,
     21,
     "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
     1,
     "m.name",
-    NULL,
+    &ghst_validate,
+  },
+
+  {
+    /* Q_GHBH - GET_HOST_BY_HWADDR, v6 */
+    "get_host_by_hwaddr",
+    "ghbh",
+    6,
+    RETRIEVE,
+    "m",
+    MACHINE_TABLE,
+    "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",
+    ghbh6_fields,
+    22,
+    "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
+    1,
+    "m.name",
+    &ghst_validate,
+  },
+
+  {
+    /* Q_GHBH - GET_HOST_BY_HWADDR, v8 */
+    "get_host_by_hwaddr",
+    "ghbh",
+    8,
+    RETRIEVE,
+    "m",
+    MACHINE_TABLE,
+    "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",
+    ghbh_fields,
+    23,
+    "m.hwaddr LIKE LOWER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
+    1,
+    "m.name",
+    &ghst_validate,
+  },
+
+  {
+    /* Q_GHBA - GET_HOST_BY_ACCOUNT_NUMBER, v8 */
+    "get_host_by_account_number",
+    "ghba",
+    8,
+    RETRIEVE,
+    "m",
+    MACHINE_TABLE,
+    "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",    
+    ghba_fields,
+    23,
+    "m.account_number LIKE '%s' AND m.mach_id != 0 and s.snet_id = m.snet_id",
+    1,
+    "m.name",
+    &ghst_validate,
   },
 
   {
@@ -3764,7 +4597,7 @@ struct query Queries[] = {
   },
 
   {
-    /* Q_AHST - ADD_HOST */ /* uses prefetch_value() for mach_id */
+    /* Q_AHST - ADD_HOST, v2 */ /* uses prefetch_value() for mach_id */
     "add_host",
     "ahst",
     2,
@@ -3772,16 +4605,50 @@ struct query Queries[] = {
     "m",
     MACHINE_TABLE,
     "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)",
-    ahst_fields,
+    ahst2_fields,
     14,
     0,
     0,
     NULL,
+    &ahst2_validate,
+  },
+
+  {
+    /* Q_AHST - ADD_HOST, v6 */ /* uses prefetch_value() for mach_id */
+    "add_host",
+    "ahst",
+    6,
+    APPEND,
+    "m",
+    MACHINE_TABLE,
+    "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)",
+    ahst6_fields,
+    15,
+    0,
+    0,
+    NULL,
+    &ahst6_validate,
+  },
+
+  {
+    /* Q_AHST - ADD_HOST, v8 */ /* Uses prefetch_value() for mach_id */
+    "add_host",
+    "ahst",
+    8,
+    APPEND,
+    "m",
+    MACHINE_TABLE,
+    "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)",
+    ahst_fields,
+    16,
+    0,
+    0,
+    NULL,
     &ahst_validate,
   },
 
   {
-    /* Q_UHST - UPDATE_HOST */
+    /* Q_UHST - UPDATE_HOST, v2 */
     "update_host",
     "uhst",
     2,
@@ -3789,11 +4656,45 @@ struct query Queries[] = {
     "m",
     MACHINE_TABLE,
     "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",
-    uhst_fields,
+    uhst2_fields,
     14,
     "mach_id = %d",
     1,
     NULL,
+    &uhst2_validate,
+  },
+
+  {
+    /* Q_UHST - UPDATE_HOST, v6 */
+    "update_host",
+    "uhst",
+    6,
+    UPDATE,
+    "m",
+    MACHINE_TABLE,
+    "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",
+    uhst6_fields,
+    15,
+    "mach_id = %d",
+    1,
+    NULL,
+    &uhst6_validate,
+  },
+
+  {
+    /* Q_UHST - UPDATE_HOST, v8 */
+    "update_host",
+    "uhst",
+    8,
+    UPDATE,
+    "m",
+    MACHINE_TABLE,
+    "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",
+    uhst_fields,
+    16,
+    "mach_id = %d",
+    1,
+    NULL,
     &uhst_validate,
   },
 
@@ -3900,7 +4801,7 @@ struct query Queries[] = {
   },
 
   {
-    /* Q_GSNT - GET_SUBNET */
+    /* Q_GSNT - GET_SUBNET, v2 */
     "get_subnet",
     "gsnt",
     2,
@@ -3908,7 +4809,7 @@ struct query Queries[] = {
     "s",
     SUBNET_TABLE,
     "name, description, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet",
-    gsnt_fields,
+    gsnt2_fields,
     12,
     "name LIKE UPPER('%s')",
     1,
@@ -3917,7 +4818,24 @@ struct query Queries[] = {
   },
 
   {
-    /* Q_ASNT - ADD_SUBNET */
+    /* Q_GSNT - GET_SUBNET, v8 */
+    "get_subnet",
+    "gsnt",
+    8,
+    RETRIEVE,
+    "s",
+    SUBNET_TABLE,
+    "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",
+    gsnt_fields,
+    15,
+    "name LIKE UPPER('%s')",
+    1,
+    "name",
+    &gsnt_validate,
+  },
+
+  {
+    /* Q_ASNT - ADD_SUBNET, v2 */
     "add_subnet",
     "asnt",
     2,
@@ -3925,25 +4843,59 @@ struct query Queries[] = {
     "s",
     SUBNET_TABLE,
     "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)",
-    asnt_fields,
+    asnt2_fields,
     9,
     0,
     0,
     NULL,
-    &asnt_validate,
+    &asnt2_validate,
+  },
+
+  {
+    /* Q_ASNT - ADD_SUBNET, v8 */
+    "add_subnet",
+    "asnt",
+    8,
+    APPEND,
+    "s",
+    SUBNET_TABLE,
+    "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)",
+    asnt_fields,
+    12,
+    0,
+    0,
+    NULL,
+    &asnt_validate,
+  },
+
+  {
+    /* Q_USNT - UPDATE_SUBNET, v2 */
+    "update_subnet",
+    "usnt",
+    2,
+    UPDATE,
+    "s",
+    SUBNET_TABLE,
+    "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",
+    usnt2_fields,
+    9,
+    "snet_id = %d",
+    1,
+    NULL,
+    &usnt2_validate,
   },
 
   {
-    /* Q_USNT - UPDATE_SUBNET */
+    /* Q_USNT - UPDATE_SUBNET, v8 */
     "update_subnet",
     "usnt",
-    2,
+    8,
     UPDATE,
     "s",
     SUBNET_TABLE,
-    "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",
+    "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",
     usnt_fields,
-    9,
+    12,
     "snet_id = %d",
     1,
     NULL,
@@ -4163,7 +5115,7 @@ struct query Queries[] = {
     "l",
     LIST_TABLE,
     "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",
-    glin_fields,
+    glin3_fields,
     14,
     "name LIKE '%s'",
     1,
@@ -4171,6 +5123,23 @@ struct query Queries[] = {
     &glin_validate,
   },
 
+  {
+    /* Q_GLIN - GET_LIST_INFO, v4 */
+    "get_list_info",
+    "glin",
+    4,
+    RETRIEVE,
+    "l",
+    LIST_TABLE,
+    "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",
+    glin_fields,
+    16,
+    "name LIKE '%s'",
+    1,
+    "name",
+    &glin_validate,
+  },
+
   {
     /* Q_EXLN - EXPAND_LIST_NAMES */
     "expand_list_names",
@@ -4214,11 +5183,28 @@ struct query Queries[] = {
     "l",
     LIST_TABLE,
     "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)", 
-    alis_fields,
+    alis3_fields,
     11,
     0,
     0,
     NULL,
+    &alis3_validate,
+  },
+
+  {
+    /* Q_ALIS - ADD_LIST, v4 */ /* uses prefetch_value() for list_id */
+    "add_list",
+    "alis",
+    4,
+    APPEND,
+    "l",
+    LIST_TABLE,
+    "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)",
+    alis_fields,
+    13,
+    0,
+    0,
+    NULL,
     &alis_validate,
   },
 
@@ -4248,11 +5234,28 @@ struct query Queries[] = {
     "l",
     LIST_TABLE,
     "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))",
-    ulis_fields,
+    ulis3_fields,
     11,
     "list_id = %d",
     1,
     NULL,
+    &ulis3_validate,
+  },
+
+  {
+    /* Q_ULIS, UPDATE_LIST, v4 */
+    "update_list",
+    "ulis",
+    4,
+    UPDATE,
+    "l",
+    LIST_TABLE,
+    "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))",
+    ulis_fields,
+    13,
+    "list_id = %d",
+    1,
+    NULL,
     &ulis_validate,
   },
 
@@ -5209,7 +6212,7 @@ struct query Queries[] = {
   },
 
   {
-    /* Q_GZCL - GET_ZEPHYR_CLASS */
+    /* Q_GZCL - GET_ZEPHYR_CLASS, v2 */
     "get_zephyr_class",
     "gzcl",
     2,
@@ -5217,7 +6220,7 @@ struct query Queries[] = {
     "z",
     ZEPHYR_TABLE,
     "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",
-    gzcl_fields,
+    gzcl2_fields,
     12,
     "class LIKE '%s'",
     1,
@@ -5226,7 +6229,24 @@ struct query Queries[] = {
   },
 
   {
-    /* Q_AZCL - ADD_ZEPHYR_CLASS */
+    /* Q_GZCL - GET_ZEPHYR_CLASS, v5 */
+    "get_zephyr_class",
+    "gzcl",
+    5,
+    RETRIEVE,
+    "z",
+    ZEPHYR_TABLE,
+    "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",
+    gzcl_fields,
+    14,
+    "class LIKE '%s'",
+    1,
+    "class",
+    &gzcl_validate,
+  },
+
+  {
+    /* Q_AZCL - ADD_ZEPHYR_CLASS, v2 */
     "add_zephyr_class",
     "azcl",
     2,
@@ -5234,16 +6254,33 @@ struct query Queries[] = {
     "z",
     ZEPHYR_TABLE,
     "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)",
-    azcl_fields,
+    azcl2_fields,
     9,
     0,
     0,
     NULL,
+    &azcl2_validate,
+  },
+
+  {
+    /* Q_AZCL - ADD_ZEPHYR_CLASS, v5 */
+    "add_zephyr_class",
+    "azcl",
+    5,
+    APPEND,
+    "z",
+    ZEPHYR_TABLE,
+    "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)",
+    azcl_fields,
+    11,
+    0,
+    0,
+    NULL,
     &azcl_validate,
   },
 
   {
-    /* Q_UZCL - UPDATE_ZEPHYR_CLASS */
+    /* Q_UZCL - UPDATE_ZEPHYR_CLASS, v2 */
     "update_zephyr_class",
     "uzcl",
     2,
@@ -5251,11 +6288,28 @@ struct query Queries[] = {
     "z",
     ZEPHYR_TABLE,
     "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",
-    uzcl_fields,
+    uzcl2_fields,
     9,
     "class = '%s'",
     1,
     NULL,
+    &uzcl2_validate,
+  },
+
+  {
+    /* Q_UZCL - UPDATE_ZEPHYR_CLASS, v5 */
+    "update_zephyr_class",
+    "uzcl",
+    5,
+    UPDATE,
+    "z",
+    ZEPHYR_TABLE,
+    "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",
+    uzcl_fields,
+    11,
+    "class = '%s'",
+    1,
+    NULL,
     &uzcl_validate,
   },
 
@@ -5406,8 +6460,8 @@ struct query Queries[] = {
     "name, protocol, port, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM services",
     gsvc_fields,
     7,
-    "name LIKE '%s'",
-    1,
+    "name LIKE '%s' AND protocol LIKE '%s'",
+    2,
     "name",
     &VDfix_modby,
   },
@@ -5438,12 +6492,12 @@ struct query Queries[] = {
     "ss",
     SERVICES_TABLE,
     0,
-    asvc_fields,
+    dsvc_fields,
     0,
-    "name = '%s'",
-    1,
+    "name = '%s' AND protocol = '%s'",
+    2,
     NULL,
-    &asvc_validate,
+    &dsvc_validate,
   },
 
   {
@@ -5837,6 +6891,261 @@ struct query Queries[] = {
     &_sdl_validate,
   },
 
+  {
+    /* Q_GUSL - GET_USER_SIDS_BY_LOGIN, v4 */
+    "get_user_sids_by_login",
+    "gusl",
+    4,
+    RETRIEVE,
+    "s",
+    USERSIDS_TABLE,
+    "u.login, us.sid, TO_CHAR(us.created, 'YYYY-MM-DD HH24:MI:SS') FROM users u, usersids us",
+    gusl_fields,
+    3,
+    "us.users_id = %d AND u.users_id = us.users_id AND SUBSTR(us.sid, 1, LENGTH(us.sid)-8) = '%s'",
+    2,
+    NULL,
+    &gusl_validate,
+  },
+
+  {
+    /* Q_AUSL - ADD_USER_SID_BY_LOGIN, v4 */
+    "add_user_sid_by_login",
+    "ausl",
+    4,
+    APPEND,
+    "s",
+    USERSIDS_TABLE,
+    "INTO usersids (users_id, sid) VALUES (%d, '%s')",
+    ausl_fields,
+    2,
+    NULL,
+    0,
+    NULL,
+    &ausl_validate,
+  },
+  
+  {
+    /* Q_GLSN - GET_LIST_SIDS_BY_NAME, v4 */
+    "get_list_sids_by_name",
+    "glsn",
+    4,
+    RETRIEVE,
+    "s",
+    LISTSIDS_TABLE,
+    "l.name, ls.sid, TO_CHAR(ls.created, 'YYYY-MM-DD HH24:MI:SS') FROM list l, listsids ls",
+    glsn_fields,
+    3,
+    "ls.list_id = %d AND l.list_id = ls.list_id AND SUBSTR(ls.sid, 1, LENGTH(ls.sid)-8) = '%s'",
+    2,
+    NULL,
+    &glsn_validate,
+  },
+
+  {
+    /* Q_ALSN - ADD_LIST_SID_BY_NAME, v4 */
+    "add_list_sid_by_name",
+    "alsn",
+    4,
+    APPEND,
+    "s",
+    LISTSIDS_TABLE,
+    "INTO listsids (list_id, sid) VALUES (%d, '%s')",
+    alsn_fields,
+    2,
+    NULL,
+    0,
+    NULL,
+    &alsn_validate,
+  },
+
+  {
+    /* Q_GDDS - GET_DISTINCT_DOMAIN_SIDS, v4 */
+    "get_distinct_domain_sids",
+    "gdds",
+    4,
+    RETRIEVE,
+    "s",
+    USERSIDS_TABLE,
+    "DISTINCT SUBSTR(sid, 1, LENGTH(sid)-8) FROM usersids",
+    gdds_fields,
+    1,
+    NULL,
+    0,
+    NULL,
+    NULL,
+  },
+
+  {
+    /* Q_GCON - GET_CONTAINER, v7 */
+    "get_container",
+    "gcon",
+    7,
+    RETRIEVE,
+    "c",
+    CONTAINERS_TABLE,
+    "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",
+    gcon_fields,
+    11,
+    "name = '%s' AND cnt_id != 0",
+    1,
+    NULL,
+    &gcon_validate,
+  },
+
+  {
+    /* Q_ACON - ADD_CONTAINER, v7 */ /* uses prefetch_value() for cnt_id */
+    "add_container",
+    "acon",
+    7,
+    APPEND,
+    "c",
+    CONTAINERS_TABLE,
+    "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)",
+    acon_fields,
+    8,
+    0,
+    0,
+    NULL,
+    &acon_validate,
+  },
+
+  {
+    /* Q_UCON - UPDATE_CONTAINER, v7 */
+    "update_container",
+    "ucon",
+    7,
+    UPDATE,
+    0,
+    CONTAINERS_TABLE,
+    0,
+    ucon_fields,
+    8,
+    0,
+    1,
+    NULL,
+    &ucon_validate,
+  },
+
+  {
+    /* Q_DCON - DELETE_CONTAINER, v7 */
+    "delete_container",
+    "dcon",
+    7,
+    DELETE,
+    "c",
+    CONTAINERS_TABLE,
+    NULL,
+    dcon_fields,
+    0,
+    "cnt_id = %d",
+    1,
+    NULL,
+    &dcon_validate,
+  },
+
+  {
+    /* Q_AMCN - ADD_MACHINE_TO_CONTAINER, v7 */
+    "add_machine_to_container",
+    "amcn",
+    7,
+    APPEND,
+    "mcn",
+    MCNTMAP_TABLE,
+    "INTO mcntmap (mach_id, cnt_id) VALUES (%d, %d)",
+    amcn_fields,
+    2,
+    0,
+    0,
+    NULL,
+    &amcn_validate,
+  },
+
+  {
+    /* Q_DMCN - DELETE_MACHINE_FROM_CONTAINER, v7 */
+    "delete_machine_from_container",
+    "dmcn",
+    7,
+    DELETE,
+    "mcn",
+    MCNTMAP_TABLE,
+    0,
+    amcn_fields,
+    0,
+    "mach_id = %d AND cnt_id = %d",
+    2,
+    NULL,
+    &dmcn_validate,
+  },
+
+  {
+    /* Q_GMNM - GET_MACHINE_TO_CONTAINER_MAP, v7 */
+    "get_machine_to_container_map",
+    "gmnm",
+    7,
+    RETRIEVE,
+    "mcn",
+    MCNTMAP_TABLE,
+    "m.name, c.name FROM machine m, containers c, mcntmap mcn",
+    gmnm_fields,
+    2,
+    "m.name = UPPER('%s') AND mcn.cnt_id = c.cnt_id AND mcn.mach_id = m.mach_id",
+    1,
+    NULL,
+    NULL,
+  },
+
+  {
+    /* Q_GMOC - GET_MACHINES_OF_CONTAINER, v7 */
+    "get_machines_of_container",
+    "gmoc",
+    7,
+    RETRIEVE,
+    NULL,
+    MCNTMAP_TABLE,
+    NULL,
+    gmoc_fields,
+    2,
+    NULL,
+    2,
+    NULL,
+    &gmoc_validate,
+  },
+
+  {
+    /* Q_GSOC - GET_SUBCONTAINERS_OF_CONTAINER, v7 */
+    "get_subcontainers_of_container",
+    "gsoc",
+    7,
+    RETRIEVE,
+    NULL,
+    CONTAINERS_TABLE,
+    NULL,
+    gsoc_fields,
+    1,
+    NULL,
+    2,
+    NULL,
+    &gsoc_validate,
+  },
+
+  {
+    /* Q_GTLC - GET_TOPLEVEL_CONTAINERS, v7 */
+    "get_toplevel_containers",
+    "gtlc",
+    7,
+    RETRIEVE,
+    "c",
+    CONTAINERS_TABLE,
+    "name FROM containers",
+    gtlc_fields,
+    1,
+    "name NOT LIKE '%%/%%'",
+    0,
+    "name",
+    NULL,
+  },
+
 };
 
 int QueryCount = (sizeof(Queries) / sizeof(struct query));
This page took 0.233591 seconds and 4 git commands to generate.