puffy 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.5.2
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', 191)
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].merge(filename: @filename))
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
- 132, 132, 129, 132, 132, 24, 153, 154, 162, 74,
203
- 10, 25, 26, 107, 33, 107, 110, 111, 110, 111,
204
- 140, 15, 34, 110, 111, 17, 115, 116, 76, 77,
205
- 19, 18, 131, 131, 21, 131, 131, 22, 164, 165,
206
- 106, 109, 106, 109, 76, 77, 49, 139, 142, 89,
207
- 90, 91, 38, 47, 48, 50, 51, 49, 25, 26,
208
- 39, 30, 31, 67, 47, 48, 50, 51, 49, 25,
209
- 26, 66, 27, 9, 69, 47, 48, 50, 51, 49,
210
- 25, 26, 68, 62, 9, 38, 47, 48, 50, 51,
211
- 49, 25, 26, 39, 89, 90, 91, 47, 48, 50,
212
- 51, 49, 25, 26, 21, 30, 31, 22, 47, 48,
213
- 50, 51, 49, 25, 26, 59, 60, 30, 31, 47,
214
- 48, 50, 51, 49, 25, 26, 21, 76, 77, 22,
215
- 47, 48, 50, 51, 49, 25, 26, 133, 134, 110,
216
- 111, 47, 48, 50, 51, 49, 25, 26, 160, 134,
217
- 110, 111, 47, 48, 50, 51, 49, 25, 26, 89,
218
- 90, 91, 78, 47, 48, 50, 51, 49, 25, 26,
219
- 89, 90, 91, 96, 47, 48, 50, 51, 49, 25,
220
- 26, 150, 99, 148, 100, 47, 48, 50, 51, 6,
221
- 25, 26, 6, 110, 111, 6, 7, 8, 6, 7,
222
- 8, 9, 7, 8, 9, 7, 8, 9, 6, 101,
223
- 9, 54, 55, 17, 21, 7, 8, 22, 17, 18,
224
- 9, 17, 28, 102, 18, 30, 31, 18, 150, 124,
225
- 125, 166, 167, 76, 77, 110, 111, 110, 111, 164,
226
- 165, 103, 104, 114, 119, 119, 126, 128, 137, 145,
227
- 119, 156, 150, 170, 171, 150, 173, 174 ]
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
- 119, 129, 119, 143, 154, 9, 143, 143, 157, 52,
231
- 1, 9, 9, 89, 16, 90, 89, 89, 90, 90,
232
- 128, 6, 16, 128, 128, 7, 97, 97, 52, 52,
233
- 8, 7, 119, 129, 8, 143, 154, 8, 157, 157,
234
- 89, 89, 90, 90, 97, 97, 33, 128, 128, 70,
235
- 70, 70, 20, 33, 33, 33, 33, 34, 33, 33,
236
- 20, 28, 28, 47, 34, 34, 34, 34, 38, 34,
237
- 34, 47, 10, 38, 48, 38, 38, 38, 38, 39,
238
- 38, 38, 48, 43, 39, 54, 39, 39, 39, 39,
239
- 44, 39, 39, 54, 71, 71, 71, 44, 44, 44,
240
- 44, 45, 44, 44, 19, 60, 60, 19, 45, 45,
241
- 45, 45, 46, 45, 45, 41, 41, 41, 41, 46,
242
- 46, 46, 46, 57, 46, 46, 55, 74, 74, 55,
243
- 57, 57, 57, 57, 58, 57, 57, 120, 120, 120,
244
- 120, 58, 58, 58, 58, 66, 58, 58, 152, 152,
245
- 152, 152, 66, 66, 66, 66, 67, 66, 66, 72,
246
- 72, 72, 53, 67, 67, 67, 67, 68, 67, 67,
247
- 136, 136, 136, 73, 68, 68, 68, 68, 69, 68,
248
- 68, 137, 81, 137, 82, 69, 69, 69, 69, 0,
249
- 69, 69, 2, 107, 107, 3, 0, 0, 4, 2,
250
- 2, 0, 3, 3, 2, 4, 4, 3, 5, 84,
251
- 4, 35, 35, 49, 35, 5, 5, 35, 50, 49,
252
- 5, 51, 15, 85, 50, 15, 15, 51, 158, 113,
253
- 113, 158, 158, 116, 116, 134, 134, 140, 140, 162,
254
- 162, 86, 87, 95, 105, 112, 114, 118, 123, 131,
255
- 138, 145, 148, 164, 165, 167, 170, 173 ]
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
- 187, 10, 190, 193, 196, 206, 18, 23, 26, -10,
259
- 72, nil, nil, nil, nil, 218, 10, nil, nil, 96,
260
- 48, nil, nil, nil, nil, nil, nil, nil, 54, nil,
261
- nil, nil, nil, 37, 48, 206, nil, nil, 59, 70,
262
- nil, 110, nil, 78, 81, 92, 103, 59, 70, 211,
263
- 216, 219, 5, 149, 81, 118, nil, 114, 125, nil,
264
- 98, nil, nil, nil, nil, nil, 136, 147, 158, 169,
265
- 21, 66, 131, 158, 104, nil, nil, nil, nil, nil,
266
- nil, 177, 171, nil, 196, 218, 228, 237, nil, 9,
267
- 11, nil, nil, nil, nil, 223, nil, 21, nil, nil,
268
- nil, nil, nil, nil, nil, 211, nil, 186, nil, nil,
269
- nil, nil, 212, 204, 238, nil, 210, nil, 218, -2,
270
- 132, nil, nil, 221, nil, nil, nil, nil, 16, -1,
271
- nil, 214, nil, nil, 228, nil, 142, 179, 217, nil,
272
- 230, nil, nil, 1, nil, 217, nil, nil, 250, nil,
273
- nil, nil, 143, nil, 2, nil, nil, 2, 226, nil,
274
- nil, nil, 203, nil, 246, 247, nil, 253, nil, nil,
275
- 223, nil, nil, 223, nil ]
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, -102, -5, -5, -5, -5, -102, -102, -102, -102,
279
- -102, -1, -2, -3, -4, -102, -102, -14, -15, -102,
280
- -102, -21, -22, -32, -33, -46, -47, 175, -102, -7,
281
- -11, -12, -13, -31, -31, -102, -20, -17, -31, -31,
282
- -25, -102, -10, -102, -31, -31, -31, -102, -102, -102,
283
- -102, -102, -48, -102, -102, -102, -19, -31, -31, -6,
284
- -102, -9, -26, -28, -29, -30, -31, -31, -31, -31,
285
- -71, -71, -71, -43, -102, -50, -54, -55, -27, -16,
286
- -18, -102, -102, -8, -102, -102, -102, -102, -38, -76,
287
- -76, -69, -70, -39, -40, -44, -42, -102, -53, -23,
288
- -24, -34, -35, -36, -37, -84, -72, -102, -74, -75,
289
- -91, -92, -84, -56, -102, -49, -102, -52, -67, -102,
290
- -102, -95, -68, -59, -57, -58, -45, -51, -81, -102,
291
- -83, -88, -89, -73, -102, -94, -102, -102, -84, -77,
292
- -102, -79, -80, -102, -87, -102, -93, -98, -102, -61,
293
- -65, -66, -102, -82, -102, -86, -90, -41, -102, -64,
294
- -78, -85, -102, -97, -102, -102, -60, -102, -63, -96,
295
- -100, -101, -62, -102, -99 ]
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, 121, 130, 29, 37, 163, 120, 16, 53,
299
- 41, 169, 36, 144, 53, 135, 32, 42, 35, 63,
300
- 64, 65, 98, 141, 118, 149, 23, 155, 56, 146,
301
- 61, 122, 81, 82, 73, 121, 159, 95, 161, 79,
302
- 152, 84, 85, 86, 87, 117, 168, 135, 80, 83,
303
- 70, 71, 72, 57, 58, 172, 1, 151, 11, 12,
304
- 13, 14, 105, 112, 127, 88, 93, 94, 113, 123,
305
- 136, 147, 157, 97, 158, 138, 143 ]
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, 34, 36, 7, 11, 37, 33, 8, 13,
309
- 6, 37, 12, 36, 13, 34, 9, 7, 10, 13,
310
- 13, 13, 27, 34, 31, 29, 17, 36, 12, 34,
311
- 7, 31, 13, 13, 19, 34, 29, 20, 36, 11,
312
- 33, 13, 13, 13, 13, 27, 29, 34, 12, 7,
313
- 8, 8, 8, 4, 4, 29, 1, 31, 1, 1,
314
- 1, 1, 30, 30, 27, 18, 18, 18, 21, 22,
315
- 23, 24, 25, 26, 28, 32, 35 ]
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, 56, nil, nil, 15, nil, -18, -11, 1, 0,
319
- -1, -15, -7, -25, nil, nil, nil, 17, -5, -18,
320
- -36, -27, -44, -53, -65, -75, -1, -52, -74, -112,
321
- -27, -81, -53, -100, -105, -53, -116, -151 ]
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, nil, nil, nil, 108, nil, nil, nil ]
357
+ nil, 108, 107, nil, nil, nil, nil ]
328
358
 
329
359
  racc_reduce_table = [
330
360
  0, 0, :racc_error,
331
- 2, 39, :_reduce_none,
332
- 2, 39, :_reduce_none,
333
- 2, 39, :_reduce_3,
334
- 2, 39, :_reduce_none,
335
- 0, 39, :_reduce_none,
336
- 5, 40, :_reduce_6,
337
- 3, 40, :_reduce_7,
338
- 3, 44, :_reduce_8,
339
- 2, 44, :_reduce_9,
340
- 1, 44, :_reduce_10,
341
- 1, 45, :_reduce_11,
342
- 1, 45, :_reduce_12,
343
- 3, 43, :_reduce_13,
344
- 1, 46, :_reduce_14,
345
- 1, 46, :_reduce_15,
346
- 5, 41, :_reduce_16,
347
- 3, 41, :_reduce_17,
348
- 3, 48, :_reduce_18,
349
- 2, 48, :_reduce_19,
350
- 1, 48, :_reduce_20,
351
- 1, 50, :_reduce_21,
352
- 1, 50, :_reduce_22,
353
- 4, 49, :_reduce_23,
354
- 4, 49, :_reduce_24,
355
- 1, 49, :_reduce_25,
356
- 3, 47, :_reduce_26,
357
- 3, 47, :_reduce_27,
358
- 2, 51, :_reduce_28,
359
- 2, 51, :_reduce_29,
360
- 2, 51, :_reduce_30,
361
- 0, 51, :_reduce_31,
362
- 2, 42, :_reduce_32,
363
- 2, 42, :_reduce_33,
364
- 4, 53, :_reduce_34,
365
- 4, 53, :_reduce_35,
366
- 4, 54, :_reduce_36,
367
- 4, 54, :_reduce_37,
368
- 3, 52, :_reduce_38,
369
- 3, 52, :_reduce_39,
370
- 3, 52, :_reduce_40,
371
- 8, 52, :_reduce_41,
372
- 1, 58, :_reduce_none,
373
- 0, 58, :_reduce_none,
374
- 0, 59, :_reduce_none,
375
- 2, 59, :_reduce_45,
376
- 1, 55, :_reduce_46,
377
- 1, 55, :_reduce_47,
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
- 4, 61, :_reduce_60,
391
- 2, 61, :_reduce_61,
392
- 3, 66, :_reduce_62,
393
- 2, 66, :_reduce_63,
394
- 1, 66, :_reduce_64,
395
- 1, 67, :_reduce_65,
396
- 6, 62, :_reduce_66,
397
- 3, 62, :_reduce_67,
398
- 3, 62, :_reduce_68,
399
- 1, 62, :_reduce_69,
400
- 1, 56, :_reduce_none,
401
- 0, 56, :_reduce_71,
402
- 1, 68, :_reduce_72,
403
- 3, 68, :_reduce_73,
404
- 1, 68, :_reduce_none,
405
- 1, 68, :_reduce_75,
406
- 0, 68, :_reduce_none,
407
- 1, 70, :_reduce_77,
408
- 3, 70, :_reduce_78,
409
- 1, 70, :_reduce_none,
410
- 1, 70, :_reduce_80,
411
- 0, 70, :_reduce_none,
412
- 4, 69, :_reduce_82,
413
- 2, 69, :_reduce_83,
414
- 0, 69, :_reduce_none,
415
- 3, 73, :_reduce_85,
416
- 2, 73, :_reduce_86,
417
- 1, 73, :_reduce_87,
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, 74, :_reduce_90,
421
- 1, 72, :_reduce_91,
422
- 1, 72, :_reduce_92,
423
- 3, 71, :_reduce_93,
424
- 2, 71, :_reduce_94,
425
- 1, 71, :_reduce_95,
426
- 3, 63, :_reduce_96,
427
- 2, 63, :_reduce_97,
428
- 0, 63, :_reduce_98,
429
- 4, 75, :_reduce_99,
430
- 2, 75, :_reduce_100,
431
- 2, 75, :_reduce_101 ]
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
- :PORT => 33,
472
- :INTEGER => 34,
473
- ":" => 35,
474
- :RDR_TO => 36,
475
- :NAT_TO => 37 }
476
-
477
- racc_nt_base = 38
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
- "hosts_from",
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', 9)
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', 10)
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', 13)
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', 14)
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', 15)
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', 18)
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', 19)
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', 22)
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', 25)
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', 26)
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', 29)
700
+ module_eval(<<'.,.,', 'parser.y', 23)
667
701
  def _reduce_16(val, _values, result)
668
- @nodes[val[2]] = val[4]; @saved_policies[val[2]] = @policy
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', 30)
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', 33)
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', 34)
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', 35)
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', 38)
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', 39)
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', 42)
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', 43)
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', 44)
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', 47)
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', 48)
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', 51)
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', 52)
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', 53)
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', 54)
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', 57)
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', 58)
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', 61)
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', 62)
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', 65)
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', 66)
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', 69)
854
+ module_eval(<<'.,.,', 'parser.y', 55)
821
855
  def _reduce_38(val, _values, result)
822
- result = @services.fetch(val[1]).deep_dup.map { |x| x.merge(val[2]) }
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', 71)
866
+ module_eval(<<'.,.,', 'parser.y', 62)
828
867
  def _reduce_39(val, _values, result)
829
- raise "service #{val[1]} cannot be used as client" if @services.fetch(val[1]).map { |x| x[:dir] }.compact.any?
830
- result = @services.fetch(val[1]).deep_dup.map { |x| x.merge(dir: :out).deep_merge(val[2]) }
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', 75)
879
+ module_eval(<<'.,.,', 'parser.y', 70)
837
880
  def _reduce_40(val, _values, result)
838
- raise "service #{val[1]} cannot be used as server" if @services.fetch(val[1]).map { |x| x[:dir] }.compact.any?
839
- result = @services.fetch(val[1]).deep_dup.map { |x| x.merge(dir: :in).deep_merge(val[2]) }
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', 78)
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', 86)
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', 89)
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', 90)
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', 94)
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', 95)
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', 98)
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', 99)
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', 100)
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', 103)
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', 104)
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', 108)
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', 109)
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', 113)
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', 114)
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', 117)
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', 118)
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', 119)
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', 122)
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', 125)
1037
+ module_eval(<<'.,.,', 'parser.y', 113)
991
1038
  def _reduce_66(val, _values, result)
992
- result = { from: { host: val[1], port: val[2] }, to: { host: val[4], port: val[5] } }
1039
+ result = { from: val[1], to: val[3] }
993
1040
  result
994
1041
  end
995
1042
  .,.,
996
1043
 
997
- module_eval(<<'.,.,', 'parser.y', 126)
1044
+ module_eval(<<'.,.,', 'parser.y', 114)
998
1045
  def _reduce_67(val, _values, result)
999
- result = { from: { host: val[1], port: val[2] } }
1046
+ result = { from: val[1] }
1000
1047
  result
1001
1048
  end
1002
1049
  .,.,
1003
1050
 
1004
- module_eval(<<'.,.,', 'parser.y', 127)
1051
+ module_eval(<<'.,.,', 'parser.y', 115)
1005
1052
  def _reduce_68(val, _values, result)
1006
- result = { to: { host: val[1], port: val[2] } }
1053
+ result = { to: val[1] }
1007
1054
  result
1008
1055
  end
1009
1056
  .,.,
1010
1057
 
1011
- module_eval(<<'.,.,', 'parser.y', 128)
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', 132)
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', 135)
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', 136)
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
- # reduce 74 omitted
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', 138)
1095
+ module_eval(<<'.,.,', 'parser.y', 124)
1044
1096
  def _reduce_75(val, _values, result)
1045
- result = @variables.fetch(val[0][:value])
1097
+ result = [{ host: val[1], port: val[3] }]
1046
1098
  result
1047
1099
  end
1048
1100
  .,.,
1049
1101
 
1050
- # reduce 76 omitted
1051
-
1052
- module_eval(<<'.,.,', 'parser.y', 142)
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', 143)
1060
- def _reduce_78(val, _values, result)
1061
- result = val[1]
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
- # reduce 79 omitted
1067
-
1068
- module_eval(<<'.,.,', 'parser.y', 145)
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
- # reduce 81 omitted
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', 150)
1085
- def _reduce_83(val, _values, result)
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 84 omitted
1137
+ # reduce 81 omitted
1092
1138
 
1093
- module_eval(<<'.,.,', 'parser.y', 154)
1094
- def _reduce_85(val, _values, result)
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', 155)
1101
- def _reduce_86(val, _values, result)
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', 156)
1108
- def _reduce_87(val, _values, result)
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', 159)
1115
- def _reduce_88(val, _values, result)
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', 160)
1122
- def _reduce_89(val, _values, result)
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', 161)
1129
- def _reduce_90(val, _values, result)
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', 164)
1136
- def _reduce_91(val, _values, result)
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', 165)
1143
- def _reduce_92(val, _values, result)
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', 168)
1150
- def _reduce_93(val, _values, result)
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', 169)
1157
- def _reduce_94(val, _values, result)
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', 170)
1164
- def _reduce_95(val, _values, result)
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', 173)
1171
- def _reduce_96(val, _values, result)
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', 174)
1178
- def _reduce_97(val, _values, result)
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', 175)
1185
- def _reduce_98(val, _values, result)
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', 178)
1192
- def _reduce_99(val, _values, result)
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', 179)
1199
- def _reduce_100(val, _values, result)
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', 180)
1206
- def _reduce_101(val, _values, result)
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