r5015 ability to override the longest-prefix-by-ip network search logic
authorAlexey Andriyanov <alan@al-an.info>
Fri, 23 Mar 2012 15:59:40 +0000 (15:59 +0000)
committerAlexey Andriyanov <alan@al-an.info>
Fri, 23 Mar 2012 15:59:40 +0000 (15:59 +0000)
getIPv4AddressNetworkId: ability to override fetchIPv4AddressNetworkRow function
getIPv6AddressNetworkId: idem

wwwroot/inc/database.php

index 9732b23ec1cfa797626b3ba6646480c47002368a..56ddfb78c8f89f87d958055925baaec925d34818 100644 (file)
@@ -2019,7 +2019,7 @@ function spotNetworkByIP ($ip_bin, $masklen = NULL)
 // masks (they aren't going to be the right pick).
 function getIPv4AddressNetworkId ($ip_bin, $masklen = 32)
 {
-       if ($row = fetchIPv4AddressNetworkRow ($ip_bin, $masklen))
+       if ($row = callHook ('fetchIPv4AddressNetworkRow', $ip_bin, $masklen))
                return $row['id'];
        return NULL;
 }
@@ -2040,7 +2040,7 @@ function fetchIPv4AddressNetworkRow ($ip_bin, $masklen = 32)
 // ($ip is an instance of IPv4Address class) or NULL, if nothing was found.
 function getIPv6AddressNetworkId ($ip_bin, $masklen = 128)
 {
-       if ($row = fetchIPv6AddressNetworkRow ($ip_bin, $masklen))
+       if ($row = callHook ('fetchIPv6AddressNetworkRow', $ip_bin, $masklen))
                return $row['id'];
        return NULL;
 }