Patch from Nicholas Brealey <nick@brealey.org> to distinguish between WinXP and WinXP64.
[ira/wip.git] / source / include / rpc_eventlog.h
1 /* 
2  *  Unix SMB/CIFS implementation.
3  *  RPC Pipe client / server routines
4  *  Copyright (C) Marcin Krzysztof Porwit    2005.
5  *  
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 3 of the License, or
9  *  (at your option) any later version.
10  *  
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *  
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
18  */
19  
20 #ifndef _RPC_EVENTLOG_H         /* _RPC_EVENTLOG_H */
21 #define _RPC_EVENTLOG_H
22
23 /* opcodes */
24
25 #define EVENTLOG_CLEAREVENTLOG          0x00
26 #define EVENTLOG_CLOSEEVENTLOG          0x02
27 #define EVENTLOG_GETNUMRECORDS          0x04
28 #define EVENTLOG_GETOLDESTENTRY         0x05
29 #define EVENTLOG_OPENEVENTLOG           0x07
30 #define EVENTLOG_READEVENTLOG           0x0a
31
32 /* Eventlog read flags */
33 /* defined in librpc/gen_ndr/eventlog.h */
34
35 /* Event types */
36 /* defined in librpc/gen_ndr/eventlog.h */
37
38 /* Defines for TDB keys */
39 #define  EVT_OLDEST_ENTRY  "INFO/oldest_entry"
40 #define  EVT_NEXT_RECORD   "INFO/next_record"
41 #define  EVT_VERSION       "INFO/version"
42 #define  EVT_MAXSIZE       "INFO/maxsize"
43 #define  EVT_RETENTION     "INFO/retention"
44
45 #define ELOG_APPL       "Application"
46 #define ELOG_SYS        "System"
47 #define ELOG_SEC        "Security"
48
49 typedef struct elog_tdb {
50         struct elog_tdb *prev, *next;
51         char *name;
52         TDB_CONTEXT *tdb;
53         int ref_count;
54 } ELOG_TDB;
55
56 #define ELOG_TDB_CTX(x) ((x)->tdb)
57
58
59 #define  EVENTLOG_DATABASE_VERSION_V1    1
60
61 /***********************************/
62
63 typedef struct 
64 {
65         POLICY_HND handle;
66         uint32 flags;
67         uint32 offset;
68         uint32 max_read_size;
69 } EVENTLOG_Q_READ_EVENTLOG;
70
71 typedef struct {
72         uint32 length;
73         uint32 reserved1;
74         uint32 record_number;
75         uint32 time_generated;
76         uint32 time_written;
77         uint32 event_id;
78         uint16 event_type;
79         uint16 num_strings;
80         uint16 event_category;
81         uint16 reserved2;
82         uint32 closing_record_number;
83         uint32 string_offset;
84         uint32 user_sid_length;
85         uint32 user_sid_offset;
86         uint32 data_length;
87         uint32 data_offset;
88 } Eventlog_record;
89
90 typedef struct {
91         uint32 source_name_len;
92         smb_ucs2_t *source_name;
93         uint32 computer_name_len;
94         smb_ucs2_t *computer_name;
95         uint32 sid_padding;
96         smb_ucs2_t *sid;
97         uint32 strings_len;
98         smb_ucs2_t *strings;
99         uint32 user_data_len;
100         char *user_data;
101         uint32 data_padding;
102 } Eventlog_data_record;
103
104 typedef struct eventlog_entry {
105         Eventlog_record record;
106         Eventlog_data_record data_record;
107         uint8 *data;
108         uint8 *end_of_data_padding;
109         struct eventlog_entry *next;
110 } Eventlog_entry;
111  
112 typedef struct {
113         uint32 num_bytes_in_resp;
114         uint32 bytes_in_next_record;
115         uint32 num_records;
116         Eventlog_entry *entry;
117         uint8 *end_of_entries_padding;
118         uint32 sent_size;
119         uint32 real_size;
120         NTSTATUS status;
121 } EVENTLOG_R_READ_EVENTLOG;
122
123 #endif /* _RPC_EVENTLOG_H */