l0bsterssg

node.js static responsive blog post generator
Log | Files | Refs | README

pf.js (2011B)


      1 /*
      2 Language: Packet Filter config
      3 Description: pf.conf — packet filter configuration file (OpenBSD)
      4 Author: Peter Piwowarski <oldlaptop654@aol.com>
      5 Website: http://man.openbsd.org/pf.conf
      6 Category: config
      7 */
      8 
      9 function pf(hljs) {
     10   var MACRO = {
     11     className: 'variable',
     12     begin: /\$[\w\d#@][\w\d_]*/
     13   };
     14   var TABLE = {
     15     className: 'variable',
     16     begin: /<(?!\/)/, end: />/
     17   };
     18 
     19   return {
     20     name: 'Packet Filter config',
     21     aliases: ['pf.conf'],
     22     keywords: {
     23       $pattern: /[a-z0-9_<>-]+/,
     24       built_in: /* block match pass are "actions" in pf.conf(5), the rest are
     25                  * lexically similar top-level commands.
     26                  */
     27         'block match pass load anchor|5 antispoof|10 set table',
     28       keyword:
     29         'in out log quick on rdomain inet inet6 proto from port os to route ' +
     30         'allow-opts divert-packet divert-reply divert-to flags group icmp-type ' +
     31         'icmp6-type label once probability recieved-on rtable prio queue ' +
     32         'tos tag tagged user keep fragment for os drop ' +
     33         'af-to|10 binat-to|10 nat-to|10 rdr-to|10 bitmask least-stats random round-robin ' +
     34         'source-hash static-port ' +
     35         'dup-to reply-to route-to ' +
     36         'parent bandwidth default min max qlimit ' +
     37         'block-policy debug fingerprints hostid limit loginterface optimization ' +
     38         'reassemble ruleset-optimization basic none profile skip state-defaults ' +
     39         'state-policy timeout ' +
     40         'const counters persist ' +
     41         'no modulate synproxy state|5 floating if-bound no-sync pflow|10 sloppy ' +
     42         'source-track global rule max-src-nodes max-src-states max-src-conn ' +
     43         'max-src-conn-rate overload flush ' +
     44         'scrub|5 max-mss min-ttl no-df|10 random-id',
     45       literal:
     46         'all any no-route self urpf-failed egress|5 unknown'
     47     },
     48     contains: [
     49       hljs.HASH_COMMENT_MODE,
     50       hljs.NUMBER_MODE,
     51       hljs.QUOTE_STRING_MODE,
     52       MACRO,
     53       TABLE
     54     ]
     55   };
     56 }
     57 
     58 module.exports = pf;