xref: /freebsd/sbin/ipf/libipf/v6optvalue.c (revision e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5)
1 /*	$FreeBSD$	*/
2 
3 /*
4  * Copyright (C) 2012 by Darren Reed.
5  *
6  * See the IPFILTER.LICENCE file for details on licencing.
7  *
8  * $Id$
9  */
10 #include "ipf.h"
11 
12 
13 
14 u_32_t getv6optbyname(char *optname)
15 {
16 #ifdef	USE_INET6
17 	struct ipopt_names *io;
18 
19 	for (io = v6ionames; io->on_name; io++)
20 		if (!strcasecmp(optname, io->on_name))
21 			return (io->on_bit);
22 #endif
23 	return (-1);
24 }
25 
26 
27 u_32_t getv6optbyvalue(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