forked from chifflier/nflog-bindings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libnetfilter_log.i
87 lines (65 loc) · 1.57 KB
/
libnetfilter_log.i
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
86
%module nflog
%{
#include <nflog.h>
#include <nflog_common.h>
#include <exception.h>
%}
%include timeval.i
%include exception.i
%apply unsigned int { uint32_t }
%apply unsigned long long { uint64_t }
enum CfgFlags {
CfgSeq,
CfgSeqGlobal,
};
enum CopyMode {
CopyNone,
CopyMeta,
CopyPacket,
};
%feature("autodoc","1");
%include docstrings.i
%include nflog.i
%extend log {
%exception {
char *err;
clear_exception();
$action
if ((err = check_exception())) {
SWIG_exception(SWIG_RuntimeError, err);
}
}
int open();
void close();
int bind(int family);
int unbind(int family);
int create_queue(int num);
int fast_open(int num, int family);
int set_bufsiz(int nlbufsiz);
int set_qthresh(uint32_t qthresh);
int set_timeout(uint32_t timeout);
int set_flags(enum CfgFlags flags);
int set_mode(enum CopyMode mode, uint32_t range);
int prepare();
int loop();
int stop_loop();
};
%extend log_payload {
uint32_t get_nfmark();
struct timeval get_timestamp();
int get_indev();
int get_physindev();
int get_outdev();
int get_physoutdev();
uint32_t get_uid();
uint32_t get_gid();
uint32_t get_seq();
uint32_t get_seq_global();
const char * get_prefix();
uint16_t get_hwtype();
unsigned int get_length(void) {
return self->len;
}
};
%include "nflog.h"
const char * nflog_bindings_version(void);