portmap-parser-180204-pmb
v0.1.0
Published
Parser for a custom notation scheme for TCP/UDP host/port ACL/flags/options.
Downloads
4
Readme
portmap-parser-180204-pmb
Parser for a custom notation scheme for TCP/UDP host/port ACL/flags/options.
Usage
from test/usage.mjs:
import pp from 'portmap-parser-180204-pmb';
const input = '!* eve.test:80 bob.test:443=eve.test:80!decrypt';
eq(pp.parse(input), {
'*': false,
'eve.test:80': { host: 'eve.test', port: 80, descr: 'eve.test:80' },
'bob.test:443': {
host: 'eve.test',
port: 80,
descr: 'eve.test:80 as bob.test:443',
origAddr: { host: 'bob.test', port: 443, descr: 'bob.test:443' },
decrypt: true,
},
});
Known issues
- Needs more/better tests and docs.
License
ISC