|
@@ -0,0 +1,46 @@
+/*
+* Copyright (C) 2013 Carsten Schoene <cs@linux-adminstrator.com>
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either
+* version 2 of the License, or (at your option) any later
+* version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software Foundation,
+* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main (int argc, char *argv[])
+{
+ int fIPv4 = 0;
+ int ppid = getppid ();
+ char *remote_ip = getenv("TCPREMOTEIP");
+ if (!remote_ip) {
+ remote_ip = "";
+ };
+ fIPv4 = (NULL == strchr(remote_ip, ':'));
+
+ //If IPv6, don't check at all
+ if (!fIPv4)
+ {
+ printf ("A\n");
+ fprintf (stderr,
+ "skip-if-ipv6: pid %d - IPV6 (%s) detected. All further plugins will be skipped.\n",
+ ppid,remote_ip);
+ exit (0);
+ }
+ // Else: Walk down the plugin chain.
+ exit (0);
+}
|