printfr.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright (C) 1993-2001 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* $Id: printfr.c,v 1.37 2003/06/03 16:01:12 darrenr Exp $
*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "ipf.h"
{
switch (addr->iplookuptype)
{
case IPLT_POOL :
printf("pool/");
break;
case IPLT_HASH :
printf("hash/");
break;
default :
break;
}
printf("(!)");
}
}
}
/*
* print the filter structure in a useful way
*/
{
struct protoent *p;
u_char *t;
char *s;
int pr;
pr = -2;
printf("# Builtin: ");
;
printf("call");
printf(" now");
printf("pass");
printf("block");
printf(" return-icmp-as-dest");
printf(" return-icmp");
printf("(%s)",
else
}
printf(" return-rst");
printf("count");
printf("auth");
printf("preauth");
printf("nomatch");
else {
}
printf(" out ");
else
printf(" in ");
putchar(' ');
}
printf("quick ");
putchar(' ');
printf("fastroute ");
printf("in-via ");
else
printf("out-via ");
putchar(' ');
}
}
}
}
pr = -1;
else
}
}
printf("all");
printf("/bcast");
printf("/net");
printf("/netmasked");
printf("/peer");
else
} else
printf("/bcast");
printf("/net");
printf("/netmasked");
printf("/peer");
else
} else
printf(" with");
fp->fr_optbits);
#ifdef USE_INET6
else
fp->fr_optbits);
#endif
printf(" not");
printf(" ipopts");
}
printf(" not");
printf(" short");
}
printf(" not");
printf(" frag");
}
printf(" not");
printf(" nat");
}
printf(" not");
printf(" lowttl");
}
printf(" not");
printf(" bad-src");
}
}
type /= 256;
else
}
printf(" flags ");
else
(void)putchar(*s);
(void)putchar('/');
else
s++, t++)
(void)putchar(*s);
}
}
#ifdef IPFILTER_BPF
} else if (type == FR_T_BPFOPC) {
int i;
printf("{");
printf(" }");
#endif
} else if (type == FR_T_COMPIPF) {
;
} else if (type == FR_T_CALLFUNC) {
} else {
}
printf(" keep state");
printf(" (");
if (fp->fr_statemax != 0)
printf(" strict");
printf(" newisn");
printf(" )");
}
}
printf(" keep frags");
printf(" (");
printf(" strict");
printf(" )");
}
}
else
printf(" scan *");
}
(void)putchar('\n');
}