int set_nfsphys_modtime(struct query *q, char *argv[], client *cl);
int set_filesys_modtime(struct query *q, char *argv[], client *cl);
int set_zephyr_modtime(struct query *q, char *argv[], client *cl);
+int set_service_modtime(struct query *q, char *argv[], client *cl);
int _sdl_followup(struct query *q, char *argv[], client *cl);
int trigger_dcm(struct query *q, char *argv[], client *cl);
return MR_SUCCESS;
}
+/* sets the modtime on an entry in services table, where argv[0] contains
+ * the service name.
+ */
+
+int set_service_modtime(struct query *q, char *argv[], client *cl)
+{
+ EXEC SQL BEGIN DECLARE SECTION;
+ char *service, *protocol, *entity;
+ int who;
+ EXEC SQL END DECLARE SECTION;
+
+ entity = cl->entity;
+ who = cl->client_id;
+
+ service = argv[0];
+ protocol = argv[1];
+
+ EXEC SQL UPDATE services SET modtime = SYSDATE, modby = :who,
+ modwith = :entity WHERE name = :service AND protocol = :protocol;
+
+ return MR_SUCCESS;
+}
/* fixes the modby field. This will be the second to last thing in the
* argv, the argv length is determined from the query structure. It is
};
static char *gsvc_fields[] = {
- "service",
+ "service", "protocol",
"service", "protocol", "port", "description", "modtime", "modby", "modwith",
};
"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"},
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[] = {
"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,
},
"ss",
SERVICES_TABLE,
0,
- asvc_fields,
+ dsvc_fields,
0,
- "name = '%s'",
- 1,
+ "name = '%s' AND protocol = '%s'",
+ 2,
NULL,
- &asvc_validate,
+ &dsvc_validate,
},
{