JavaScript generic ASN.1 parser (mirror)
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Parametrize parsed file too.

+5 -4
+2 -2
parseRFC.js
··· 454 454 s = s.replace(p[0], p[1]); 455 455 // fs.writeFileSync('rfc3161_patched.txt', s, 'utf8'); 456 456 // console.log(s); 457 - asn1 = JSON.parse(fs.readFileSync('rfcasn1.json', 'utf8')); 457 + asn1 = JSON.parse(fs.readFileSync(process.argv[3], 'utf8')); 458 458 const reModuleDefinition = /\s[A-Z](?:[-]?[a-zA-Z0-9])*\s*\{[^}]+\}\s*DEFINITIONS/gm; 459 459 let m; 460 460 while ((m = reModuleDefinition.exec(s))) { ··· 470 470 }, 471 471 {} 472 472 );*/ 473 - fs.writeFileSync('rfcasn1.json', JSON.stringify(asn1, null, 2) + '\n', 'utf8'); 473 + fs.writeFileSync(process.argv[3], JSON.stringify(asn1, null, 2) + '\n', 'utf8'); 474 474 // console.log('Module:', mod); 475 475 /*while ((idx = s.indexOf('::=', idx + 1)) >= 0) { 476 476 let line = s.lastIndexOf('\n', idx) + 1;
+3 -2
updateRFC.sh
··· 12 12 } 13 13 echo '{}' > rfcasn1.json # start from scratch 14 14 mkdir -p rfc 15 + cd rfc 15 16 for n in 5280 3369 3161; do 16 - ( cd rfc ; downloadRFC $n ) 17 - ./parseRFC.js rfc/rfc$n.txt 17 + downloadRFC $n 18 + ../parseRFC.js rfc$n.txt ../rfcasn1.json 18 19 done 19 20 echo Conversion completed.