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(optname) 15 char *optname; 16 { 17 #ifdef USE_INET6 18 struct ipopt_names *io; 19 20 for (io = v6ionames; io->on_name; io++) 21 if (!strcasecmp(optname, io->on_name)) 22 return io->on_bit; 23 #endif 24 return -1; 25 } 26 27 28 u_32_t getv6optbyvalue(optval) 29 int optval; 30 { 31 #ifdef USE_INET6 32 struct ipopt_names *io; 33 34 for (io = v6ionames; io->on_name; io++) 35 if (io->on_value == optval) 36 return io->on_bit; 37 #endif 38 return -1; 39 } 40