puffy 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -0
- data/.github/workflows/ci.yml +23 -5
- data/.rubocop.yml +2 -0
- data/CHANGELOG.md +50 -0
- data/README.md +22 -13
- data/Rakefile +10 -0
- data/bin/puffy +2 -5
- data/lib/core_ext.rb +16 -4
- data/lib/puffy/cli.rb +1 -1
- data/lib/puffy/formatters/{netfilter.rb → iptables.rb} +7 -7
- data/lib/puffy/formatters/iptables4.rb +23 -0
- data/lib/puffy/formatters/iptables6.rb +23 -0
- data/lib/puffy/parser.tab.rb +406 -360
- data/lib/puffy/puppet.rb +4 -6
- data/lib/puffy/resolver.rb +32 -0
- data/lib/puffy/rule.rb +11 -2
- data/lib/puffy/rule_factory.rb +7 -5
- data/lib/puffy/version.rb +1 -1
- data/lib/puffy.rb +6 -3
- data/puffy.gemspec +2 -0
- metadata +23 -6
- data/lib/puffy/formatters/netfilter4.rb +0 -23
- data/lib/puffy/formatters/netfilter6.rb +0 -23
data/lib/puffy/parser.tab.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.
|
3
|
+
# This file is automatically generated by Racc 1.6.0
|
4
4
|
# from Racc grammar file "".
|
5
5
|
#
|
6
6
|
|
@@ -8,12 +8,13 @@ require 'racc/parser.rb'
|
|
8
8
|
|
9
9
|
|
10
10
|
require 'deep_merge'
|
11
|
+
require 'ipaddr'
|
11
12
|
require 'strscan'
|
12
13
|
|
13
14
|
module Puffy
|
14
15
|
class Parser < Racc::Parser
|
15
16
|
|
16
|
-
module_eval(<<'...end parser.y/module_eval...', 'parser.y',
|
17
|
+
module_eval(<<'...end parser.y/module_eval...', 'parser.y', 165)
|
17
18
|
|
18
19
|
attr_accessor :yydebug
|
19
20
|
attr_reader :policy, :filename
|
@@ -33,6 +34,7 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 191)
|
|
33
34
|
end
|
34
35
|
|
35
36
|
def parse(text)
|
37
|
+
@filename ||= '<stdin>'
|
36
38
|
@lineno = 1
|
37
39
|
s = StringScanner.new(text)
|
38
40
|
|
@@ -61,11 +63,6 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 191)
|
|
61
63
|
end
|
62
64
|
n += 1
|
63
65
|
end
|
64
|
-
when s.scan(/=/) then emit('=', s.matched)
|
65
|
-
when s.scan(/:/) then emit(':', s.matched)
|
66
|
-
when s.scan(/,/) then emit(',', s.matched)
|
67
|
-
when s.scan(/{/) then emit('{', s.matched)
|
68
|
-
when s.scan(/}/) then emit('}', s.matched)
|
69
66
|
when s.scan(/service\b/) then emit(:SERVICE, s.matched)
|
70
67
|
when s.scan(/client\b/) then emit(:CLIENT, s.matched)
|
71
68
|
when s.scan(/server\b/) then emit(:SERVER, s.matched)
|
@@ -99,12 +96,22 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 191)
|
|
99
96
|
when s.scan(/port\b/) then emit(:PORT, s.matched)
|
100
97
|
when s.scan(/nat-to\b/) then emit(:NAT_TO, s.matched)
|
101
98
|
when s.scan(/rdr-to\b/) then emit(:RDR_TO, s.matched)
|
99
|
+
when s.scan(/srv\b/) then emit(:SRV, s.matched)
|
100
|
+
when s.scan(/apt-mirror\b/) then emit(:APT_MIRROR, s.matched)
|
102
101
|
|
103
102
|
when s.scan(/\d+\.\d+\.\d+\.\d+(\/\d+)?/) && ip = ipaddress?(s) then emit(:ADDRESS, ip, s.matched_size)
|
104
103
|
when s.scan(/[[:xdigit:]]*:[:[:xdigit:]]+(\/\d+)?/) && ip = ipaddress?(s) then emit(:ADDRESS, ip, s.matched_size)
|
105
104
|
|
106
105
|
when s.scan(/\d+/) then emit(:INTEGER, s.matched.to_i, s.matched_size)
|
107
106
|
when s.scan(/\w[\w-]+/) then emit(:IDENTIFIER, s.matched)
|
107
|
+
|
108
|
+
when s.scan(/=/) then emit('=', s.matched)
|
109
|
+
when s.scan(/:/) then emit(':', s.matched)
|
110
|
+
when s.scan(/,/) then emit(',', s.matched)
|
111
|
+
when s.scan(/{/) then emit('{', s.matched)
|
112
|
+
when s.scan(/}/) then emit('}', s.matched)
|
113
|
+
when s.scan(/\(/) then emit('(', s.matched)
|
114
|
+
when s.scan(/\)/) then emit(')', s.matched)
|
108
115
|
else
|
109
116
|
raise SyntaxError.new('Syntax error', { filename: @filename, lineno: @lineno, position: @position, line: @line })
|
110
117
|
end
|
@@ -114,7 +121,7 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 191)
|
|
114
121
|
begin
|
115
122
|
do_parse
|
116
123
|
rescue Racc::ParseError => e
|
117
|
-
raise ParseError.new("Parse error: unexpected token: #{@current_token[0]}", @current_token[1]
|
124
|
+
raise ParseError.new("Parse error: unexpected token: #{@current_token[0]}", @current_token[1])
|
118
125
|
end
|
119
126
|
end
|
120
127
|
|
@@ -130,6 +137,7 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 191)
|
|
130
137
|
line: @line,
|
131
138
|
lineno: @lineno,
|
132
139
|
position: @position,
|
140
|
+
filename: @filename,
|
133
141
|
length: length,
|
134
142
|
}
|
135
143
|
@tokens << [token, exvalue]
|
@@ -195,244 +203,263 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 191)
|
|
195
203
|
def policy_for(hostname)
|
196
204
|
prefered_value_for_hostname(@saved_policies, hostname) || @default_policy || :block
|
197
205
|
end
|
206
|
+
|
207
|
+
def constraint_service_to_hosts(service, hosts)
|
208
|
+
result = @services.fetch(service).deep_dup
|
209
|
+
result.map! do |item|
|
210
|
+
item[:from] = if item[:from]
|
211
|
+
item[:from].product(hosts.fetch(:from, [{}])).map { |parts| parts[0].merge(parts[1].compact) }
|
212
|
+
else
|
213
|
+
hosts.fetch(:from, [{}])
|
214
|
+
end
|
215
|
+
|
216
|
+
item[:to] = if item[:to]
|
217
|
+
item[:to].product(hosts.fetch(:to, [{}])).map { |parts| parts[0].merge(parts[1].compact) }
|
218
|
+
else
|
219
|
+
hosts.fetch(:to, [{}])
|
220
|
+
end
|
221
|
+
|
222
|
+
item
|
223
|
+
end
|
224
|
+
result
|
225
|
+
end
|
198
226
|
...end parser.y/module_eval...
|
199
227
|
##### State transition tables begin ###
|
200
228
|
|
201
229
|
racc_action_table = [
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
48, 50, 51, 49, 25, 26,
|
215
|
-
47, 48, 50, 51, 49, 25,
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
26,
|
221
|
-
25, 26,
|
222
|
-
|
223
|
-
|
224
|
-
9,
|
225
|
-
|
226
|
-
|
227
|
-
|
230
|
+
133, 133, 130, 133, 133, 33, 154, 155, 166, 21,
|
231
|
+
74, 6, 22, 34, 119, 120, 17, 109, 7, 8,
|
232
|
+
114, 115, 18, 9, 109, 30, 31, 114, 115, 76,
|
233
|
+
77, 109, 76, 77, 114, 115, 132, 132, 21, 132,
|
234
|
+
132, 22, 168, 169, 106, 110, 111, 38, 10, 112,
|
235
|
+
113, 106, 110, 111, 67, 39, 112, 113, 106, 110,
|
236
|
+
111, 49, 66, 112, 113, 30, 31, 69, 47, 48,
|
237
|
+
50, 51, 49, 25, 26, 68, 76, 77, 38, 47,
|
238
|
+
48, 50, 51, 49, 25, 26, 39, 161, 9, 159,
|
239
|
+
47, 48, 50, 51, 49, 25, 26, 114, 115, 9,
|
240
|
+
15, 47, 48, 50, 51, 49, 25, 26, 59, 60,
|
241
|
+
30, 31, 47, 48, 50, 51, 49, 25, 26, 140,
|
242
|
+
141, 114, 115, 47, 48, 50, 51, 49, 25, 26,
|
243
|
+
89, 90, 91, 27, 47, 48, 50, 51, 49, 25,
|
244
|
+
26, 89, 90, 91, 62, 47, 48, 50, 51, 49,
|
245
|
+
25, 26, 89, 90, 91, 78, 47, 48, 50, 51,
|
246
|
+
49, 25, 26, 89, 90, 91, 96, 47, 48, 50,
|
247
|
+
51, 49, 25, 26, 135, 136, 76, 77, 47, 48,
|
248
|
+
50, 51, 49, 25, 26, 114, 115, 168, 169, 47,
|
249
|
+
48, 50, 51, 49, 25, 26, 99, 100, 101, 102,
|
250
|
+
47, 48, 50, 51, 6, 25, 26, 6, 103, 104,
|
251
|
+
6, 7, 8, 6, 7, 8, 9, 7, 8, 9,
|
252
|
+
7, 8, 9, 19, 118, 9, 24, 21, 54, 55,
|
253
|
+
22, 21, 25, 26, 22, 17, 17, 17, 122, 113,
|
254
|
+
113, 18, 18, 18, 28, 113, 161, 30, 31, 170,
|
255
|
+
171, 128, 129, 137, 143, 144, 147, 149, 113, 152,
|
256
|
+
153, 157, 161, 174, 175, 161, 177, 178 ]
|
228
257
|
|
229
258
|
racc_action_check = [
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
68,
|
249
|
-
|
250
|
-
|
251
|
-
4,
|
252
|
-
5,
|
253
|
-
|
254
|
-
|
255
|
-
|
259
|
+
113, 130, 113, 145, 155, 16, 145, 145, 163, 19,
|
260
|
+
52, 0, 19, 16, 97, 97, 7, 89, 0, 0,
|
261
|
+
89, 89, 7, 0, 90, 28, 28, 90, 90, 52,
|
262
|
+
52, 122, 97, 97, 122, 122, 113, 130, 55, 145,
|
263
|
+
155, 55, 163, 163, 89, 89, 89, 20, 1, 89,
|
264
|
+
89, 90, 90, 90, 47, 20, 90, 90, 122, 122,
|
265
|
+
122, 33, 47, 122, 122, 60, 60, 48, 33, 33,
|
266
|
+
33, 33, 34, 33, 33, 48, 74, 74, 54, 34,
|
267
|
+
34, 34, 34, 38, 34, 34, 54, 149, 38, 149,
|
268
|
+
38, 38, 38, 38, 39, 38, 38, 109, 109, 39,
|
269
|
+
6, 39, 39, 39, 39, 44, 39, 39, 41, 41,
|
270
|
+
41, 41, 44, 44, 44, 44, 45, 44, 44, 125,
|
271
|
+
125, 125, 125, 45, 45, 45, 45, 46, 45, 45,
|
272
|
+
70, 70, 70, 10, 46, 46, 46, 46, 57, 46,
|
273
|
+
46, 71, 71, 71, 43, 57, 57, 57, 57, 58,
|
274
|
+
57, 57, 72, 72, 72, 53, 58, 58, 58, 58,
|
275
|
+
66, 58, 58, 148, 148, 148, 73, 66, 66, 66,
|
276
|
+
66, 67, 66, 66, 117, 117, 120, 120, 67, 67,
|
277
|
+
67, 67, 68, 67, 67, 141, 141, 166, 166, 68,
|
278
|
+
68, 68, 68, 69, 68, 68, 81, 82, 84, 85,
|
279
|
+
69, 69, 69, 69, 2, 69, 69, 3, 86, 87,
|
280
|
+
4, 2, 2, 5, 3, 3, 2, 4, 4, 3,
|
281
|
+
5, 5, 4, 8, 95, 5, 9, 8, 35, 35,
|
282
|
+
8, 35, 9, 9, 35, 49, 50, 51, 105, 106,
|
283
|
+
107, 49, 50, 51, 15, 110, 164, 15, 15, 164,
|
284
|
+
164, 111, 112, 118, 128, 129, 132, 134, 140, 143,
|
285
|
+
144, 147, 159, 168, 169, 171, 174, 177 ]
|
256
286
|
|
257
287
|
racc_action_pointer = [
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
nil, nil, nil,
|
262
|
-
nil,
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
nil,
|
267
|
-
|
268
|
-
nil, nil, nil, nil, nil,
|
269
|
-
|
270
|
-
|
271
|
-
nil,
|
272
|
-
|
273
|
-
nil, nil,
|
274
|
-
nil, nil,
|
275
|
-
|
288
|
+
9, 48, 202, 205, 208, 211, 97, 14, 219, 211,
|
289
|
+
133, nil, nil, nil, nil, 240, 1, nil, nil, 1,
|
290
|
+
43, nil, nil, nil, nil, nil, nil, nil, 18, nil,
|
291
|
+
nil, nil, nil, 52, 63, 223, nil, nil, 74, 85,
|
292
|
+
nil, 103, nil, 139, 96, 107, 118, 50, 63, 233,
|
293
|
+
234, 235, 6, 142, 74, 30, nil, 129, 140, nil,
|
294
|
+
58, nil, nil, nil, nil, nil, 151, 162, 173, 184,
|
295
|
+
102, 113, 124, 151, 53, nil, nil, nil, nil, nil,
|
296
|
+
nil, 191, 184, nil, 185, 194, 195, 204, nil, 13,
|
297
|
+
20, nil, nil, nil, nil, 204, nil, 9, nil, nil,
|
298
|
+
nil, nil, nil, nil, nil, 209, 202, 203, nil, 90,
|
299
|
+
208, 217, 218, -2, nil, nil, nil, 149, 245, nil,
|
300
|
+
153, nil, 27, nil, nil, 114, nil, nil, 246, 247,
|
301
|
+
-1, nil, 217, nil, 230, nil, nil, nil, nil, nil,
|
302
|
+
221, 178, nil, 224, 225, 1, nil, 223, 135, 85,
|
303
|
+
nil, nil, nil, nil, nil, 2, nil, nil, nil, 260,
|
304
|
+
nil, nil, nil, 2, 244, nil, 147, nil, 256, 257,
|
305
|
+
nil, 263, nil, nil, 229, nil, nil, 229, nil ]
|
276
306
|
|
277
307
|
racc_action_default = [
|
278
|
-
-5,
|
279
|
-
|
280
|
-
|
281
|
-
-11, -12, -13, -31, -31,
|
282
|
-
-25,
|
283
|
-
|
284
|
-
|
285
|
-
-71, -71, -71, -43,
|
286
|
-
-18,
|
287
|
-
-
|
288
|
-
-24, -34, -35, -36, -37, -
|
289
|
-
-
|
290
|
-
|
291
|
-
-
|
292
|
-
|
293
|
-
-
|
294
|
-
-
|
295
|
-
|
308
|
+
-5, -99, -5, -5, -5, -5, -99, -99, -99, -99,
|
309
|
+
-99, -1, -2, -3, -4, -99, -99, -14, -15, -99,
|
310
|
+
-99, -21, -22, -32, -33, -46, -47, 179, -99, -7,
|
311
|
+
-11, -12, -13, -31, -31, -99, -20, -17, -31, -31,
|
312
|
+
-25, -99, -10, -99, -31, -31, -31, -99, -99, -99,
|
313
|
+
-99, -99, -48, -99, -99, -99, -19, -31, -31, -6,
|
314
|
+
-99, -9, -26, -28, -29, -30, -31, -31, -31, -31,
|
315
|
+
-71, -71, -71, -43, -99, -50, -54, -55, -27, -16,
|
316
|
+
-18, -99, -99, -8, -99, -99, -99, -99, -38, -81,
|
317
|
+
-81, -69, -70, -39, -40, -44, -42, -99, -53, -23,
|
318
|
+
-24, -34, -35, -36, -37, -67, -81, -81, -74, -99,
|
319
|
+
-81, -99, -99, -99, -88, -89, -68, -56, -99, -49,
|
320
|
+
-99, -52, -81, -72, -73, -99, -92, -76, -99, -99,
|
321
|
+
-99, -80, -85, -86, -59, -57, -58, -45, -51, -66,
|
322
|
+
-81, -99, -91, -99, -99, -99, -84, -99, -99, -99,
|
323
|
+
-75, -90, -77, -78, -79, -99, -83, -87, -95, -99,
|
324
|
+
-61, -65, -82, -41, -99, -64, -99, -94, -99, -99,
|
325
|
+
-60, -99, -63, -93, -97, -98, -62, -99, -96 ]
|
296
326
|
|
297
327
|
racc_goto_table = [
|
298
|
-
75, 20,
|
299
|
-
|
300
|
-
|
301
|
-
61,
|
302
|
-
|
303
|
-
70, 71, 72,
|
304
|
-
13, 14,
|
305
|
-
|
328
|
+
75, 20, 131, 37, 29, 123, 124, 41, 16, 127,
|
329
|
+
160, 32, 36, 105, 116, 167, 35, 42, 173, 146,
|
330
|
+
165, 23, 98, 73, 126, 172, 57, 58, 56, 95,
|
331
|
+
61, 53, 176, 117, 156, 134, 53, 79, 148, 150,
|
332
|
+
142, 63, 64, 65, 162, 121, 139, 158, 80, 83,
|
333
|
+
70, 71, 72, 163, 81, 82, 151, 1, 97, 11,
|
334
|
+
12, 13, 14, 84, 85, 86, 87, 164, 138, 88,
|
335
|
+
93, 94, 125, 145 ]
|
306
336
|
|
307
337
|
racc_goto_check = [
|
308
|
-
27, 12,
|
309
|
-
|
310
|
-
|
311
|
-
7,
|
312
|
-
|
313
|
-
8, 8, 8,
|
314
|
-
1, 1,
|
315
|
-
|
338
|
+
27, 12, 35, 11, 7, 31, 31, 6, 8, 31,
|
339
|
+
29, 9, 12, 30, 30, 36, 10, 7, 36, 35,
|
340
|
+
29, 17, 27, 19, 32, 29, 4, 4, 12, 20,
|
341
|
+
7, 13, 29, 21, 35, 22, 13, 11, 23, 31,
|
342
|
+
32, 13, 13, 13, 35, 27, 30, 24, 12, 7,
|
343
|
+
8, 8, 8, 25, 13, 13, 32, 1, 26, 1,
|
344
|
+
1, 1, 1, 13, 13, 13, 13, 28, 27, 18,
|
345
|
+
18, 18, 33, 34 ]
|
316
346
|
|
317
347
|
racc_goto_pointer = [
|
318
|
-
nil,
|
319
|
-
-
|
320
|
-
-
|
321
|
-
-
|
348
|
+
nil, 57, nil, nil, -12, nil, -21, -11, 1, -5,
|
349
|
+
-3, -17, -7, -3, nil, nil, nil, 12, -1, -29,
|
350
|
+
-44, -62, -82, -96, -101, -105, -16, -52, -92, -139,
|
351
|
+
-76, -101, -85, -37, -57, -111, -148 ]
|
322
352
|
|
323
353
|
racc_goto_default = [
|
324
354
|
nil, nil, 2, 3, 4, 5, nil, nil, nil, 40,
|
325
355
|
nil, nil, nil, 43, 44, 45, 46, 52, nil, nil,
|
326
356
|
nil, nil, nil, nil, 92, nil, nil, nil, nil, nil,
|
327
|
-
nil,
|
357
|
+
nil, 108, 107, nil, nil, nil, nil ]
|
328
358
|
|
329
359
|
racc_reduce_table = [
|
330
360
|
0, 0, :racc_error,
|
331
|
-
2,
|
332
|
-
2,
|
333
|
-
2,
|
334
|
-
2,
|
335
|
-
0,
|
336
|
-
5,
|
337
|
-
3,
|
338
|
-
3,
|
339
|
-
2,
|
340
|
-
1,
|
341
|
-
1,
|
342
|
-
1,
|
343
|
-
3,
|
344
|
-
1,
|
345
|
-
1,
|
346
|
-
5,
|
347
|
-
3,
|
348
|
-
3,
|
349
|
-
2,
|
350
|
-
1,
|
351
|
-
1,
|
352
|
-
1,
|
353
|
-
4,
|
354
|
-
4,
|
355
|
-
1,
|
356
|
-
3,
|
357
|
-
3,
|
358
|
-
2,
|
359
|
-
2,
|
360
|
-
2,
|
361
|
-
0,
|
362
|
-
2,
|
363
|
-
2,
|
364
|
-
4,
|
365
|
-
4,
|
366
|
-
4,
|
367
|
-
4,
|
368
|
-
3,
|
369
|
-
3,
|
370
|
-
3,
|
371
|
-
8,
|
372
|
-
1,
|
373
|
-
0,
|
374
|
-
0,
|
375
|
-
2,
|
376
|
-
1,
|
377
|
-
1,
|
378
|
-
0, 57, :_reduce_none,
|
379
|
-
3, 57, :_reduce_49,
|
380
|
-
1, 57, :_reduce_50,
|
381
|
-
3, 64, :_reduce_51,
|
382
|
-
2, 64, :_reduce_52,
|
383
|
-
1, 64, :_reduce_53,
|
384
|
-
1, 65, :_reduce_54,
|
385
|
-
1, 65, :_reduce_55,
|
386
|
-
0, 60, :_reduce_none,
|
387
|
-
1, 60, :_reduce_57,
|
388
|
-
1, 60, :_reduce_58,
|
361
|
+
2, 43, :_reduce_none,
|
362
|
+
2, 43, :_reduce_none,
|
363
|
+
2, 43, :_reduce_3,
|
364
|
+
2, 43, :_reduce_none,
|
365
|
+
0, 43, :_reduce_none,
|
366
|
+
5, 44, :_reduce_6,
|
367
|
+
3, 44, :_reduce_7,
|
368
|
+
3, 48, :_reduce_8,
|
369
|
+
2, 48, :_reduce_9,
|
370
|
+
1, 48, :_reduce_10,
|
371
|
+
1, 49, :_reduce_11,
|
372
|
+
1, 49, :_reduce_12,
|
373
|
+
3, 47, :_reduce_13,
|
374
|
+
1, 50, :_reduce_14,
|
375
|
+
1, 50, :_reduce_15,
|
376
|
+
5, 45, :_reduce_16,
|
377
|
+
3, 45, :_reduce_17,
|
378
|
+
3, 52, :_reduce_18,
|
379
|
+
2, 52, :_reduce_19,
|
380
|
+
1, 52, :_reduce_20,
|
381
|
+
1, 54, :_reduce_21,
|
382
|
+
1, 54, :_reduce_22,
|
383
|
+
4, 53, :_reduce_23,
|
384
|
+
4, 53, :_reduce_24,
|
385
|
+
1, 53, :_reduce_25,
|
386
|
+
3, 51, :_reduce_26,
|
387
|
+
3, 51, :_reduce_27,
|
388
|
+
2, 55, :_reduce_28,
|
389
|
+
2, 55, :_reduce_29,
|
390
|
+
2, 55, :_reduce_30,
|
391
|
+
0, 55, :_reduce_31,
|
392
|
+
2, 46, :_reduce_32,
|
393
|
+
2, 46, :_reduce_33,
|
394
|
+
4, 57, :_reduce_34,
|
395
|
+
4, 57, :_reduce_35,
|
396
|
+
4, 58, :_reduce_36,
|
397
|
+
4, 58, :_reduce_37,
|
398
|
+
3, 56, :_reduce_38,
|
399
|
+
3, 56, :_reduce_39,
|
400
|
+
3, 56, :_reduce_40,
|
401
|
+
8, 56, :_reduce_41,
|
402
|
+
1, 62, :_reduce_none,
|
403
|
+
0, 62, :_reduce_none,
|
404
|
+
0, 63, :_reduce_none,
|
405
|
+
2, 63, :_reduce_45,
|
406
|
+
1, 59, :_reduce_46,
|
407
|
+
1, 59, :_reduce_47,
|
389
408
|
0, 61, :_reduce_none,
|
390
|
-
|
391
|
-
|
392
|
-
3,
|
393
|
-
2,
|
394
|
-
1,
|
395
|
-
1,
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
1,
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
3,
|
404
|
-
|
405
|
-
1,
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
1,
|
411
|
-
|
412
|
-
|
413
|
-
2,
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
409
|
+
3, 61, :_reduce_49,
|
410
|
+
1, 61, :_reduce_50,
|
411
|
+
3, 68, :_reduce_51,
|
412
|
+
2, 68, :_reduce_52,
|
413
|
+
1, 68, :_reduce_53,
|
414
|
+
1, 69, :_reduce_54,
|
415
|
+
1, 69, :_reduce_55,
|
416
|
+
0, 64, :_reduce_none,
|
417
|
+
1, 64, :_reduce_57,
|
418
|
+
1, 64, :_reduce_58,
|
419
|
+
0, 65, :_reduce_none,
|
420
|
+
4, 65, :_reduce_60,
|
421
|
+
2, 65, :_reduce_61,
|
422
|
+
3, 70, :_reduce_62,
|
423
|
+
2, 70, :_reduce_63,
|
424
|
+
1, 70, :_reduce_64,
|
425
|
+
1, 71, :_reduce_65,
|
426
|
+
4, 66, :_reduce_66,
|
427
|
+
2, 66, :_reduce_67,
|
428
|
+
2, 66, :_reduce_68,
|
429
|
+
1, 66, :_reduce_69,
|
430
|
+
1, 60, :_reduce_none,
|
431
|
+
0, 60, :_reduce_71,
|
432
|
+
2, 72, :_reduce_72,
|
433
|
+
2, 72, :_reduce_73,
|
434
|
+
1, 72, :_reduce_74,
|
435
|
+
4, 72, :_reduce_75,
|
436
|
+
2, 72, :_reduce_76,
|
437
|
+
4, 72, :_reduce_77,
|
438
|
+
4, 72, :_reduce_78,
|
439
|
+
4, 73, :_reduce_79,
|
440
|
+
2, 73, :_reduce_80,
|
441
|
+
0, 73, :_reduce_none,
|
442
|
+
3, 76, :_reduce_82,
|
443
|
+
2, 76, :_reduce_83,
|
444
|
+
1, 76, :_reduce_84,
|
445
|
+
1, 77, :_reduce_85,
|
446
|
+
1, 77, :_reduce_86,
|
447
|
+
3, 77, :_reduce_87,
|
418
448
|
1, 74, :_reduce_88,
|
419
449
|
1, 74, :_reduce_89,
|
420
|
-
3,
|
421
|
-
|
422
|
-
1,
|
423
|
-
3,
|
424
|
-
2,
|
425
|
-
|
426
|
-
|
427
|
-
2,
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
racc_reduce_n = 102
|
434
|
-
|
435
|
-
racc_shift_n = 175
|
450
|
+
3, 75, :_reduce_90,
|
451
|
+
2, 75, :_reduce_91,
|
452
|
+
1, 75, :_reduce_92,
|
453
|
+
3, 67, :_reduce_93,
|
454
|
+
2, 67, :_reduce_94,
|
455
|
+
0, 67, :_reduce_95,
|
456
|
+
4, 78, :_reduce_96,
|
457
|
+
2, 78, :_reduce_97,
|
458
|
+
2, 78, :_reduce_98 ]
|
459
|
+
|
460
|
+
racc_reduce_n = 99
|
461
|
+
|
462
|
+
racc_shift_n = 179
|
436
463
|
|
437
464
|
racc_token_table = {
|
438
465
|
false => 0,
|
@@ -468,13 +495,17 @@ racc_token_table = {
|
|
468
495
|
:ALL => 30,
|
469
496
|
:ANY => 31,
|
470
497
|
:VARIABLE => 32,
|
471
|
-
:
|
472
|
-
|
473
|
-
"
|
474
|
-
:
|
475
|
-
:
|
476
|
-
|
477
|
-
|
498
|
+
:SRV => 33,
|
499
|
+
"(" => 34,
|
500
|
+
")" => 35,
|
501
|
+
:APT_MIRROR => 36,
|
502
|
+
:PORT => 37,
|
503
|
+
:INTEGER => 38,
|
504
|
+
":" => 39,
|
505
|
+
:RDR_TO => 40,
|
506
|
+
:NAT_TO => 41 }
|
507
|
+
|
508
|
+
racc_nt_base = 42
|
478
509
|
|
479
510
|
racc_use_result_var = true
|
480
511
|
|
@@ -528,6 +559,10 @@ Racc_token_to_s_table = [
|
|
528
559
|
"ALL",
|
529
560
|
"ANY",
|
530
561
|
"VARIABLE",
|
562
|
+
"SRV",
|
563
|
+
"\"(\"",
|
564
|
+
"\")\"",
|
565
|
+
"APT_MIRROR",
|
531
566
|
"PORT",
|
532
567
|
"INTEGER",
|
533
568
|
"\":\"",
|
@@ -563,11 +598,10 @@ Racc_token_to_s_table = [
|
|
563
598
|
"direction",
|
564
599
|
"protocol_list",
|
565
600
|
"protocol",
|
566
|
-
"
|
601
|
+
"hosts_host",
|
567
602
|
"hosts_port",
|
568
|
-
"hosts_to",
|
569
|
-
"host_list",
|
570
603
|
"host",
|
604
|
+
"host_list",
|
571
605
|
"port_list",
|
572
606
|
"port",
|
573
607
|
"filteropt" ]
|
@@ -593,256 +627,269 @@ module_eval(<<'.,.,', 'parser.y', 4)
|
|
593
627
|
|
594
628
|
# reduce 5 omitted
|
595
629
|
|
596
|
-
module_eval(<<'.,.,', 'parser.y',
|
630
|
+
module_eval(<<'.,.,', 'parser.y', 8)
|
597
631
|
def _reduce_6(val, _values, result)
|
598
632
|
@variables[val[0][:value]] = val[3].freeze
|
599
633
|
result
|
600
634
|
end
|
601
635
|
.,.,
|
602
636
|
|
603
|
-
module_eval(<<'.,.,', 'parser.y',
|
637
|
+
module_eval(<<'.,.,', 'parser.y', 9)
|
604
638
|
def _reduce_7(val, _values, result)
|
605
639
|
@variables[val[0][:value]] = val[2].freeze
|
606
640
|
result
|
607
641
|
end
|
608
642
|
.,.,
|
609
643
|
|
610
|
-
module_eval(<<'.,.,', 'parser.y',
|
644
|
+
module_eval(<<'.,.,', 'parser.y', 11)
|
611
645
|
def _reduce_8(val, _values, result)
|
612
646
|
result = val[0] + [val[2]]
|
613
647
|
result
|
614
648
|
end
|
615
649
|
.,.,
|
616
650
|
|
617
|
-
module_eval(<<'.,.,', 'parser.y',
|
651
|
+
module_eval(<<'.,.,', 'parser.y', 12)
|
618
652
|
def _reduce_9(val, _values, result)
|
619
653
|
result = val[0] + [val[1]]
|
620
654
|
result
|
621
655
|
end
|
622
656
|
.,.,
|
623
657
|
|
624
|
-
module_eval(<<'.,.,', 'parser.y',
|
658
|
+
module_eval(<<'.,.,', 'parser.y', 13)
|
625
659
|
def _reduce_10(val, _values, result)
|
626
660
|
result = [val[0]]
|
627
661
|
result
|
628
662
|
end
|
629
663
|
.,.,
|
630
664
|
|
631
|
-
module_eval(<<'.,.,', 'parser.y',
|
665
|
+
module_eval(<<'.,.,', 'parser.y', 15)
|
632
666
|
def _reduce_11(val, _values, result)
|
633
667
|
result = val[0][:value]
|
634
668
|
result
|
635
669
|
end
|
636
670
|
.,.,
|
637
671
|
|
638
|
-
module_eval(<<'.,.,', 'parser.y',
|
672
|
+
module_eval(<<'.,.,', 'parser.y', 16)
|
639
673
|
def _reduce_12(val, _values, result)
|
640
674
|
result = val[0][:value]
|
641
675
|
result
|
642
676
|
end
|
643
677
|
.,.,
|
644
678
|
|
645
|
-
module_eval(<<'.,.,', 'parser.y',
|
679
|
+
module_eval(<<'.,.,', 'parser.y', 18)
|
646
680
|
def _reduce_13(val, _values, result)
|
647
681
|
@services[val[1]] = val[2]
|
648
682
|
result
|
649
683
|
end
|
650
684
|
.,.,
|
651
685
|
|
652
|
-
module_eval(<<'.,.,', 'parser.y',
|
686
|
+
module_eval(<<'.,.,', 'parser.y', 20)
|
653
687
|
def _reduce_14(val, _values, result)
|
654
688
|
result = val[0][:value]
|
655
689
|
result
|
656
690
|
end
|
657
691
|
.,.,
|
658
692
|
|
659
|
-
module_eval(<<'.,.,', 'parser.y',
|
693
|
+
module_eval(<<'.,.,', 'parser.y', 21)
|
660
694
|
def _reduce_15(val, _values, result)
|
661
695
|
result = val[0][:value]
|
662
696
|
result
|
663
697
|
end
|
664
698
|
.,.,
|
665
699
|
|
666
|
-
module_eval(<<'.,.,', 'parser.y',
|
700
|
+
module_eval(<<'.,.,', 'parser.y', 23)
|
667
701
|
def _reduce_16(val, _values, result)
|
668
|
-
|
702
|
+
val[2].each { |name| @nodes[name] = val[4]; @saved_policies[name] = @policy }
|
669
703
|
result
|
670
704
|
end
|
671
705
|
.,.,
|
672
706
|
|
673
|
-
module_eval(<<'.,.,', 'parser.y',
|
707
|
+
module_eval(<<'.,.,', 'parser.y', 24)
|
674
708
|
def _reduce_17(val, _values, result)
|
675
709
|
@nodes[val[1]] = val[2]; @saved_policies[val[1]] = @policy
|
676
710
|
result
|
677
711
|
end
|
678
712
|
.,.,
|
679
713
|
|
680
|
-
module_eval(<<'.,.,', 'parser.y',
|
714
|
+
module_eval(<<'.,.,', 'parser.y', 26)
|
681
715
|
def _reduce_18(val, _values, result)
|
682
716
|
result = val[0] + [val[2]]
|
683
717
|
result
|
684
718
|
end
|
685
719
|
.,.,
|
686
720
|
|
687
|
-
module_eval(<<'.,.,', 'parser.y',
|
721
|
+
module_eval(<<'.,.,', 'parser.y', 27)
|
688
722
|
def _reduce_19(val, _values, result)
|
689
723
|
result = val[0] + [val[1]]
|
690
724
|
result
|
691
725
|
end
|
692
726
|
.,.,
|
693
727
|
|
694
|
-
module_eval(<<'.,.,', 'parser.y',
|
728
|
+
module_eval(<<'.,.,', 'parser.y', 28)
|
695
729
|
def _reduce_20(val, _values, result)
|
696
730
|
result = [val[0]]
|
697
731
|
result
|
698
732
|
end
|
699
733
|
.,.,
|
700
734
|
|
701
|
-
module_eval(<<'.,.,', 'parser.y',
|
735
|
+
module_eval(<<'.,.,', 'parser.y', 30)
|
702
736
|
def _reduce_21(val, _values, result)
|
703
737
|
result = val[0][:value]
|
704
738
|
result
|
705
739
|
end
|
706
740
|
.,.,
|
707
741
|
|
708
|
-
module_eval(<<'.,.,', 'parser.y',
|
742
|
+
module_eval(<<'.,.,', 'parser.y', 31)
|
709
743
|
def _reduce_22(val, _values, result)
|
710
744
|
result = val[0][:value]
|
711
745
|
result
|
712
746
|
end
|
713
747
|
.,.,
|
714
748
|
|
715
|
-
module_eval(<<'.,.,', 'parser.y',
|
749
|
+
module_eval(<<'.,.,', 'parser.y', 33)
|
716
750
|
def _reduce_23(val, _values, result)
|
717
751
|
@policy = val[1]; result = val[2]
|
718
752
|
result
|
719
753
|
end
|
720
754
|
.,.,
|
721
755
|
|
722
|
-
module_eval(<<'.,.,', 'parser.y',
|
756
|
+
module_eval(<<'.,.,', 'parser.y', 34)
|
723
757
|
def _reduce_24(val, _values, result)
|
724
758
|
@policy = val[1]; result = val[2]
|
725
759
|
result
|
726
760
|
end
|
727
761
|
.,.,
|
728
762
|
|
729
|
-
module_eval(<<'.,.,', 'parser.y',
|
763
|
+
module_eval(<<'.,.,', 'parser.y', 35)
|
730
764
|
def _reduce_25(val, _values, result)
|
731
765
|
@policy = nil; result = val[0]
|
732
766
|
result
|
733
767
|
end
|
734
768
|
.,.,
|
735
769
|
|
736
|
-
module_eval(<<'.,.,', 'parser.y',
|
770
|
+
module_eval(<<'.,.,', 'parser.y', 37)
|
737
771
|
def _reduce_26(val, _values, result)
|
738
772
|
result = val[1].freeze
|
739
773
|
result
|
740
774
|
end
|
741
775
|
.,.,
|
742
776
|
|
743
|
-
module_eval(<<'.,.,', 'parser.y',
|
777
|
+
module_eval(<<'.,.,', 'parser.y', 38)
|
744
778
|
def _reduce_27(val, _values, result)
|
745
779
|
result = val[1].freeze
|
746
780
|
result
|
747
781
|
end
|
748
782
|
.,.,
|
749
783
|
|
750
|
-
module_eval(<<'.,.,', 'parser.y',
|
784
|
+
module_eval(<<'.,.,', 'parser.y', 40)
|
751
785
|
def _reduce_28(val, _values, result)
|
752
786
|
result = val[0] + val[1]
|
753
787
|
result
|
754
788
|
end
|
755
789
|
.,.,
|
756
790
|
|
757
|
-
module_eval(<<'.,.,', 'parser.y',
|
791
|
+
module_eval(<<'.,.,', 'parser.y', 41)
|
758
792
|
def _reduce_29(val, _values, result)
|
759
793
|
result = val[0] + val[1]
|
760
794
|
result
|
761
795
|
end
|
762
796
|
.,.,
|
763
797
|
|
764
|
-
module_eval(<<'.,.,', 'parser.y',
|
798
|
+
module_eval(<<'.,.,', 'parser.y', 42)
|
765
799
|
def _reduce_30(val, _values, result)
|
766
800
|
result = val[0] + val[1]
|
767
801
|
result
|
768
802
|
end
|
769
803
|
.,.,
|
770
804
|
|
771
|
-
module_eval(<<'.,.,', 'parser.y',
|
805
|
+
module_eval(<<'.,.,', 'parser.y', 43)
|
772
806
|
def _reduce_31(val, _values, result)
|
773
807
|
result = []
|
774
808
|
result
|
775
809
|
end
|
776
810
|
.,.,
|
777
811
|
|
778
|
-
module_eval(<<'.,.,', 'parser.y',
|
812
|
+
module_eval(<<'.,.,', 'parser.y', 45)
|
779
813
|
def _reduce_32(val, _values, result)
|
780
814
|
result = val[1][:action]
|
781
815
|
result
|
782
816
|
end
|
783
817
|
.,.,
|
784
818
|
|
785
|
-
module_eval(<<'.,.,', 'parser.y',
|
819
|
+
module_eval(<<'.,.,', 'parser.y', 46)
|
786
820
|
def _reduce_33(val, _values, result)
|
787
821
|
result = 'log'
|
788
822
|
result
|
789
823
|
end
|
790
824
|
.,.,
|
791
825
|
|
792
|
-
module_eval(<<'.,.,', 'parser.y',
|
826
|
+
module_eval(<<'.,.,', 'parser.y', 48)
|
793
827
|
def _reduce_34(val, _values, result)
|
794
828
|
result = val[2].reject { |x| x[:af] == :inet6 }.map { |x| x[:af] = :inet ; x }
|
795
829
|
result
|
796
830
|
end
|
797
831
|
.,.,
|
798
832
|
|
799
|
-
module_eval(<<'.,.,', 'parser.y',
|
833
|
+
module_eval(<<'.,.,', 'parser.y', 49)
|
800
834
|
def _reduce_35(val, _values, result)
|
801
835
|
result = val[2].reject { |x| x[:af] == :inet6 }.map { |x| x[:af] = :inet ; x }
|
802
836
|
result
|
803
837
|
end
|
804
838
|
.,.,
|
805
839
|
|
806
|
-
module_eval(<<'.,.,', 'parser.y',
|
840
|
+
module_eval(<<'.,.,', 'parser.y', 51)
|
807
841
|
def _reduce_36(val, _values, result)
|
808
842
|
result = val[2].reject { |x| x[:af] == :inet }.map { |x| x[:af] = :inet6 ; x }
|
809
843
|
result
|
810
844
|
end
|
811
845
|
.,.,
|
812
846
|
|
813
|
-
module_eval(<<'.,.,', 'parser.y',
|
847
|
+
module_eval(<<'.,.,', 'parser.y', 52)
|
814
848
|
def _reduce_37(val, _values, result)
|
815
849
|
result = val[2].reject { |x| x[:af] == :inet }.map { |x| x[:af] = :inet6 ; x }
|
816
850
|
result
|
817
851
|
end
|
818
852
|
.,.,
|
819
853
|
|
820
|
-
module_eval(<<'.,.,', 'parser.y',
|
854
|
+
module_eval(<<'.,.,', 'parser.y', 55)
|
821
855
|
def _reduce_38(val, _values, result)
|
822
|
-
|
856
|
+
begin
|
857
|
+
result = constraint_service_to_hosts(val[1], val[2])
|
858
|
+
rescue KeyError
|
859
|
+
raise ParseError.new("Parse error: service \"#{val[1]}\" is not defined", val[0])
|
860
|
+
end
|
861
|
+
|
823
862
|
result
|
824
863
|
end
|
825
864
|
.,.,
|
826
865
|
|
827
|
-
module_eval(<<'.,.,', 'parser.y',
|
866
|
+
module_eval(<<'.,.,', 'parser.y', 62)
|
828
867
|
def _reduce_39(val, _values, result)
|
829
|
-
|
830
|
-
|
868
|
+
begin
|
869
|
+
raise "service #{val[1]} cannot be used as client" if @services.fetch(val[1]).map { |x| x[:dir] }.compact.any?
|
870
|
+
result = constraint_service_to_hosts(val[1], val[2]).map { |item| item.merge(dir: :out) }
|
871
|
+
rescue KeyError
|
872
|
+
raise ParseError.new("Parse error: service \"#{val[1]}\" is not defined", val[0])
|
873
|
+
end
|
831
874
|
|
832
875
|
result
|
833
876
|
end
|
834
877
|
.,.,
|
835
878
|
|
836
|
-
module_eval(<<'.,.,', 'parser.y',
|
879
|
+
module_eval(<<'.,.,', 'parser.y', 70)
|
837
880
|
def _reduce_40(val, _values, result)
|
838
|
-
|
839
|
-
|
881
|
+
begin
|
882
|
+
raise "service #{val[1]} cannot be used as server" if @services.fetch(val[1]).map { |x| x[:dir] }.compact.any?
|
883
|
+
result = constraint_service_to_hosts(val[1], val[2]).map { |item| item.merge(dir: :in) }
|
884
|
+
rescue KeyError
|
885
|
+
raise ParseError.new("Parse error: service \"#{val[1]}\" is not defined", val[0])
|
886
|
+
end
|
840
887
|
|
841
888
|
result
|
842
889
|
end
|
843
890
|
.,.,
|
844
891
|
|
845
|
-
module_eval(<<'.,.,', 'parser.y',
|
892
|
+
module_eval(<<'.,.,', 'parser.y', 77)
|
846
893
|
def _reduce_41(val, _values, result)
|
847
894
|
result = [val.compact.inject(:merge)]
|
848
895
|
result
|
@@ -855,21 +902,21 @@ module_eval(<<'.,.,', 'parser.y', 78)
|
|
855
902
|
|
856
903
|
# reduce 44 omitted
|
857
904
|
|
858
|
-
module_eval(<<'.,.,', 'parser.y',
|
905
|
+
module_eval(<<'.,.,', 'parser.y', 83)
|
859
906
|
def _reduce_45(val, _values, result)
|
860
907
|
result = { on: val[1][:value] }
|
861
908
|
result
|
862
909
|
end
|
863
910
|
.,.,
|
864
911
|
|
865
|
-
module_eval(<<'.,.,', 'parser.y',
|
912
|
+
module_eval(<<'.,.,', 'parser.y', 85)
|
866
913
|
def _reduce_46(val, _values, result)
|
867
914
|
result = { action: :block }
|
868
915
|
result
|
869
916
|
end
|
870
917
|
.,.,
|
871
918
|
|
872
|
-
module_eval(<<'.,.,', 'parser.y',
|
919
|
+
module_eval(<<'.,.,', 'parser.y', 86)
|
873
920
|
def _reduce_47(val, _values, result)
|
874
921
|
result = { action: :pass }
|
875
922
|
result
|
@@ -878,49 +925,49 @@ module_eval(<<'.,.,', 'parser.y', 90)
|
|
878
925
|
|
879
926
|
# reduce 48 omitted
|
880
927
|
|
881
|
-
module_eval(<<'.,.,', 'parser.y',
|
928
|
+
module_eval(<<'.,.,', 'parser.y', 89)
|
882
929
|
def _reduce_49(val, _values, result)
|
883
930
|
result = { dir: val[1] }
|
884
931
|
result
|
885
932
|
end
|
886
933
|
.,.,
|
887
934
|
|
888
|
-
module_eval(<<'.,.,', 'parser.y',
|
935
|
+
module_eval(<<'.,.,', 'parser.y', 90)
|
889
936
|
def _reduce_50(val, _values, result)
|
890
937
|
result = { dir: val[0] }
|
891
938
|
result
|
892
939
|
end
|
893
940
|
.,.,
|
894
941
|
|
895
|
-
module_eval(<<'.,.,', 'parser.y',
|
942
|
+
module_eval(<<'.,.,', 'parser.y', 92)
|
896
943
|
def _reduce_51(val, _values, result)
|
897
944
|
result = val[0] + [val[2]]
|
898
945
|
result
|
899
946
|
end
|
900
947
|
.,.,
|
901
948
|
|
902
|
-
module_eval(<<'.,.,', 'parser.y',
|
949
|
+
module_eval(<<'.,.,', 'parser.y', 93)
|
903
950
|
def _reduce_52(val, _values, result)
|
904
951
|
result = val[0] + [val[1]]
|
905
952
|
result
|
906
953
|
end
|
907
954
|
.,.,
|
908
955
|
|
909
|
-
module_eval(<<'.,.,', 'parser.y',
|
956
|
+
module_eval(<<'.,.,', 'parser.y', 94)
|
910
957
|
def _reduce_53(val, _values, result)
|
911
958
|
result = [val[0]]
|
912
959
|
result
|
913
960
|
end
|
914
961
|
.,.,
|
915
962
|
|
916
|
-
module_eval(<<'.,.,', 'parser.y',
|
963
|
+
module_eval(<<'.,.,', 'parser.y', 96)
|
917
964
|
def _reduce_54(val, _values, result)
|
918
965
|
result = :in
|
919
966
|
result
|
920
967
|
end
|
921
968
|
.,.,
|
922
969
|
|
923
|
-
module_eval(<<'.,.,', 'parser.y',
|
970
|
+
module_eval(<<'.,.,', 'parser.y', 97)
|
924
971
|
def _reduce_55(val, _values, result)
|
925
972
|
result = :out
|
926
973
|
result
|
@@ -929,14 +976,14 @@ module_eval(<<'.,.,', 'parser.y', 104)
|
|
929
976
|
|
930
977
|
# reduce 56 omitted
|
931
978
|
|
932
|
-
module_eval(<<'.,.,', 'parser.y',
|
979
|
+
module_eval(<<'.,.,', 'parser.y', 100)
|
933
980
|
def _reduce_57(val, _values, result)
|
934
981
|
result = { af: :inet }
|
935
982
|
result
|
936
983
|
end
|
937
984
|
.,.,
|
938
985
|
|
939
|
-
module_eval(<<'.,.,', 'parser.y',
|
986
|
+
module_eval(<<'.,.,', 'parser.y', 101)
|
940
987
|
def _reduce_58(val, _values, result)
|
941
988
|
result = { af: :inet6 }
|
942
989
|
result
|
@@ -945,70 +992,70 @@ module_eval(<<'.,.,', 'parser.y', 109)
|
|
945
992
|
|
946
993
|
# reduce 59 omitted
|
947
994
|
|
948
|
-
module_eval(<<'.,.,', 'parser.y',
|
995
|
+
module_eval(<<'.,.,', 'parser.y', 104)
|
949
996
|
def _reduce_60(val, _values, result)
|
950
997
|
result = { proto: val[2] }
|
951
998
|
result
|
952
999
|
end
|
953
1000
|
.,.,
|
954
1001
|
|
955
|
-
module_eval(<<'.,.,', 'parser.y',
|
1002
|
+
module_eval(<<'.,.,', 'parser.y', 105)
|
956
1003
|
def _reduce_61(val, _values, result)
|
957
1004
|
result = { proto: val[1] }
|
958
1005
|
result
|
959
1006
|
end
|
960
1007
|
.,.,
|
961
1008
|
|
962
|
-
module_eval(<<'.,.,', 'parser.y',
|
1009
|
+
module_eval(<<'.,.,', 'parser.y', 107)
|
963
1010
|
def _reduce_62(val, _values, result)
|
964
1011
|
result = val[0] + [val[2]]
|
965
1012
|
result
|
966
1013
|
end
|
967
1014
|
.,.,
|
968
1015
|
|
969
|
-
module_eval(<<'.,.,', 'parser.y',
|
1016
|
+
module_eval(<<'.,.,', 'parser.y', 108)
|
970
1017
|
def _reduce_63(val, _values, result)
|
971
1018
|
result = val[0] + [val[1]]
|
972
1019
|
result
|
973
1020
|
end
|
974
1021
|
.,.,
|
975
1022
|
|
976
|
-
module_eval(<<'.,.,', 'parser.y',
|
1023
|
+
module_eval(<<'.,.,', 'parser.y', 109)
|
977
1024
|
def _reduce_64(val, _values, result)
|
978
1025
|
result = [val[0]]
|
979
1026
|
result
|
980
1027
|
end
|
981
1028
|
.,.,
|
982
1029
|
|
983
|
-
module_eval(<<'.,.,', 'parser.y',
|
1030
|
+
module_eval(<<'.,.,', 'parser.y', 111)
|
984
1031
|
def _reduce_65(val, _values, result)
|
985
1032
|
result = val[0][:value].to_sym
|
986
1033
|
result
|
987
1034
|
end
|
988
1035
|
.,.,
|
989
1036
|
|
990
|
-
module_eval(<<'.,.,', 'parser.y',
|
1037
|
+
module_eval(<<'.,.,', 'parser.y', 113)
|
991
1038
|
def _reduce_66(val, _values, result)
|
992
|
-
result = { from:
|
1039
|
+
result = { from: val[1], to: val[3] }
|
993
1040
|
result
|
994
1041
|
end
|
995
1042
|
.,.,
|
996
1043
|
|
997
|
-
module_eval(<<'.,.,', 'parser.y',
|
1044
|
+
module_eval(<<'.,.,', 'parser.y', 114)
|
998
1045
|
def _reduce_67(val, _values, result)
|
999
|
-
result = { from:
|
1046
|
+
result = { from: val[1] }
|
1000
1047
|
result
|
1001
1048
|
end
|
1002
1049
|
.,.,
|
1003
1050
|
|
1004
|
-
module_eval(<<'.,.,', 'parser.y',
|
1051
|
+
module_eval(<<'.,.,', 'parser.y', 115)
|
1005
1052
|
def _reduce_68(val, _values, result)
|
1006
|
-
result = { to:
|
1053
|
+
result = { to: val[1] }
|
1007
1054
|
result
|
1008
1055
|
end
|
1009
1056
|
.,.,
|
1010
1057
|
|
1011
|
-
module_eval(<<'.,.,', 'parser.y',
|
1058
|
+
module_eval(<<'.,.,', 'parser.y', 116)
|
1012
1059
|
def _reduce_69(val, _values, result)
|
1013
1060
|
result = {}
|
1014
1061
|
result
|
@@ -1017,193 +1064,192 @@ module_eval(<<'.,.,', 'parser.y', 128)
|
|
1017
1064
|
|
1018
1065
|
# reduce 70 omitted
|
1019
1066
|
|
1020
|
-
module_eval(<<'.,.,', 'parser.y',
|
1067
|
+
module_eval(<<'.,.,', 'parser.y', 119)
|
1021
1068
|
def _reduce_71(val, _values, result)
|
1022
1069
|
result = {}
|
1023
1070
|
result
|
1024
1071
|
end
|
1025
1072
|
.,.,
|
1026
1073
|
|
1027
|
-
module_eval(<<'.,.,', 'parser.y',
|
1074
|
+
module_eval(<<'.,.,', 'parser.y', 121)
|
1028
1075
|
def _reduce_72(val, _values, result)
|
1029
|
-
result = nil
|
1076
|
+
result = [{ host: nil, port: val[1] }]
|
1030
1077
|
result
|
1031
1078
|
end
|
1032
1079
|
.,.,
|
1033
1080
|
|
1034
|
-
module_eval(<<'.,.,', 'parser.y',
|
1081
|
+
module_eval(<<'.,.,', 'parser.y', 122)
|
1035
1082
|
def _reduce_73(val, _values, result)
|
1036
|
-
result = val[1]
|
1083
|
+
result = [{ host: val[0], port: val[1] }]
|
1037
1084
|
result
|
1038
1085
|
end
|
1039
1086
|
.,.,
|
1040
1087
|
|
1041
|
-
|
1088
|
+
module_eval(<<'.,.,', 'parser.y', 123)
|
1089
|
+
def _reduce_74(val, _values, result)
|
1090
|
+
result = [{ host: nil, port: val[0] }]
|
1091
|
+
result
|
1092
|
+
end
|
1093
|
+
.,.,
|
1042
1094
|
|
1043
|
-
module_eval(<<'.,.,', 'parser.y',
|
1095
|
+
module_eval(<<'.,.,', 'parser.y', 124)
|
1044
1096
|
def _reduce_75(val, _values, result)
|
1045
|
-
result =
|
1097
|
+
result = [{ host: val[1], port: val[3] }]
|
1046
1098
|
result
|
1047
1099
|
end
|
1048
1100
|
.,.,
|
1049
1101
|
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
def _reduce_77(val, _values, result)
|
1054
|
-
result = nil
|
1102
|
+
module_eval(<<'.,.,', 'parser.y', 125)
|
1103
|
+
def _reduce_76(val, _values, result)
|
1104
|
+
result = [{ host: @variables.fetch(val[0][:value]), port: val[1] }]
|
1055
1105
|
result
|
1056
1106
|
end
|
1057
1107
|
.,.,
|
1058
1108
|
|
1059
|
-
module_eval(<<'.,.,', 'parser.y',
|
1060
|
-
def
|
1061
|
-
result = val[
|
1109
|
+
module_eval(<<'.,.,', 'parser.y', 126)
|
1110
|
+
def _reduce_77(val, _values, result)
|
1111
|
+
result = Resolver.instance.resolv_srv(val[2][:value])
|
1062
1112
|
result
|
1063
1113
|
end
|
1064
1114
|
.,.,
|
1065
1115
|
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
def _reduce_80(val, _values, result)
|
1070
|
-
result = @variables.fetch(val[0][:value])
|
1116
|
+
module_eval(<<'.,.,', 'parser.y', 127)
|
1117
|
+
def _reduce_78(val, _values, result)
|
1118
|
+
result = Resolver.instance.resolv_apt_mirror(val[2][:value])
|
1071
1119
|
result
|
1072
1120
|
end
|
1073
1121
|
.,.,
|
1074
1122
|
|
1075
|
-
|
1076
|
-
|
1077
|
-
module_eval(<<'.,.,', 'parser.y', 149)
|
1078
|
-
def _reduce_82(val, _values, result)
|
1123
|
+
module_eval(<<'.,.,', 'parser.y', 129)
|
1124
|
+
def _reduce_79(val, _values, result)
|
1079
1125
|
result = val[2]
|
1080
1126
|
result
|
1081
1127
|
end
|
1082
1128
|
.,.,
|
1083
1129
|
|
1084
|
-
module_eval(<<'.,.,', 'parser.y',
|
1085
|
-
def
|
1130
|
+
module_eval(<<'.,.,', 'parser.y', 130)
|
1131
|
+
def _reduce_80(val, _values, result)
|
1086
1132
|
result = val[1]
|
1087
1133
|
result
|
1088
1134
|
end
|
1089
1135
|
.,.,
|
1090
1136
|
|
1091
|
-
# reduce
|
1137
|
+
# reduce 81 omitted
|
1092
1138
|
|
1093
|
-
module_eval(<<'.,.,', 'parser.y',
|
1094
|
-
def
|
1139
|
+
module_eval(<<'.,.,', 'parser.y', 133)
|
1140
|
+
def _reduce_82(val, _values, result)
|
1095
1141
|
result = val[0] + [val[2]]
|
1096
1142
|
result
|
1097
1143
|
end
|
1098
1144
|
.,.,
|
1099
1145
|
|
1100
|
-
module_eval(<<'.,.,', 'parser.y',
|
1101
|
-
def
|
1146
|
+
module_eval(<<'.,.,', 'parser.y', 134)
|
1147
|
+
def _reduce_83(val, _values, result)
|
1102
1148
|
result = val[0] + [val[1]]
|
1103
1149
|
result
|
1104
1150
|
end
|
1105
1151
|
.,.,
|
1106
1152
|
|
1107
|
-
module_eval(<<'.,.,', 'parser.y',
|
1108
|
-
def
|
1153
|
+
module_eval(<<'.,.,', 'parser.y', 135)
|
1154
|
+
def _reduce_84(val, _values, result)
|
1109
1155
|
result = [val[0]]
|
1110
1156
|
result
|
1111
1157
|
end
|
1112
1158
|
.,.,
|
1113
1159
|
|
1114
|
-
module_eval(<<'.,.,', 'parser.y',
|
1115
|
-
def
|
1160
|
+
module_eval(<<'.,.,', 'parser.y', 137)
|
1161
|
+
def _reduce_85(val, _values, result)
|
1116
1162
|
result = val[0][:value]
|
1117
1163
|
result
|
1118
1164
|
end
|
1119
1165
|
.,.,
|
1120
1166
|
|
1121
|
-
module_eval(<<'.,.,', 'parser.y',
|
1122
|
-
def
|
1167
|
+
module_eval(<<'.,.,', 'parser.y', 138)
|
1168
|
+
def _reduce_86(val, _values, result)
|
1123
1169
|
result = val[0][:value]
|
1124
1170
|
result
|
1125
1171
|
end
|
1126
1172
|
.,.,
|
1127
1173
|
|
1128
|
-
module_eval(<<'.,.,', 'parser.y',
|
1129
|
-
def
|
1174
|
+
module_eval(<<'.,.,', 'parser.y', 139)
|
1175
|
+
def _reduce_87(val, _values, result)
|
1130
1176
|
result = Range.new(val[0][:value], val[2][:value])
|
1131
1177
|
result
|
1132
1178
|
end
|
1133
1179
|
.,.,
|
1134
1180
|
|
1135
|
-
module_eval(<<'.,.,', 'parser.y',
|
1136
|
-
def
|
1181
|
+
module_eval(<<'.,.,', 'parser.y', 141)
|
1182
|
+
def _reduce_88(val, _values, result)
|
1137
1183
|
result = val[0][:value]
|
1138
1184
|
result
|
1139
1185
|
end
|
1140
1186
|
.,.,
|
1141
1187
|
|
1142
|
-
module_eval(<<'.,.,', 'parser.y',
|
1143
|
-
def
|
1188
|
+
module_eval(<<'.,.,', 'parser.y', 142)
|
1189
|
+
def _reduce_89(val, _values, result)
|
1144
1190
|
result = val[0][:value]
|
1145
1191
|
result
|
1146
1192
|
end
|
1147
1193
|
.,.,
|
1148
1194
|
|
1149
|
-
module_eval(<<'.,.,', 'parser.y',
|
1150
|
-
def
|
1195
|
+
module_eval(<<'.,.,', 'parser.y', 144)
|
1196
|
+
def _reduce_90(val, _values, result)
|
1151
1197
|
result = val[0] + [val[2]]
|
1152
1198
|
result
|
1153
1199
|
end
|
1154
1200
|
.,.,
|
1155
1201
|
|
1156
|
-
module_eval(<<'.,.,', 'parser.y',
|
1157
|
-
def
|
1202
|
+
module_eval(<<'.,.,', 'parser.y', 145)
|
1203
|
+
def _reduce_91(val, _values, result)
|
1158
1204
|
result = val[0] + [val[1]]
|
1159
1205
|
result
|
1160
1206
|
end
|
1161
1207
|
.,.,
|
1162
1208
|
|
1163
|
-
module_eval(<<'.,.,', 'parser.y',
|
1164
|
-
def
|
1209
|
+
module_eval(<<'.,.,', 'parser.y', 146)
|
1210
|
+
def _reduce_92(val, _values, result)
|
1165
1211
|
result = [val[0]]
|
1166
1212
|
result
|
1167
1213
|
end
|
1168
1214
|
.,.,
|
1169
1215
|
|
1170
|
-
module_eval(<<'.,.,', 'parser.y',
|
1171
|
-
def
|
1216
|
+
module_eval(<<'.,.,', 'parser.y', 148)
|
1217
|
+
def _reduce_93(val, _values, result)
|
1172
1218
|
result = val[0].merge(val[2])
|
1173
1219
|
result
|
1174
1220
|
end
|
1175
1221
|
.,.,
|
1176
1222
|
|
1177
|
-
module_eval(<<'.,.,', 'parser.y',
|
1178
|
-
def
|
1223
|
+
module_eval(<<'.,.,', 'parser.y', 149)
|
1224
|
+
def _reduce_94(val, _values, result)
|
1179
1225
|
result = val[0].merge(val[1])
|
1180
1226
|
result
|
1181
1227
|
end
|
1182
1228
|
.,.,
|
1183
1229
|
|
1184
|
-
module_eval(<<'.,.,', 'parser.y',
|
1185
|
-
def
|
1230
|
+
module_eval(<<'.,.,', 'parser.y', 150)
|
1231
|
+
def _reduce_95(val, _values, result)
|
1186
1232
|
result = {}
|
1187
1233
|
result
|
1188
1234
|
end
|
1189
1235
|
.,.,
|
1190
1236
|
|
1191
|
-
module_eval(<<'.,.,', 'parser.y',
|
1192
|
-
def
|
1193
|
-
result = { rdr_to: { host: val[1][:value], port: val[3][:value] } }
|
1237
|
+
module_eval(<<'.,.,', 'parser.y', 152)
|
1238
|
+
def _reduce_96(val, _values, result)
|
1239
|
+
result = { rdr_to: [{ host: val[1][:value], port: val[3][:value] }] }
|
1194
1240
|
result
|
1195
1241
|
end
|
1196
1242
|
.,.,
|
1197
1243
|
|
1198
|
-
module_eval(<<'.,.,', 'parser.y',
|
1199
|
-
def
|
1200
|
-
result = { rdr_to: { host: val[1][:value] } }
|
1244
|
+
module_eval(<<'.,.,', 'parser.y', 153)
|
1245
|
+
def _reduce_97(val, _values, result)
|
1246
|
+
result = { rdr_to: [{ host: val[1][:value], port: nil }] }
|
1201
1247
|
result
|
1202
1248
|
end
|
1203
1249
|
.,.,
|
1204
1250
|
|
1205
|
-
module_eval(<<'.,.,', 'parser.y',
|
1206
|
-
def
|
1251
|
+
module_eval(<<'.,.,', 'parser.y', 154)
|
1252
|
+
def _reduce_98(val, _values, result)
|
1207
1253
|
result = { nat_to: val[1][:value] }
|
1208
1254
|
result
|
1209
1255
|
end
|