preparing for release of alpha.1.4
[Samba.git] / source / rpcclient / display_event.c
blobcd941851ac53bef6731d973cbcfbbb47433f504d
1 /*
2 Unix SMB/Netbios implementation.
3 Version 1.9.
4 Samba utility functions
5 Copyright (C) Andrew Tridgell 1992-1999
6 Copyright (C) Luke Kenneth Casson Leighton 1996 - 1999
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "includes.h"
26 /****************************************************************************
27 display structure
28 ****************************************************************************/
29 void display_eventlog_eventrecord(FILE *out_hnd, enum action_type action, EVENTLOGRECORD *const ev)
31 switch (action)
33 case ACTION_HEADER:
35 report(out_hnd, "\tevent log records\n");
36 report(out_hnd, "\t-----------------\n");
37 break;
39 case ACTION_ENUMERATE:
41 fstring temp;
42 report(out_hnd, "\t\trecord n.:\t%d\n", ev->recordnumber);
44 report(out_hnd, "\t\tsource\teventnumber\teventtype\tcategory\n");
45 unistr_to_ascii(temp, ev->sourcename.buffer, sizeof(temp)-1);
47 report(out_hnd, "\t\t%s", temp);
49 report(out_hnd, "\t%d\t\t", ev->eventnumber&0x0000FFFF);
51 switch (ev->eventtype)
53 case EVENTLOG_OK:
54 report(out_hnd, "Normal");
55 break;
57 case EVENTLOG_ERROR:
58 report(out_hnd, "Error");
59 break;
61 case EVENTLOG_WARNING:
62 report(out_hnd, "Warning");
63 break;
65 case EVENTLOG_INFORMATION:
66 report(out_hnd, "Information");
67 break;
69 case EVENTLOG_AUDIT_OK:
70 report(out_hnd, "Audit Normal");
71 break;
73 case EVENTLOG_AUDIT_ERROR:
74 report(out_hnd, "Audit Error\n");
75 break;
78 report(out_hnd, "\t%d\n", ev->category);
79 report(out_hnd, "\t\tcreationtime:\t%s\n", http_timestring(ev->creationtime));
80 report(out_hnd, "\t\twritetime:\t%s\n", http_timestring(ev->writetime));
82 unistr_to_ascii(temp, ev->computername.buffer, sizeof(temp)-1);
83 report(out_hnd, "\t\tcomputer:\t%s\n", temp);
85 if (ev->num_of_strings!=0)
87 unistr_to_ascii(temp, ev->strings.buffer, sizeof(temp)-1);
88 report(out_hnd, "\t\tdescription:\t%s\n", temp);
91 report(out_hnd, "\n");
92 break;
94 case ACTION_FOOTER:
96 report(out_hnd, "\n");
97 break;