2005-03-24 02:26:33 +03:00
/*
* Unix SMB / CIFS implementation .
* RPC Pipe client / server routines
* Copyright ( C ) Marcin Krzysztof Porwit 2005.
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
2007-07-09 23:25:36 +04:00
* the Free Software Foundation ; either version 3 of the License , or
2005-03-24 02:26:33 +03:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2007-07-10 09:23:25 +04:00
* along with this program ; if not , see < http : //www.gnu.org/licenses/>.
2005-03-24 02:26:33 +03:00
*/
# ifndef _RPC_EVENTLOG_H /* _RPC_EVENTLOG_H */
# define _RPC_EVENTLOG_H
/* opcodes */
# define EVENTLOG_CLEAREVENTLOG 0x00
# define EVENTLOG_CLOSEEVENTLOG 0x02
# define EVENTLOG_GETNUMRECORDS 0x04
# define EVENTLOG_GETOLDESTENTRY 0x05
# define EVENTLOG_OPENEVENTLOG 0x07
# define EVENTLOG_READEVENTLOG 0x0a
/* Eventlog read flags */
2006-09-18 23:46:11 +04:00
/* defined in librpc/gen_ndr/eventlog.h */
2005-03-24 02:26:33 +03:00
/* Event types */
2006-09-18 23:46:11 +04:00
/* defined in librpc/gen_ndr/eventlog.h */
2005-03-24 02:26:33 +03:00
2005-10-06 21:48:03 +04:00
/* Defines for TDB keys */
2005-10-14 20:07:00 +04:00
# define EVT_OLDEST_ENTRY "INFO / oldest_entry"
# define EVT_NEXT_RECORD "INFO / next_record"
# define EVT_VERSION "INFO / version"
# define EVT_MAXSIZE "INFO / maxsize"
# define EVT_RETENTION "INFO / retention"
# define ELOG_APPL "Application"
# define ELOG_SYS "System"
# define ELOG_SEC "Security"
2005-10-06 21:48:03 +04:00
2005-11-17 23:08:59 +03:00
typedef struct elog_tdb {
struct elog_tdb * prev , * next ;
char * name ;
TDB_CONTEXT * tdb ;
int ref_count ;
} ELOG_TDB ;
# define ELOG_TDB_CTX(x) ((x)->tdb)
2005-10-06 21:48:03 +04:00
# define EVENTLOG_DATABASE_VERSION_V1 1
2005-03-24 02:26:33 +03:00
2005-09-30 21:13:37 +04:00
/***********************************/
typedef struct
2005-03-24 02:26:33 +03:00
{
POLICY_HND handle ;
uint32 flags ;
uint32 offset ;
uint32 max_read_size ;
2005-09-30 21:13:37 +04:00
} EVENTLOG_Q_READ_EVENTLOG ;
2005-03-24 02:26:33 +03:00
2005-09-30 21:13:37 +04:00
typedef struct {
2005-03-24 02:26:33 +03:00
uint32 length ;
uint32 reserved1 ;
uint32 record_number ;
uint32 time_generated ;
uint32 time_written ;
uint32 event_id ;
uint16 event_type ;
uint16 num_strings ;
uint16 event_category ;
uint16 reserved2 ;
uint32 closing_record_number ;
uint32 string_offset ;
uint32 user_sid_length ;
uint32 user_sid_offset ;
uint32 data_length ;
uint32 data_offset ;
} Eventlog_record ;
2005-09-30 21:13:37 +04:00
typedef struct {
2005-03-24 02:26:33 +03:00
uint32 source_name_len ;
2007-11-27 22:22:58 +03:00
smb_ucs2_t * source_name ;
2005-03-24 02:26:33 +03:00
uint32 computer_name_len ;
2007-11-27 22:22:58 +03:00
smb_ucs2_t * computer_name ;
2005-03-24 02:26:33 +03:00
uint32 sid_padding ;
2007-11-27 22:22:58 +03:00
smb_ucs2_t * sid ;
2005-03-24 02:26:33 +03:00
uint32 strings_len ;
2007-11-27 22:22:58 +03:00
smb_ucs2_t * strings ;
2005-03-24 02:26:33 +03:00
uint32 user_data_len ;
2007-11-27 22:22:58 +03:00
char * user_data ;
2005-03-24 02:26:33 +03:00
uint32 data_padding ;
} Eventlog_data_record ;
2005-09-30 21:13:37 +04:00
typedef struct eventlog_entry {
2005-03-24 02:26:33 +03:00
Eventlog_record record ;
Eventlog_data_record data_record ;
uint8 * data ;
uint8 * end_of_data_padding ;
struct eventlog_entry * next ;
} Eventlog_entry ;
2005-09-30 21:13:37 +04:00
typedef struct {
2005-03-24 02:26:33 +03:00
uint32 num_bytes_in_resp ;
uint32 bytes_in_next_record ;
uint32 num_records ;
Eventlog_entry * entry ;
uint8 * end_of_entries_padding ;
uint32 sent_size ;
uint32 real_size ;
2005-10-27 17:30:23 +04:00
NTSTATUS status ;
2005-09-30 21:13:37 +04:00
} EVENTLOG_R_READ_EVENTLOG ;
2005-03-24 02:26:33 +03:00
# endif /* _RPC_EVENTLOG_H */