pf.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. Language: pf
  3. Category: config
  4. Author: Peter Piwowarski <[email protected]>
  5. Description: The pf.conf(5) format as of OpenBSD 5.6
  6. */
  7. function(hljs) {
  8. var MACRO = {
  9. className: 'variable',
  10. begin: /\$[\w\d#@][\w\d_]*/
  11. };
  12. var TABLE = {
  13. className: 'variable',
  14. begin: /<(?!\/)/, end: />/
  15. };
  16. var QUOTE_STRING = {
  17. className: 'string',
  18. begin: /"/, end: /"/
  19. };
  20. return {
  21. aliases: ['pf.conf'],
  22. lexemes: /[a-z0-9_<>-]+/,
  23. keywords: {
  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. }