forked from SpiderLabs/modsecurity-mlogc-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmlogc-ng.h
85 lines (64 loc) · 1.6 KB
/
mlogc-ng.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifndef __MLOGC_NG_H__
#define __MLOGC_NG_H__
struct audit_log_entry_t
{
/* buf len */
char *buf;
size_t buf_len;
char *id;
char *date;
char *origin;
char *origin_port;
char *dest;
char *dest_port;
/* Sections */
char *mark;
char *section_a;
char *section_b;
char *section_f;
char *section_e;
char *section_h;
/* summary line */
char *summary_line;
char *hostname;
char *remote_addr;
char *remote_user;
char *local_user;
char *logtime;
char *request;
char *response_status;
char *bytes_sent;
char *refer;
char *user_agent;
char *uniqueid;
char *sessionid;
char *audit_file;
char *extra;
char *audit_size;
char *md5;
/* internal */
size_t uploaded;
};
/* Verbose, Debug and Print definitions */
extern int verbose;
extern int debug;
/* FIXME: Check if that value makes sense. Use bytes here. */
#define MAX_FILE_SIZE 1024*1024
#ifndef WIN32
#define d(fmt, ARGS...) do { if (debug) printf("%s:%d:%s(): " fmt, __FILE__, \
__LINE__, __func__, ## ARGS); } while (0)
#define v(fmt, ARGS...) do { if (verbose) printf("%s:%d:%s(): " fmt, __FILE__, \
__LINE__, __func__, ## ARGS); } while (0)
#define e(fmt, ARGS...) do { fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \
__LINE__, __func__, ## ARGS); } while (0)
#define p(fmt, ARGS...) do { printf(fmt, ## ARGS); } while (0)
#else
#define p printf
#define e printf
#define v if (verbose) printf
#define d if (debug) printf
#endif
#endif