junoser 0.2.10 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/example/vsrx-12.1.x47.rb +166 -1
- data/lib/junoser/parser.rb +171 -6
- data/lib/junoser/ruler.rb +1 -0
- data/lib/junoser/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 681932944528ce0c17ed6a01d9630eccc3487353
|
4
|
+
data.tar.gz: b93ab704fafd87072e69b836131b48a892e584d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a9be3d00d639ae70468c6fefcf8d7f9d24aa4e1cb45e2203611bf4e1bc13d4cc76e55c0ad12f5e23d1618e5830da0a1497e9c3120117525fc15c32327a63c4c
|
7
|
+
data.tar.gz: 43bf75c835a850e9fcdc0bac537aeaa293d8d45450ee7bd5a0a5b94adf201a6c8a6d8b7e70c65f7dec1b885addfa404d6416ca6329997d079f0e855537b9f712
|
data/CHANGELOG.md
CHANGED
data/example/vsrx-12.1.x47.rb
CHANGED
@@ -16318,6 +16318,9 @@ rule(:juniper_forwarding_options) do
|
|
16318
16318
|
"accounting" (
|
16319
16319
|
juniper_packet_accounting_options
|
16320
16320
|
),
|
16321
|
+
"analyzer" (
|
16322
|
+
smpl_analyzer_type
|
16323
|
+
),
|
16321
16324
|
"port-mirroring" (
|
16322
16325
|
juniper_port_mirror_options
|
16323
16326
|
),
|
@@ -29620,7 +29623,8 @@ rule(:dynamic_tunnel_type) do
|
|
29620
29623
|
)
|
29621
29624
|
)
|
29622
29625
|
),
|
29623
|
-
"gre"
|
29626
|
+
"gre",
|
29627
|
+
"udp",
|
29624
29628
|
),
|
29625
29629
|
"destination-networks" (
|
29626
29630
|
network_type
|
@@ -38480,3 +38484,164 @@ rule(:juniper_protocols_sflow) do
|
|
38480
38484
|
)
|
38481
38485
|
)
|
38482
38486
|
end
|
38487
|
+
|
38488
|
+
rule(:smpl_analyzer_type) do
|
38489
|
+
arg.as(:arg) (
|
38490
|
+
c(
|
38491
|
+
"input" (
|
38492
|
+
smpl_analyzer_input_type
|
38493
|
+
),
|
38494
|
+
"output" (
|
38495
|
+
smpl_analyzer_output_type
|
38496
|
+
)
|
38497
|
+
)
|
38498
|
+
)
|
38499
|
+
end
|
38500
|
+
|
38501
|
+
rule(:smpl_analyzer_input_type) do
|
38502
|
+
c(
|
38503
|
+
"rate" arg,
|
38504
|
+
"maximum-packet-length" arg,
|
38505
|
+
"ingress" (
|
38506
|
+
smpl_analyzer_ingress_type
|
38507
|
+
),
|
38508
|
+
"egress" (
|
38509
|
+
smpl_analyzer_egress_type
|
38510
|
+
)
|
38511
|
+
)
|
38512
|
+
end
|
38513
|
+
|
38514
|
+
rule(:smpl_analyzer_egress_type) do
|
38515
|
+
c(
|
38516
|
+
"interface" (
|
38517
|
+
analyzer_egress_interface_type
|
38518
|
+
),
|
38519
|
+
"routing-instance" (
|
38520
|
+
analyzer_egress_routing_instance_type
|
38521
|
+
),
|
38522
|
+
"vlan" (
|
38523
|
+
analyzer_egress_vlan_type
|
38524
|
+
),
|
38525
|
+
"bridge-domain" (
|
38526
|
+
analyzer_egress_bridge_domain_type
|
38527
|
+
)
|
38528
|
+
)
|
38529
|
+
end
|
38530
|
+
|
38531
|
+
rule(:analyzer_egress_bridge_domain_type) do
|
38532
|
+
arg.as(:arg)
|
38533
|
+
end
|
38534
|
+
|
38535
|
+
rule(:analyzer_egress_interface_type) do
|
38536
|
+
("name" | "all").as(:arg)
|
38537
|
+
end
|
38538
|
+
|
38539
|
+
rule(:analyzer_egress_routing_instance_type) do
|
38540
|
+
arg.as(:arg) (
|
38541
|
+
c(
|
38542
|
+
"vlan" (
|
38543
|
+
analyzer_egress_vlan_type
|
38544
|
+
),
|
38545
|
+
"bridge-domain" (
|
38546
|
+
analyzer_egress_bridge_domain_type
|
38547
|
+
)
|
38548
|
+
)
|
38549
|
+
)
|
38550
|
+
end
|
38551
|
+
|
38552
|
+
rule(:analyzer_egress_vlan_type) do
|
38553
|
+
arg.as(:arg)
|
38554
|
+
end
|
38555
|
+
|
38556
|
+
rule(:smpl_analyzer_ingress_type) do
|
38557
|
+
c(
|
38558
|
+
"interface" (
|
38559
|
+
analyzer_ingress_interface_type
|
38560
|
+
),
|
38561
|
+
"routing-instance" (
|
38562
|
+
analyzer_ingress_routing_instance_type
|
38563
|
+
),
|
38564
|
+
"vlan" (
|
38565
|
+
analyzer_ingress_vlan_type
|
38566
|
+
),
|
38567
|
+
"bridge-domain" (
|
38568
|
+
analyzer_ingress_bridge_domain_type
|
38569
|
+
)
|
38570
|
+
)
|
38571
|
+
end
|
38572
|
+
|
38573
|
+
rule(:analyzer_ingress_bridge_domain_type) do
|
38574
|
+
arg.as(:arg)
|
38575
|
+
end
|
38576
|
+
|
38577
|
+
rule(:analyzer_ingress_interface_type) do
|
38578
|
+
("name" | "all").as(:arg)
|
38579
|
+
end
|
38580
|
+
|
38581
|
+
rule(:analyzer_ingress_routing_instance_type) do
|
38582
|
+
arg.as(:arg) (
|
38583
|
+
c(
|
38584
|
+
"vlan" (
|
38585
|
+
analyzer_ingress_vlan_type
|
38586
|
+
),
|
38587
|
+
"bridge-domain" (
|
38588
|
+
analyzer_ingress_bridge_domain_type
|
38589
|
+
)
|
38590
|
+
)
|
38591
|
+
)
|
38592
|
+
end
|
38593
|
+
|
38594
|
+
rule(:analyzer_ingress_vlan_type) do
|
38595
|
+
arg.as(:arg)
|
38596
|
+
end
|
38597
|
+
|
38598
|
+
rule(:smpl_analyzer_output_type) do
|
38599
|
+
c(
|
38600
|
+
c(
|
38601
|
+
"interface" (
|
38602
|
+
interface_name
|
38603
|
+
),
|
38604
|
+
"ip-address" (
|
38605
|
+
ipv4addr
|
38606
|
+
),
|
38607
|
+
"next-hop-group" arg,
|
38608
|
+
"routing-instance" (
|
38609
|
+
output_routing_instance_type
|
38610
|
+
),
|
38611
|
+
"vlan" (
|
38612
|
+
pm_rspan_vlan
|
38613
|
+
),
|
38614
|
+
"bridge-domain" (
|
38615
|
+
pm_rspan_bridge_domain
|
38616
|
+
)
|
38617
|
+
)
|
38618
|
+
)
|
38619
|
+
end
|
38620
|
+
|
38621
|
+
rule(:output_routing_instance_type) do
|
38622
|
+
arg.as(:arg) (
|
38623
|
+
c(
|
38624
|
+
"ip-address" (
|
38625
|
+
ipv4addr
|
38626
|
+
),
|
38627
|
+
"vlan" (
|
38628
|
+
pm_rspan_vlan
|
38629
|
+
),
|
38630
|
+
"bridge-domain" (
|
38631
|
+
pm_rspan_bridge_domain
|
38632
|
+
)
|
38633
|
+
)
|
38634
|
+
)
|
38635
|
+
end
|
38636
|
+
|
38637
|
+
rule(:pm_rspan_bridge_domain) do
|
38638
|
+
arg.as(:arg)
|
38639
|
+
end
|
38640
|
+
|
38641
|
+
rule(:pm_rspan_vlan) do
|
38642
|
+
arg.as(:arg) (
|
38643
|
+
c(
|
38644
|
+
"no-tag"
|
38645
|
+
)
|
38646
|
+
)
|
38647
|
+
end
|
data/lib/junoser/parser.rb
CHANGED
@@ -16023,7 +16023,7 @@ module Junoser
|
|
16023
16023
|
),
|
16024
16024
|
b(str("voip"),
|
16025
16025
|
c(
|
16026
|
-
a(str("interface"),
|
16026
|
+
a(str("interface"), arg | str("access-ports"),
|
16027
16027
|
c(
|
16028
16028
|
a(str("vlan"), arg),
|
16029
16029
|
a(str("forwarding-class"), arg)
|
@@ -16242,7 +16242,7 @@ module Junoser
|
|
16242
16242
|
end
|
16243
16243
|
|
16244
16244
|
rule(:analyzer_egress_interface_type) do
|
16245
|
-
(
|
16245
|
+
(arg | str("all")).as(:arg)
|
16246
16246
|
end
|
16247
16247
|
|
16248
16248
|
rule(:analyzer_ingress_type) do
|
@@ -16257,7 +16257,7 @@ module Junoser
|
|
16257
16257
|
end
|
16258
16258
|
|
16259
16259
|
rule(:analyzer_ingress_interface_type) do
|
16260
|
-
(
|
16260
|
+
(arg | str("all")).as(:arg)
|
16261
16261
|
end
|
16262
16262
|
|
16263
16263
|
rule(:analyzer_output_type) do
|
@@ -16324,6 +16324,9 @@ module Junoser
|
|
16324
16324
|
b(str("accounting"),
|
16325
16325
|
juniper_packet_accounting_options
|
16326
16326
|
),
|
16327
|
+
b(str("analyzer"),
|
16328
|
+
smpl_analyzer_type
|
16329
|
+
),
|
16327
16330
|
b(str("port-mirroring"),
|
16328
16331
|
juniper_port_mirror_options
|
16329
16332
|
),
|
@@ -22719,7 +22722,7 @@ module Junoser
|
|
22719
22722
|
a(str("ptopo-configuration-maximum-hold-time"), arg),
|
22720
22723
|
a(str("lldp-configuration-notification-interval"), arg),
|
22721
22724
|
str("netbios-snooping"),
|
22722
|
-
a(str("interface"),
|
22725
|
+
a(str("interface"), arg | str("all"),
|
22723
22726
|
c(
|
22724
22727
|
c(
|
22725
22728
|
str("disable")
|
@@ -22734,7 +22737,7 @@ module Junoser
|
|
22734
22737
|
str("disable")
|
22735
22738
|
),
|
22736
22739
|
a(str("fast-start"), arg),
|
22737
|
-
a(str("interface"),
|
22740
|
+
a(str("interface"), arg | str("all"),
|
22738
22741
|
c(
|
22739
22742
|
c(
|
22740
22743
|
str("disable")
|
@@ -29470,7 +29473,8 @@ module Junoser
|
|
29470
29473
|
)
|
29471
29474
|
)
|
29472
29475
|
),
|
29473
|
-
str("gre")
|
29476
|
+
str("gre"),
|
29477
|
+
str("udp"),
|
29474
29478
|
),
|
29475
29479
|
b(str("destination-networks"),
|
29476
29480
|
network_type
|
@@ -38275,5 +38279,166 @@ module Junoser
|
|
38275
38279
|
)
|
38276
38280
|
)
|
38277
38281
|
end
|
38282
|
+
|
38283
|
+
rule(:smpl_analyzer_type) do
|
38284
|
+
b(arg.as(:arg),
|
38285
|
+
c(
|
38286
|
+
b(str("input"),
|
38287
|
+
smpl_analyzer_input_type
|
38288
|
+
),
|
38289
|
+
b(str("output"),
|
38290
|
+
smpl_analyzer_output_type
|
38291
|
+
)
|
38292
|
+
)
|
38293
|
+
)
|
38294
|
+
end
|
38295
|
+
|
38296
|
+
rule(:smpl_analyzer_input_type) do
|
38297
|
+
c(
|
38298
|
+
a(str("rate"), arg),
|
38299
|
+
a(str("maximum-packet-length"), arg),
|
38300
|
+
b(str("ingress"),
|
38301
|
+
smpl_analyzer_ingress_type
|
38302
|
+
),
|
38303
|
+
b(str("egress"),
|
38304
|
+
smpl_analyzer_egress_type
|
38305
|
+
)
|
38306
|
+
)
|
38307
|
+
end
|
38308
|
+
|
38309
|
+
rule(:smpl_analyzer_egress_type) do
|
38310
|
+
c(
|
38311
|
+
b(str("interface"),
|
38312
|
+
analyzer_egress_interface_type
|
38313
|
+
),
|
38314
|
+
b(str("routing-instance"),
|
38315
|
+
analyzer_egress_routing_instance_type
|
38316
|
+
),
|
38317
|
+
b(str("vlan"),
|
38318
|
+
analyzer_egress_vlan_type
|
38319
|
+
),
|
38320
|
+
b(str("bridge-domain"),
|
38321
|
+
analyzer_egress_bridge_domain_type
|
38322
|
+
)
|
38323
|
+
)
|
38324
|
+
end
|
38325
|
+
|
38326
|
+
rule(:analyzer_egress_bridge_domain_type) do
|
38327
|
+
arg.as(:arg)
|
38328
|
+
end
|
38329
|
+
|
38330
|
+
rule(:analyzer_egress_interface_type) do
|
38331
|
+
(arg | str("all")).as(:arg)
|
38332
|
+
end
|
38333
|
+
|
38334
|
+
rule(:analyzer_egress_routing_instance_type) do
|
38335
|
+
b(arg.as(:arg),
|
38336
|
+
c(
|
38337
|
+
b(str("vlan"),
|
38338
|
+
analyzer_egress_vlan_type
|
38339
|
+
),
|
38340
|
+
b(str("bridge-domain"),
|
38341
|
+
analyzer_egress_bridge_domain_type
|
38342
|
+
)
|
38343
|
+
)
|
38344
|
+
)
|
38345
|
+
end
|
38346
|
+
|
38347
|
+
rule(:analyzer_egress_vlan_type) do
|
38348
|
+
arg.as(:arg)
|
38349
|
+
end
|
38350
|
+
|
38351
|
+
rule(:smpl_analyzer_ingress_type) do
|
38352
|
+
c(
|
38353
|
+
b(str("interface"),
|
38354
|
+
analyzer_ingress_interface_type
|
38355
|
+
),
|
38356
|
+
b(str("routing-instance"),
|
38357
|
+
analyzer_ingress_routing_instance_type
|
38358
|
+
),
|
38359
|
+
b(str("vlan"),
|
38360
|
+
analyzer_ingress_vlan_type
|
38361
|
+
),
|
38362
|
+
b(str("bridge-domain"),
|
38363
|
+
analyzer_ingress_bridge_domain_type
|
38364
|
+
)
|
38365
|
+
)
|
38366
|
+
end
|
38367
|
+
|
38368
|
+
rule(:analyzer_ingress_bridge_domain_type) do
|
38369
|
+
arg.as(:arg)
|
38370
|
+
end
|
38371
|
+
|
38372
|
+
rule(:analyzer_ingress_interface_type) do
|
38373
|
+
(arg | str("all")).as(:arg)
|
38374
|
+
end
|
38375
|
+
|
38376
|
+
rule(:analyzer_ingress_routing_instance_type) do
|
38377
|
+
b(arg.as(:arg),
|
38378
|
+
c(
|
38379
|
+
b(str("vlan"),
|
38380
|
+
analyzer_ingress_vlan_type
|
38381
|
+
),
|
38382
|
+
b(str("bridge-domain"),
|
38383
|
+
analyzer_ingress_bridge_domain_type
|
38384
|
+
)
|
38385
|
+
)
|
38386
|
+
)
|
38387
|
+
end
|
38388
|
+
|
38389
|
+
rule(:analyzer_ingress_vlan_type) do
|
38390
|
+
arg.as(:arg)
|
38391
|
+
end
|
38392
|
+
|
38393
|
+
rule(:smpl_analyzer_output_type) do
|
38394
|
+
c(
|
38395
|
+
c(
|
38396
|
+
b(str("interface"),
|
38397
|
+
interface_name
|
38398
|
+
),
|
38399
|
+
b(str("ip-address"),
|
38400
|
+
ipv4addr
|
38401
|
+
),
|
38402
|
+
a(str("next-hop-group"), arg),
|
38403
|
+
b(str("routing-instance"),
|
38404
|
+
output_routing_instance_type
|
38405
|
+
),
|
38406
|
+
b(str("vlan"),
|
38407
|
+
pm_rspan_vlan
|
38408
|
+
),
|
38409
|
+
b(str("bridge-domain"),
|
38410
|
+
pm_rspan_bridge_domain
|
38411
|
+
)
|
38412
|
+
)
|
38413
|
+
)
|
38414
|
+
end
|
38415
|
+
|
38416
|
+
rule(:output_routing_instance_type) do
|
38417
|
+
b(arg.as(:arg),
|
38418
|
+
c(
|
38419
|
+
b(str("ip-address"),
|
38420
|
+
ipv4addr
|
38421
|
+
),
|
38422
|
+
b(str("vlan"),
|
38423
|
+
pm_rspan_vlan
|
38424
|
+
),
|
38425
|
+
b(str("bridge-domain"),
|
38426
|
+
pm_rspan_bridge_domain
|
38427
|
+
)
|
38428
|
+
)
|
38429
|
+
)
|
38430
|
+
end
|
38431
|
+
|
38432
|
+
rule(:pm_rspan_bridge_domain) do
|
38433
|
+
arg.as(:arg)
|
38434
|
+
end
|
38435
|
+
|
38436
|
+
rule(:pm_rspan_vlan) do
|
38437
|
+
b(arg.as(:arg),
|
38438
|
+
c(
|
38439
|
+
str("no-tag")
|
38440
|
+
)
|
38441
|
+
)
|
38442
|
+
end
|
38278
38443
|
end
|
38279
38444
|
end
|
data/lib/junoser/ruler.rb
CHANGED
@@ -48,6 +48,7 @@ module Junoser
|
|
48
48
|
str.gsub! '"minus-literal"', '"-"'
|
49
49
|
|
50
50
|
str.gsub!(/\((.*) \| "name"\)/) { "(#$1 | arg)" }
|
51
|
+
str.gsub!(/\("name" \| (.*)\)/) { "(arg | #$1)" }
|
51
52
|
str.gsub! '"vlan" ("id-name" | "all")', '"vlan" ("all" | arg)'
|
52
53
|
str.gsub! '"vlan" ("all" | "vlan-name")', '"vlan" ("all" | arg)'
|
53
54
|
str.gsub!(/("ssh-\S+") arg/) { "#$1 (quote | arg)" }
|
data/lib/junoser/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: junoser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shintaro Kojima
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parslet
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
143
|
rubyforge_project:
|
144
|
-
rubygems_version: 2.6.
|
144
|
+
rubygems_version: 2.6.13
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: PEG parser for JUNOS configuration.
|