r23801: The FSF has moved around a lot. This fixes their Mass Ave address.
[tprouty/samba.git] / source3 / 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         uint16 unknown1;
65         uint16 unknown2;
66 } EVENTLOG_OPEN_UNKNOWN0;
67
68 typedef struct {
69         EVENTLOG_OPEN_UNKNOWN0 *unknown0;
70         UNISTR4 logname;
71         UNISTR4 servername;
72         uint32 unknown1;
73         uint32 unknown2;
74 } EVENTLOG_Q_OPEN_EVENTLOG;
75
76 typedef struct {
77         POLICY_HND handle;
78         NTSTATUS status;
79 } EVENTLOG_R_OPEN_EVENTLOG;
80
81
82 /***********************************/
83
84 typedef struct {
85         POLICY_HND handle;
86 } EVENTLOG_Q_GET_NUM_RECORDS;
87
88 typedef struct {
89         uint32 num_records;
90         NTSTATUS status;
91 } EVENTLOG_R_GET_NUM_RECORDS;
92
93
94 /***********************************/
95
96 typedef struct {
97         POLICY_HND handle;
98 } EVENTLOG_Q_GET_OLDEST_ENTRY;
99
100 typedef struct {
101         uint32 oldest_entry;
102         NTSTATUS status;
103 } EVENTLOG_R_GET_OLDEST_ENTRY;
104
105
106 /***********************************/
107
108 typedef struct 
109 {
110         POLICY_HND handle;
111         uint32 flags;
112         uint32 offset;
113         uint32 max_read_size;
114 } EVENTLOG_Q_READ_EVENTLOG;
115
116 typedef struct {
117         uint32 length;
118         uint32 reserved1;
119         uint32 record_number;
120         uint32 time_generated;
121         uint32 time_written;
122         uint32 event_id;
123         uint16 event_type;
124         uint16 num_strings;
125         uint16 event_category;
126         uint16 reserved2;
127         uint32 closing_record_number;
128         uint32 string_offset;
129         uint32 user_sid_length;
130         uint32 user_sid_offset;
131         uint32 data_length;
132         uint32 data_offset;
133 } Eventlog_record;
134
135 typedef struct {
136         uint32 source_name_len;
137         wpstring source_name;
138         uint32 computer_name_len;
139         wpstring computer_name;
140         uint32 sid_padding;
141         wpstring sid;
142         uint32 strings_len;
143         wpstring strings;
144         uint32 user_data_len;
145         pstring user_data;
146         uint32 data_padding;
147 } Eventlog_data_record;
148
149 typedef struct eventlog_entry {
150         Eventlog_record record;
151         Eventlog_data_record data_record;
152         uint8 *data;
153         uint8 *end_of_data_padding;
154         struct eventlog_entry *next;
155 } Eventlog_entry;
156  
157 typedef struct {
158         uint32 num_bytes_in_resp;
159         uint32 bytes_in_next_record;
160         uint32 num_records;
161         Eventlog_entry *entry;
162         uint8 *end_of_entries_padding;
163         uint32 sent_size;
164         uint32 real_size;
165         NTSTATUS status;
166 } EVENTLOG_R_READ_EVENTLOG;
167
168
169 /***********************************/
170
171 typedef struct {
172         POLICY_HND handle;
173         UNISTR4 backupfile;
174 } EVENTLOG_Q_CLEAR_EVENTLOG;
175
176 typedef struct {
177         NTSTATUS status;
178 } EVENTLOG_R_CLEAR_EVENTLOG;
179
180 #endif /* _RPC_EVENTLOG_H */