Compare commits

...

4 commits

3 changed files with 28 additions and 8 deletions

View file

@ -119,6 +119,13 @@ function writeRoutinatorExceptionFile ($roas)
function writeExportJSON ($roas) function writeExportJSON ($roas)
{ {
$n = 0;
foreach ($roas['roas'] as $object)
{
$roas['roas'][$n]['asn'] = "AS" . $roas['roas'][$n]['asn'];
$n++;
}
$json = json_encode($roas, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT); $json = json_encode($roas, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
$fp = fopen ('roa/export_dn42.json', 'w'); $fp = fopen ('roa/export_dn42.json', 'w');

View file

@ -97,7 +97,7 @@ foreach ($raw_array as $sub_array)
// Extract ASxxxxx from string. // Extract ASxxxxx from string.
preg_match ("/AS[0-9]+/", explode (":", $asn)[1], $_asn); preg_match ("/AS[0-9]+/", explode (":", $asn)[1], $_asn);
$roas["roas"][$k]["asn"] = $_asn[0]; $roas["roas"][$k]["asn"] = trim ($_asn[0], "AS");
$roas["roas"][$k]["prefix"] = $_prefix; $roas["roas"][$k]["prefix"] = $_prefix;
$roas["roas"][$k]["maxLength"] = ($_asn[0] != "AS0" ? $_maxlength : MAX_LEN_IPV6_AS0); $roas["roas"][$k]["maxLength"] = ($_asn[0] != "AS0" ? $_maxlength : MAX_LEN_IPV6_AS0);
$roas["roas"][$k]["ta"] = $_ta; $roas["roas"][$k]["ta"] = $_ta;
@ -187,7 +187,7 @@ foreach ($raw_array as $sub_array)
// Extract ASxxxxx from string. // Extract ASxxxxx from string.
preg_match ("/AS[0-9]+/", explode (":", $asn)[1], $_asn); preg_match ("/AS[0-9]+/", explode (":", $asn)[1], $_asn);
$roas["roas"][$k]["asn"] = $_asn[0]; $roas["roas"][$k]["asn"] = trim ($_asn[0], "AS");
$roas["roas"][$k]["prefix"] = $_prefix; $roas["roas"][$k]["prefix"] = $_prefix;
$roas["roas"][$k]["maxLength"] = ($_asn[0] != "AS0" ? $_maxlength : MAX_LEN_IPV4_AS0); $roas["roas"][$k]["maxLength"] = ($_asn[0] != "AS0" ? $_maxlength : MAX_LEN_IPV4_AS0);
$roas["roas"][$k]["ta"] = $_ta; $roas["roas"][$k]["ta"] = $_ta;

View file

@ -38,13 +38,17 @@ if [ ! -f roa/.git/config ] ; then
echo "## Notes echo "## Notes
- These files are Bird 1.x compatible: - These files are Bird 1.x compatible:
- bird_roa_dn42.conf - [bird_roa_dn42.conf](bird_roa_dn42.conf)
- bird4_roa_dn42.conf - [bird4_roa_dn42.conf](bird4_roa_dn42.conf)
- bird6_roa_dn42.conf - [bird6_roa_dn42.conf](bird6_roa_dn42.conf)
- These files are Bird 2.x compatible: - These files are Bird 2.x compatible:
- bird_route_dn42.conf - [bird_route_dn42.conf](bird_route_dn42.conf)
- bird4_route_dn42.conf - [bird4_route_dn42.conf](bird4_route_dn42.conf)
- bird6_route_dn42.conf - [bird6_route_dn42.conf](bird6_route_dn42.conf)
- These files are [Routinator][2] compatible:
- [export_rfc8416_dn42.json](export_rfc8416_dn42.json) _(SLURM standard, format specified in [RFC 8416][4])_
- These files are [gortr][3] compatible:
- [export_dn42.json](export_dn42.json)
## [Last commit][0] at [dn42 registry][1] ## [Last commit][0] at [dn42 registry][1]
@ -52,8 +56,17 @@ echo "## Notes
$(git -C ../registry/ log -n 1 --merges) $(git -C ../registry/ log -n 1 --merges)
\`\`\` \`\`\`
## Misc statistics
- ROAs IPv4: $(cat roa/bird4_route_dn42.conf | grep -v '^#' | grep -v '^$' | wc -l)
- ROAs IPv6: $(cat roa/bird6_route_dn42.conf | grep -v '^#' | grep -v '^$' | wc -l)
- ROAs total: $(cat roa/bird_route_dn42.conf | grep -v '^#' | grep -v '^$' | wc -l)
[0]: https://git.dn42.us/dn42/registry/commit/$(git -C ../registry/ log -n 1 --merges --pretty='format:%H') [0]: https://git.dn42.us/dn42/registry/commit/$(git -C ../registry/ log -n 1 --merges --pretty='format:%H')
[1]: https://git.dn42.us/dn42/registry [1]: https://git.dn42.us/dn42/registry
[2]: https://github.com/NLnetLabs/routinator
[3]: https://github.com/cloudflare/gortr
[4]: https://tools.ietf.org/html/rfc8416
" > roa/README.md " > roa/README.md
# Commit latest version of ROA files # Commit latest version of ROA files