summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>1999-05-03 22:04:02 +0000
committerJean-François Micouleau <jfm@samba.org>1999-05-03 22:04:02 +0000
commit4e5bf481fba36655e8fc8e04f6f67ba17dcb9844 (patch)
tree51967337c3f5f48cc2f6c93d1957f83135fd794e /source3/rpcclient
parent9ac038817ea75db29ccf7d6d149483eeaa88ecb6 (diff)
downloadsamba-4e5bf481fba36655e8fc8e04f6f67ba17dcb9844.tar.gz
samba-4e5bf481fba36655e8fc8e04f6f67ba17dcb9844.tar.bz2
samba-4e5bf481fba36655e8fc8e04f6f67ba17dcb9844.zip
last part of RPC api change.
and of rpcclient eventlog funtion Jean Francois (This used to be commit 7fc8659e83bf0269df297016beac6793ff0bdf32)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/display.c76
-rw-r--r--source3/rpcclient/rpcclient.c1
2 files changed, 77 insertions, 0 deletions
diff --git a/source3/rpcclient/display.c b/source3/rpcclient/display.c
index 963b5b6249..dc801805c6 100644
--- a/source3/rpcclient/display.c
+++ b/source3/rpcclient/display.c
@@ -1827,6 +1827,82 @@ void display_at_job_info(FILE *out_hnd, enum action_type action,
}
}
+/****************************************************************************
+ display structure
+ ****************************************************************************/
+void display_eventlog_eventrecord(FILE *out_hnd, enum action_type action, EVENTLOGRECORD *ev)
+{
+ switch (action)
+ {
+ case ACTION_HEADER:
+ {
+ fprintf(out_hnd, "\tevent log records\n");
+ fprintf(out_hnd, "\t-----------------\n");
+ break;
+ }
+ case ACTION_ENUMERATE:
+ {
+ fstring temp;
+ fprintf(out_hnd, "\t\trecord n.:\t%d\n", ev->recordnumber);
+
+ fprintf(out_hnd, "\t\tsource\teventnumber\teventtype\tcategory\n");
+ unistr_to_ascii(temp, ev->sourcename.buffer, sizeof(temp)-1);
+
+ fprintf(out_hnd, "\t\t%s", temp);
+
+ fprintf(out_hnd, "\t%d\t\t", ev->eventnumber&0x0000FFFF);
+
+ switch (ev->eventtype)
+ {
+ case EVENTLOG_OK:
+ fprintf(out_hnd, "Normal");
+ break;
+
+ case EVENTLOG_ERROR:
+ fprintf(out_hnd, "Error");
+ break;
+
+ case EVENTLOG_WARNING:
+ fprintf(out_hnd, "Warning");
+ break;
+
+ case EVENTLOG_INFORMATION:
+ fprintf(out_hnd, "Information");
+ break;
+
+ case EVENTLOG_AUDIT_OK:
+ fprintf(out_hnd, "Audit Normal");
+ break;
+
+ case EVENTLOG_AUDIT_ERROR:
+ fprintf(out_hnd, "Audit Error\n");
+ break;
+ }
+
+ fprintf(out_hnd, "\t%d\n", ev->category);
+ fprintf(out_hnd, "\t\tcreationtime:\t%s\n", http_timestring(ev->creationtime));
+ fprintf(out_hnd, "\t\twritetime:\t%s\n", http_timestring(ev->writetime));
+
+ unistr_to_ascii(temp, ev->computername.buffer, sizeof(temp)-1);
+ fprintf(out_hnd, "\t\tcomputer:\t%s\n", temp);
+
+ if (ev->num_of_strings!=0)
+ {
+ unistr_to_ascii(temp, ev->strings.buffer, sizeof(temp)-1);
+ fprintf(out_hnd, "\t\tdescription:\t%s\n", temp);
+ }
+
+ fprintf(out_hnd, "\n");
+ break;
+ }
+ case ACTION_FOOTER:
+ {
+ fprintf(out_hnd, "\n");
+ break;
+ }
+ }
+}
+
#if COPY_THIS_TEMPLATE
/****************************************************************************
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 255ec4c936..9bfb80aa3d 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -105,6 +105,7 @@ struct
char *description;
} commands[] =
{
+ {"eventlog", cmd_eventlog, "list the events"},
{"svcenum", cmd_svc_enum, "[-i] Lists Services Manager"},
{"at", cmd_at, "Scheduler control (at /? for syntax)"},
{"time", cmd_time, "Display remote time"},