summaryrefslogtreecommitdiffstats
path: root/lib/printip.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/printip.c')
-rw-r--r--lib/printip.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/printip.c b/lib/printip.c
new file mode 100644
index 0000000..fb91208
--- /dev/null
+++ b/lib/printip.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2002-2005 by Darren Reed.
+ *
+ * See the IPFILTER.LICENCE file for details on licencing.
+ *
+ * $Id: printip.c,v 1.3.4.1 2006/06/16 17:21:12 darrenr Exp $
+ */
+
+#include "ipf.h"
+
+
+void printip(addr)
+u_32_t *addr;
+{
+ struct in_addr ipa;
+
+ ipa.s_addr = *addr;
+ if (ntohl(ipa.s_addr) < 256)
+ printf("%lu", (u_long)ntohl(ipa.s_addr));
+ else
+ printf("%s", inet_ntoa(ipa));
+}
OpenPOWER on IntegriCloud