Index: trunk/src/sh_portcheck.c
===================================================================
--- trunk/src/sh_portcheck.c	(revision 119)
+++ trunk/src/sh_portcheck.c	(revision 127)
@@ -79,4 +79,5 @@
 #define SH_PORT_REQ 1
 #define SH_PORT_OPT 2
+#define SH_PORT_IGN 3
 
 #define SH_PORT_MISS 0
@@ -118,4 +119,8 @@
 #endif
 
+/* Exported interface to add ignoreable ports as 'iface:portlist'
+ */
+static int sh_portchk_add_ignore (const char * str);
+
 /* Exported interface to add required ports as 'iface:portlist'
  */
@@ -184,4 +189,8 @@
         N_("portcheckoptional"),
         sh_portchk_add_optional,
+    },
+    {
+        N_("portcheckignore"),
+        sh_portchk_add_ignore,
     },
     {
@@ -330,5 +339,5 @@
 	  /* Don't report missing ports that are marked as optional
 	   */
-	  if (ptr->flag != SH_PORT_OPT)
+	  if (ptr->flag != SH_PORT_OPT && ptr->flag != SH_PORT_IGN)
 	    {
 	      snprintf (errbuf, sizeof(errbuf), _("POLICY [ServiceMissing] port %s:%d/%s (%s)"), 
@@ -455,5 +464,5 @@
 	  sh_portchk_add_to_list (proto, port, haddr, service, SH_PORT_NOT, SH_PORT_ISOK);
 	}
-      else if (portent->status == SH_PORT_MISS)
+      else if (portent->status == SH_PORT_MISS && portent->flag != SH_PORT_IGN)
 	{
 	  snprintf (errbuf, sizeof(errbuf), _("POLICY [ServiceRestarted] port %s:%d/%s to %d/%s (%s)"), 
@@ -478,5 +487,5 @@
 			  MSG_PORT_REPORT, errbuf);
 #endif
-
+	  portent->port   = port;
 	  portent->status = SH_PORT_ISOK;
 	}
@@ -504,5 +513,5 @@
 	  sh_portchk_add_to_list (proto, port, haddr, service, SH_PORT_NOT, SH_PORT_ISOK);
 	}
-      else if (portent->status == SH_PORT_MISS)
+      else if (portent->status == SH_PORT_MISS && portent->flag != SH_PORT_IGN)
 	{
 	  snprintf (errbuf, sizeof(errbuf), _("POLICY [ServiceRestarted] port %s:%d/%s (%s)"), 
@@ -1214,4 +1223,11 @@
 }
 
+/* User interface to add ignoreable ports as 'iface:portlist'
+ */
+static int sh_portchk_add_ignore (const char * str)
+{
+  return sh_portchk_add_required_generic (str, SH_PORT_IGN); 
+}
+
 /* Interface to run port check
  */
@@ -1273,8 +1289,10 @@
   sh_portchk_add_to_list ("tcp",  8002, haddr_local, NULL, SH_PORT_REQ, SH_PORT_UNKN);
   sh_portchk_add_to_list ("tcp",  8003, haddr_local, NULL, SH_PORT_NOT, SH_PORT_UNKN);
+  sh_portchk_add_to_list ("tcp",  8004, haddr_local, NULL, SH_PORT_IGN, SH_PORT_UNKN);
   sh_portchk_add_to_list ("tcp",    -1, haddr_local, "foo1", SH_PORT_NOT, SH_PORT_UNKN);
   sh_portchk_add_to_list ("tcp",    -1, haddr_local, "foo2", SH_PORT_REQ, SH_PORT_UNKN);
   sh_portchk_add_to_list ("tcp",    -1, haddr_local, "foo3", SH_PORT_NOT, SH_PORT_UNKN);
   sh_portchk_add_to_list ("tcp",    -1, haddr_local, "foo4", SH_PORT_REQ, SH_PORT_UNKN);
+  sh_portchk_add_to_list ("tcp",    -1, haddr_local, "foo5", SH_PORT_IGN, SH_PORT_UNKN);
 
   sh_portchk_check_list (&portlist_tcp, "tcp", SH_PORT_NOREPT);
@@ -1293,4 +1311,7 @@
   portent = sh_portchk_get_from_list("tcp",  8003, haddr_local, NULL);
   CuAssertTrue(tc, NULL == portent);
+
+  portent = sh_portchk_get_from_list("tcp",  8004, haddr_local, NULL);
+  CuAssertPtrNotNull(tc, portent);
 
   portent = sh_portchk_get_from_list("tcp",  8000, haddr_local, "foo1");
@@ -1307,4 +1328,8 @@
   CuAssertPtrNotNull(tc, portent);
   CuAssertTrue(tc, 0 == strcmp(portent->service, "foo4"));
+
+  portent = sh_portchk_get_from_list("tcp",  8000, haddr_local, "foo5");
+  CuAssertPtrNotNull(tc, portent);
+  CuAssertTrue(tc, 0 == strcmp(portent->service, "foo5"));
 #else
   (void) tc; /* fix compiler warning */
