summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/lib/printhash_live.c
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2013-07-19 05:41:57 +0000
committercy <cy@FreeBSD.org>2013-07-19 05:41:57 +0000
commit672af8808c0e7c15f330b401482f9271c2eb3fa6 (patch)
tree225b5acf68c01bc6a260b386c2b2dbf4fa2839e3 /contrib/ipfilter/lib/printhash_live.c
parent71e82d94e82560b20789833f60056506de34de8b (diff)
downloadFreeBSD-src-672af8808c0e7c15f330b401482f9271c2eb3fa6.zip
FreeBSD-src-672af8808c0e7c15f330b401482f9271c2eb3fa6.tar.gz
As per the developers handbook (5.3.1 step 1), prepare the vendor trees for
import of new ipfilter vendor sources by flattening them. To keep the tags consistent with dist, the tags are also flattened. Approved by: glebius (Mentor)
Diffstat (limited to 'contrib/ipfilter/lib/printhash_live.c')
-rw-r--r--contrib/ipfilter/lib/printhash_live.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/contrib/ipfilter/lib/printhash_live.c b/contrib/ipfilter/lib/printhash_live.c
deleted file mode 100644
index 1afe632..0000000
--- a/contrib/ipfilter/lib/printhash_live.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2002 by Darren Reed.
- *
- * See the IPFILTER.LICENCE file for details on licencing.
- */
-
-#include <sys/ioctl.h>
-#include "ipf.h"
-#include "netinet/ipl.h"
-
-#define PRINTF (void)printf
-#define FPRINTF (void)fprintf
-
-
-iphtable_t *printhash_live(hp, fd, name, opts)
-iphtable_t *hp;
-int fd;
-char *name;
-int opts;
-{
- iphtent_t entry, *top, *node;
- ipflookupiter_t iter;
- int printed, last;
- ipfobj_t obj;
-
- if ((name != NULL) && strncmp(name, hp->iph_name, FR_GROUPLEN))
- return hp->iph_next;
-
- printhashdata(hp, opts);
-
- if ((hp->iph_flags & IPHASH_DELETE) != 0)
- PRINTF("# ");
-
- if ((opts & OPT_DEBUG) == 0)
- PRINTF("\t{");
-
- obj.ipfo_rev = IPFILTER_VERSION;
- obj.ipfo_type = IPFOBJ_LOOKUPITER;
- obj.ipfo_ptr = &iter;
- obj.ipfo_size = sizeof(iter);
-
- iter.ili_data = &entry;
- iter.ili_type = IPLT_HASH;
- iter.ili_otype = IPFLOOKUPITER_NODE;
- iter.ili_ival = IPFGENITER_LOOKUP;
- iter.ili_unit = hp->iph_unit;
- strncpy(iter.ili_name, hp->iph_name, FR_GROUPLEN);
-
- last = 0;
- top = NULL;
- printed = 0;
-
- while (!last && (ioctl(fd, SIOCLOOKUPITER, &obj) == 0)) {
- if (entry.ipe_next == NULL)
- last = 1;
- entry.ipe_next = top;
- top = malloc(sizeof(*top));
- if (top == NULL)
- break;
- bcopy(&entry, top, sizeof(entry));
- }
-
- while (top != NULL) {
- node = top;
- (void) printhashnode(hp, node, bcopywrap, opts);
- top = node->ipe_next;
- free(node);
- printed++;
- }
-
- if (printed == 0)
- putchar(';');
-
- if ((opts & OPT_DEBUG) == 0)
- PRINTF(" };\n");
- return hp->iph_next;
-}
OpenPOWER on IntegriCloud