parsing of ipv6 afi on junos bgp poll/discovery

git-svn-id: http://www.observium.org/svn/observer/trunk@1743 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-11-26 17:56:13 +00:00
parent 8bb0b4106a
commit dc1f46ac2e
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -129,7 +129,10 @@ if (isset($peerlist))
$j_peerIndexes[$ip] = $entry['jnxBgpM2PeerIndex'];
break;
case 'ipv6':
# FIXME not implemented yet
$ip6 = trim(str_replace(' ','',$entry['jnxBgpM2PeerRemoteAddr']),'"');
$ip6 = substr($ip6,0,4) . ':' . substr($ip6,4,4) . ':' . substr($ip6,8,4) . ':' . substr($ip6,12,4) . ':' . substr($ip6,16,4) . ':' . substr($ip6,20,4) . ':' . substr($ip6,24,4) . ':' . substr($ip6,28,4);
$ip6 = Net_IPv6::compress($ip6);
$j_peerIndexes[$ip6] = $entry['jnxBgpM2PeerIndex'];
break;
default:
echo("PANIC: Don't know RemoteAddrType " . $entry['jnxBgpM2PeerRemoteAddrType'] . "!\n");
+4 -1
View File
@@ -170,7 +170,10 @@ if ($device['os'] == "junos")
$j_peerIndexes[$ip] = $entry['jnxBgpM2PeerIndex'];
break;
case 'ipv6':
# FIXME not implemented yet
$ip6 = trim(str_replace(' ','',$entry['jnxBgpM2PeerRemoteAddr']),'"');
$ip6 = substr($ip6,0,4) . ':' . substr($ip6,4,4) . ':' . substr($ip6,8,4) . ':' . substr($ip6,12,4) . ':' . substr($ip6,16,4) . ':' . substr($ip6,20,4) . ':' . substr($ip6,24,4) . ':' . substr($ip6,28,4);
$ip6 = Net_IPv6::compress($ip6);
$j_peerIndexes[$ip6] = $entry['jnxBgpM2PeerIndex'];
break;
default:
echo("PANIC: Don't know RemoteAddrType " . $entry['jnxBgpM2PeerRemoteAddrType'] . "!\n");