xref: /titanic_44/usr/src/cmd/ipf/lib/common/v6optvalue.c (revision bfed486ad8de8b8ebc6345a8e10accae08bf2f45)
1 /*
2  * Copyright (C) 1993-2001 by Darren Reed.
3  *
4  * See the IPFILTER.LICENCE file for details on licencing.
5  *
6  * $Id: v6optvalue.c,v 1.1 2003/04/26 04:55:58 darrenr Exp $
7  */
8 #include "ipf.h"
9 
10 
11 
12 u_32_t getv6optbyname(optname)
13 char *optname;
14 {
15 #ifdef	USE_INET6
16 	struct ipopt_names *io;
17 
18 	for (io = v6ionames; io->on_name; io++)
19 		if (!strcasecmp(optname, io->on_name))
20 			return io->on_bit;
21 #endif
22 	return -1;
23 }
24 
25 
26 u_32_t getv6optbyvalue(optval)
27 int optval;
28 {
29 #ifdef	USE_INET6
30 	struct ipopt_names *io;
31 
32 	for (io = v6ionames; io->on_name; io++)
33 		if (io->on_value == optval)
34 			return io->on_bit;
35 #endif
36 	return -1;
37 }
38