lwes 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +3 -0
- data/README +2 -2
- data/ext/lwes/extconf.rb +20 -4
- data/ext/lwes/lwes-0.23.1.tar.gz +0 -0
- data/lib/lwes.rb +2 -2
- data/lwes.gemspec +2 -3
- metadata +5 -6
- data/ext/lwes/lwes-0.22.3.diff +0 -287
- data/ext/lwes/lwes-0.22.3.tar.gz +0 -0
data/ChangeLog
CHANGED
data/README
CHANGED
@@ -48,7 +48,7 @@ gem.
|
|
48
48
|
emitter = LWES::Emitter.new(:address => '224.1.1.11',
|
49
49
|
:port => 12345,
|
50
50
|
:heartbeat => 30, # nil to disable
|
51
|
-
:ttl => 1) # nil for
|
51
|
+
:ttl => 1) # nil for default TTL(3)
|
52
52
|
|
53
53
|
# parse your ESF file at startup, the example below assumes you
|
54
54
|
# have "Event1" and "Event2" defined in your ESF file:
|
@@ -86,7 +86,7 @@ just use an emitter to send Hash objects:
|
|
86
86
|
emitter = LWES::Emitter.new(:address => '224.1.1.11',
|
87
87
|
:port => 12345,
|
88
88
|
:heartbeat => 30, # nil to disable
|
89
|
-
:ttl => 1) # nil for
|
89
|
+
:ttl => 1) # nil for default TTL(3)
|
90
90
|
|
91
91
|
# Since we can't reliably map certain Ruby types to LWES types, you'll
|
92
92
|
# have to specify them explicitly for IP addresses and all Integer
|
data/ext/lwes/extconf.rb
CHANGED
@@ -4,13 +4,27 @@ require 'fileutils'
|
|
4
4
|
dir_config('lwes')
|
5
5
|
|
6
6
|
pwd = File.expand_path(File.dirname(__FILE__))
|
7
|
-
v = '0.
|
7
|
+
v = '0.23.1'
|
8
8
|
dir = "lwes-#{v}"
|
9
9
|
diff = "#{pwd}/#{dir}.diff"
|
10
10
|
inst = "#{pwd}/.inst"
|
11
11
|
tgz = "#{dir}.tar.gz"
|
12
12
|
url = "http://sourceforge.net/projects/lwes/files/lwes-c/#{v}/#{tgz}/download"
|
13
13
|
|
14
|
+
def sub_cd(dir, &b)
|
15
|
+
oldpwd = ENV["PWD"]
|
16
|
+
begin
|
17
|
+
ENV["PWD"] = dir
|
18
|
+
Dir.chdir(dir, &b)
|
19
|
+
ensure
|
20
|
+
if oldpwd
|
21
|
+
ENV["PWD"] = oldpwd
|
22
|
+
else
|
23
|
+
ENV.delete("PWD")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
14
28
|
# from Net::HTTP example
|
15
29
|
def fetch(uri_str, limit = 10)
|
16
30
|
raise ArgumentError, 'HTTP redirect too deep' if limit == 0
|
@@ -26,7 +40,7 @@ end
|
|
26
40
|
|
27
41
|
unless have_library('lwes') && have_header('lwes.h')
|
28
42
|
warn "LWES library not found, building locally"
|
29
|
-
|
43
|
+
sub_cd(pwd) do
|
30
44
|
unless test ?r, tgz
|
31
45
|
response = fetch(url)
|
32
46
|
File.open("#{tgz}.#{$$}.#{rand}.tmp", "wb") do |fp|
|
@@ -37,8 +51,10 @@ unless have_library('lwes') && have_header('lwes.h')
|
|
37
51
|
unless test ?r, "#{inst}/.ok"
|
38
52
|
FileUtils.rm_rf(dir)
|
39
53
|
system('tar', 'zxf', tgz) or abort "tar failed with #{$?}"
|
40
|
-
|
41
|
-
|
54
|
+
sub_cd(dir) do
|
55
|
+
if File.exist?(diff)
|
56
|
+
system("patch", "-p1", "-i", diff) or abort "patch failed: #{$?}"
|
57
|
+
end
|
42
58
|
args = %w(--disable-shared
|
43
59
|
--disable-hardcore
|
44
60
|
--with-pic
|
Binary file
|
data/lib/lwes.rb
CHANGED
data/lwes.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{lwes}
|
3
|
-
s.version = "0.
|
3
|
+
s.version = "0.7.0"
|
4
4
|
s.date = Time.now
|
5
5
|
s.authors = ["Erik S. Chang", "Frank Maritato"]
|
6
6
|
s.email = %q{lwes-devel@lists.sourceforge.net}
|
@@ -24,7 +24,6 @@ examples/my_events.esf
|
|
24
24
|
ext/lwes/emitter.c
|
25
25
|
ext/lwes/event.c
|
26
26
|
ext/lwes/extconf.rb
|
27
|
-
ext/lwes/lwes-0.22.3.diff
|
28
27
|
ext/lwes/lwes.c
|
29
28
|
ext/lwes/lwes_ruby.h
|
30
29
|
ext/lwes/numeric.c
|
@@ -46,7 +45,7 @@ test/unit/test_event.rb
|
|
46
45
|
test/unit/test_struct.rb
|
47
46
|
test/unit/test_type_db.rb
|
48
47
|
) + %w(
|
49
|
-
ext/lwes/lwes-0.
|
48
|
+
ext/lwes/lwes-0.23.1.tar.gz
|
50
49
|
)
|
51
50
|
s.rubyforge_project = 'lwes'
|
52
51
|
s.test_files = s.files.grep(%r{\Atest/unit/test_})
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 7
|
8
|
+
- 0
|
9
|
+
version: 0.7.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Erik S. Chang
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-01-27 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -42,7 +42,6 @@ files:
|
|
42
42
|
- ext/lwes/emitter.c
|
43
43
|
- ext/lwes/event.c
|
44
44
|
- ext/lwes/extconf.rb
|
45
|
-
- ext/lwes/lwes-0.22.3.diff
|
46
45
|
- ext/lwes/lwes.c
|
47
46
|
- ext/lwes/lwes_ruby.h
|
48
47
|
- ext/lwes/numeric.c
|
@@ -63,7 +62,7 @@ files:
|
|
63
62
|
- test/unit/test_event.rb
|
64
63
|
- test/unit/test_struct.rb
|
65
64
|
- test/unit/test_type_db.rb
|
66
|
-
- ext/lwes/lwes-0.
|
65
|
+
- ext/lwes/lwes-0.23.1.tar.gz
|
67
66
|
has_rdoc: true
|
68
67
|
homepage: http://www.lwes.org/
|
69
68
|
licenses: []
|
data/ext/lwes/lwes-0.22.3.diff
DELETED
@@ -1,287 +0,0 @@
|
|
1
|
-
backport of several things from lwes trunk
|
2
|
-
|
3
|
-
* ESF error handling (r344)
|
4
|
-
* empty events in ESFs (inherited fields only) (r307)
|
5
|
-
|
6
|
-
https://lwes.svn.sourceforge.net/svnroot/lwes/lwes/trunk
|
7
|
-
|
8
|
-
diff -rup a/src/lwes_esf_parser_y.y b/src/lwes_esf_parser_y.y
|
9
|
-
--- a/src/lwes_esf_parser_y.y
|
10
|
-
+++ b/src/lwes_esf_parser_y.y
|
11
|
-
@@ -63,8 +63,10 @@ eventname: EVENTWORD {
|
12
|
-
|
13
|
-
;
|
14
|
-
|
15
|
-
-attributelist: attribute
|
16
|
-
- | attributelist attribute
|
17
|
-
+attributelist:
|
18
|
-
+ /* empty */
|
19
|
-
+ | attribute
|
20
|
-
+ | attributelist attribute
|
21
|
-
;
|
22
|
-
|
23
|
-
attribute: type attributename ';'
|
24
|
-
@@ -221,6 +223,7 @@ lwes_parse_esf
|
25
|
-
else
|
26
|
-
{
|
27
|
-
fprintf (stderr,"ERROR: No such file : \"%s\"\n",filename);
|
28
|
-
+ state.errors++;
|
29
|
-
}
|
30
|
-
|
31
|
-
if (state.errors)
|
32
|
-
diff -rup a/src/lwes_event_type_db.c b/src/lwes_event_type_db.c
|
33
|
-
--- a/src/lwes_event_type_db.c
|
34
|
-
+++ b/src/lwes_event_type_db.c
|
35
|
-
@@ -36,7 +36,11 @@ lwes_event_type_db_create
|
36
|
-
db->events = lwes_hash_create ();
|
37
|
-
if (db->events != NULL)
|
38
|
-
{
|
39
|
-
- lwes_parse_esf (db, db->esf_filename);
|
40
|
-
+ if (lwes_parse_esf (db, db->esf_filename) != 0)
|
41
|
-
+ {
|
42
|
-
+ free (db);
|
43
|
-
+ db = NULL;
|
44
|
-
+ }
|
45
|
-
}
|
46
|
-
else
|
47
|
-
{
|
48
|
-
diff -rup a/src/lwes_esf_parser_y.c b/src/lwes_esf_parser_y.c
|
49
|
-
--- a/src/lwes_esf_parser_y.c
|
50
|
-
+++ b/src/lwes_esf_parser_y.c
|
51
|
-
@@ -387,7 +387,7 @@ union yyalloc
|
52
|
-
/* YYNNTS -- Number of nonterminals. */
|
53
|
-
#define YYNNTS 8
|
54
|
-
/* YYNRULES -- Number of rules. */
|
55
|
-
-#define YYNRULES 23
|
56
|
-
+#define YYNRULES 24
|
57
|
-
/* YYNRULES -- Number of states. */
|
58
|
-
#define YYNSTATES 32
|
59
|
-
|
60
|
-
@@ -435,9 +435,9 @@ static const yytype_uint8 yytranslate[] =
|
61
|
-
YYRHS. */
|
62
|
-
static const yytype_uint8 yyprhs[] =
|
63
|
-
{
|
64
|
-
- 0, 0, 3, 5, 8, 13, 16, 19, 21, 23,
|
65
|
-
- 26, 30, 35, 40, 42, 44, 46, 48, 50, 52,
|
66
|
-
- 54, 56, 58, 60
|
67
|
-
+ 0, 0, 3, 5, 8, 13, 16, 19, 21, 22,
|
68
|
-
+ 24, 27, 31, 36, 41, 43, 45, 47, 49, 51,
|
69
|
-
+ 53, 55, 57, 59, 61
|
70
|
-
};
|
71
|
-
|
72
|
-
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
73
|
-
@@ -445,19 +445,19 @@ static const yytype_int8 yyrhs[] =
|
74
|
-
{
|
75
|
-
18, 0, -1, 19, -1, 18, 19, -1, 20, 14,
|
76
|
-
21, 15, -1, 1, 16, -1, 1, 15, -1, 12,
|
77
|
-
- -1, 22, -1, 21, 22, -1, 24, 23, 16, -1,
|
78
|
-
- 24, 23, 1, 16, -1, 24, 23, 1, 15, -1,
|
79
|
-
- 13, -1, 3, -1, 4, -1, 5, -1, 6, -1,
|
80
|
-
- 10, -1, 11, -1, 7, -1, 8, -1, 9, -1,
|
81
|
-
- 13, -1
|
82
|
-
+ -1, -1, 22, -1, 21, 22, -1, 24, 23, 16,
|
83
|
-
+ -1, 24, 23, 1, 16, -1, 24, 23, 1, 15,
|
84
|
-
+ -1, 13, -1, 3, -1, 4, -1, 5, -1, 6,
|
85
|
-
+ -1, 10, -1, 11, -1, 7, -1, 8, -1, 9,
|
86
|
-
+ -1, 13, -1
|
87
|
-
};
|
88
|
-
|
89
|
-
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
90
|
-
static const yytype_uint8 yyrline[] =
|
91
|
-
{
|
92
|
-
- 0, 35, 35, 36, 39, 47, 48, 51, 66, 67,
|
93
|
-
- 70, 71, 72, 75, 93, 104, 115, 125, 135, 145,
|
94
|
-
- 155, 165, 175, 185
|
95
|
-
+ 0, 35, 35, 36, 39, 47, 48, 51, 66, 68,
|
96
|
-
+ 69, 72, 73, 74, 77, 95, 106, 117, 127, 137,
|
97
|
-
+ 147, 157, 167, 177, 187
|
98
|
-
};
|
99
|
-
#endif
|
100
|
-
|
101
|
-
@@ -488,16 +488,16 @@ static const yytype_uint16 yytoknum[] =
|
102
|
-
static const yytype_uint8 yyr1[] =
|
103
|
-
{
|
104
|
-
0, 17, 18, 18, 19, 19, 19, 20, 21, 21,
|
105
|
-
- 22, 22, 22, 23, 24, 24, 24, 24, 24, 24,
|
106
|
-
- 24, 24, 24, 24
|
107
|
-
+ 21, 22, 22, 22, 23, 24, 24, 24, 24, 24,
|
108
|
-
+ 24, 24, 24, 24, 24
|
109
|
-
};
|
110
|
-
|
111
|
-
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
112
|
-
static const yytype_uint8 yyr2[] =
|
113
|
-
{
|
114
|
-
- 0, 2, 1, 2, 4, 2, 2, 1, 1, 2,
|
115
|
-
- 3, 4, 4, 1, 1, 1, 1, 1, 1, 1,
|
116
|
-
- 1, 1, 1, 1
|
117
|
-
+ 0, 2, 1, 2, 4, 2, 2, 1, 0, 1,
|
118
|
-
+ 2, 3, 4, 4, 1, 1, 1, 1, 1, 1,
|
119
|
-
+ 1, 1, 1, 1, 1
|
120
|
-
};
|
121
|
-
|
122
|
-
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
|
123
|
-
@@ -506,9 +506,9 @@ static const yytype_uint8 yyr2[] =
|
124
|
-
static const yytype_uint8 yydefact[] =
|
125
|
-
{
|
126
|
-
0, 0, 7, 0, 2, 0, 6, 5, 1, 3,
|
127
|
-
- 0, 14, 15, 16, 17, 20, 21, 22, 18, 19,
|
128
|
-
- 23, 0, 8, 0, 4, 9, 13, 0, 0, 10,
|
129
|
-
- 12, 11
|
130
|
-
+ 8, 15, 16, 17, 18, 21, 22, 23, 19, 20,
|
131
|
-
+ 24, 0, 9, 0, 4, 10, 14, 0, 0, 11,
|
132
|
-
+ 13, 12
|
133
|
-
};
|
134
|
-
|
135
|
-
/* YYDEFGOTO[NTERM-NUM]. */
|
136
|
-
@@ -1414,18 +1414,18 @@ yyreduce:
|
137
|
-
}
|
138
|
-
break;
|
139
|
-
|
140
|
-
- case 11:
|
141
|
-
-#line 71 "lwes_esf_parser_y.y"
|
142
|
-
+ case 12:
|
143
|
-
+#line 73 "lwes_esf_parser_y.y"
|
144
|
-
{ lweserror("Did you forget a ';'?"); }
|
145
|
-
break;
|
146
|
-
|
147
|
-
- case 12:
|
148
|
-
-#line 72 "lwes_esf_parser_y.y"
|
149
|
-
+ case 13:
|
150
|
-
+#line 74 "lwes_esf_parser_y.y"
|
151
|
-
{ lweserror("Did you forget a semi-colon?"); }
|
152
|
-
break;
|
153
|
-
|
154
|
-
- case 13:
|
155
|
-
-#line 75 "lwes_esf_parser_y.y"
|
156
|
-
+ case 14:
|
157
|
-
+#line 77 "lwes_esf_parser_y.y"
|
158
|
-
{
|
159
|
-
if (((struct lwes_parser_state *) param)->lastType != NULL)
|
160
|
-
{
|
161
|
-
@@ -1444,8 +1444,8 @@ yyreduce:
|
162
|
-
}
|
163
|
-
break;
|
164
|
-
|
165
|
-
- case 14:
|
166
|
-
-#line 93 "lwes_esf_parser_y.y"
|
167
|
-
+ case 15:
|
168
|
-
+#line 95 "lwes_esf_parser_y.y"
|
169
|
-
{
|
170
|
-
/* allocate a string, and copy the type value into it */
|
171
|
-
((struct lwes_parser_state *) param)->lastType = strdup(lweslval);
|
172
|
-
@@ -1459,8 +1459,8 @@ yyreduce:
|
173
|
-
}
|
174
|
-
break;
|
175
|
-
|
176
|
-
- case 15:
|
177
|
-
-#line 104 "lwes_esf_parser_y.y"
|
178
|
-
+ case 16:
|
179
|
-
+#line 106 "lwes_esf_parser_y.y"
|
180
|
-
{
|
181
|
-
/* allocate a string, and copy the type value into it */
|
182
|
-
((struct lwes_parser_state *) param)->lastType = strdup(lweslval);
|
183
|
-
@@ -1474,8 +1474,8 @@ yyreduce:
|
184
|
-
}
|
185
|
-
break;
|
186
|
-
|
187
|
-
- case 16:
|
188
|
-
-#line 115 "lwes_esf_parser_y.y"
|
189
|
-
+ case 17:
|
190
|
-
+#line 117 "lwes_esf_parser_y.y"
|
191
|
-
{
|
192
|
-
/* allocate a string, and copy the type value into it */
|
193
|
-
((struct lwes_parser_state *) param)->lastType = strdup(lweslval);
|
194
|
-
@@ -1488,8 +1488,8 @@ yyreduce:
|
195
|
-
}
|
196
|
-
break;
|
197
|
-
|
198
|
-
- case 17:
|
199
|
-
-#line 125 "lwes_esf_parser_y.y"
|
200
|
-
+ case 18:
|
201
|
-
+#line 127 "lwes_esf_parser_y.y"
|
202
|
-
{
|
203
|
-
/* allocate a string, and copy the type value into it */
|
204
|
-
((struct lwes_parser_state *) param)->lastType = strdup(lweslval);
|
205
|
-
@@ -1502,8 +1502,8 @@ yyreduce:
|
206
|
-
}
|
207
|
-
break;
|
208
|
-
|
209
|
-
- case 18:
|
210
|
-
-#line 135 "lwes_esf_parser_y.y"
|
211
|
-
+ case 19:
|
212
|
-
+#line 137 "lwes_esf_parser_y.y"
|
213
|
-
{
|
214
|
-
/* allocate a string, and copy the type value into it */
|
215
|
-
((struct lwes_parser_state *) param)->lastType = strdup(lweslval);
|
216
|
-
@@ -1516,8 +1516,8 @@ yyreduce:
|
217
|
-
}
|
218
|
-
break;
|
219
|
-
|
220
|
-
- case 19:
|
221
|
-
-#line 145 "lwes_esf_parser_y.y"
|
222
|
-
+ case 20:
|
223
|
-
+#line 147 "lwes_esf_parser_y.y"
|
224
|
-
{
|
225
|
-
/* allocate a string, and copy the type value into it */
|
226
|
-
((struct lwes_parser_state *) param)->lastType = strdup(lweslval);
|
227
|
-
@@ -1530,8 +1530,8 @@ yyreduce:
|
228
|
-
}
|
229
|
-
break;
|
230
|
-
|
231
|
-
- case 20:
|
232
|
-
-#line 155 "lwes_esf_parser_y.y"
|
233
|
-
+ case 21:
|
234
|
-
+#line 157 "lwes_esf_parser_y.y"
|
235
|
-
{
|
236
|
-
/* allocate a string, and copy the type value into it */
|
237
|
-
((struct lwes_parser_state *) param)->lastType = strdup(lweslval);
|
238
|
-
@@ -1544,8 +1544,8 @@ yyreduce:
|
239
|
-
}
|
240
|
-
break;
|
241
|
-
|
242
|
-
- case 21:
|
243
|
-
-#line 165 "lwes_esf_parser_y.y"
|
244
|
-
+ case 22:
|
245
|
-
+#line 167 "lwes_esf_parser_y.y"
|
246
|
-
{
|
247
|
-
/* allocate a string, and copy the type value into it */
|
248
|
-
((struct lwes_parser_state *) param)->lastType = strdup(lweslval);
|
249
|
-
@@ -1558,8 +1558,8 @@ yyreduce:
|
250
|
-
}
|
251
|
-
break;
|
252
|
-
|
253
|
-
- case 22:
|
254
|
-
-#line 175 "lwes_esf_parser_y.y"
|
255
|
-
+ case 23:
|
256
|
-
+#line 177 "lwes_esf_parser_y.y"
|
257
|
-
{
|
258
|
-
/* allocate a string, and copy the type value into it */
|
259
|
-
((struct lwes_parser_state *) param)->lastType = strdup(lweslval);
|
260
|
-
@@ -1572,8 +1572,8 @@ yyreduce:
|
261
|
-
}
|
262
|
-
break;
|
263
|
-
|
264
|
-
- case 23:
|
265
|
-
-#line 185 "lwes_esf_parser_y.y"
|
266
|
-
+ case 24:
|
267
|
-
+#line 187 "lwes_esf_parser_y.y"
|
268
|
-
{ char buffer[256];
|
269
|
-
sprintf(buffer,"unknown type '%s'",lweslval);
|
270
|
-
lweserror(buffer);
|
271
|
-
@@ -1797,7 +1797,7 @@ yyreturn:
|
272
|
-
}
|
273
|
-
|
274
|
-
|
275
|
-
-#line 192 "lwes_esf_parser_y.y"
|
276
|
-
+#line 194 "lwes_esf_parser_y.y"
|
277
|
-
|
278
|
-
|
279
|
-
extern FILE *lwesin;
|
280
|
-
@@ -1830,6 +1830,7 @@ lwes_parse_esf
|
281
|
-
else
|
282
|
-
{
|
283
|
-
fprintf (stderr,"ERROR: No such file : \"%s\"\n",filename);
|
284
|
-
+ state.errors++;
|
285
|
-
}
|
286
|
-
|
287
|
-
if (state.errors)
|
data/ext/lwes/lwes-0.22.3.tar.gz
DELETED
Binary file
|