]> andersk Git - moira.git/blobdiff - server/queries2.c
*** empty log message ***
[moira.git] / server / queries2.c
index 219ee337f856a3eeb453e5591083307ea24ac805..3c9baadd7a462b0e04e3593c7444fa27ed0f418b 100644 (file)
@@ -23,6 +23,9 @@ int access_member();
 int access_qgli();
 int access_service();
 int access_filesys();
+int access_host();
+int access_ahal();
+int access_snt();
 
 /* Query Setup Routines */
 int prefetch_value();
@@ -32,6 +35,7 @@ int setup_dusr();
 int setup_spop();
 int setup_dpob();
 int setup_dmac();
+int setup_dsnet();
 int setup_dclu();
 int setup_alis();
 int setup_dlis();
@@ -45,6 +49,9 @@ int setup_dnfp();
 int setup_dqot();
 int setup_sshi();
 int setup_akum();
+int setup_dsnt();
+int setup_ahst();
+int setup_ahal();
 
 /* Query Followup Routines */
 int followup_fix_modby();
@@ -52,12 +59,15 @@ int followup_ausr();
 int followup_gpob();
 int followup_glin();
 int followup_aqot();
+int followup_dqot();
 int followup_gzcl();
 int followup_gsha();
 int followup_gqot();
 int followup_gpce();
 int followup_guax();
 int followup_uuac();
+int followup_gsnt();
+int followup_ghst();
 
 int set_modtime();
 int set_modtime_by_id();
@@ -86,6 +96,7 @@ int trigger_dcm();
 int count_members_of_list();
 int get_lists_of_member();
 int register_user();
+int _sdl_followup();
 
 
 \f
@@ -96,6 +107,8 @@ int register_user();
 
 static char ACE_NAME[] = "ace_name";
 static char ACE_TYPE[] = "ace_type";
+static char ADDRESS[] = "address";
+static char ALIAS[] = "alias";
 static char CLASS[] = "class";
 static char CLU_ID[] = "clu_id";
 static char CLUSTER[] = "cluster";
@@ -126,6 +139,8 @@ static char SECURE[] = "secure";
 static char SERVICE[] = "service";
 static char SHELL[] = "shell";
 static char SIGNATURE[] = "signature";
+static char SNET_ID[] = "snet_id";
+static char SUBNET[] = "subnet";
 static char STATUS[] = "status";
 static char TYPE[] = "type";
 static char USERS[] = "users";
@@ -336,6 +351,19 @@ static char *guan_fields[] = {
   MIT_ID, CLASS, COMMENTS, SIGNATURE, SECURE, MOD1, MOD2, MOD3,
 };
 
+static struct validate guan_validate = 
+{
+  VOwild01sort01,
+  4,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  followup_guax,
+};
+
 static char *guac_fields[] = {
   CLASS,
   LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS,
@@ -600,8 +628,8 @@ static struct validate akum_validate =
   USERS_ID,
   access_user,
   setup_akum,
-  0
-    };
+  0,
+};
 
 static struct validate dkum_validate =
 {
@@ -613,8 +641,8 @@ static struct validate dkum_validate =
   USERS_ID,
   access_user,
   0,
-  0
-    };
+  0,
+};
 
 static char *gfbl_fields[] = {
   LOGIN,
@@ -741,63 +769,105 @@ static char *gmac_fields[] = {
   NAME, TYPE, MOD1, MOD2, MOD3,
 };
 
-static char *amac_fields[] = {
-  NAME, TYPE,
+static char *ghst_fields[] = {
+  NAME, ADDRESS, "location", "contact",
+  NAME, "vendor", "model", "os", "location", "contact", "use", "status", "status_change", SUBNET, ADDRESS, ACE_TYPE, ACE_NAME, "admin_comment", "ops_comment", "created", "creator", "inuse", MOD1, MOD2, MOD3,
+};
+
+static struct valobj ghst_valobj[] = {
+  {V_UPWILD, 0},
+  {V_UPWILD, 1},
+  {V_UPWILD, 2},
+  {V_UPWILD, 3},
+  {V_SORT, 0},
+};
+
+static struct validate ghst_validate = { 
+  ghst_valobj,
+  5,
+  0,
+  0,
+  0,
+  0,
+  access_host,
+  0,
+  followup_ghst,
+};
+
+static char *ahst_fields[] = {
+  NAME, "vendor", "model", "os", "location", "contact", "use", "status", SUBNET, ADDRESS, ACE_TYPE, ACE_NAME, "admin_comment", "ops_comment",
 };
 
-static struct valobj amac_valobj[] = {
+static struct valobj ahst_valobj[] = {
   {V_CHAR, 0},
+  {V_CHAR, 1},
+  {V_CHAR, 2},
+  {V_CHAR, 3},
+  {V_CHAR, 4},
   {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
-  {V_TYPE, 1, "mac_type", 0, 0, MR_TYPE},
+  {V_ID, 8, SUBNET, NAME, SNET_ID, MR_SUBNET},
+  {V_TYPE, 10, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 11, 0, 0, 0, MR_ACE},
+  {V_ID, 12, "strings", "string", "string_id", MR_NO_MATCH},
+  {V_ID, 13, "strings", "string", "string_id", MR_NO_MATCH},
 };
 
-static struct validate amac_validate = {
-  amac_valobj,
-  3,
+static struct validate ahst_validate = {
+  ahst_valobj,
+  11,
   NAME,
   "name = uppercase(LEFT('%s',SIZE(name)))",
   1,
   MACH_ID,
-  0,
-  prefetch_value,
+  access_host,
+  setup_ahst,
   set_uppercase_modtime,
 };
 
-static char *umac_fields[] = {
+static char *uhst_fields[] = {
   NAME,
-  "newname", TYPE,
+  "newname", "vendor", "model", "os", "location", "contact", "use", "status", SUBNET, ADDRESS, ACE_TYPE, ACE_NAME, "admin_comment", "ops_comment",
 };
 
-static struct valobj umac_valobj[] = {
-  {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
+static struct valobj uhst_valobj[] = {
+  {V_CHAR, 0},
   {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
   {V_RENAME, 1, MACHINE, NAME, MACH_ID, MR_NOT_UNIQUE},
-  {V_TYPE, 2, "mac_type", 0, 0, MR_TYPE},
+  {V_CHAR, 2},
+  {V_CHAR, 3},
+  {V_CHAR, 4},
+  {V_CHAR, 5},
+  {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
+  {V_ID, 9, SUBNET, NAME, SNET_ID, MR_SUBNET},
+  {V_TYPE, 11, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 12, 0, 0, 0, MR_ACE},
+  {V_ID, 13, "strings", "string", "string_id", MR_NO_MATCH},
+  {V_ID, 14, "strings", "string", "string_id", MR_NO_MATCH},
 };
 
-static struct validate umac_validate = {
-  umac_valobj,
-  4,
+static struct validate uhst_validate = {
+  uhst_valobj,
+  13,
   0,
   0,
   0,
   MACH_ID,
-  0,
-  0,
+  access_host,
+  setup_ahst,
   set_modtime_by_id,
 };
 
-static char *dmac_fields[] = {
+static char *dhst_fields[] = {
   NAME,
 };
 
-static struct valobj dmac_valobj[] = {
+static struct valobj dhst_valobj[] = {
   {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
   {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
 };
 
-static struct validate dmac_validate = {
-  dmac_valobj,
+static struct validate dhst_validate = {
+  dhst_valobj,
   2,
   0,
   0,
@@ -808,6 +878,159 @@ static struct validate dmac_validate = {
   0,
 };
 
+static char *ghal_fields[] = {
+    ALIAS, "canonical_hostname",
+    ALIAS, "canonical_hostname"
+};
+
+static struct valobj ghal_valobj[] = {
+  {V_UPWILD, 0},
+  {V_UPWILD, 1},
+  {V_SORT, 0},
+};
+
+static struct validate ghal_validate = {
+  ghal_valobj,
+  3,
+  0,
+  0,
+  0,
+  0,
+  access_ahal,
+  0,
+  0,
+};
+
+static struct valobj ahal_valobj[] = {
+  {V_CHAR, 0},
+  {V_UPWILD, 0},
+  {V_ID, 1, MACHINE, NAME, MACH_ID, MR_MACHINE},
+};
+
+static struct validate ahal_validate = {
+  ahal_valobj,
+  3,
+  NAME,
+  "name = LEFT('%s',SIZE(name))",
+  1,
+  MACH_ID,
+  access_ahal,
+  setup_ahal,
+  0,
+};
+
+static struct valobj dhal_valobj[] = {
+    {V_UPWILD, 0},
+    {V_LOCK, 0, MACHINE, 0, MACH_ID, MR_DEADLOCK},
+    {V_ID, 1, MACHINE, NAME, MACH_ID, MR_MACHINE},
+};
+
+static struct validate dhal_validate = {
+  dhal_valobj,
+  3,
+  NAME,
+  "name = LEFT('%s',SIZE(name)) AND mach_id = %d",
+  2,
+  MACH_ID,
+  access_ahal,
+  0,
+  0,
+};
+
+static char *gsnt_fields[] = {
+    NAME,
+    NAME, DESC, ADDRESS, "mask", "low", "high", "prefix", ACE_TYPE, ACE_NAME,
+    MOD1, MOD2, MOD3
+};
+
+static struct valobj gsnt_valobj[] = {
+  {V_UPWILD, 0},
+  {V_SORT, 0},
+};
+
+static struct validate gsnt_validate = {
+  gsnt_valobj,
+  2,
+  0,
+  0,
+  0,
+  0,
+  access_snt,
+  0,
+  followup_gsnt,
+};
+
+static char *asnt_fields[] = {
+    NAME, DESC, ADDRESS, "mask", "low", "high", "prefix", ACE_TYPE, ACE_NAME,
+};
+
+static struct valobj asnt_valobj[] = {
+  {V_LOCK, 0, SUBNET, 0, SNET_ID, MR_DEADLOCK},
+  {V_CHAR, 0},
+  {V_TYPE, 7, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 8, 0, 0, 0, MR_ACE},
+};
+
+static struct validate asnt_validate = 
+{
+    asnt_valobj,
+    4,
+    NAME,
+    "name = uppercase(LEFT('%s',SIZE(name)))",
+    1,
+    SNET_ID,
+    0,
+    prefetch_value,
+    set_uppercase_modtime,
+};
+
+static char *usnt_fields[] = {
+    NAME,
+    "newname", DESC, ADDRESS, "mask", "low", "high", "prefix", ACE_TYPE, ACE_NAME,
+};
+
+static struct valobj usnt_valobj[] = {
+  {V_LOCK, 0, SUBNET, 0, SNET_ID, MR_DEADLOCK},
+  {V_ID, 0, SUBNET, NAME, SNET_ID, MR_NO_MATCH},
+  {V_RENAME, 1, SUBNET, NAME, SNET_ID, MR_NOT_UNIQUE},
+  {V_TYPE, 8, ACE_TYPE, 0, 0, MR_ACE},
+  {V_TYPEDATA, 9, 0, 0, 0, MR_ACE},
+};
+
+static struct validate usnt_validate = 
+{
+    usnt_valobj,
+    5,
+    NAME,
+    "snet_id = %d",
+    1,
+    SNET_ID,
+    0,
+    0,
+    set_modtime_by_id,
+};
+
+static char *dsnt_fields[] = {
+  NAME,
+};
+
+static struct valobj dsnt_valobj[] = {
+  {V_LOCK, 0, SUBNET, 0, SNET_ID, MR_DEADLOCK},
+  {V_ID, 0, SUBNET, NAME, SNET_ID, MR_SUBNET},
+};
+
+static struct validate dsnt_validate = {
+  dsnt_valobj,
+  2,
+  0,
+  0,
+  0,
+  0,
+  0,
+  setup_dsnt,
+  0,
+};
+
 static char *gclu_fields[] = {
   NAME,
   NAME, DESC, LOCATION, MOD1, MOD2, MOD3, 
@@ -1529,6 +1752,7 @@ static char *gqot_fields[] = {
 };
 
 static struct valobj gqot_valobj[] = {
+  {V_WILD, 0},
   {V_TYPE, 1, QUOTA_TYPE, 0, 0, MR_TYPE},
   {V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
   {V_SORT, 0, 0, 0, 0, 0},
@@ -1536,7 +1760,7 @@ static struct valobj gqot_valobj[] = {
 
 static struct validate gqot_validate = {
   gqot_valobj,
-  3,
+  4,
   0,
   0,
   0,
@@ -1552,8 +1776,8 @@ static char *gqbf_fields[] = {
 };
 
 static struct validate gqbf_validate = {
-  VOsort0,
-  1,
+  VOwild0sort,
+  2,
   0,
   0,
   0,
@@ -1607,7 +1831,7 @@ static struct validate dqot_validate = {
   0,
   0,
   setup_dqot,
-  0,
+  followup_dqot,
 };
 
 static char *gnfq_fields[] = {
@@ -1649,7 +1873,7 @@ static struct validate anfq_validate = {
   FILSYS_ID,
   "filsys_id = %d AND type = 'USER' AND entity_id = %d",
   2,
-  0,
+  0, /* object ? */
   0,
   prefetch_filesys,
   followup_aqot,
@@ -1676,7 +1900,7 @@ static struct validate dnfq_validate = {
   0,
   0,
   setup_dqot,
-  0,
+  followup_dqot,
 };
 
 static char *glin_fields[] = {
@@ -2135,7 +2359,7 @@ static char *aali_fields[] = {
 
 static struct valobj aali_valobj[] = {
   {V_CHAR, 0},
-  {V_TYPE, 1, "alias", 0, 0, MR_TYPE},
+  {V_TYPE, 1, ALIAS, 0, 0, MR_TYPE},
   {V_CHAR, 2},
 };
 
@@ -2209,6 +2433,23 @@ static char *gats_fields[] = {
   "table_name", "appends", "updates", "deletes", MOD1, MOD2, MOD3,
 };
 
+static char *_sdl_fields[] = {
+    "level",
+};
+
+static struct validate _sdl_validate = 
+{
+    0,
+    0,
+    (char *)0,
+    (char *)0,
+    0,
+    0,
+    0,
+    0,
+    _sdl_followup,
+};
+
 
 \f
 /* Generalized Query Definitions */
@@ -2255,7 +2496,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "CHAR(u.login), CHAR(u.uid), u.shell, CHAR(u.last), CHAR(u.first), u.middle, CHAR(u.status), CHAR(u.clearid), u.type, str.string, CHAR(u.signature), CHAR(u.secure), CHAR(u.modtime), CHAR(u.modby), u.modwith FROM users u, strings str",
+    "CHAR(u.login), CHAR(u.uid), u.shell, CHAR(u.last), CHAR(u.first), u.middle, CHAR(u.status), CHAR(u.clearid), u.type, CHAR(str.string), CHAR(u.signature), CHAR(u.secure), CHAR(u.modtime), CHAR(u.modby), u.modwith FROM users u, strings str",
     gual_fields,
     15,
     "u.login LIKE '%s' ESCAPE '*' AND u.users_id != 0 AND u.comment = str.string_id",
@@ -2270,7 +2511,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "CHAR(u.login), CHAR(u.uid), u.shell, CHAR(u.last), CHAR(u.first), u.middle, CHAR(u.status), CHAR(u.clearid), u.type, str.string, CHAR(u.signature), CHAR(u.secure), CHAR(u.modtime), CHAR(u.modby), u.modwith FROM users u, strings str",
+    "CHAR(u.login), CHAR(u.uid), u.shell, CHAR(u.last), CHAR(u.first), u.middle, CHAR(u.status), CHAR(u.clearid), u.type, CHAR(str.string), CHAR(u.signature), CHAR(u.secure), CHAR(u.modtime), CHAR(u.modby), u.modwith FROM users u, strings str",
     guau_fields,
     15,
     "u.uid = %s AND u.users_id != 0 AND u.comment = str.string_id",
@@ -2285,12 +2526,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "CHAR(u.login), CHAR(u.uid), u.shell, CHAR(u.last), CHAR(u.first), u.middle, CHAR(u.status), CHAR(u.clearid), u.type, str.string, CHAR(u.signature), CHAR(u.secure), CHAR(u.modtime), CHAR(u.modby), u.modwith FROM users u, strings str",
+    "CHAR(u.login), CHAR(u.uid), u.shell, CHAR(u.last), CHAR(u.first), u.middle, CHAR(u.status), CHAR(u.clearid), u.type, CHAR(str.string), CHAR(u.signature), CHAR(u.secure), CHAR(u.modtime), CHAR(u.modby), u.modwith FROM users u, strings str",
     guan_fields,
     15,
     "u.first LIKE '%s' ESCAPE '*' AND u.last LIKE '%s' ESCAPE '*' AND u.users_id != 0 and u.comment = str.string_id",
     2,
-    &VDwild2sortf,
+    &guan_validate,
   },
   
   {
@@ -2300,7 +2541,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "CHAR(u.login), CHAR(u.uid), u.shell, CHAR(u.last), CHAR(u.first), u.middle, CHAR(u.status), CHAR(u.clearid), u.type, str.string, CHAR(u.signature), CHAR(u.secure), CHAR(u.modtime), CHAR(u.modby), u.modwith FROM users u, strings str",
+    "CHAR(u.login), CHAR(u.uid), u.shell, CHAR(u.last), CHAR(u.first), u.middle, CHAR(u.status), CHAR(u.clearid), u.type, CHAR(str.string), CHAR(u.signature), CHAR(u.secure), CHAR(u.modtime), CHAR(u.modby), u.modwith FROM users u, strings str",
     guac_fields,
     15,
     "u.type = uppercase('%s') AND u.users_id != 0 AND u.comment = str.string_id",
@@ -2315,7 +2556,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "CHAR(u.login), CHAR(u.uid), u.shell, CHAR(u.last), CHAR(u.first), u.middle, CHAR(u.status), CHAR(u.clearid), u.type, str.string, CHAR(u.signature), CHAR(u.secure), CHAR(u.modtime), CHAR(u.modby), u.modwith FROM users u, strings str",
+    "CHAR(u.login), CHAR(u.uid), u.shell, CHAR(u.last), CHAR(u.first), u.middle, CHAR(u.status), CHAR(u.clearid), u.type, CHAR(str.string), CHAR(u.signature), CHAR(u.secure), CHAR(u.modtime), CHAR(u.modby), u.modwith FROM users u, strings str",
     guam_fields,
     15,
     "u.clearid LIKE '%s' ESCAPE '*' AND u.users_id != 0 AND u.comment = str.string_id",
@@ -2510,7 +2751,7 @@ struct query Queries2[] = {
     UPDATE,
     "u",
     USERS,
-    "secure = %s",
+    "users SET secure = %s",
     uuss_fields,
     1,
     "users_id = %d",
@@ -2735,7 +2976,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "m",
     MACHINE,
-    "CHAR(m.name), m.type, CHAR(m.modtime), CHAR(m.modby), modwith FROM machine m",
+    "CHAR(m.name), m.vendor, CHAR(m.modtime), CHAR(m.modby), m.modwith FROM machine m",
     gmac_fields,
     5,
     "m.name LIKE '%s' ESCAPE '*' AND m.mach_id != 0", 
@@ -2744,48 +2985,168 @@ struct query Queries2[] = {
   },
 
   {
-    /* Q_AMAC - ADD_MACHINE */ /* uses prefetch_value() for mach_id */
-    "add_machine",
-    "amac",
+    /* Q_GHST - GET_HOST */
+    "get_host",
+    "ghst",
+    RETRIEVE,
+    "m",
+    MACHINE,
+    "CHAR(m.name), m.vendor, m.model, m.os, m.location, m.contact, CHAR(m.use), CHAR(m.status), CHAR(m.statuschange), CHAR(s.name), m.address, m.owner_type, CHAR(m.owner_id), CHAR(m.acomment), CHAR(m.ocomment), CHAR(m.created), CHAR(m.creator), CHAR(m.inuse), CHAR(m.modtime), CHAR(m.modby), m.modwith FROM machine m, subnet s",
+    ghst_fields,
+    21,
+    "m.name LIKE '%s' ESCAPE '*' AND m.address LIKE '%s' ESCAPE '*' AND m.location LIKE '%s' ESCAPE '*' AND m.contact LIKE '%s' ESCAPE '*' AND m.mach_id != 0 AND s.snet_id = m.snet_id", 
+    4,
+    &ghst_validate,
+  },
+
+  {
+    /* Q_AHST - ADD_HOST */ /* uses prefetch_value() for mach_id */
+    "add_host",
+    "ahst",
     APPEND,
     "m",
     MACHINE,
-    "INTO machine (name, type, mach_id) VALUES (uppercase('%s'),'%s',%s)",
-    amac_fields,
-    2,
+    "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 (uppercase('%s'),uppercase('%s'),uppercase('%s'),uppercase('%s'),uppercase('%s'),'%s',%s,%s,date('now'),%d,'%s','%s',%d,%d,%d,date('now'),date('now'),%s,%s)",
+    ahst_fields,
+    14,
     0,
     0,
-    &amac_validate,
+    &ahst_validate,
   },
 
   {
-    /* Q_UMAC - UPDATE_MACHINE */
-    "update_machine",
-    "umac",
+    /* Q_UHST - UPDATE_HOST */
+    "update_host",
+    "uhst",
     UPDATE,
     "m",
     MACHINE,
-    "machine SET name = uppercase('%s'), type = '%s'",
-    umac_fields,
-    2,
+    "machine SET name=uppercase('%s'),vendor=uppercase('%s'),model=uppercase('%s'),os=uppercase('%s'),location=uppercase('%s'),contact='%s',use=%s,status=%s,snet_id=%d,address='%s',owner_type='%s',owner_id=%d,acomment=%d,ocomment=%d",
+    uhst_fields,
+    14,
     "mach_id = %d",
     1,
-    &umac_validate,
+    &uhst_validate,
   },
 
   {
-    /* Q_DMAC - DELETE_MACHINE */
-    "delete_machine",
-    "dmac",
+    /* Q_DHST - DELETE_HOST */
+    "delete_host",
+    "dhst",
     DELETE,
     "m",
     MACHINE,
     (char *)0,
-    dmac_fields,
+    dhst_fields,
     0,
     "mach_id = %d",
     1,
-    &dmac_validate,
+    &dhst_validate,
+  },
+
+  {
+    /* Q_GHAL - GET_HOSTALIAS */
+    "get_hostalias",
+    "ghal",
+    RETRIEVE,
+    "a",
+    "hostalias",
+    "CHAR(a.name), CHAR(m.name) FROM hostalias a, machine m",
+    ghal_fields,
+    2,
+    "m.mach_id = a.mach_id and a.name LIKE '%s' ESCAPE '*' AND m.name LIKE '%s' ESCAPE '*'",
+    2,
+    &ghal_validate,
+  },
+
+  {
+    /* Q_AHAL - ADD_HOSTALIAS */
+    "add_hostalias",
+    "ahal",
+    APPEND,
+    "a",
+    "hostalias",
+    "INTO hostalias (name, mach_id) VALUES (uppercase('%s'),%d)",
+    ghal_fields,
+    2,
+    0,
+    0,
+    &ahal_validate,
+  },
+
+  {
+    /* Q_DHAL - DELETE_HOSTALIAS */
+    "delete_hostalias",
+    "dhal",
+    DELETE,
+    "a",
+    "hostalias",
+    (char *)0,
+    ghal_fields,
+    0,
+    "name = uppercase('%s') AND mach_id = %d",
+    2,
+    &dhal_validate,
+  },
+
+  {
+    /* Q_GSNT - GET_SUBNET */
+    "get_subnet",
+    "gsnt",
+    RETRIEVE,
+    "s",
+    SUBNET,
+    "CHAR(s.name), CHAR(s.description), CHAR(s.saddr), CHAR(s.mask), CHAR(s.low), CHAR(s.high), s.prefix, s.owner_type, CHAR(s.owner_id), CHAR(s.modtime), CHAR(s.modby), s.modwith FROM subnet s",
+    gsnt_fields,
+    12,
+    "s.name LIKE '%s' ESCAPE '*' and s.snet_id != 0",
+    1,
+    &gsnt_validate,
+  },
+
+  {
+    /* Q_ASNT - ADD_SUBNET */
+    "add_subnet",
+    "asnt",
+    APPEND,
+    "s",
+    SUBNET,
+    "INTO subnet (name, description, saddr, mask, low, high, prefix, owner_type, owner_id, snet_id) VALUES (uppercase('%s'), '%s', %s, %s, %s, %s, '%s', '%s', %d, %s)",
+    asnt_fields,
+    9,
+    0,
+    0,
+    &asnt_validate,
+  },
+
+  {
+    /* Q_USNT - UPDATE_SUBNET */
+    "update_subnet",
+    "usnt",
+    UPDATE,
+    "s",
+    SUBNET,
+    "subnet SET name=uppercase('%s'), description='%s', saddr=%s, mask=%s, low=%s, high=%s, prefix='%s', owner_type='%s', owner_id=%d",
+    usnt_fields,
+    9,
+    "snet_id = %d",
+    1,
+    &usnt_validate,
+  },
+
+  {
+    /* Q_DSNT - DELETE_SUBNET */
+    "delete_subnet",
+    "dsnt",
+    DELETE,
+    "s",
+    SUBNET,
+    (char *)0,
+    dsnt_fields,
+    0,
+    "snet_id = %d",
+    1,
+    &dsnt_validate,
   },
 
   {
@@ -3059,11 +3420,11 @@ struct query Queries2[] = {
   },
 
   {
-    /* Q_QGSV - QUALIFIED_GET_SERVER_HOST */
+    /* Q_QGSH - QUALIFIED_GET_SERVER_HOST */
     "qualified_get_server_host",
     "qgsh",
     RETRIEVE,
-    "sh",
+    0,
     "serverhosts",
     0,
     qgsh_fields,
@@ -3455,8 +3816,8 @@ struct query Queries2[] = {
     UPDATE,
     "np",
     "nfsphys",
-    "nfsphys SET device = '%s', status = '%s', allocated = %s, partsize = %s",
-    gnfp_fields,
+    "nfsphys SET device = '%s', status = %s, allocated = %s, partsize = %s",
+    ganf_fields,
     4,
     "mach_id = %d AND dir = '%s'", 
     2,
@@ -3524,15 +3885,15 @@ struct query Queries2[] = {
   },
 
   {
-    /* Q_AQOT - ADD_QUOTA */ /* prefetch_filsys() gets last 2 values */
+    /* Q_AQOT - ADD_QUOTA */ /* prefetch_filsys() gets last 1 value */
     "add_quota",
     "aqot",
     APPEND,
-    "q",
+    0,
     QUOTA,
-    "INTO quota (type, entity_id, quota, filsys_id, phys_id) VALUES ('%s', %d, %s, %s, %s)",
+    "INTO quota (filsys_id, type, entity_id, quota, phys_id) VALUES ('%s', %d, %d, %s, %s)",
     aqot_fields,
-    3,
+    4,
     (char *)0,
     0,
     &aqot_validate,
@@ -3543,12 +3904,12 @@ struct query Queries2[] = {
     "update_quota",
     "uqot",
     UPDATE,
-    "q",
+    0,
     QUOTA,
     "quota SET quota = %s",
     aqot_fields,
     1,
-    "q.filsys_id = %d AND q.type = '%s' AND q.entity_id = %d",
+    0,
     3,
     &uqot_validate,
   },
@@ -3558,12 +3919,12 @@ struct query Queries2[] = {
     "delete_quota",
     "dqot",
     DELETE,
-    "q",
+    0,
     QUOTA,
     (char *)0,
     aqot_fields,
     0,
-    "q.filsys_id = %d AND q.type = '%s' AND q.entity_id = %d",
+    0,
     3,
     &dqot_validate,
   },
@@ -3599,31 +3960,31 @@ struct query Queries2[] = {
   },
 
   {
-    /* Q_ANFQ - ADD_NFS_QUOTA */ /* prefetch_filsys() gets last 2 values */
+    /* Q_ANFQ - ADD_NFS_QUOTA */ /* prefetch_filsys() gets last 1 value */
     "add_nfs_quota",
     "anfq",
     APPEND,
-    "q",
+    0,
     QUOTA,
-    "INTO quota (type, entity_id, quota, filsys_id, phys_id) VALUES ('USER', %d, %s, %s, %s)",
+    "INTO quota (type, filsys_id, entity_id, quota, phys_id ) VALUES ('USER', %d, %d, %s, %s)",
     anfq_fields,
-    2,
+    3,
     (char *)0,
     0,
     &anfq_validate,
   },
 
   {
-    /* Q_UNFQ - UPDATE_NFS_QUOTA */
+    /* Q_UNFQ - UPDATE_NFS_QUOTA */ 
     "update_nfs_quota",
     "unfq",
     UPDATE,
-    "q",
+    0,
     QUOTA,
     "quota SET quota = %s",
     anfq_fields,
     1,
-    "filsys_id = %d AND type = 'USER' AND entity_id = %d",
+    0,
     2,
     &unfq_validate,
   },
@@ -3633,12 +3994,12 @@ struct query Queries2[] = {
     "delete_nfs_quota",
     "dnfq",
     DELETE,
-    "q",
+    0,
     QUOTA,
     (char *)0,
     anfq_fields,
     0,
-    "filsys_id = %d AND type = 'USER' AND entity_id = %d",
+    0,
     2,
     &dnfq_validate,
   },
@@ -3875,7 +4236,7 @@ struct query Queries2[] = {
     UPDATE,
     "z",
     "zephyr",
-    "zephyr SET class = '%s', xmt_type = '%d', xmt_id = %d, sub_type = '%s', sub_id = %d, iws_type = '%s', iws_id = %d, iui_type = '%s', iui_id = %d",
+    "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,
     9,
     "class = '%s'",
@@ -4069,7 +4430,7 @@ struct query Queries2[] = {
     "gali",
     RETRIEVE,
     "a",
-    "alias",
+    ALIAS,
     "CHAR(a.name), CHAR(a.type), CHAR(a.trans) FROM alias a",
     gali_fields,
     3,
@@ -4084,7 +4445,7 @@ struct query Queries2[] = {
     "aali",
     APPEND,
     "a",
-    "alias",
+    ALIAS,
     "INTO alias (name, type, trans) VALUES ('%s', '%s', '%s')",
     aali_fields,
     3,
@@ -4099,7 +4460,7 @@ struct query Queries2[] = {
     "dali",
     DELETE,
     "a",
-    "alias",
+    ALIAS,
     (char *)0,
     aali_fields,
     0,
@@ -4183,6 +4544,21 @@ struct query Queries2[] = {
     0,
   },
 
+  {
+    /* Q__SDL - _SET_DEBUG_LEVEL */
+    "_set_debug_level",
+    "_sdl",
+    UPDATE,
+    (char *)0,
+    (char *)0,
+    (char *)0,
+    _sdl_fields,
+    1,
+    (char *)0,
+    0,
+    &_sdl_validate,
+  },
+
 };
 
 int QueryCount2 = (sizeof Queries2 / sizeof (struct query));
This page took 0.072662 seconds and 4 git commands to generate.