/*
* Copyright (C) 2000-2005 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* $Id: printfr.c,v 1.43.2.12 2005/06/12 07:18:42 darrenr Exp $
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "ipf.h"
/*
* print the filter structure in a useful way
*/
{
struct protoent *p;
u_char *t;
char *s;
int pr;
pr = -2;
printf("# Builtin: ");
if (fp->fr_collect != 0)
;
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;
p = getprotobynumber(pr);
printf("proto ");
putchar(' ');
}
}
printf("all");
#ifdef USE_INET6
#endif
type /= 256;
else
}
printf(" flags ");
else
(void)putchar(*s);
(void)putchar('/');
else
s++, t++)
(void)putchar(*s);
}
}
} else if (type == FR_T_BPFOPC) {
int i;
printf("\" }");
} else if (type == FR_T_COMPIPF) {
;
} else if (type == FR_T_CALLFUNC) {
} else {
}
printf(" with");
#ifdef USE_INET6
else
fp->fr_optbits);
#endif
printf("not ");
printf("ipopts");
comma = ",";
}
printf("not ");
printf("short");
comma = ",";
}
printf("not ");
printf("frag");
comma = ",";
}
printf("not ");
printf("frag-body");
comma = ",";
}
printf("not ");
printf("nat");
comma = ",";
}
printf("not ");
printf("lowttl");
comma = ",";
}
printf("not ");
printf("bad");
comma = ",";
}
printf("not ");
printf("bad-src");
comma = ",";
}
printf("not ");
printf("bad-nat");
comma = ",";
}
printf("not ");
printf("oow");
}
printf("not ");
printf("mcast");
comma = ",";
}
printf("not ");
printf("bcast");
comma = ",";
}
printf("not ");
printf("mbcast");
comma = ",";
}
printf("not ");
printf("state");
comma = ",";
}
}
printf(" keep state");
printf(" (");
if (fp->fr_statemax != 0) {
comma = ",";
}
comma = ",";
}
comma = ",";
}
comma = ",";
}
comma = ",";
}
printf(")");
}
}
printf(" keep frags");
printf(" (");
printf(" strict");
printf(" )");
}
}
else
printf(" scan *");
}
char *s = "";
printf(" set-tag(");
s = ", ";
}
}
printf(")");
}
(void)putchar('\n');
}