puffy 0.3.1 → 1.1.0.pre.rc1
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/dependabot.yml +18 -0
- data/.github/workflows/ci.yml +3 -10
- data/.rubocop.yml +14 -0
- data/CHANGELOG.md +9 -0
- data/README.md +8 -0
- data/Rakefile +6 -2
- data/lib/core_ext.rb +6 -8
- data/lib/puffy/cli.rb +2 -2
- data/lib/puffy/formatters/base.rb +3 -3
- data/lib/puffy/formatters/iptables.rb +35 -15
- data/lib/puffy/formatters/iptables4.rb +3 -3
- data/lib/puffy/formatters/iptables6.rb +3 -3
- data/lib/puffy/formatters/pf.rb +21 -6
- data/lib/puffy/parser.tab.rb +1145 -426
- data/lib/puffy/puppet.rb +2 -2
- data/lib/puffy/resolver.rb +13 -0
- data/lib/puffy/rule.rb +2 -3
- data/lib/puffy/rule_factory.rb +2 -2
- data/lib/puffy/version.rb +1 -1
- data/puffy.gemspec +2 -2
- metadata +4 -7
data/lib/puffy/parser.tab.rb
CHANGED
|
@@ -1,23 +1,671 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
#
|
|
2
3
|
# DO NOT MODIFY!!!!
|
|
3
|
-
# This file is automatically generated by Racc 1.
|
|
4
|
+
# This file is automatically generated by Racc 1.8.1
|
|
4
5
|
# from Racc grammar file "parser.y".
|
|
5
6
|
#
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
###### racc/parser.rb begin
|
|
9
|
+
unless $".find {|p| p.end_with?('/racc/parser.rb')}
|
|
10
|
+
$".push "#{__dir__}/racc/parser.rb"
|
|
11
|
+
self.class.module_eval(<<'...end racc/parser.rb/module_eval...', 'racc/parser.rb', 1)
|
|
12
|
+
#--
|
|
13
|
+
# Copyright (c) 1999-2006 Minero Aoki
|
|
14
|
+
#
|
|
15
|
+
# This program is free software.
|
|
16
|
+
# You can distribute/modify this program under the same terms of ruby.
|
|
17
|
+
#
|
|
18
|
+
# As a special exception, when this code is copied by Racc
|
|
19
|
+
# into a Racc output file, you may use that output file
|
|
20
|
+
# without restriction.
|
|
21
|
+
#++
|
|
22
|
+
|
|
23
|
+
unless $".find {|p| p.end_with?('/racc/info.rb')}
|
|
24
|
+
$".push "#{__dir__}/racc/info.rb"
|
|
25
|
+
|
|
26
|
+
module Racc
|
|
27
|
+
VERSION = '1.8.1'
|
|
28
|
+
Version = VERSION
|
|
29
|
+
Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
module Racc
|
|
36
|
+
class ParseError < StandardError; end
|
|
37
|
+
end
|
|
38
|
+
unless defined?(::ParseError)
|
|
39
|
+
ParseError = Racc::ParseError # :nodoc:
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Racc is an LALR(1) parser generator.
|
|
43
|
+
# It is written in Ruby itself, and generates Ruby programs.
|
|
44
|
+
#
|
|
45
|
+
# == Command-line Reference
|
|
46
|
+
#
|
|
47
|
+
# racc [-o<var>filename</var>] [--output-file=<var>filename</var>]
|
|
48
|
+
# [-e<var>rubypath</var>] [--executable=<var>rubypath</var>]
|
|
49
|
+
# [-v] [--verbose]
|
|
50
|
+
# [-O<var>filename</var>] [--log-file=<var>filename</var>]
|
|
51
|
+
# [-g] [--debug]
|
|
52
|
+
# [-E] [--embedded]
|
|
53
|
+
# [-l] [--no-line-convert]
|
|
54
|
+
# [-c] [--line-convert-all]
|
|
55
|
+
# [-a] [--no-omit-actions]
|
|
56
|
+
# [-C] [--check-only]
|
|
57
|
+
# [-S] [--output-status]
|
|
58
|
+
# [--version] [--copyright] [--help] <var>grammarfile</var>
|
|
59
|
+
#
|
|
60
|
+
# [+grammarfile+]
|
|
61
|
+
# Racc grammar file. Any extension is permitted.
|
|
62
|
+
# [-o+outfile+, --output-file=+outfile+]
|
|
63
|
+
# A filename for output. default is <+filename+>.tab.rb
|
|
64
|
+
# [-O+filename+, --log-file=+filename+]
|
|
65
|
+
# Place logging output in file +filename+.
|
|
66
|
+
# Default log file name is <+filename+>.output.
|
|
67
|
+
# [-e+rubypath+, --executable=+rubypath+]
|
|
68
|
+
# output executable file(mode 755). where +path+ is the Ruby interpreter.
|
|
69
|
+
# [-v, --verbose]
|
|
70
|
+
# verbose mode. create +filename+.output file, like yacc's y.output file.
|
|
71
|
+
# [-g, --debug]
|
|
72
|
+
# add debug code to parser class. To display debugging information,
|
|
73
|
+
# use this '-g' option and set @yydebug true in parser class.
|
|
74
|
+
# [-E, --embedded]
|
|
75
|
+
# Output parser which doesn't need runtime files (racc/parser.rb).
|
|
76
|
+
# [-F, --frozen]
|
|
77
|
+
# Output parser which declares frozen_string_literals: true
|
|
78
|
+
# [-C, --check-only]
|
|
79
|
+
# Check syntax of racc grammar file and quit.
|
|
80
|
+
# [-S, --output-status]
|
|
81
|
+
# Print messages time to time while compiling.
|
|
82
|
+
# [-l, --no-line-convert]
|
|
83
|
+
# turns off line number converting.
|
|
84
|
+
# [-c, --line-convert-all]
|
|
85
|
+
# Convert line number of actions, inner, header and footer.
|
|
86
|
+
# [-a, --no-omit-actions]
|
|
87
|
+
# Call all actions, even if an action is empty.
|
|
88
|
+
# [--version]
|
|
89
|
+
# print Racc version and quit.
|
|
90
|
+
# [--copyright]
|
|
91
|
+
# Print copyright and quit.
|
|
92
|
+
# [--help]
|
|
93
|
+
# Print usage and quit.
|
|
94
|
+
#
|
|
95
|
+
# == Generating Parser Using Racc
|
|
96
|
+
#
|
|
97
|
+
# To compile Racc grammar file, simply type:
|
|
98
|
+
#
|
|
99
|
+
# $ racc parse.y
|
|
100
|
+
#
|
|
101
|
+
# This creates Ruby script file "parse.tab.y". The -o option can change the output filename.
|
|
102
|
+
#
|
|
103
|
+
# == Writing A Racc Grammar File
|
|
104
|
+
#
|
|
105
|
+
# If you want your own parser, you have to write a grammar file.
|
|
106
|
+
# A grammar file contains the name of your parser class, grammar for the parser,
|
|
107
|
+
# user code, and anything else.
|
|
108
|
+
# When writing a grammar file, yacc's knowledge is helpful.
|
|
109
|
+
# If you have not used yacc before, Racc is not too difficult.
|
|
110
|
+
#
|
|
111
|
+
# Here's an example Racc grammar file.
|
|
112
|
+
#
|
|
113
|
+
# class Calcparser
|
|
114
|
+
# rule
|
|
115
|
+
# target: exp { print val[0] }
|
|
116
|
+
#
|
|
117
|
+
# exp: exp '+' exp
|
|
118
|
+
# | exp '*' exp
|
|
119
|
+
# | '(' exp ')'
|
|
120
|
+
# | NUMBER
|
|
121
|
+
# end
|
|
122
|
+
#
|
|
123
|
+
# Racc grammar files resemble yacc files.
|
|
124
|
+
# But (of course), this is Ruby code.
|
|
125
|
+
# yacc's $$ is the 'result', $0, $1... is
|
|
126
|
+
# an array called 'val', and $-1, $-2... is an array called '_values'.
|
|
127
|
+
#
|
|
128
|
+
# See the {Grammar File Reference}[rdoc-ref:lib/racc/rdoc/grammar.en.rdoc] for
|
|
129
|
+
# more information on grammar files.
|
|
130
|
+
#
|
|
131
|
+
# == Parser
|
|
132
|
+
#
|
|
133
|
+
# Then you must prepare the parse entry method. There are two types of
|
|
134
|
+
# parse methods in Racc, Racc::Parser#do_parse and Racc::Parser#yyparse
|
|
135
|
+
#
|
|
136
|
+
# Racc::Parser#do_parse is simple.
|
|
137
|
+
#
|
|
138
|
+
# It's yyparse() of yacc, and Racc::Parser#next_token is yylex().
|
|
139
|
+
# This method must returns an array like [TOKENSYMBOL, ITS_VALUE].
|
|
140
|
+
# EOF is [false, false].
|
|
141
|
+
# (TOKENSYMBOL is a Ruby symbol (taken from String#intern) by default.
|
|
142
|
+
# If you want to change this, see the grammar reference.
|
|
143
|
+
#
|
|
144
|
+
# Racc::Parser#yyparse is little complicated, but useful.
|
|
145
|
+
# It does not use Racc::Parser#next_token, instead it gets tokens from any iterator.
|
|
146
|
+
#
|
|
147
|
+
# For example, <code>yyparse(obj, :scan)</code> causes
|
|
148
|
+
# calling +obj#scan+, and you can return tokens by yielding them from +obj#scan+.
|
|
149
|
+
#
|
|
150
|
+
# == Debugging
|
|
151
|
+
#
|
|
152
|
+
# When debugging, "-v" or/and the "-g" option is helpful.
|
|
153
|
+
#
|
|
154
|
+
# "-v" creates verbose log file (.output).
|
|
155
|
+
# "-g" creates a "Verbose Parser".
|
|
156
|
+
# Verbose Parser prints the internal status when parsing.
|
|
157
|
+
# But it's _not_ automatic.
|
|
158
|
+
# You must use -g option and set +@yydebug+ to +true+ in order to get output.
|
|
159
|
+
# -g option only creates the verbose parser.
|
|
160
|
+
#
|
|
161
|
+
# === Racc reported syntax error.
|
|
162
|
+
#
|
|
163
|
+
# Isn't there too many "end"?
|
|
164
|
+
# grammar of racc file is changed in v0.10.
|
|
165
|
+
#
|
|
166
|
+
# Racc does not use '%' mark, while yacc uses huge number of '%' marks..
|
|
167
|
+
#
|
|
168
|
+
# === Racc reported "XXXX conflicts".
|
|
169
|
+
#
|
|
170
|
+
# Try "racc -v xxxx.y".
|
|
171
|
+
# It causes producing racc's internal log file, xxxx.output.
|
|
172
|
+
#
|
|
173
|
+
# === Generated parsers does not work correctly
|
|
174
|
+
#
|
|
175
|
+
# Try "racc -g xxxx.y".
|
|
176
|
+
# This command let racc generate "debugging parser".
|
|
177
|
+
# Then set @yydebug=true in your parser.
|
|
178
|
+
# It produces a working log of your parser.
|
|
179
|
+
#
|
|
180
|
+
# == Re-distributing Racc runtime
|
|
181
|
+
#
|
|
182
|
+
# A parser, which is created by Racc, requires the Racc runtime module;
|
|
183
|
+
# racc/parser.rb.
|
|
184
|
+
#
|
|
185
|
+
# Ruby 1.8.x comes with Racc runtime module,
|
|
186
|
+
# you need NOT distribute Racc runtime files.
|
|
187
|
+
#
|
|
188
|
+
# If you want to include the Racc runtime module with your parser.
|
|
189
|
+
# This can be done by using '-E' option:
|
|
190
|
+
#
|
|
191
|
+
# $ racc -E -omyparser.rb myparser.y
|
|
192
|
+
#
|
|
193
|
+
# This command creates myparser.rb which `includes' Racc runtime.
|
|
194
|
+
# Only you must do is to distribute your parser file (myparser.rb).
|
|
195
|
+
#
|
|
196
|
+
# Note: parser.rb is ruby license, but your parser is not.
|
|
197
|
+
# Your own parser is completely yours.
|
|
198
|
+
module Racc
|
|
199
|
+
|
|
200
|
+
unless defined?(Racc_No_Extensions)
|
|
201
|
+
Racc_No_Extensions = false # :nodoc:
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
class Parser
|
|
205
|
+
|
|
206
|
+
Racc_Runtime_Version = ::Racc::VERSION
|
|
207
|
+
Racc_Runtime_Core_Version_R = ::Racc::VERSION
|
|
208
|
+
|
|
209
|
+
begin
|
|
210
|
+
if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
|
|
211
|
+
require 'jruby'
|
|
212
|
+
require 'racc/cparse-jruby.jar'
|
|
213
|
+
com.headius.racc.Cparse.new.load(JRuby.runtime, false)
|
|
214
|
+
else
|
|
215
|
+
require 'racc/cparse'
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
unless new.respond_to?(:_racc_do_parse_c, true)
|
|
219
|
+
raise LoadError, 'old cparse.so'
|
|
220
|
+
end
|
|
221
|
+
if Racc_No_Extensions
|
|
222
|
+
raise LoadError, 'selecting ruby version of racc runtime core'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
Racc_Main_Parsing_Routine = :_racc_do_parse_c # :nodoc:
|
|
226
|
+
Racc_YY_Parse_Method = :_racc_yyparse_c # :nodoc:
|
|
227
|
+
Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C # :nodoc:
|
|
228
|
+
Racc_Runtime_Type = 'c' # :nodoc:
|
|
229
|
+
rescue LoadError
|
|
230
|
+
Racc_Main_Parsing_Routine = :_racc_do_parse_rb
|
|
231
|
+
Racc_YY_Parse_Method = :_racc_yyparse_rb
|
|
232
|
+
Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_R
|
|
233
|
+
Racc_Runtime_Type = 'ruby'
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
def Parser.racc_runtime_type # :nodoc:
|
|
237
|
+
Racc_Runtime_Type
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
def _racc_setup
|
|
241
|
+
@yydebug = false unless self.class::Racc_debug_parser
|
|
242
|
+
@yydebug = false unless defined?(@yydebug)
|
|
243
|
+
if @yydebug
|
|
244
|
+
@racc_debug_out = $stderr unless defined?(@racc_debug_out)
|
|
245
|
+
@racc_debug_out ||= $stderr
|
|
246
|
+
end
|
|
247
|
+
arg = self.class::Racc_arg
|
|
248
|
+
arg[13] = true if arg.size < 14
|
|
249
|
+
arg
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
def _racc_init_sysvars
|
|
253
|
+
@racc_state = [0]
|
|
254
|
+
@racc_tstack = []
|
|
255
|
+
@racc_vstack = []
|
|
256
|
+
|
|
257
|
+
@racc_t = nil
|
|
258
|
+
@racc_val = nil
|
|
259
|
+
|
|
260
|
+
@racc_read_next = true
|
|
261
|
+
|
|
262
|
+
@racc_user_yyerror = false
|
|
263
|
+
@racc_error_status = 0
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
# The entry point of the parser. This method is used with #next_token.
|
|
267
|
+
# If Racc wants to get token (and its value), calls next_token.
|
|
268
|
+
#
|
|
269
|
+
# Example:
|
|
270
|
+
# def parse
|
|
271
|
+
# @q = [[1,1],
|
|
272
|
+
# [2,2],
|
|
273
|
+
# [3,3],
|
|
274
|
+
# [false, '$']]
|
|
275
|
+
# do_parse
|
|
276
|
+
# end
|
|
277
|
+
#
|
|
278
|
+
# def next_token
|
|
279
|
+
# @q.shift
|
|
280
|
+
# end
|
|
281
|
+
class_eval <<~RUBY, __FILE__, __LINE__ + 1
|
|
282
|
+
def do_parse
|
|
283
|
+
#{Racc_Main_Parsing_Routine}(_racc_setup(), false)
|
|
284
|
+
end
|
|
285
|
+
RUBY
|
|
286
|
+
|
|
287
|
+
# The method to fetch next token.
|
|
288
|
+
# If you use #do_parse method, you must implement #next_token.
|
|
289
|
+
#
|
|
290
|
+
# The format of return value is [TOKEN_SYMBOL, VALUE].
|
|
291
|
+
# +token-symbol+ is represented by Ruby's symbol by default, e.g. :IDENT
|
|
292
|
+
# for 'IDENT'. ";" (String) for ';'.
|
|
293
|
+
#
|
|
294
|
+
# The final symbol (End of file) must be false.
|
|
295
|
+
def next_token
|
|
296
|
+
raise NotImplementedError, "#{self.class}\#next_token is not defined"
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
def _racc_do_parse_rb(arg, in_debug)
|
|
300
|
+
action_table, action_check, action_default, action_pointer,
|
|
301
|
+
_, _, _, _,
|
|
302
|
+
_, _, token_table, * = arg
|
|
303
|
+
|
|
304
|
+
_racc_init_sysvars
|
|
305
|
+
tok = act = i = nil
|
|
306
|
+
|
|
307
|
+
catch(:racc_end_parse) {
|
|
308
|
+
while true
|
|
309
|
+
if i = action_pointer[@racc_state[-1]]
|
|
310
|
+
if @racc_read_next
|
|
311
|
+
if @racc_t != 0 # not EOF
|
|
312
|
+
tok, @racc_val = next_token()
|
|
313
|
+
unless tok # EOF
|
|
314
|
+
@racc_t = 0
|
|
315
|
+
else
|
|
316
|
+
@racc_t = (token_table[tok] or 1) # error token
|
|
317
|
+
end
|
|
318
|
+
racc_read_token(@racc_t, tok, @racc_val) if @yydebug
|
|
319
|
+
@racc_read_next = false
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
i += @racc_t
|
|
323
|
+
unless i >= 0 and
|
|
324
|
+
act = action_table[i] and
|
|
325
|
+
action_check[i] == @racc_state[-1]
|
|
326
|
+
act = action_default[@racc_state[-1]]
|
|
327
|
+
end
|
|
328
|
+
else
|
|
329
|
+
act = action_default[@racc_state[-1]]
|
|
330
|
+
end
|
|
331
|
+
while act = _racc_evalact(act, arg)
|
|
332
|
+
;
|
|
333
|
+
end
|
|
334
|
+
end
|
|
335
|
+
}
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
# Another entry point for the parser.
|
|
339
|
+
# If you use this method, you must implement RECEIVER#METHOD_ID method.
|
|
340
|
+
#
|
|
341
|
+
# RECEIVER#METHOD_ID is a method to get next token.
|
|
342
|
+
# It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
|
|
343
|
+
class_eval <<~RUBY, __FILE__, __LINE__ + 1
|
|
344
|
+
def yyparse(recv, mid)
|
|
345
|
+
#{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), false)
|
|
346
|
+
end
|
|
347
|
+
RUBY
|
|
348
|
+
|
|
349
|
+
def _racc_yyparse_rb(recv, mid, arg, c_debug)
|
|
350
|
+
action_table, action_check, action_default, action_pointer,
|
|
351
|
+
_, _, _, _,
|
|
352
|
+
_, _, token_table, * = arg
|
|
353
|
+
|
|
354
|
+
_racc_init_sysvars
|
|
355
|
+
|
|
356
|
+
catch(:racc_end_parse) {
|
|
357
|
+
until i = action_pointer[@racc_state[-1]]
|
|
358
|
+
while act = _racc_evalact(action_default[@racc_state[-1]], arg)
|
|
359
|
+
;
|
|
360
|
+
end
|
|
361
|
+
end
|
|
362
|
+
recv.__send__(mid) do |tok, val|
|
|
363
|
+
unless tok
|
|
364
|
+
@racc_t = 0
|
|
365
|
+
else
|
|
366
|
+
@racc_t = (token_table[tok] or 1) # error token
|
|
367
|
+
end
|
|
368
|
+
@racc_val = val
|
|
369
|
+
@racc_read_next = false
|
|
370
|
+
|
|
371
|
+
i += @racc_t
|
|
372
|
+
unless i >= 0 and
|
|
373
|
+
act = action_table[i] and
|
|
374
|
+
action_check[i] == @racc_state[-1]
|
|
375
|
+
act = action_default[@racc_state[-1]]
|
|
376
|
+
end
|
|
377
|
+
while act = _racc_evalact(act, arg)
|
|
378
|
+
;
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
while !(i = action_pointer[@racc_state[-1]]) ||
|
|
382
|
+
! @racc_read_next ||
|
|
383
|
+
@racc_t == 0 # $
|
|
384
|
+
unless i and i += @racc_t and
|
|
385
|
+
i >= 0 and
|
|
386
|
+
act = action_table[i] and
|
|
387
|
+
action_check[i] == @racc_state[-1]
|
|
388
|
+
act = action_default[@racc_state[-1]]
|
|
389
|
+
end
|
|
390
|
+
while act = _racc_evalact(act, arg)
|
|
391
|
+
;
|
|
392
|
+
end
|
|
393
|
+
end
|
|
394
|
+
end
|
|
395
|
+
}
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
###
|
|
399
|
+
### common
|
|
400
|
+
###
|
|
401
|
+
|
|
402
|
+
def _racc_evalact(act, arg)
|
|
403
|
+
action_table, action_check, _, action_pointer,
|
|
404
|
+
_, _, _, _,
|
|
405
|
+
_, _, _, shift_n,
|
|
406
|
+
reduce_n, * = arg
|
|
407
|
+
nerr = 0 # tmp
|
|
408
|
+
|
|
409
|
+
if act > 0 and act < shift_n
|
|
410
|
+
#
|
|
411
|
+
# shift
|
|
412
|
+
#
|
|
413
|
+
if @racc_error_status > 0
|
|
414
|
+
@racc_error_status -= 1 unless @racc_t <= 1 # error token or EOF
|
|
415
|
+
end
|
|
416
|
+
@racc_vstack.push @racc_val
|
|
417
|
+
@racc_state.push act
|
|
418
|
+
@racc_read_next = true
|
|
419
|
+
if @yydebug
|
|
420
|
+
@racc_tstack.push @racc_t
|
|
421
|
+
racc_shift @racc_t, @racc_tstack, @racc_vstack
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
elsif act < 0 and act > -reduce_n
|
|
425
|
+
#
|
|
426
|
+
# reduce
|
|
427
|
+
#
|
|
428
|
+
code = catch(:racc_jump) {
|
|
429
|
+
@racc_state.push _racc_do_reduce(arg, act)
|
|
430
|
+
false
|
|
431
|
+
}
|
|
432
|
+
if code
|
|
433
|
+
case code
|
|
434
|
+
when 1 # yyerror
|
|
435
|
+
@racc_user_yyerror = true # user_yyerror
|
|
436
|
+
return -reduce_n
|
|
437
|
+
when 2 # yyaccept
|
|
438
|
+
return shift_n
|
|
439
|
+
else
|
|
440
|
+
raise '[Racc Bug] unknown jump code'
|
|
441
|
+
end
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
elsif act == shift_n
|
|
445
|
+
#
|
|
446
|
+
# accept
|
|
447
|
+
#
|
|
448
|
+
racc_accept if @yydebug
|
|
449
|
+
throw :racc_end_parse, @racc_vstack[0]
|
|
450
|
+
|
|
451
|
+
elsif act == -reduce_n
|
|
452
|
+
#
|
|
453
|
+
# error
|
|
454
|
+
#
|
|
455
|
+
case @racc_error_status
|
|
456
|
+
when 0
|
|
457
|
+
unless arg[21] # user_yyerror
|
|
458
|
+
nerr += 1
|
|
459
|
+
on_error @racc_t, @racc_val, @racc_vstack
|
|
460
|
+
end
|
|
461
|
+
when 3
|
|
462
|
+
if @racc_t == 0 # is $
|
|
463
|
+
# We're at EOF, and another error occurred immediately after
|
|
464
|
+
# attempting auto-recovery
|
|
465
|
+
throw :racc_end_parse, nil
|
|
466
|
+
end
|
|
467
|
+
@racc_read_next = true
|
|
468
|
+
end
|
|
469
|
+
@racc_user_yyerror = false
|
|
470
|
+
@racc_error_status = 3
|
|
471
|
+
while true
|
|
472
|
+
if i = action_pointer[@racc_state[-1]]
|
|
473
|
+
i += 1 # error token
|
|
474
|
+
if i >= 0 and
|
|
475
|
+
(act = action_table[i]) and
|
|
476
|
+
action_check[i] == @racc_state[-1]
|
|
477
|
+
break
|
|
478
|
+
end
|
|
479
|
+
end
|
|
480
|
+
throw :racc_end_parse, nil if @racc_state.size <= 1
|
|
481
|
+
@racc_state.pop
|
|
482
|
+
@racc_vstack.pop
|
|
483
|
+
if @yydebug
|
|
484
|
+
@racc_tstack.pop
|
|
485
|
+
racc_e_pop @racc_state, @racc_tstack, @racc_vstack
|
|
486
|
+
end
|
|
487
|
+
end
|
|
488
|
+
return act
|
|
489
|
+
|
|
490
|
+
else
|
|
491
|
+
raise "[Racc Bug] unknown action #{act.inspect}"
|
|
492
|
+
end
|
|
493
|
+
|
|
494
|
+
racc_next_state(@racc_state[-1], @racc_state) if @yydebug
|
|
495
|
+
|
|
496
|
+
nil
|
|
497
|
+
end
|
|
498
|
+
|
|
499
|
+
def _racc_do_reduce(arg, act)
|
|
500
|
+
_, _, _, _,
|
|
501
|
+
goto_table, goto_check, goto_default, goto_pointer,
|
|
502
|
+
nt_base, reduce_table, _, _,
|
|
503
|
+
_, use_result, * = arg
|
|
504
|
+
|
|
505
|
+
state = @racc_state
|
|
506
|
+
vstack = @racc_vstack
|
|
507
|
+
tstack = @racc_tstack
|
|
508
|
+
|
|
509
|
+
i = act * -3
|
|
510
|
+
len = reduce_table[i]
|
|
511
|
+
reduce_to = reduce_table[i+1]
|
|
512
|
+
method_id = reduce_table[i+2]
|
|
513
|
+
void_array = []
|
|
514
|
+
|
|
515
|
+
tmp_t = tstack[-len, len] if @yydebug
|
|
516
|
+
tmp_v = vstack[-len, len]
|
|
517
|
+
tstack[-len, len] = void_array if @yydebug
|
|
518
|
+
vstack[-len, len] = void_array
|
|
519
|
+
state[-len, len] = void_array
|
|
520
|
+
|
|
521
|
+
# tstack must be updated AFTER method call
|
|
522
|
+
if use_result
|
|
523
|
+
vstack.push __send__(method_id, tmp_v, vstack, tmp_v[0])
|
|
524
|
+
else
|
|
525
|
+
vstack.push __send__(method_id, tmp_v, vstack)
|
|
526
|
+
end
|
|
527
|
+
tstack.push reduce_to
|
|
528
|
+
|
|
529
|
+
racc_reduce(tmp_t, reduce_to, tstack, vstack) if @yydebug
|
|
530
|
+
|
|
531
|
+
k1 = reduce_to - nt_base
|
|
532
|
+
if i = goto_pointer[k1]
|
|
533
|
+
i += state[-1]
|
|
534
|
+
if i >= 0 and (curstate = goto_table[i]) and goto_check[i] == k1
|
|
535
|
+
return curstate
|
|
536
|
+
end
|
|
537
|
+
end
|
|
538
|
+
goto_default[k1]
|
|
539
|
+
end
|
|
540
|
+
|
|
541
|
+
# This method is called when a parse error is found.
|
|
542
|
+
#
|
|
543
|
+
# ERROR_TOKEN_ID is an internal ID of token which caused error.
|
|
544
|
+
# You can get string representation of this ID by calling
|
|
545
|
+
# #token_to_str.
|
|
546
|
+
#
|
|
547
|
+
# ERROR_VALUE is a value of error token.
|
|
548
|
+
#
|
|
549
|
+
# value_stack is a stack of symbol values.
|
|
550
|
+
# DO NOT MODIFY this object.
|
|
551
|
+
#
|
|
552
|
+
# This method raises ParseError by default.
|
|
553
|
+
#
|
|
554
|
+
# If this method returns, parsers enter "error recovering mode".
|
|
555
|
+
def on_error(t, val, vstack)
|
|
556
|
+
raise ParseError, sprintf("parse error on value %s (%s)",
|
|
557
|
+
val.inspect, token_to_str(t) || '?')
|
|
558
|
+
end
|
|
559
|
+
|
|
560
|
+
# Enter error recovering mode.
|
|
561
|
+
# This method does not call #on_error.
|
|
562
|
+
def yyerror
|
|
563
|
+
throw :racc_jump, 1
|
|
564
|
+
end
|
|
565
|
+
|
|
566
|
+
# Exit parser.
|
|
567
|
+
# Return value is +Symbol_Value_Stack[0]+.
|
|
568
|
+
def yyaccept
|
|
569
|
+
throw :racc_jump, 2
|
|
570
|
+
end
|
|
571
|
+
|
|
572
|
+
# Leave error recovering mode.
|
|
573
|
+
def yyerrok
|
|
574
|
+
@racc_error_status = 0
|
|
575
|
+
end
|
|
576
|
+
|
|
577
|
+
# For debugging output
|
|
578
|
+
def racc_read_token(t, tok, val)
|
|
579
|
+
@racc_debug_out.print 'read '
|
|
580
|
+
@racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') '
|
|
581
|
+
@racc_debug_out.puts val.inspect
|
|
582
|
+
@racc_debug_out.puts
|
|
583
|
+
end
|
|
584
|
+
|
|
585
|
+
def racc_shift(tok, tstack, vstack)
|
|
586
|
+
@racc_debug_out.puts "shift #{racc_token2str tok}"
|
|
587
|
+
racc_print_stacks tstack, vstack
|
|
588
|
+
@racc_debug_out.puts
|
|
589
|
+
end
|
|
590
|
+
|
|
591
|
+
def racc_reduce(toks, sim, tstack, vstack)
|
|
592
|
+
out = @racc_debug_out
|
|
593
|
+
out.print 'reduce '
|
|
594
|
+
if toks.empty?
|
|
595
|
+
out.print ' <none>'
|
|
596
|
+
else
|
|
597
|
+
toks.each {|t| out.print ' ', racc_token2str(t) }
|
|
598
|
+
end
|
|
599
|
+
out.puts " --> #{racc_token2str(sim)}"
|
|
600
|
+
racc_print_stacks tstack, vstack
|
|
601
|
+
@racc_debug_out.puts
|
|
602
|
+
end
|
|
603
|
+
|
|
604
|
+
def racc_accept
|
|
605
|
+
@racc_debug_out.puts 'accept'
|
|
606
|
+
@racc_debug_out.puts
|
|
607
|
+
end
|
|
608
|
+
|
|
609
|
+
def racc_e_pop(state, tstack, vstack)
|
|
610
|
+
@racc_debug_out.puts 'error recovering mode: pop token'
|
|
611
|
+
racc_print_states state
|
|
612
|
+
racc_print_stacks tstack, vstack
|
|
613
|
+
@racc_debug_out.puts
|
|
614
|
+
end
|
|
615
|
+
|
|
616
|
+
def racc_next_state(curstate, state)
|
|
617
|
+
@racc_debug_out.puts "goto #{curstate}"
|
|
618
|
+
racc_print_states state
|
|
619
|
+
@racc_debug_out.puts
|
|
620
|
+
end
|
|
621
|
+
|
|
622
|
+
def racc_print_stacks(t, v)
|
|
623
|
+
out = @racc_debug_out
|
|
624
|
+
out.print ' ['
|
|
625
|
+
t.each_index do |i|
|
|
626
|
+
out.print ' (', racc_token2str(t[i]), ' ', v[i].inspect, ')'
|
|
627
|
+
end
|
|
628
|
+
out.puts ' ]'
|
|
629
|
+
end
|
|
630
|
+
|
|
631
|
+
def racc_print_states(s)
|
|
632
|
+
out = @racc_debug_out
|
|
633
|
+
out.print ' ['
|
|
634
|
+
s.each {|st| out.print ' ', st }
|
|
635
|
+
out.puts ' ]'
|
|
636
|
+
end
|
|
637
|
+
|
|
638
|
+
def racc_token2str(tok)
|
|
639
|
+
self.class::Racc_token_to_s_table[tok] or
|
|
640
|
+
raise "[Racc Bug] can't convert token #{tok} to string"
|
|
641
|
+
end
|
|
642
|
+
|
|
643
|
+
# Convert internal ID of token symbol to the string.
|
|
644
|
+
def token_to_str(t)
|
|
645
|
+
self.class::Racc_token_to_s_table[t]
|
|
646
|
+
end
|
|
647
|
+
|
|
648
|
+
end
|
|
649
|
+
|
|
650
|
+
end
|
|
651
|
+
|
|
652
|
+
...end racc/parser.rb/module_eval...
|
|
653
|
+
end
|
|
654
|
+
###### racc/parser.rb end
|
|
8
655
|
|
|
9
656
|
|
|
10
657
|
require 'deep_merge'
|
|
11
658
|
require 'ipaddr'
|
|
659
|
+
require 'json'
|
|
12
660
|
require 'strscan'
|
|
13
661
|
|
|
14
662
|
module Puffy
|
|
15
663
|
class Parser < Racc::Parser
|
|
16
664
|
|
|
17
|
-
module_eval(<<'...end parser.y/module_eval...', 'parser.y',
|
|
665
|
+
module_eval(<<'...end parser.y/module_eval...', 'parser.y', 176)
|
|
18
666
|
|
|
19
667
|
attr_accessor :yydebug
|
|
20
|
-
attr_reader :
|
|
668
|
+
attr_reader :current_policies, :filename
|
|
21
669
|
#attr_accessor :variables, :nodes, :services
|
|
22
670
|
|
|
23
671
|
def ipaddress?(s)
|
|
@@ -98,6 +746,7 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 166)
|
|
|
98
746
|
when s.scan(/rdr-to\b/) then emit(:RDR_TO, s.matched)
|
|
99
747
|
when s.scan(/srv\b/) then emit(:SRV, s.matched)
|
|
100
748
|
when s.scan(/apt-mirror\b/) then emit(:APT_MIRROR, s.matched)
|
|
749
|
+
when s.scan(/azure-ip-range\b/) then emit(:AZURE_IP_RANGE, s.matched)
|
|
101
750
|
|
|
102
751
|
when s.scan(/\d+\.\d+\.\d+\.\d+(\/\d+)?/) && ip = ipaddress?(s) then emit(:ADDRESS, ip, s.matched_size)
|
|
103
752
|
when s.scan(/[[:xdigit:]]*:[:[:xdigit:]]+(\/\d+)?/) && ip = ipaddress?(s) then emit(:ADDRESS, ip, s.matched_size)
|
|
@@ -120,7 +769,7 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 166)
|
|
|
120
769
|
|
|
121
770
|
begin
|
|
122
771
|
do_parse
|
|
123
|
-
rescue Racc::ParseError
|
|
772
|
+
rescue Racc::ParseError
|
|
124
773
|
raise ParseError.new("Parse error: unexpected token: #{@current_token[0]}", @current_token[1])
|
|
125
774
|
end
|
|
126
775
|
end
|
|
@@ -154,6 +803,10 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 166)
|
|
|
154
803
|
@saved_policies = {}
|
|
155
804
|
@services = {}
|
|
156
805
|
@rule_factory = Puffy::RuleFactory.new
|
|
806
|
+
@default_policies = {
|
|
807
|
+
in: { action: :block, log: false },
|
|
808
|
+
out: { action: :block, log: false },
|
|
809
|
+
}
|
|
157
810
|
end
|
|
158
811
|
|
|
159
812
|
def nodes
|
|
@@ -200,8 +853,8 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 166)
|
|
|
200
853
|
end.flatten
|
|
201
854
|
end
|
|
202
855
|
|
|
203
|
-
def
|
|
204
|
-
prefered_value_for_hostname(@saved_policies, hostname)
|
|
856
|
+
def policies_for(hostname)
|
|
857
|
+
return @default_policies.merge(prefered_value_for_hostname(@saved_policies, hostname))
|
|
205
858
|
end
|
|
206
859
|
|
|
207
860
|
def constraint_service_to_hosts(service, hosts)
|
|
@@ -227,244 +880,259 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 166)
|
|
|
227
880
|
##### State transition tables begin ###
|
|
228
881
|
|
|
229
882
|
racc_action_table = [
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
883
|
+
36, 36, 31, 144, 93, 36, 38, 134, 135, 12,
|
|
884
|
+
36, 38, 43, 76, 77, 36, 38, 17, 23, 44,
|
|
885
|
+
24, 38, 6, 51, 52, 51, 52, 7, 127, 8,
|
|
886
|
+
178, 29, 38, 10, 40, 35, 35, 37, 41, 40,
|
|
887
|
+
35, 30, 37, 41, 40, 35, 36, 37, 41, 40,
|
|
888
|
+
35, 36, 37, 41, 124, 128, 56, 127, 129, 130,
|
|
889
|
+
40, 38, 48, 37, 41, 180, 181, 36, 127, 49,
|
|
890
|
+
167, 168, 38, 57, 152, 153, 23, 38, 24, 38,
|
|
891
|
+
160, 35, 110, 124, 128, 160, 35, 129, 130, 40,
|
|
892
|
+
38, 10, 37, 41, 124, 128, 108, 109, 129, 130,
|
|
893
|
+
40, 160, 35, 37, 41, 40, 86, 40, 37, 41,
|
|
894
|
+
37, 41, 10, 85, 19, 64, 75, 110, 40, 110,
|
|
895
|
+
20, 37, 41, 62, 63, 65, 66, 64, 79, 26,
|
|
896
|
+
27, 108, 109, 108, 109, 62, 63, 65, 66, 64,
|
|
897
|
+
21, 26, 27, 110, 23, 88, 24, 62, 63, 65,
|
|
898
|
+
66, 64, 87, 26, 27, 26, 27, 108, 109, 62,
|
|
899
|
+
63, 65, 66, 64, 19, 26, 27, 51, 52, 48,
|
|
900
|
+
20, 62, 63, 65, 66, 64, 49, 26, 27, 173,
|
|
901
|
+
80, 171, 19, 62, 63, 65, 66, 64, 20, 26,
|
|
902
|
+
27, 26, 27, 81, 19, 62, 63, 65, 66, 64,
|
|
903
|
+
20, 26, 27, 51, 52, 51, 52, 62, 63, 65,
|
|
904
|
+
66, 64, 173, 26, 27, 182, 183, 147, 148, 62,
|
|
905
|
+
63, 65, 66, 64, 95, 26, 27, 51, 52, 180,
|
|
906
|
+
181, 62, 63, 65, 66, 64, 100, 26, 27, 102,
|
|
907
|
+
75, 117, 118, 62, 63, 65, 66, 6, 6, 26,
|
|
908
|
+
27, 119, 7, 7, 8, 8, 6, 6, 10, 10,
|
|
909
|
+
120, 7, 7, 8, 8, 121, 122, 10, 10, 69,
|
|
910
|
+
70, 133, 23, 137, 24, 130, 130, 142, 143, 149,
|
|
911
|
+
155, 156, 162, 130, 165, 166, 173, 186, 187, 173,
|
|
912
|
+
189, 190 ]
|
|
258
913
|
|
|
259
914
|
racc_action_check = [
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
915
|
+
17, 130, 17, 130, 67, 31, 17, 115, 115, 1,
|
|
916
|
+
54, 31, 18, 54, 54, 77, 54, 6, 21, 18,
|
|
917
|
+
21, 77, 0, 67, 67, 115, 115, 0, 108, 0,
|
|
918
|
+
175, 11, 108, 0, 17, 17, 130, 17, 17, 31,
|
|
919
|
+
31, 12, 31, 31, 54, 54, 144, 54, 54, 77,
|
|
920
|
+
77, 168, 77, 77, 108, 108, 35, 109, 108, 108,
|
|
921
|
+
108, 109, 22, 108, 108, 175, 175, 157, 137, 22,
|
|
922
|
+
157, 157, 137, 41, 140, 140, 70, 140, 70, 127,
|
|
923
|
+
144, 144, 89, 109, 109, 168, 168, 109, 109, 109,
|
|
924
|
+
153, 48, 109, 109, 137, 137, 89, 89, 137, 137,
|
|
925
|
+
137, 157, 157, 137, 137, 140, 62, 127, 140, 140,
|
|
926
|
+
127, 127, 49, 62, 7, 43, 50, 90, 153, 91,
|
|
927
|
+
7, 153, 153, 43, 43, 43, 43, 44, 56, 43,
|
|
928
|
+
43, 90, 90, 91, 91, 44, 44, 44, 44, 59,
|
|
929
|
+
8, 44, 44, 161, 8, 63, 8, 59, 59, 59,
|
|
930
|
+
59, 60, 63, 59, 59, 10, 10, 161, 161, 60,
|
|
931
|
+
60, 60, 60, 61, 64, 60, 60, 25, 25, 69,
|
|
932
|
+
64, 61, 61, 61, 61, 72, 69, 61, 61, 162,
|
|
933
|
+
57, 162, 65, 72, 72, 72, 72, 73, 65, 72,
|
|
934
|
+
72, 29, 29, 58, 66, 73, 73, 73, 73, 85,
|
|
935
|
+
66, 73, 73, 53, 53, 93, 93, 85, 85, 85,
|
|
936
|
+
85, 86, 176, 85, 85, 176, 176, 132, 132, 86,
|
|
937
|
+
86, 86, 86, 87, 68, 86, 86, 135, 135, 178,
|
|
938
|
+
178, 87, 87, 87, 87, 88, 74, 87, 87, 80,
|
|
939
|
+
92, 98, 99, 88, 88, 88, 88, 2, 3, 88,
|
|
940
|
+
88, 103, 2, 3, 2, 3, 4, 5, 2, 3,
|
|
941
|
+
104, 4, 5, 4, 5, 105, 106, 4, 5, 45,
|
|
942
|
+
45, 114, 45, 123, 45, 124, 126, 128, 129, 133,
|
|
943
|
+
142, 143, 146, 152, 155, 156, 171, 180, 181, 183,
|
|
944
|
+
186, 189 ]
|
|
288
945
|
|
|
289
946
|
racc_action_pointer = [
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
nil, nil, nil, nil,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
nil, nil, nil,
|
|
301
|
-
|
|
302
|
-
nil,
|
|
303
|
-
|
|
304
|
-
nil,
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
947
|
+
20, 9, 245, 246, 254, 255, 14, 112, 136, nil,
|
|
948
|
+
134, 18, 41, nil, nil, nil, nil, -2, 8, nil,
|
|
949
|
+
nil, 10, 58, nil, nil, 144, nil, nil, nil, 170,
|
|
950
|
+
nil, 3, nil, nil, nil, 18, nil, nil, nil, nil,
|
|
951
|
+
nil, 41, nil, 108, 120, 264, nil, nil, 78, 99,
|
|
952
|
+
97, nil, nil, 180, 8, nil, 91, 172, 188, 132,
|
|
953
|
+
144, 156, 102, 141, 162, 180, 192, 0, 212, 165,
|
|
954
|
+
68, nil, 168, 180, 222, nil, nil, 13, nil, nil,
|
|
955
|
+
206, nil, nil, nil, nil, 192, 204, 216, 228, 68,
|
|
956
|
+
103, 105, 221, 182, nil, nil, nil, nil, 236, 230,
|
|
957
|
+
nil, nil, nil, 239, 255, 253, 261, nil, 24, 53,
|
|
958
|
+
nil, nil, nil, nil, 251, 2, nil, nil, nil, nil,
|
|
959
|
+
nil, nil, nil, 244, 240, nil, 241, 71, 245, 246,
|
|
960
|
+
-1, nil, 192, 271, nil, 204, nil, 64, nil, nil,
|
|
961
|
+
69, nil, 272, 273, 44, nil, 255, nil, nil, nil,
|
|
962
|
+
nil, nil, 248, 82, nil, 251, 252, 65, nil, nil,
|
|
963
|
+
nil, 129, 177, nil, nil, nil, nil, nil, 49, nil,
|
|
964
|
+
nil, 284, nil, nil, nil, 24, 210, nil, 188, nil,
|
|
965
|
+
248, 249, nil, 287, nil, nil, 255, nil, nil, 254,
|
|
966
|
+
nil ]
|
|
308
967
|
|
|
309
968
|
racc_action_default = [
|
|
310
|
-
-5, -
|
|
311
|
-
-
|
|
312
|
-
-
|
|
313
|
-
-
|
|
314
|
-
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
-
|
|
320
|
-
-
|
|
321
|
-
|
|
322
|
-
-
|
|
323
|
-
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
-
|
|
327
|
-
-
|
|
969
|
+
-5, -105, -5, -5, -5, -5, -105, -105, -105, -31,
|
|
970
|
+
-105, -34, -105, -1, -2, -3, -4, -105, -105, -14,
|
|
971
|
+
-15, -105, -105, -21, -22, -32, -48, -49, -33, -105,
|
|
972
|
+
191, -105, -7, -11, -12, -88, -89, -91, -92, -96,
|
|
973
|
+
-97, -105, -13, -30, -30, -105, -20, -17, -34, -34,
|
|
974
|
+
-45, -56, -57, -105, -105, -10, -105, -105, -105, -30,
|
|
975
|
+
-30, -30, -105, -105, -105, -105, -105, -50, -105, -105,
|
|
976
|
+
-105, -19, -30, -30, -105, -44, -6, -105, -9, -90,
|
|
977
|
+
-105, -25, -27, -28, -29, -30, -30, -30, -30, -73,
|
|
978
|
+
-73, -73, -45, -105, -52, -26, -16, -18, -105, -105,
|
|
979
|
+
-35, -8, -98, -105, -105, -105, -105, -40, -82, -82,
|
|
980
|
+
-71, -72, -41, -42, -46, -105, -55, -23, -24, -36,
|
|
981
|
+
-37, -38, -39, -69, -82, -75, -82, -105, -105, -105,
|
|
982
|
+
-105, -70, -58, -105, -51, -105, -54, -82, -74, -76,
|
|
983
|
+
-105, -95, -105, -105, -105, -81, -61, -59, -60, -47,
|
|
984
|
+
-53, -68, -82, -105, -94, -105, -105, -105, -85, -86,
|
|
985
|
+
-87, -105, -105, -77, -93, -78, -79, -80, -105, -84,
|
|
986
|
+
-101, -105, -63, -67, -83, -43, -105, -66, -105, -100,
|
|
987
|
+
-105, -105, -62, -105, -65, -99, -103, -104, -64, -105,
|
|
988
|
+
-102 ]
|
|
328
989
|
|
|
329
990
|
racc_goto_table = [
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
991
|
+
94, 22, 32, 47, 126, 126, 25, 18, 145, 74,
|
|
992
|
+
179, 58, 68, 185, 46, 138, 55, 139, 123, 131,
|
|
993
|
+
54, 158, 159, 141, 42, 53, 116, 82, 83, 84,
|
|
994
|
+
107, 112, 113, 126, 169, 159, 154, 45, 71, 78,
|
|
995
|
+
98, 99, 28, 163, 92, 174, 159, 151, 136, 164,
|
|
996
|
+
96, 114, 132, 103, 104, 105, 106, 146, 172, 72,
|
|
997
|
+
73, 161, 101, 97, 89, 90, 91, 177, 150, 170,
|
|
998
|
+
175, 1, 184, 13, 14, 15, 16, 115, 176, 188,
|
|
999
|
+
140, 157 ]
|
|
339
1000
|
|
|
340
1001
|
racc_goto_check = [
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
1002
|
+
22, 14, 7, 13, 8, 8, 20, 10, 9, 23,
|
|
1003
|
+
40, 15, 15, 40, 14, 35, 7, 35, 34, 34,
|
|
1004
|
+
6, 38, 9, 8, 11, 20, 22, 15, 15, 15,
|
|
1005
|
+
24, 24, 24, 8, 38, 9, 8, 12, 14, 7,
|
|
1006
|
+
15, 15, 19, 35, 25, 38, 9, 34, 22, 8,
|
|
1007
|
+
13, 23, 26, 15, 15, 15, 15, 27, 33, 4,
|
|
1008
|
+
4, 28, 7, 14, 10, 10, 10, 33, 22, 29,
|
|
1009
|
+
30, 1, 33, 1, 1, 1, 1, 31, 32, 33,
|
|
1010
|
+
36, 37 ]
|
|
350
1011
|
|
|
351
1012
|
racc_goto_pointer = [
|
|
352
|
-
nil,
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
-
|
|
1013
|
+
nil, 71, nil, nil, 11, nil, -11, -15, -104, -122,
|
|
1014
|
+
0, 6, 16, -19, -7, -32, nil, nil, nil, 31,
|
|
1015
|
+
-4, nil, -67, -41, -59, -23, -62, -75, -85, -92,
|
|
1016
|
+
-100, -16, -93, -104, -90, -109, -47, -63, -123, nil,
|
|
1017
|
+
-165 ]
|
|
356
1018
|
|
|
357
1019
|
racc_goto_default = [
|
|
358
|
-
nil, nil, 2, 3, 4, 5, nil, nil,
|
|
359
|
-
nil, nil, nil,
|
|
360
|
-
|
|
361
|
-
nil,
|
|
1020
|
+
nil, nil, 2, 3, 4, 5, nil, nil, 33, 34,
|
|
1021
|
+
nil, nil, nil, nil, nil, nil, 59, 60, 61, 9,
|
|
1022
|
+
67, 11, 50, nil, nil, nil, nil, nil, nil, 111,
|
|
1023
|
+
nil, nil, nil, nil, nil, 125, nil, nil, nil, 39,
|
|
1024
|
+
nil ]
|
|
362
1025
|
|
|
363
1026
|
racc_reduce_table = [
|
|
364
1027
|
0, 0, :racc_error,
|
|
365
|
-
2,
|
|
366
|
-
2,
|
|
367
|
-
2,
|
|
368
|
-
2,
|
|
369
|
-
0,
|
|
370
|
-
5,
|
|
371
|
-
3,
|
|
372
|
-
3,
|
|
373
|
-
2,
|
|
374
|
-
1,
|
|
375
|
-
1,
|
|
376
|
-
1,
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
1,
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
3,
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
1,
|
|
386
|
-
1,
|
|
387
|
-
|
|
388
|
-
4,
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
2,
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
2,
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
4,
|
|
401
|
-
4,
|
|
402
|
-
4,
|
|
403
|
-
|
|
404
|
-
3,
|
|
405
|
-
3,
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
0,
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
1,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
1,
|
|
420
|
-
1,
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
1,
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
1,
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
2,
|
|
434
|
-
|
|
435
|
-
1,
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
2,
|
|
439
|
-
1,
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
4,
|
|
443
|
-
4,
|
|
444
|
-
4,
|
|
445
|
-
2,
|
|
446
|
-
0,
|
|
447
|
-
3,
|
|
448
|
-
2,
|
|
449
|
-
1,
|
|
450
|
-
1,
|
|
451
|
-
1,
|
|
452
|
-
|
|
453
|
-
1,
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
1028
|
+
2, 44, :_reduce_none,
|
|
1029
|
+
2, 44, :_reduce_none,
|
|
1030
|
+
2, 44, :_reduce_3,
|
|
1031
|
+
2, 44, :_reduce_none,
|
|
1032
|
+
0, 44, :_reduce_none,
|
|
1033
|
+
5, 45, :_reduce_6,
|
|
1034
|
+
3, 45, :_reduce_7,
|
|
1035
|
+
3, 49, :_reduce_8,
|
|
1036
|
+
2, 49, :_reduce_9,
|
|
1037
|
+
1, 49, :_reduce_10,
|
|
1038
|
+
1, 50, :_reduce_11,
|
|
1039
|
+
1, 50, :_reduce_12,
|
|
1040
|
+
3, 48, :_reduce_13,
|
|
1041
|
+
1, 53, :_reduce_14,
|
|
1042
|
+
1, 53, :_reduce_15,
|
|
1043
|
+
5, 46, :_reduce_16,
|
|
1044
|
+
3, 46, :_reduce_17,
|
|
1045
|
+
3, 55, :_reduce_18,
|
|
1046
|
+
2, 55, :_reduce_19,
|
|
1047
|
+
1, 55, :_reduce_20,
|
|
1048
|
+
1, 57, :_reduce_21,
|
|
1049
|
+
1, 57, :_reduce_22,
|
|
1050
|
+
4, 56, :_reduce_23,
|
|
1051
|
+
4, 56, :_reduce_24,
|
|
1052
|
+
3, 54, :_reduce_25,
|
|
1053
|
+
3, 54, :_reduce_26,
|
|
1054
|
+
2, 58, :_reduce_27,
|
|
1055
|
+
2, 58, :_reduce_28,
|
|
1056
|
+
2, 58, :_reduce_29,
|
|
1057
|
+
0, 58, :_reduce_30,
|
|
1058
|
+
1, 47, :_reduce_31,
|
|
1059
|
+
2, 47, :_reduce_32,
|
|
1060
|
+
2, 62, :_reduce_33,
|
|
1061
|
+
0, 62, :_reduce_34,
|
|
1062
|
+
5, 64, :_reduce_35,
|
|
1063
|
+
4, 60, :_reduce_36,
|
|
1064
|
+
4, 60, :_reduce_37,
|
|
1065
|
+
4, 61, :_reduce_38,
|
|
1066
|
+
4, 61, :_reduce_39,
|
|
1067
|
+
3, 59, :_reduce_40,
|
|
1068
|
+
3, 59, :_reduce_41,
|
|
1069
|
+
3, 59, :_reduce_42,
|
|
1070
|
+
8, 59, :_reduce_43,
|
|
1071
|
+
1, 66, :_reduce_44,
|
|
1072
|
+
0, 66, :_reduce_45,
|
|
1073
|
+
0, 69, :_reduce_none,
|
|
1074
|
+
2, 69, :_reduce_47,
|
|
1075
|
+
1, 63, :_reduce_48,
|
|
1076
|
+
1, 63, :_reduce_49,
|
|
1077
|
+
0, 68, :_reduce_none,
|
|
1078
|
+
3, 68, :_reduce_51,
|
|
1079
|
+
1, 68, :_reduce_52,
|
|
1080
|
+
3, 74, :_reduce_53,
|
|
1081
|
+
2, 74, :_reduce_54,
|
|
1082
|
+
1, 74, :_reduce_55,
|
|
1083
|
+
1, 65, :_reduce_56,
|
|
1084
|
+
1, 65, :_reduce_57,
|
|
1085
|
+
0, 70, :_reduce_none,
|
|
1086
|
+
1, 70, :_reduce_59,
|
|
1087
|
+
1, 70, :_reduce_60,
|
|
1088
|
+
0, 71, :_reduce_none,
|
|
1089
|
+
4, 71, :_reduce_62,
|
|
1090
|
+
2, 71, :_reduce_63,
|
|
1091
|
+
3, 75, :_reduce_64,
|
|
1092
|
+
2, 75, :_reduce_65,
|
|
1093
|
+
1, 75, :_reduce_66,
|
|
1094
|
+
1, 76, :_reduce_67,
|
|
1095
|
+
4, 72, :_reduce_68,
|
|
1096
|
+
2, 72, :_reduce_69,
|
|
1097
|
+
2, 72, :_reduce_70,
|
|
1098
|
+
1, 72, :_reduce_71,
|
|
1099
|
+
1, 67, :_reduce_none,
|
|
1100
|
+
0, 67, :_reduce_73,
|
|
1101
|
+
2, 77, :_reduce_74,
|
|
1102
|
+
1, 77, :_reduce_75,
|
|
1103
|
+
2, 77, :_reduce_76,
|
|
1104
|
+
4, 77, :_reduce_77,
|
|
1105
|
+
4, 77, :_reduce_78,
|
|
1106
|
+
4, 77, :_reduce_79,
|
|
1107
|
+
4, 78, :_reduce_80,
|
|
1108
|
+
2, 78, :_reduce_81,
|
|
1109
|
+
0, 78, :_reduce_none,
|
|
1110
|
+
3, 80, :_reduce_83,
|
|
1111
|
+
2, 80, :_reduce_84,
|
|
1112
|
+
1, 80, :_reduce_85,
|
|
1113
|
+
1, 81, :_reduce_86,
|
|
1114
|
+
1, 81, :_reduce_87,
|
|
1115
|
+
1, 52, :_reduce_88,
|
|
1116
|
+
1, 52, :_reduce_89,
|
|
1117
|
+
3, 52, :_reduce_90,
|
|
1118
|
+
1, 82, :_reduce_91,
|
|
1119
|
+
1, 82, :_reduce_92,
|
|
1120
|
+
3, 79, :_reduce_93,
|
|
1121
|
+
2, 79, :_reduce_94,
|
|
1122
|
+
1, 79, :_reduce_95,
|
|
1123
|
+
1, 51, :_reduce_96,
|
|
1124
|
+
1, 51, :_reduce_97,
|
|
1125
|
+
4, 51, :_reduce_98,
|
|
1126
|
+
3, 73, :_reduce_99,
|
|
1127
|
+
2, 73, :_reduce_100,
|
|
1128
|
+
0, 73, :_reduce_101,
|
|
1129
|
+
4, 83, :_reduce_102,
|
|
1130
|
+
2, 83, :_reduce_103,
|
|
1131
|
+
2, 83, :_reduce_104 ]
|
|
1132
|
+
|
|
1133
|
+
racc_reduce_n = 105
|
|
1134
|
+
|
|
1135
|
+
racc_shift_n = 191
|
|
468
1136
|
|
|
469
1137
|
racc_token_table = {
|
|
470
1138
|
false => 0,
|
|
@@ -474,43 +1142,44 @@ racc_token_table = {
|
|
|
474
1142
|
"{" => 4,
|
|
475
1143
|
"}" => 5,
|
|
476
1144
|
"," => 6,
|
|
477
|
-
:
|
|
1145
|
+
:SERVICE => 7,
|
|
478
1146
|
:STRING => 8,
|
|
479
|
-
:
|
|
480
|
-
:
|
|
481
|
-
:
|
|
482
|
-
:
|
|
483
|
-
:
|
|
484
|
-
:
|
|
485
|
-
:
|
|
486
|
-
:
|
|
487
|
-
:
|
|
488
|
-
:
|
|
489
|
-
:
|
|
490
|
-
:
|
|
491
|
-
:
|
|
492
|
-
:
|
|
493
|
-
:
|
|
494
|
-
:
|
|
495
|
-
:
|
|
496
|
-
:
|
|
497
|
-
:
|
|
498
|
-
:
|
|
499
|
-
:
|
|
500
|
-
:
|
|
501
|
-
:
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
:
|
|
507
|
-
:
|
|
508
|
-
:
|
|
509
|
-
|
|
510
|
-
:
|
|
511
|
-
:
|
|
512
|
-
|
|
513
|
-
|
|
1147
|
+
:NODE => 9,
|
|
1148
|
+
:REGEX => 10,
|
|
1149
|
+
:DO => 11,
|
|
1150
|
+
:END => 12,
|
|
1151
|
+
:POLICY => 13,
|
|
1152
|
+
:ALL => 14,
|
|
1153
|
+
:IPV4 => 15,
|
|
1154
|
+
:IPV6 => 16,
|
|
1155
|
+
:CLIENT => 17,
|
|
1156
|
+
:SERVER => 18,
|
|
1157
|
+
:LOG => 19,
|
|
1158
|
+
:ON => 20,
|
|
1159
|
+
:BLOCK => 21,
|
|
1160
|
+
:PASS => 22,
|
|
1161
|
+
:IN => 23,
|
|
1162
|
+
:OUT => 24,
|
|
1163
|
+
:INET => 25,
|
|
1164
|
+
:INET6 => 26,
|
|
1165
|
+
:PROTO => 27,
|
|
1166
|
+
:FROM => 28,
|
|
1167
|
+
:TO => 29,
|
|
1168
|
+
:ANY => 30,
|
|
1169
|
+
:SRV => 31,
|
|
1170
|
+
"(" => 32,
|
|
1171
|
+
")" => 33,
|
|
1172
|
+
:APT_MIRROR => 34,
|
|
1173
|
+
:PORT => 35,
|
|
1174
|
+
:VARIABLE => 36,
|
|
1175
|
+
:INTEGER => 37,
|
|
1176
|
+
":" => 38,
|
|
1177
|
+
:ADDRESS => 39,
|
|
1178
|
+
:AZURE_IP_RANGE => 40,
|
|
1179
|
+
:RDR_TO => 41,
|
|
1180
|
+
:NAT_TO => 42 }
|
|
1181
|
+
|
|
1182
|
+
racc_nt_base = 43
|
|
514
1183
|
|
|
515
1184
|
racc_use_result_var = true
|
|
516
1185
|
|
|
@@ -539,20 +1208,19 @@ Racc_token_to_s_table = [
|
|
|
539
1208
|
"\"{\"",
|
|
540
1209
|
"\"}\"",
|
|
541
1210
|
"\",\"",
|
|
542
|
-
"ADDRESS",
|
|
543
|
-
"STRING",
|
|
544
|
-
"VARIABLE",
|
|
545
1211
|
"SERVICE",
|
|
1212
|
+
"STRING",
|
|
546
1213
|
"NODE",
|
|
547
1214
|
"REGEX",
|
|
548
1215
|
"DO",
|
|
549
1216
|
"END",
|
|
550
1217
|
"POLICY",
|
|
551
|
-
"
|
|
1218
|
+
"ALL",
|
|
552
1219
|
"IPV4",
|
|
553
1220
|
"IPV6",
|
|
554
1221
|
"CLIENT",
|
|
555
1222
|
"SERVER",
|
|
1223
|
+
"LOG",
|
|
556
1224
|
"ON",
|
|
557
1225
|
"BLOCK",
|
|
558
1226
|
"PASS",
|
|
@@ -563,53 +1231,59 @@ Racc_token_to_s_table = [
|
|
|
563
1231
|
"PROTO",
|
|
564
1232
|
"FROM",
|
|
565
1233
|
"TO",
|
|
566
|
-
"ALL",
|
|
567
1234
|
"ANY",
|
|
568
1235
|
"SRV",
|
|
569
1236
|
"\"(\"",
|
|
570
1237
|
"\")\"",
|
|
571
1238
|
"APT_MIRROR",
|
|
572
1239
|
"PORT",
|
|
1240
|
+
"VARIABLE",
|
|
573
1241
|
"INTEGER",
|
|
574
1242
|
"\":\"",
|
|
1243
|
+
"ADDRESS",
|
|
1244
|
+
"AZURE_IP_RANGE",
|
|
575
1245
|
"RDR_TO",
|
|
576
1246
|
"NAT_TO",
|
|
577
1247
|
"$start",
|
|
578
1248
|
"target",
|
|
579
1249
|
"assignation",
|
|
580
1250
|
"node",
|
|
581
|
-
"
|
|
1251
|
+
"policies",
|
|
582
1252
|
"service",
|
|
583
1253
|
"variable_value_list",
|
|
584
1254
|
"variable_value",
|
|
1255
|
+
"host_list_item",
|
|
1256
|
+
"port",
|
|
585
1257
|
"service_name",
|
|
586
1258
|
"block",
|
|
587
1259
|
"node_name_list",
|
|
588
|
-
"
|
|
1260
|
+
"block_with_policies",
|
|
589
1261
|
"node_name",
|
|
590
1262
|
"rules",
|
|
591
1263
|
"pf_rule",
|
|
592
1264
|
"ipv4_block",
|
|
593
1265
|
"ipv6_block",
|
|
1266
|
+
"policy_list",
|
|
594
1267
|
"action",
|
|
1268
|
+
"policy",
|
|
1269
|
+
"direction",
|
|
1270
|
+
"log",
|
|
595
1271
|
"optional_hosts",
|
|
596
1272
|
"rule_direction",
|
|
597
|
-
"log",
|
|
598
1273
|
"on_interface",
|
|
599
1274
|
"rule_af",
|
|
600
1275
|
"protospec",
|
|
601
1276
|
"hosts",
|
|
602
1277
|
"filteropts",
|
|
603
1278
|
"direction_list",
|
|
604
|
-
"direction",
|
|
605
1279
|
"protocol_list",
|
|
606
1280
|
"protocol",
|
|
607
1281
|
"hosts_host",
|
|
608
1282
|
"hosts_port",
|
|
609
|
-
"host",
|
|
610
1283
|
"host_list",
|
|
611
1284
|
"port_list",
|
|
612
|
-
"
|
|
1285
|
+
"port_list_item",
|
|
1286
|
+
"host",
|
|
613
1287
|
"filteropt" ]
|
|
614
1288
|
Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
|
|
615
1289
|
|
|
@@ -625,7 +1299,7 @@ Racc_debug_parser = false
|
|
|
625
1299
|
|
|
626
1300
|
module_eval(<<'.,.,', 'parser.y', 4)
|
|
627
1301
|
def _reduce_3(val, _values, result)
|
|
628
|
-
@
|
|
1302
|
+
@default_policies = val[0]
|
|
629
1303
|
result
|
|
630
1304
|
end
|
|
631
1305
|
.,.,
|
|
@@ -671,28 +1345,28 @@ module_eval(<<'.,.,', 'parser.y', 13)
|
|
|
671
1345
|
|
|
672
1346
|
module_eval(<<'.,.,', 'parser.y', 15)
|
|
673
1347
|
def _reduce_11(val, _values, result)
|
|
674
|
-
result = val[0]
|
|
1348
|
+
result = val[0]
|
|
675
1349
|
result
|
|
676
1350
|
end
|
|
677
1351
|
.,.,
|
|
678
1352
|
|
|
679
1353
|
module_eval(<<'.,.,', 'parser.y', 16)
|
|
680
1354
|
def _reduce_12(val, _values, result)
|
|
681
|
-
result = val[0]
|
|
1355
|
+
result = val[0]
|
|
682
1356
|
result
|
|
683
1357
|
end
|
|
684
1358
|
.,.,
|
|
685
1359
|
|
|
686
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1360
|
+
module_eval(<<'.,.,', 'parser.y', 18)
|
|
687
1361
|
def _reduce_13(val, _values, result)
|
|
688
|
-
|
|
1362
|
+
@services[val[1]] = val[2]
|
|
689
1363
|
result
|
|
690
1364
|
end
|
|
691
1365
|
.,.,
|
|
692
1366
|
|
|
693
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1367
|
+
module_eval(<<'.,.,', 'parser.y', 20)
|
|
694
1368
|
def _reduce_14(val, _values, result)
|
|
695
|
-
|
|
1369
|
+
result = val[0][:value]
|
|
696
1370
|
result
|
|
697
1371
|
end
|
|
698
1372
|
.,.,
|
|
@@ -704,44 +1378,44 @@ module_eval(<<'.,.,', 'parser.y', 21)
|
|
|
704
1378
|
end
|
|
705
1379
|
.,.,
|
|
706
1380
|
|
|
707
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1381
|
+
module_eval(<<'.,.,', 'parser.y', 23)
|
|
708
1382
|
def _reduce_16(val, _values, result)
|
|
709
|
-
|
|
1383
|
+
val[2].each { |name| @nodes[name] = val[4]; @saved_policies[name] = @current_policies }
|
|
710
1384
|
result
|
|
711
1385
|
end
|
|
712
1386
|
.,.,
|
|
713
1387
|
|
|
714
1388
|
module_eval(<<'.,.,', 'parser.y', 24)
|
|
715
1389
|
def _reduce_17(val, _values, result)
|
|
716
|
-
|
|
1390
|
+
@nodes[val[1]] = val[2]; @saved_policies[val[1]] = @current_policies
|
|
717
1391
|
result
|
|
718
1392
|
end
|
|
719
1393
|
.,.,
|
|
720
1394
|
|
|
721
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1395
|
+
module_eval(<<'.,.,', 'parser.y', 26)
|
|
722
1396
|
def _reduce_18(val, _values, result)
|
|
723
|
-
|
|
1397
|
+
result = val[0] + [val[2]]
|
|
724
1398
|
result
|
|
725
1399
|
end
|
|
726
1400
|
.,.,
|
|
727
1401
|
|
|
728
1402
|
module_eval(<<'.,.,', 'parser.y', 27)
|
|
729
1403
|
def _reduce_19(val, _values, result)
|
|
730
|
-
result = val[0] + [val[
|
|
1404
|
+
result = val[0] + [val[1]]
|
|
731
1405
|
result
|
|
732
1406
|
end
|
|
733
1407
|
.,.,
|
|
734
1408
|
|
|
735
1409
|
module_eval(<<'.,.,', 'parser.y', 28)
|
|
736
1410
|
def _reduce_20(val, _values, result)
|
|
737
|
-
result = val[0]
|
|
1411
|
+
result = [val[0]]
|
|
738
1412
|
result
|
|
739
1413
|
end
|
|
740
1414
|
.,.,
|
|
741
1415
|
|
|
742
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1416
|
+
module_eval(<<'.,.,', 'parser.y', 30)
|
|
743
1417
|
def _reduce_21(val, _values, result)
|
|
744
|
-
result =
|
|
1418
|
+
result = val[0][:value]
|
|
745
1419
|
result
|
|
746
1420
|
end
|
|
747
1421
|
.,.,
|
|
@@ -753,44 +1427,44 @@ module_eval(<<'.,.,', 'parser.y', 31)
|
|
|
753
1427
|
end
|
|
754
1428
|
.,.,
|
|
755
1429
|
|
|
756
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1430
|
+
module_eval(<<'.,.,', 'parser.y', 33)
|
|
757
1431
|
def _reduce_23(val, _values, result)
|
|
758
|
-
|
|
1432
|
+
@current_policies = val[1]; result = val[2]
|
|
759
1433
|
result
|
|
760
1434
|
end
|
|
761
1435
|
.,.,
|
|
762
1436
|
|
|
763
1437
|
module_eval(<<'.,.,', 'parser.y', 34)
|
|
764
1438
|
def _reduce_24(val, _values, result)
|
|
765
|
-
@
|
|
1439
|
+
@current_policies = val[1]; result = val[2]
|
|
766
1440
|
result
|
|
767
1441
|
end
|
|
768
1442
|
.,.,
|
|
769
1443
|
|
|
770
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1444
|
+
module_eval(<<'.,.,', 'parser.y', 36)
|
|
771
1445
|
def _reduce_25(val, _values, result)
|
|
772
|
-
|
|
1446
|
+
result = val[1].freeze
|
|
773
1447
|
result
|
|
774
1448
|
end
|
|
775
1449
|
.,.,
|
|
776
1450
|
|
|
777
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1451
|
+
module_eval(<<'.,.,', 'parser.y', 37)
|
|
778
1452
|
def _reduce_26(val, _values, result)
|
|
779
|
-
|
|
1453
|
+
result = val[1].freeze
|
|
780
1454
|
result
|
|
781
1455
|
end
|
|
782
1456
|
.,.,
|
|
783
1457
|
|
|
784
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1458
|
+
module_eval(<<'.,.,', 'parser.y', 39)
|
|
785
1459
|
def _reduce_27(val, _values, result)
|
|
786
|
-
result = val[1]
|
|
1460
|
+
result = val[0] + val[1]
|
|
787
1461
|
result
|
|
788
1462
|
end
|
|
789
1463
|
.,.,
|
|
790
1464
|
|
|
791
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1465
|
+
module_eval(<<'.,.,', 'parser.y', 40)
|
|
792
1466
|
def _reduce_28(val, _values, result)
|
|
793
|
-
result = val[1]
|
|
1467
|
+
result = val[0] + val[1]
|
|
794
1468
|
result
|
|
795
1469
|
end
|
|
796
1470
|
.,.,
|
|
@@ -804,61 +1478,61 @@ module_eval(<<'.,.,', 'parser.y', 41)
|
|
|
804
1478
|
|
|
805
1479
|
module_eval(<<'.,.,', 'parser.y', 42)
|
|
806
1480
|
def _reduce_30(val, _values, result)
|
|
807
|
-
result =
|
|
1481
|
+
result = []
|
|
808
1482
|
result
|
|
809
1483
|
end
|
|
810
1484
|
.,.,
|
|
811
1485
|
|
|
812
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1486
|
+
module_eval(<<'.,.,', 'parser.y', 44)
|
|
813
1487
|
def _reduce_31(val, _values, result)
|
|
814
|
-
result = val[0]
|
|
1488
|
+
result = val[0]
|
|
815
1489
|
result
|
|
816
1490
|
end
|
|
817
1491
|
.,.,
|
|
818
1492
|
|
|
819
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1493
|
+
module_eval(<<'.,.,', 'parser.y', 45)
|
|
820
1494
|
def _reduce_32(val, _values, result)
|
|
821
|
-
result = []
|
|
1495
|
+
warn("#{val[0][:filename]}:#{val[0][:lineno]}:#{val[0][:position]}: deprecated policy syntax:\n\t#{val[0][:line]}\n\t#{' ' * val[0][:position]}^#{'~' * (val[0][:line].length - 1 - val[0][:position])}\n\tUse explicit 'in' and 'out' policies, with optional logging:\n\tpolicy #{val[1][:action]} in all\n\tpolicy #{val[1][:action]} out all") ; result = { in: { action: val[1][:action] }, out: { action: val[1][:action] } }
|
|
822
1496
|
result
|
|
823
1497
|
end
|
|
824
1498
|
.,.,
|
|
825
1499
|
|
|
826
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1500
|
+
module_eval(<<'.,.,', 'parser.y', 47)
|
|
827
1501
|
def _reduce_33(val, _values, result)
|
|
828
|
-
result = val[1][:
|
|
1502
|
+
result = val[1].merge(val[0][:dir] => val[0])
|
|
829
1503
|
result
|
|
830
1504
|
end
|
|
831
1505
|
.,.,
|
|
832
1506
|
|
|
833
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1507
|
+
module_eval(<<'.,.,', 'parser.y', 48)
|
|
834
1508
|
def _reduce_34(val, _values, result)
|
|
835
|
-
result =
|
|
1509
|
+
result = {}
|
|
836
1510
|
result
|
|
837
1511
|
end
|
|
838
1512
|
.,.,
|
|
839
1513
|
|
|
840
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1514
|
+
module_eval(<<'.,.,', 'parser.y', 50)
|
|
841
1515
|
def _reduce_35(val, _values, result)
|
|
842
|
-
result =
|
|
1516
|
+
result = { action: val[1][:action], dir: val[2], log: val[3].any? }
|
|
843
1517
|
result
|
|
844
1518
|
end
|
|
845
1519
|
.,.,
|
|
846
1520
|
|
|
847
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1521
|
+
module_eval(<<'.,.,', 'parser.y', 52)
|
|
848
1522
|
def _reduce_36(val, _values, result)
|
|
849
1523
|
result = val[2].reject { |x| x[:af] == :inet6 }.map { |x| x[:af] = :inet ; x }
|
|
850
1524
|
result
|
|
851
1525
|
end
|
|
852
1526
|
.,.,
|
|
853
1527
|
|
|
854
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1528
|
+
module_eval(<<'.,.,', 'parser.y', 53)
|
|
855
1529
|
def _reduce_37(val, _values, result)
|
|
856
|
-
result = val[2].reject { |x| x[:af] == :
|
|
1530
|
+
result = val[2].reject { |x| x[:af] == :inet6 }.map { |x| x[:af] = :inet ; x }
|
|
857
1531
|
result
|
|
858
1532
|
end
|
|
859
1533
|
.,.,
|
|
860
1534
|
|
|
861
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1535
|
+
module_eval(<<'.,.,', 'parser.y', 55)
|
|
862
1536
|
def _reduce_38(val, _values, result)
|
|
863
1537
|
result = val[2].reject { |x| x[:af] == :inet }.map { |x| x[:af] = :inet6 ; x }
|
|
864
1538
|
result
|
|
@@ -867,6 +1541,13 @@ module_eval(<<'.,.,', 'parser.y', 53)
|
|
|
867
1541
|
|
|
868
1542
|
module_eval(<<'.,.,', 'parser.y', 56)
|
|
869
1543
|
def _reduce_39(val, _values, result)
|
|
1544
|
+
result = val[2].reject { |x| x[:af] == :inet }.map { |x| x[:af] = :inet6 ; x }
|
|
1545
|
+
result
|
|
1546
|
+
end
|
|
1547
|
+
.,.,
|
|
1548
|
+
|
|
1549
|
+
module_eval(<<'.,.,', 'parser.y', 59)
|
|
1550
|
+
def _reduce_40(val, _values, result)
|
|
870
1551
|
begin
|
|
871
1552
|
result = constraint_service_to_hosts(val[1], val[2])
|
|
872
1553
|
rescue KeyError
|
|
@@ -877,8 +1558,8 @@ module_eval(<<'.,.,', 'parser.y', 56)
|
|
|
877
1558
|
end
|
|
878
1559
|
.,.,
|
|
879
1560
|
|
|
880
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
881
|
-
def
|
|
1561
|
+
module_eval(<<'.,.,', 'parser.y', 66)
|
|
1562
|
+
def _reduce_41(val, _values, result)
|
|
882
1563
|
begin
|
|
883
1564
|
raise "service #{val[1]} cannot be used as client" if @services.fetch(val[1]).map { |x| x[:dir] }.compact.any?
|
|
884
1565
|
result = constraint_service_to_hosts(val[1], val[2]).map { |item| item.merge(dir: :out) }
|
|
@@ -890,8 +1571,8 @@ module_eval(<<'.,.,', 'parser.y', 63)
|
|
|
890
1571
|
end
|
|
891
1572
|
.,.,
|
|
892
1573
|
|
|
893
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
894
|
-
def
|
|
1574
|
+
module_eval(<<'.,.,', 'parser.y', 74)
|
|
1575
|
+
def _reduce_42(val, _values, result)
|
|
895
1576
|
begin
|
|
896
1577
|
raise "service #{val[1]} cannot be used as server" if @services.fetch(val[1]).map { |x| x[:dir] }.compact.any?
|
|
897
1578
|
result = constraint_service_to_hosts(val[1], val[2]).map { |item| item.merge(dir: :in) }
|
|
@@ -903,245 +1584,248 @@ module_eval(<<'.,.,', 'parser.y', 71)
|
|
|
903
1584
|
end
|
|
904
1585
|
.,.,
|
|
905
1586
|
|
|
906
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
907
|
-
def
|
|
1587
|
+
module_eval(<<'.,.,', 'parser.y', 81)
|
|
1588
|
+
def _reduce_43(val, _values, result)
|
|
908
1589
|
result = [val.compact.inject(:merge)]
|
|
909
1590
|
result
|
|
910
1591
|
end
|
|
911
1592
|
.,.,
|
|
912
1593
|
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
1594
|
+
module_eval(<<'.,.,', 'parser.y', 83)
|
|
1595
|
+
def _reduce_44(val, _values, result)
|
|
1596
|
+
result = { log: true }
|
|
1597
|
+
result
|
|
1598
|
+
end
|
|
1599
|
+
.,.,
|
|
918
1600
|
|
|
919
1601
|
module_eval(<<'.,.,', 'parser.y', 84)
|
|
920
|
-
def
|
|
921
|
-
result = {
|
|
1602
|
+
def _reduce_45(val, _values, result)
|
|
1603
|
+
result = {}
|
|
922
1604
|
result
|
|
923
1605
|
end
|
|
924
1606
|
.,.,
|
|
925
1607
|
|
|
926
|
-
|
|
1608
|
+
# reduce 46 omitted
|
|
1609
|
+
|
|
1610
|
+
module_eval(<<'.,.,', 'parser.y', 87)
|
|
927
1611
|
def _reduce_47(val, _values, result)
|
|
928
|
-
result = {
|
|
1612
|
+
result = { on: val[1][:value] }
|
|
929
1613
|
result
|
|
930
1614
|
end
|
|
931
1615
|
.,.,
|
|
932
1616
|
|
|
933
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1617
|
+
module_eval(<<'.,.,', 'parser.y', 89)
|
|
934
1618
|
def _reduce_48(val, _values, result)
|
|
935
|
-
result = { action: :
|
|
1619
|
+
result = { action: :block }
|
|
936
1620
|
result
|
|
937
1621
|
end
|
|
938
1622
|
.,.,
|
|
939
1623
|
|
|
940
|
-
# reduce 49 omitted
|
|
941
|
-
|
|
942
1624
|
module_eval(<<'.,.,', 'parser.y', 90)
|
|
943
|
-
def
|
|
944
|
-
result = {
|
|
1625
|
+
def _reduce_49(val, _values, result)
|
|
1626
|
+
result = { action: :pass }
|
|
945
1627
|
result
|
|
946
1628
|
end
|
|
947
1629
|
.,.,
|
|
948
1630
|
|
|
949
|
-
|
|
1631
|
+
# reduce 50 omitted
|
|
1632
|
+
|
|
1633
|
+
module_eval(<<'.,.,', 'parser.y', 93)
|
|
950
1634
|
def _reduce_51(val, _values, result)
|
|
951
|
-
result = { dir: val[
|
|
1635
|
+
result = { dir: val[1] }
|
|
952
1636
|
result
|
|
953
1637
|
end
|
|
954
1638
|
.,.,
|
|
955
1639
|
|
|
956
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1640
|
+
module_eval(<<'.,.,', 'parser.y', 94)
|
|
957
1641
|
def _reduce_52(val, _values, result)
|
|
958
|
-
result = val[0]
|
|
1642
|
+
result = { dir: val[0] }
|
|
959
1643
|
result
|
|
960
1644
|
end
|
|
961
1645
|
.,.,
|
|
962
1646
|
|
|
963
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1647
|
+
module_eval(<<'.,.,', 'parser.y', 96)
|
|
964
1648
|
def _reduce_53(val, _values, result)
|
|
965
|
-
result = val[0] + [val[
|
|
1649
|
+
result = val[0] + [val[2]]
|
|
966
1650
|
result
|
|
967
1651
|
end
|
|
968
1652
|
.,.,
|
|
969
1653
|
|
|
970
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1654
|
+
module_eval(<<'.,.,', 'parser.y', 97)
|
|
971
1655
|
def _reduce_54(val, _values, result)
|
|
972
|
-
result =
|
|
1656
|
+
result = val[0] + [val[1]]
|
|
973
1657
|
result
|
|
974
1658
|
end
|
|
975
1659
|
.,.,
|
|
976
1660
|
|
|
977
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1661
|
+
module_eval(<<'.,.,', 'parser.y', 98)
|
|
978
1662
|
def _reduce_55(val, _values, result)
|
|
979
|
-
result =
|
|
1663
|
+
result = [val[0]]
|
|
980
1664
|
result
|
|
981
1665
|
end
|
|
982
1666
|
.,.,
|
|
983
1667
|
|
|
984
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1668
|
+
module_eval(<<'.,.,', 'parser.y', 100)
|
|
985
1669
|
def _reduce_56(val, _values, result)
|
|
986
|
-
result = :
|
|
1670
|
+
result = :in
|
|
987
1671
|
result
|
|
988
1672
|
end
|
|
989
1673
|
.,.,
|
|
990
1674
|
|
|
991
|
-
# reduce 57 omitted
|
|
992
|
-
|
|
993
1675
|
module_eval(<<'.,.,', 'parser.y', 101)
|
|
994
|
-
def
|
|
995
|
-
result =
|
|
1676
|
+
def _reduce_57(val, _values, result)
|
|
1677
|
+
result = :out
|
|
996
1678
|
result
|
|
997
1679
|
end
|
|
998
1680
|
.,.,
|
|
999
1681
|
|
|
1000
|
-
|
|
1682
|
+
# reduce 58 omitted
|
|
1683
|
+
|
|
1684
|
+
module_eval(<<'.,.,', 'parser.y', 104)
|
|
1001
1685
|
def _reduce_59(val, _values, result)
|
|
1002
|
-
result = { af: :
|
|
1686
|
+
result = { af: :inet }
|
|
1003
1687
|
result
|
|
1004
1688
|
end
|
|
1005
1689
|
.,.,
|
|
1006
1690
|
|
|
1007
|
-
# reduce 60 omitted
|
|
1008
|
-
|
|
1009
1691
|
module_eval(<<'.,.,', 'parser.y', 105)
|
|
1010
|
-
def
|
|
1011
|
-
result = {
|
|
1692
|
+
def _reduce_60(val, _values, result)
|
|
1693
|
+
result = { af: :inet6 }
|
|
1012
1694
|
result
|
|
1013
1695
|
end
|
|
1014
1696
|
.,.,
|
|
1015
1697
|
|
|
1016
|
-
|
|
1698
|
+
# reduce 61 omitted
|
|
1699
|
+
|
|
1700
|
+
module_eval(<<'.,.,', 'parser.y', 108)
|
|
1017
1701
|
def _reduce_62(val, _values, result)
|
|
1018
|
-
result = { proto: val[
|
|
1702
|
+
result = { proto: val[2] }
|
|
1019
1703
|
result
|
|
1020
1704
|
end
|
|
1021
1705
|
.,.,
|
|
1022
1706
|
|
|
1023
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1707
|
+
module_eval(<<'.,.,', 'parser.y', 109)
|
|
1024
1708
|
def _reduce_63(val, _values, result)
|
|
1025
|
-
result =
|
|
1709
|
+
result = { proto: val[1] }
|
|
1026
1710
|
result
|
|
1027
1711
|
end
|
|
1028
1712
|
.,.,
|
|
1029
1713
|
|
|
1030
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1714
|
+
module_eval(<<'.,.,', 'parser.y', 111)
|
|
1031
1715
|
def _reduce_64(val, _values, result)
|
|
1032
|
-
result = val[0] + [val[
|
|
1716
|
+
result = val[0] + [val[2]]
|
|
1033
1717
|
result
|
|
1034
1718
|
end
|
|
1035
1719
|
.,.,
|
|
1036
1720
|
|
|
1037
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1721
|
+
module_eval(<<'.,.,', 'parser.y', 112)
|
|
1038
1722
|
def _reduce_65(val, _values, result)
|
|
1039
|
-
result =
|
|
1723
|
+
result = val[0] + [val[1]]
|
|
1040
1724
|
result
|
|
1041
1725
|
end
|
|
1042
1726
|
.,.,
|
|
1043
1727
|
|
|
1044
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1728
|
+
module_eval(<<'.,.,', 'parser.y', 113)
|
|
1045
1729
|
def _reduce_66(val, _values, result)
|
|
1046
|
-
result = val[0]
|
|
1730
|
+
result = [val[0]]
|
|
1047
1731
|
result
|
|
1048
1732
|
end
|
|
1049
1733
|
.,.,
|
|
1050
1734
|
|
|
1051
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1735
|
+
module_eval(<<'.,.,', 'parser.y', 115)
|
|
1052
1736
|
def _reduce_67(val, _values, result)
|
|
1053
|
-
result =
|
|
1737
|
+
result = val[0][:value].to_sym
|
|
1054
1738
|
result
|
|
1055
1739
|
end
|
|
1056
1740
|
.,.,
|
|
1057
1741
|
|
|
1058
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1742
|
+
module_eval(<<'.,.,', 'parser.y', 117)
|
|
1059
1743
|
def _reduce_68(val, _values, result)
|
|
1060
|
-
result = { from: val[1] }
|
|
1744
|
+
result = { from: val[1], to: val[3] }
|
|
1061
1745
|
result
|
|
1062
1746
|
end
|
|
1063
1747
|
.,.,
|
|
1064
1748
|
|
|
1065
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1749
|
+
module_eval(<<'.,.,', 'parser.y', 118)
|
|
1066
1750
|
def _reduce_69(val, _values, result)
|
|
1067
|
-
result = {
|
|
1751
|
+
result = { from: val[1] }
|
|
1068
1752
|
result
|
|
1069
1753
|
end
|
|
1070
1754
|
.,.,
|
|
1071
1755
|
|
|
1072
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1756
|
+
module_eval(<<'.,.,', 'parser.y', 119)
|
|
1073
1757
|
def _reduce_70(val, _values, result)
|
|
1074
|
-
result = {}
|
|
1758
|
+
result = { to: val[1] }
|
|
1075
1759
|
result
|
|
1076
1760
|
end
|
|
1077
1761
|
.,.,
|
|
1078
1762
|
|
|
1079
|
-
# reduce 71 omitted
|
|
1080
|
-
|
|
1081
1763
|
module_eval(<<'.,.,', 'parser.y', 120)
|
|
1082
|
-
def
|
|
1764
|
+
def _reduce_71(val, _values, result)
|
|
1083
1765
|
result = {}
|
|
1084
1766
|
result
|
|
1085
1767
|
end
|
|
1086
1768
|
.,.,
|
|
1087
1769
|
|
|
1088
|
-
|
|
1770
|
+
# reduce 72 omitted
|
|
1771
|
+
|
|
1772
|
+
module_eval(<<'.,.,', 'parser.y', 123)
|
|
1089
1773
|
def _reduce_73(val, _values, result)
|
|
1090
|
-
result =
|
|
1774
|
+
result = {}
|
|
1091
1775
|
result
|
|
1092
1776
|
end
|
|
1093
1777
|
.,.,
|
|
1094
1778
|
|
|
1095
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1779
|
+
module_eval(<<'.,.,', 'parser.y', 125)
|
|
1096
1780
|
def _reduce_74(val, _values, result)
|
|
1097
|
-
result = [{ host:
|
|
1781
|
+
result = [{ host: nil, port: val[1] }]
|
|
1098
1782
|
result
|
|
1099
1783
|
end
|
|
1100
1784
|
.,.,
|
|
1101
1785
|
|
|
1102
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1786
|
+
module_eval(<<'.,.,', 'parser.y', 126)
|
|
1103
1787
|
def _reduce_75(val, _values, result)
|
|
1104
1788
|
result = [{ host: nil, port: val[0] }]
|
|
1105
1789
|
result
|
|
1106
1790
|
end
|
|
1107
1791
|
.,.,
|
|
1108
1792
|
|
|
1109
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1793
|
+
module_eval(<<'.,.,', 'parser.y', 127)
|
|
1110
1794
|
def _reduce_76(val, _values, result)
|
|
1111
|
-
result = [{ host: val[
|
|
1795
|
+
result = [{ host: val[0], port: val[1] }]
|
|
1112
1796
|
result
|
|
1113
1797
|
end
|
|
1114
1798
|
.,.,
|
|
1115
1799
|
|
|
1116
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1800
|
+
module_eval(<<'.,.,', 'parser.y', 128)
|
|
1117
1801
|
def _reduce_77(val, _values, result)
|
|
1118
|
-
result = [{ host:
|
|
1802
|
+
result = [{ host: val[1], port: val[3] }]
|
|
1119
1803
|
result
|
|
1120
1804
|
end
|
|
1121
1805
|
.,.,
|
|
1122
1806
|
|
|
1123
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1807
|
+
module_eval(<<'.,.,', 'parser.y', 129)
|
|
1124
1808
|
def _reduce_78(val, _values, result)
|
|
1125
1809
|
result = Resolver.instance.resolv_srv(val[2][:value])
|
|
1126
1810
|
result
|
|
1127
1811
|
end
|
|
1128
1812
|
.,.,
|
|
1129
1813
|
|
|
1130
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1814
|
+
module_eval(<<'.,.,', 'parser.y', 130)
|
|
1131
1815
|
def _reduce_79(val, _values, result)
|
|
1132
1816
|
result = Resolver.instance.resolv_apt_mirror(val[2][:value])
|
|
1133
1817
|
result
|
|
1134
1818
|
end
|
|
1135
1819
|
.,.,
|
|
1136
1820
|
|
|
1137
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1821
|
+
module_eval(<<'.,.,', 'parser.y', 132)
|
|
1138
1822
|
def _reduce_80(val, _values, result)
|
|
1139
1823
|
result = val[2]
|
|
1140
1824
|
result
|
|
1141
1825
|
end
|
|
1142
1826
|
.,.,
|
|
1143
1827
|
|
|
1144
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1828
|
+
module_eval(<<'.,.,', 'parser.y', 133)
|
|
1145
1829
|
def _reduce_81(val, _values, result)
|
|
1146
1830
|
result = val[1]
|
|
1147
1831
|
result
|
|
@@ -1150,120 +1834,155 @@ module_eval(<<'.,.,', 'parser.y', 131)
|
|
|
1150
1834
|
|
|
1151
1835
|
# reduce 82 omitted
|
|
1152
1836
|
|
|
1153
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1837
|
+
module_eval(<<'.,.,', 'parser.y', 136)
|
|
1154
1838
|
def _reduce_83(val, _values, result)
|
|
1155
|
-
result = val[0] +
|
|
1839
|
+
result = val[0] + val[2]
|
|
1156
1840
|
result
|
|
1157
1841
|
end
|
|
1158
1842
|
.,.,
|
|
1159
1843
|
|
|
1160
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1844
|
+
module_eval(<<'.,.,', 'parser.y', 137)
|
|
1161
1845
|
def _reduce_84(val, _values, result)
|
|
1162
|
-
result = val[0] +
|
|
1846
|
+
result = val[0] + val[1]
|
|
1163
1847
|
result
|
|
1164
1848
|
end
|
|
1165
1849
|
.,.,
|
|
1166
1850
|
|
|
1167
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1851
|
+
module_eval(<<'.,.,', 'parser.y', 138)
|
|
1168
1852
|
def _reduce_85(val, _values, result)
|
|
1169
|
-
result =
|
|
1853
|
+
result = val[0]
|
|
1170
1854
|
result
|
|
1171
1855
|
end
|
|
1172
1856
|
.,.,
|
|
1173
1857
|
|
|
1174
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1858
|
+
module_eval(<<'.,.,', 'parser.y', 140)
|
|
1175
1859
|
def _reduce_86(val, _values, result)
|
|
1176
|
-
result = val[0]
|
|
1860
|
+
result = [val[0]]
|
|
1177
1861
|
result
|
|
1178
1862
|
end
|
|
1179
1863
|
.,.,
|
|
1180
1864
|
|
|
1181
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1865
|
+
module_eval(<<'.,.,', 'parser.y', 141)
|
|
1182
1866
|
def _reduce_87(val, _values, result)
|
|
1183
|
-
result = val[0][:value]
|
|
1867
|
+
result = @variables.fetch(val[0][:value])
|
|
1184
1868
|
result
|
|
1185
1869
|
end
|
|
1186
1870
|
.,.,
|
|
1187
1871
|
|
|
1188
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1872
|
+
module_eval(<<'.,.,', 'parser.y', 143)
|
|
1189
1873
|
def _reduce_88(val, _values, result)
|
|
1190
|
-
result =
|
|
1874
|
+
result = val[0][:value]
|
|
1191
1875
|
result
|
|
1192
1876
|
end
|
|
1193
1877
|
.,.,
|
|
1194
1878
|
|
|
1195
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1879
|
+
module_eval(<<'.,.,', 'parser.y', 144)
|
|
1196
1880
|
def _reduce_89(val, _values, result)
|
|
1197
1881
|
result = val[0][:value]
|
|
1198
1882
|
result
|
|
1199
1883
|
end
|
|
1200
1884
|
.,.,
|
|
1201
1885
|
|
|
1202
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1886
|
+
module_eval(<<'.,.,', 'parser.y', 145)
|
|
1203
1887
|
def _reduce_90(val, _values, result)
|
|
1204
|
-
result = val[0][:value]
|
|
1888
|
+
result = Range.new(val[0][:value], val[2][:value])
|
|
1205
1889
|
result
|
|
1206
1890
|
end
|
|
1207
1891
|
.,.,
|
|
1208
1892
|
|
|
1209
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1893
|
+
module_eval(<<'.,.,', 'parser.y', 147)
|
|
1210
1894
|
def _reduce_91(val, _values, result)
|
|
1211
|
-
result = val[0]
|
|
1895
|
+
result = val[0][:value]
|
|
1212
1896
|
result
|
|
1213
1897
|
end
|
|
1214
1898
|
.,.,
|
|
1215
1899
|
|
|
1216
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1900
|
+
module_eval(<<'.,.,', 'parser.y', 148)
|
|
1217
1901
|
def _reduce_92(val, _values, result)
|
|
1218
|
-
result = val[0]
|
|
1902
|
+
result = val[0][:value]
|
|
1219
1903
|
result
|
|
1220
1904
|
end
|
|
1221
1905
|
.,.,
|
|
1222
1906
|
|
|
1223
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1907
|
+
module_eval(<<'.,.,', 'parser.y', 150)
|
|
1224
1908
|
def _reduce_93(val, _values, result)
|
|
1225
|
-
result =
|
|
1909
|
+
result = val[0] + val[2]
|
|
1226
1910
|
result
|
|
1227
1911
|
end
|
|
1228
1912
|
.,.,
|
|
1229
1913
|
|
|
1230
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1914
|
+
module_eval(<<'.,.,', 'parser.y', 151)
|
|
1231
1915
|
def _reduce_94(val, _values, result)
|
|
1232
|
-
result = val[0]
|
|
1916
|
+
result = val[0] + val[1]
|
|
1233
1917
|
result
|
|
1234
1918
|
end
|
|
1235
1919
|
.,.,
|
|
1236
1920
|
|
|
1237
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1921
|
+
module_eval(<<'.,.,', 'parser.y', 152)
|
|
1238
1922
|
def _reduce_95(val, _values, result)
|
|
1239
|
-
result = val[0]
|
|
1923
|
+
result = val[0]
|
|
1240
1924
|
result
|
|
1241
1925
|
end
|
|
1242
1926
|
.,.,
|
|
1243
1927
|
|
|
1244
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1928
|
+
module_eval(<<'.,.,', 'parser.y', 154)
|
|
1245
1929
|
def _reduce_96(val, _values, result)
|
|
1246
|
-
result =
|
|
1930
|
+
result = [val[0]]
|
|
1247
1931
|
result
|
|
1248
1932
|
end
|
|
1249
1933
|
.,.,
|
|
1250
1934
|
|
|
1251
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1935
|
+
module_eval(<<'.,.,', 'parser.y', 155)
|
|
1252
1936
|
def _reduce_97(val, _values, result)
|
|
1253
|
-
result =
|
|
1937
|
+
result = @variables.fetch(val[0][:value])
|
|
1254
1938
|
result
|
|
1255
1939
|
end
|
|
1256
1940
|
.,.,
|
|
1257
1941
|
|
|
1258
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1942
|
+
module_eval(<<'.,.,', 'parser.y', 156)
|
|
1259
1943
|
def _reduce_98(val, _values, result)
|
|
1260
|
-
result =
|
|
1944
|
+
result = Resolver.instance.resolv_azure_ip_range(val[2][:value])
|
|
1261
1945
|
result
|
|
1262
1946
|
end
|
|
1263
1947
|
.,.,
|
|
1264
1948
|
|
|
1265
|
-
module_eval(<<'.,.,', 'parser.y',
|
|
1949
|
+
module_eval(<<'.,.,', 'parser.y', 158)
|
|
1266
1950
|
def _reduce_99(val, _values, result)
|
|
1951
|
+
result = val[0].merge(val[2])
|
|
1952
|
+
result
|
|
1953
|
+
end
|
|
1954
|
+
.,.,
|
|
1955
|
+
|
|
1956
|
+
module_eval(<<'.,.,', 'parser.y', 159)
|
|
1957
|
+
def _reduce_100(val, _values, result)
|
|
1958
|
+
result = val[0].merge(val[1])
|
|
1959
|
+
result
|
|
1960
|
+
end
|
|
1961
|
+
.,.,
|
|
1962
|
+
|
|
1963
|
+
module_eval(<<'.,.,', 'parser.y', 160)
|
|
1964
|
+
def _reduce_101(val, _values, result)
|
|
1965
|
+
result = {}
|
|
1966
|
+
result
|
|
1967
|
+
end
|
|
1968
|
+
.,.,
|
|
1969
|
+
|
|
1970
|
+
module_eval(<<'.,.,', 'parser.y', 162)
|
|
1971
|
+
def _reduce_102(val, _values, result)
|
|
1972
|
+
result = { rdr_to: [{ host: val[1][:value], port: val[3][:value] }] }
|
|
1973
|
+
result
|
|
1974
|
+
end
|
|
1975
|
+
.,.,
|
|
1976
|
+
|
|
1977
|
+
module_eval(<<'.,.,', 'parser.y', 163)
|
|
1978
|
+
def _reduce_103(val, _values, result)
|
|
1979
|
+
result = { rdr_to: [{ host: val[1][:value], port: nil }] }
|
|
1980
|
+
result
|
|
1981
|
+
end
|
|
1982
|
+
.,.,
|
|
1983
|
+
|
|
1984
|
+
module_eval(<<'.,.,', 'parser.y', 164)
|
|
1985
|
+
def _reduce_104(val, _values, result)
|
|
1267
1986
|
result = { nat_to: val[1][:value] }
|
|
1268
1987
|
result
|
|
1269
1988
|
end
|