From 2cbb8fdf07bbf0c6e38770365514adf5a7d684fc Mon Sep 17 00:00:00 2001 From: Christoffer Date: Mon, 17 Dec 2018 17:37:09 +0000 Subject: [PATCH] Update rfc8416.php to populate locallyAddedAssertions > bgpsecAssertions with asn,comment,SKI,routerPublicKey, too. --- rfc8416.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/rfc8416.php b/rfc8416.php index c058ca6..98cb490 100755 --- a/rfc8416.php +++ b/rfc8416.php @@ -148,11 +148,16 @@ foreach ($raw_array as $sub_array) // Extract ASxxxxx from string. preg_match ("/AS[0-9]+/", explode (":", $asn)[1], $_asn); - $roas["locallyAddedAssertions"]["prefixAssertions"][$k]["asn"] = $_asn[0]; + $roas["locallyAddedAssertions"]["prefixAssertions"][$k]["asn"] = trim ($_asn[0], "AS"); $roas["locallyAddedAssertions"]["prefixAssertions"][$k]["prefix"] = $_prefix; $roas["locallyAddedAssertions"]["prefixAssertions"][$k]["maxPrefixLength"] = $_maxlength; $roas["locallyAddedAssertions"]["prefixAssertions"][$k]["comment"] = "$_ta - mnt-by $_mnt"; + $roas["locallyAddedAssertions"]["bgpsecAssertions"][$k]["asn"] = trim ($_asn[0], "AS"); + $roas["locallyAddedAssertions"]["bgpsecAssertions"][$k]["comment"] = "$_ta - mnt-by $_mnt"; + $roas["locallyAddedAssertions"]["bgpsecAssertions"][$k]["SKI"] = ""; + $roas["locallyAddedAssertions"]["bgpsecAssertions"][$k]["routerPublicKey"] = ""; + $k++; } } @@ -247,11 +252,16 @@ foreach ($raw_array as $sub_array) // Extract ASxxxxx from string. preg_match ("/AS[0-9]+/", explode (":", $asn)[1], $_asn); - $roas["locallyAddedAssertions"]["prefixAssertions"][$k]["asn"] = $_asn[0]; + $roas["locallyAddedAssertions"]["prefixAssertions"][$k]["asn"] = trim ($_asn[0], "AS"); $roas["locallyAddedAssertions"]["prefixAssertions"][$k]["prefix"] = $_prefix; $roas["locallyAddedAssertions"]["prefixAssertions"][$k]["maxPrefixLength"] = $_maxlength; $roas["locallyAddedAssertions"]["prefixAssertions"][$k]["comment"] = "$_ta - mnt-by $_mnt"; + $roas["locallyAddedAssertions"]["bgpsecAssertions"][$k]["asn"] = trim ($_asn[0], "AS"); + $roas["locallyAddedAssertions"]["bgpsecAssertions"][$k]["comment"] = "$_ta - mnt-by $_mnt"; + $roas["locallyAddedAssertions"]["bgpsecAssertions"][$k]["SKI"] = ""; + $roas["locallyAddedAssertions"]["bgpsecAssertions"][$k]["routerPublicKey"] = ""; + $k++; } }