4 * Copyright (C) 2002 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
11 #include "netinet/ipl.h"
13 #define PRINTF (void)printf
14 #define FPRINTF (void)fprintf
17 iphtable_t
*printhash_live(hp
, fd
, name
, opts
)
23 iphtent_t entry
, *top
, *node
;
28 if ((name
!= NULL
) && strncmp(name
, hp
->iph_name
, FR_GROUPLEN
))
31 printhashdata(hp
, opts
);
33 if ((hp
->iph_flags
& IPHASH_DELETE
) != 0)
36 if ((opts
& OPT_DEBUG
) == 0)
39 obj
.ipfo_rev
= IPFILTER_VERSION
;
40 obj
.ipfo_type
= IPFOBJ_LOOKUPITER
;
42 obj
.ipfo_size
= sizeof(iter
);
44 iter
.ili_data
= &entry
;
45 iter
.ili_type
= IPLT_HASH
;
46 iter
.ili_otype
= IPFLOOKUPITER_NODE
;
47 iter
.ili_ival
= IPFGENITER_LOOKUP
;
48 iter
.ili_unit
= hp
->iph_unit
;
49 strncpy(iter
.ili_name
, hp
->iph_name
, FR_GROUPLEN
);
55 while (!last
&& (ioctl(fd
, SIOCLOOKUPITER
, &obj
) == 0)) {
56 if (entry
.ipe_next
== NULL
)
59 top
= malloc(sizeof(*top
));
62 bcopy(&entry
, top
, sizeof(entry
));
67 (void) printhashnode(hp
, node
, bcopywrap
, opts
);
76 if ((opts
& OPT_DEBUG
) == 0)