1
0
mirror of https://github.com/HorlogeSkynet/Nftables synced 2025-05-01 04:00:16 +02:00

Applies string.unquoted.{limit,quota}-unit.nftables scope to units

This commit is contained in:
Samuel FORESTIER 2023-06-20 19:01:55 +02:00
parent 3d3ba0c6c2
commit ec6c9479fe
3 changed files with 12 additions and 1 deletions

@ -6,9 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- `string.unquoted.{limit,quota}-unit.nftables` scopes for bytes and packets limit/quota units
- nftables 1.0.7 features :
* `destroy` script command
### Fixed
- `mbytes` pattern matching
## [v2.1.0] - 2022-10-27
### Fixed
- CHANGELOG v2.0.1 anchor link

@ -843,7 +843,8 @@ contexts:
push: _expect-numeric
- match: ({{time_units}})
scope: string.unquoted.time-string.nftables
- match: \b([bk]?bytes|packets)\b
- match: \b([km]?bytes|packets)\b
scope: string.unquoted.limit-unit.nftables
- include: numerics
limit-specs:
@ -880,6 +881,8 @@ contexts:
- match: \b(used)\b
scope: constant.language.quota-used.nftables
push: _expect-numeric
- match: \b([km]?bytes|packets)\b
scope: string.unquoted.quota-unit.nftables
quota-specs:
- match: \b({{identifier_extended}})\b

@ -337,6 +337,7 @@ table a-strang3_Name {
# ^ constant.language.quota-used.nftables
# ^ constant.numeric.integer.decimal.nftables
quota q_over_http { over 500 mbytes ; comment "cap http (but not https)" ; }
# ^ string.unquoted.quota-unit.nftables
# ^ punctuation.terminator.semi-colon.nftables
# ^ storage.type.quota-comments.nftables
# ^ string.quoted.double.nftables
@ -351,6 +352,7 @@ table a-strang3_Name {
# ^ string.unquoted.time-string.nftables
limit lim_1kbps { rate over 1024 bytes/second burst 512 bytes ; comment "use to limit incoming smtp" ; }
# ^ constant.language.limit-mode.nftables
# ^ string.unquoted.limit-unit.nftables
# ^ constant.language.limit-burst.nftables
# ^^^ constant.numeric.integer.decimal.nftables
# ^ punctuation.terminator.semi-colon.nftables
@ -521,6 +523,7 @@ chain a-strang3_Name c {
# ^ punctuation.separator.limit-rate.nftables
# ^ string.unquoted.time-string.nftables
# ^ constant.language.limit-burst.nftables
# ^ string.unquoted.limit-unit.nftables
# ^ keyword.control.rule-statement.nftables
tcp dport 8888 ct state invalid,untracked synproxy mss 1460 wscale 7 timestamp sack-perm
@ -548,6 +551,7 @@ quota filter example over 100 mbytes used 0 bytes ;
# ^ entity.name.quota.nftables
# ^ constant.language.quota-mode.nftables
# ^^^ constant.numeric.integer.decimal.nftables
# ^ string.unquoted.quota-unit.nftables
# ^ constant.language.quota-used.nftables
# ^ constant.numeric.integer.decimal.nftables
# ^ punctuation.terminator.semi-colon.nftables