v6optvalue.c revision 302408
1/* $FreeBSD: stable/11/contrib/ipfilter/lib/v6optvalue.c 255332 2013-09-06 23:11:19Z cy $ */ 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 14u_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 28u_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