Move /var/svc/log to /var/log/svc
[unleashed/lotheac.git] / usr / src / cmd / ipf / lib / common / ipoptsec.c
blob558ae58a1b62ec09f53ab4fc92e40481a5b6892c
1 /*
2 * Copyright (C) 1993-2001 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 * $Id: ipoptsec.c,v 1.2 2002/01/28 06:50:46 darrenr Exp $
7 */
9 #include "ipf.h"
12 struct ipopt_names secclass[] = {
13 { IPSO_CLASS_RES4, 0x01, 0, "reserv-4" },
14 { IPSO_CLASS_TOPS, 0x02, 0, "topsecret" },
15 { IPSO_CLASS_SECR, 0x04, 0, "secret" },
16 { IPSO_CLASS_RES3, 0x08, 0, "reserv-3" },
17 { IPSO_CLASS_CONF, 0x10, 0, "confid" },
18 { IPSO_CLASS_UNCL, 0x20, 0, "unclass" },
19 { IPSO_CLASS_RES2, 0x40, 0, "reserv-2" },
20 { IPSO_CLASS_RES1, 0x80, 0, "reserv-1" },
21 { 0, 0, 0, NULL } /* must be last */
25 u_char seclevel(slevel)
26 char *slevel;
28 struct ipopt_names *so;
30 for (so = secclass; so->on_name; so++)
31 if (!strcasecmp(slevel, so->on_name))
32 break;
34 if (!so->on_name) {
35 fprintf(stderr, "no such security level: %s\n", slevel);
36 return 0;
38 return (u_char)so->on_value;
42 u_char secbit(class)
43 int class;
45 struct ipopt_names *so;
47 for (so = secclass; so->on_name; so++)
48 if (so->on_value == class)
49 break;
51 if (!so->on_name) {
52 fprintf(stderr, "no such security class: %d\n", class);
53 return 0;
55 return (u_char)so->on_bit;