ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Nftables

by HorlogeSkynet ST3

:lipstick: A Sublime Text 3+ syntax definition for your nftables rules

Details

Installs

  • Total 413
  • Win 123
  • Mac 111
  • Linux 179
Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0

Readme

Source
raw.​githubusercontent.​com

Nftables

A Sublime Text 3+ syntax definition for your nftables rules

Introduction

nftables should now be the regular way of handling Netfilter rules, and I was surprised not to find any syntax definition for Sublime Text.
This project aims to provide a “basic” one, as long as a building procedure for GNU/Linux users (when the nft binary is available for “dynamic” syntax checks).

This project has been inspired by the official nano syntax definition.
See the Scripting nftables Wiki page for external reference.

Installation

With Package Control

  1. Open your command palette and type in : Package Control: Install Package
  2. Browse the list or search for Nftables
  3. Press Enter and you're done !

Package Control dedicated page here.

Manually

  1. Move into Sublime Text packages folder (usually $HOME/.config/sublime-text/Packages/ or %AppData%\Sublime Text\Packages\)
  2. Clone this repository there : git clone https://github.com/HorlogeSkynet/Nftables.git
  3. Restart Sublime Text and… :tada:

Usage

Syntax

  • Open your command palette and type in : Set Syntax: Nftables

  • Click on the bottom-right corner : Nftables

  • View > Syntax > Nftables

Build

  • Open your command palette and type in : Build With: Nftables

  • Press CTRL + B

  • Tools > Build

Formats currently supported

  • [X] nftables output
  • [X] scripted configuration

Frequently Asked Questions

Do you plan to support the whole nftables syntax ?

No, but feel free to contribute.

Why does this syntax coloration s*cks ?

Well, sorry to hear that. Grammar wasn't my favorite course at school.
I'd be pleased to review any issue or pull request.

Why didn't you convert the official Bison parser to Sublime's definition syntax ?

It looks like such a tool does not exist (yet ?).

Would this plugin help me building a secure fire-wall ?

No, but I would advise you this blog post as a well-explained starting point, written by @tasn.

I've noticed you got an extensive tests suite, can I run it ?

Of course, open the Nftables.sublime-syntax file, press CTRL + Shift + B and choose Build With: Syntax Tests.