--- database.php.orig	2012-03-02 11:41:31.246420443 +0100
+++ database.php	2012-03-02 11:46:06.924372580 +0100
@@ -1827,6 +1827,25 @@
 	return $ret;
 }
 
+function getIPv4AllocationSearchResult ($terms)
+{
+	$query = "select inet_ntoa(ip) as ip, name from IPv4Allocation where ";
+	$or = '';
+	$qparams = array();
+	foreach (explode (' ', $terms) as $term)
+	{
+		$query .= $or . "name like ? or inet_ntoa(ip) like ?";
+		$or = ' or ';
+		$qparams[] = "%${term}%";
+		$qparams[] = "%${term}%";
+	}
+	$result = usePreparedSelectBlade ($query, $qparams);
+	$ret = array();
+	while ($row = $result->fetch (PDO::FETCH_ASSOC))
+		$ret[$row['ip']] = $row;
+	return $ret;
+}
+
 function getIPv6AddressSearchResult ($terms)
 {
 	$query = "select ip, name from IPv6Address where ";
--- interface.php.orig	2012-03-02 11:41:45.009375719 +0100
+++ interface.php	2012-03-02 11:33:31.668379287 +0100
@@ -3507,6 +3507,7 @@
 				if ($record['net_id'] !== NULL)
 					echo "<script language='Javascript'>document.location='index.php?page=ipv6net&tab=default&id=${record['net_id']}&hl_ipv6_addr=${v6_ip_dq}';//</script>";
 				break;
+			case 'ipv4allocation':
 			case 'ipv4addressbydescr':
 				$parentnet = getIPv4AddressNetworkId ($record['ip']);
 				if ($parentnet !== NULL)
@@ -3667,6 +3668,7 @@
 					echo '</table>';
 					finishPortlet();
 					break;
+				case 'ipv4allocation':
 				case 'ipv4addressbydescr':
 					startPortlet ('IPv4 addresses');
 					echo '<table border=0 cellpadding=5 cellspacing=0 align=center class=cooltable>';
--- functions.php.orig	2012-03-02 11:41:56.995373419 +0100
+++ functions.php	2012-03-02 11:43:36.045373368 +0100
@@ -4238,6 +4238,7 @@
 	{
 		$summary['object'] = getObjectSearchResults ($terms);
 		$summary['ipv4addressbydescr'] = getIPv4AddressSearchResult ($terms);
+		$summary['ipv4allocation'] = getIPv4AllocationSearchResult ($terms);
 		$summary['ipv6addressbydescr'] = getIPv6AddressSearchResult ($terms);
 		$summary['ipv4network'] = getIPv4PrefixSearchResult ($terms);
 		$summary['ipv6network'] = getIPv6PrefixSearchResult ($terms);
