-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlwes.i
152 lines (111 loc) · 3.73 KB
/
lwes.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
%module lwes
%pragma(php4) phpinfo="
php_info_print_table_start();
php_info_print_table_header(2, \"LWES support\", \"enabled\");
php_info_print_table_end();
"
%{
#include "lwes.h"
%}
%typemap(in) char * {
if ((*$input)->type == IS_NULL) {
$1 = NULL;
} else {
convert_to_string_ex($input);
$1 = Z_STRVAL_PP($input);
}
}
%typemap(in) struct lwes_event_type_db * {
if ((*$input)->type == IS_NULL) {
$1 = NULL;
} else {
if(SWIG_ConvertPtr(*$input, (void **)&$1, $1_descriptor, 0) < 0) {
$1 = NULL;
}
}
}
struct lwes_event_type_db *
lwes_event_type_db_create(char *filename);
int
lwes_event_type_db_destroy(struct lwes_event_type_db *db);
struct lwes_emitter *
lwes_emitter_create(char *address, char *iface, int port,
int emit_heartbeat, short freq);
struct lwes_emitter *
lwes_emitter_create_with_ttl(char *address, char *iface, int port,
int emit_heartbeat, short freq, int ttl);
int
lwes_emitter_emit(struct lwes_emitter *emitter, struct lwes_event *event);
int
lwes_emitter_emitto(char *address, char *iface, int port,
struct lwes_emitter *emitter, struct lwes_event *event);
int
lwes_emitter_destroy(struct lwes_emitter *emitter);
struct lwes_event *
lwes_event_create(struct lwes_event_type_db *db, char *event_name);
struct lwes_event *
lwes_event_create_with_encoding(struct lwes_event_type_db *db,
char *event_name, short encoding);
int
lwes_event_set_U_INT_16(struct lwes_event *event, char *attribute_name,
unsigned short a_uint16);
int
lwes_event_get_U_INT_16(struct lwes_event *event, char *attribute_name,
unsigned short *a_uint16);
int
lwes_event_set_INT_16(struct lwes_event *event, char *attribute_name,
short a_int16);
int
lwes_event_get_INT_16(struct lwes_event *event, char *attribute_name,
short *a_int16);
int
lwes_event_set_U_INT_32(struct lwes_event *event, char *attribute_name,
unsigned int a_uint32);
int
lwes_event_get_U_INT_32(struct lwes_event *event, char *attribute_name,
unsigned int *a_uint32);
int
lwes_event_set_INT_32(struct lwes_event *event, char *attribute_name,
int a_int32);
int
lwes_event_get_INT_32(struct lwes_event *event, char *attribute_name,
int *a_int32);
int
lwes_event_set_U_INT_64(struct lwes_event *event, char *attribute_name,
unsigned long a_uint64);
int
lwes_event_get_U_INT_64(struct lwes_event *event, char *attribute_name,
unsigned long &a_uint64);
int
lwes_event_set_INT_64(struct lwes_event *event, char *attribute_name,
long a_uint64);
int
lwes_event_get_INT_64(struct lwes_event *event, char *attribute_name,
long &a_uint64);
int
lwes_event_set_STRING(struct lwes_event *event, char *attribute_name,
char *a_string);
int
lwes_event_get_STRING(struct lwes_event *event, char *attribute_name,
char **a_string);
int
lwes_event_set_IP_ADDR_w_string(struct lwes_event *event, char *attribute_name,
char *an_ip_addr);
int
lwes_event_get_IP_ADDR(struct lwes_event *event, char *attribute_name,
struct in_addr *an_in_addr);
int
lwes_event_set_BOOLEAN(struct lwes_event *event, char *attribute_name,
int a_boolean);
int
lwes_event_get_BOOLEAN(struct lwes_event *event, char *attribute_name,
int *a_boolean);
int
lwes_event_destroy(struct lwes_event *event);
%inline %{
struct lwes_event *
lwes_event_create_no_db(char *event_name)
{
return lwes_event_create(NULL, event_name);
}
%}