Parser for a custom notation scheme for TCP/UDP host/port ACL/flags/options.
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,
},
});
- Needs more/better tests and docs.
ISC