Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
heyglen committed Apr 22, 2020
1 parent c9393b2 commit 70298d3
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Cisco syntax highlighting and completions for Sublime Text 3.

😎

[Documentation](http://network-tech.readthedocs.io/en/stable/)
[📘 Documentation](http://network-tech.readthedocs.io/en/stable/)

[SubReddit](https://www.reddit.com/r/SublimeNetworkTech/)

Expand Down
66 changes: 66 additions & 0 deletions cisco-asa.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ variables:
command_end: '(?:\s|{{comment}}|$)'
line_number: '^\s*\d+'
ip: '(?:(?:(?:[0-2]?\d?\d)\.){3}(?:[0-2]?\d?\d))'
group_policy_name: |
(?xi)
(?:
(?:"[^"]{1,64}")|
(?:'[^']{1,64}')|
(?:\S{1,64})
)
configure_terminal_ctx_words: |
(?xi)
\s*
Expand All @@ -39,6 +46,7 @@ variables:
(?:class-map)|
(?:crypto)|
(?:enable)|
(?:group-policy)|
(?:hostname)|
(?:http)|
(?:icmp)|
Expand Down Expand Up @@ -122,6 +130,15 @@ variables:
(?:tacacs\+)|
(?:radius)
)
vpn_tunnel_protocols: |
(?xi)
(?:
(?:ikev[1-2])|
(?:l2tp-ipsec)|
(?:webvpn)|
(?:IPsec)|
(?:ssl-client(?:less)?)
)
ikev1_transform_sets: |
(?xi)
(?:
Expand Down Expand Up @@ -511,6 +528,7 @@ contexts:
- include: reverse_path
- include: access_group
- include: object_group
- include: group_policy
- include: interface_mtu
- include: user_identity
- include: service_policy
Expand Down Expand Up @@ -929,6 +947,54 @@ contexts:
captures:
1: comment.line

group_policy:
- match: |
(?xi)
^\s*
(group-policy)\s+
({{group_policy_name}})\s+
(?:
(?:(internal)(?:\s+(from)\s+({{group_policy_name}}))?)|
(?:(external\s+server-group)\s+(\S+)\s+(password)\s+(\S{1,128}))
)
captures:
1: support.constant
2: string.unquoted
3: support.constant
4: support.constant
5: string.unquoted
6: support.constant
7: string.unquoted
8: support.constant
9: string.unquoted
- include: group_policy_attributes

group_policy_attributes:
- match: |
(?xi)
^\s*
(group-policy)\s+
({{group_policy_name}})\s+(attributes)
captures:
0: cisco.scope
1: variable.parameter
2: string.unquoted
3: support.constant
push:
- meta_content_scope: text.network.cisco.asa.group-policy-attributes
- include: group_policy_vpn_tunnel_protocol
- include: pop_on_configure_terminal_context
group_policy_vpn_tunnel_protocol:
- match: |
(?xi)
^\s*
(vpn-tunnel-protocol)\s+
({{vpn_tunnel_protocols}})
captures:
1: support.constant
2: entity.other.attribute-name
object_group:
- include: object_group_incomplete
- include: object_group_network
Expand Down
35 changes: 35 additions & 0 deletions cisco/asa/asa.group_policy.sublime-completions
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"scope": "text.network.cisco.asa.group-policy-attributes",
"completions": [
{
"trigger": "vpn-tunnel-protocol\tikev1",
"contents": "vpn-tunnel-protocol ${1:ikev1}"
},
{
"trigger": "vpn-tunnel-protocol\tikev2",
"contents": "vpn-tunnel-protocol ${1:ikev2}"
},
{
"trigger": "vpn-tunnel-protocol\tl2tp-ipsec",
"contents": "vpn-tunnel-protocol ${1:l2tp-ipsec}"
},
{
"trigger": "vpn-tunnel-protocol\twebvpn",
"contents": "vpn-tunnel-protocol ${1:webvpn}"
},
{
"trigger": "vpn-tunnel-protocol\tIPsec",
"contents": "vpn-tunnel-protocol ${1:IPsec}"
},
{
"trigger": "vpn-tunnel-protocol\tssl-client",
"contents": "vpn-tunnel-protocol ${1:ssl-client}"
},
{
"trigger": "vpn-tunnel-protocol\tssl-clientless",
"contents": "vpn-tunnel-protocol ${1:ssl-clientless}"
},

]
}

12 changes: 12 additions & 0 deletions cisco/asa/asa.sublime-completions
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
"trigger": "changeto\tcontext",
"contents": "changeto context ${1:CONTEXT_NAME}"
},
{
"trigger": "group-policy\tinternal",
"contents": "group-policy ${1:NAME} internal"
},
{
"trigger": "group-policy\tinternal from",
"contents": "group-policy ${1:NAME} internal from ${2:NAME}"
},
{
"trigger": "group-policy\tattributes",
"contents": "group-policy ${1:NAME} attributes\n\t"
},
]
}

3 changes: 2 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"2.34.0": "messages/2.34.0.md",
"2.35.0": "messages/2.35.0.md",
"2.36.0": "messages/2.36.0.md",
"2.37.0": "messages/2.37.0.md"
"2.37.0": "messages/2.37.0.md",
"2.38.0": "messages/2.38.0.md"
}
9 changes: 9 additions & 0 deletions messages/2.38.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [2.38.0] - 2020.04.22

## Added

* Cisco ASA

* Group Policy

* vpn-tunnel-protocol
8 changes: 6 additions & 2 deletions tests/syntax_test_cisco_asa.cisco-asa
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ object-group network NAME
group-object group_name
exit



object-group service NAME tcp-udp
description blah
port-object eq 42
Expand Down Expand Up @@ -231,6 +229,12 @@ nat (real,mapped) source static any any service real mapped net-to-net dns no-pr
nat (real,mapped) source static any any service real mapped net-to-net dns no-proxy-arp route-lookup inactive
nat (real,mapped) source static any any service real mapped net-to-net dns unidirectional inactive description whatever

group-policy NAME internal
group-policy NAME internal from NAME
group-policy NAME external server-group NAME password PASSWORD
group-policy NAME attributes
vpn-tunnel-protocol ikev1


mtu outside 1500
fragment chain 1 outside
Expand Down

0 comments on commit 70298d3

Please sign in to comment.