xref: /freebsd/sbin/ipf/libipf/v6optvalue.c (revision 2008043f386721d58158e37e0d7e50df8095942d)
1 
2 /*
3  * Copyright (C) 2012 by Darren Reed.
4  *
5  * See the IPFILTER.LICENCE file for details on licencing.
6  *
7  * $Id$
8  */
9 #include "ipf.h"
10 
11 
12 
13 u_32_t getv6optbyname(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(int optval)
27 {
28 #ifdef	USE_INET6
29 	struct ipopt_names *io;
30 
31 	for (io = v6ionames; io->on_name; io++)
32 		if (io->on_value == optval)
33 			return (io->on_bit);
34 #endif
35 	return (-1);
36 }
37