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