1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * Copyright (C) 1993-2001 by Darren Reed. 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * See the IPFILTER.LICENCE file for details on licencing. 5*0Sstevel@tonic-gate * 6*0Sstevel@tonic-gate * $Id: optvalue.c,v 1.2 2002/01/28 06:50:47 darrenr Exp $ 7*0Sstevel@tonic-gate */ 8*0Sstevel@tonic-gate #include "ipf.h" 9*0Sstevel@tonic-gate 10*0Sstevel@tonic-gate 11*0Sstevel@tonic-gate u_32_t getoptbyname(optname) 12*0Sstevel@tonic-gate char *optname; 13*0Sstevel@tonic-gate { 14*0Sstevel@tonic-gate struct ipopt_names *io; 15*0Sstevel@tonic-gate 16*0Sstevel@tonic-gate for (io = ionames; io->on_name; io++) 17*0Sstevel@tonic-gate if (!strcasecmp(optname, io->on_name)) 18*0Sstevel@tonic-gate return io->on_bit; 19*0Sstevel@tonic-gate return -1; 20*0Sstevel@tonic-gate } 21*0Sstevel@tonic-gate 22*0Sstevel@tonic-gate 23*0Sstevel@tonic-gate u_32_t getoptbyvalue(optval) 24*0Sstevel@tonic-gate int optval; 25*0Sstevel@tonic-gate { 26*0Sstevel@tonic-gate struct ipopt_names *io; 27*0Sstevel@tonic-gate 28*0Sstevel@tonic-gate for (io = ionames; io->on_name; io++) 29*0Sstevel@tonic-gate if (io->on_value == optval) 30*0Sstevel@tonic-gate return io->on_bit; 31*0Sstevel@tonic-gate return -1; 32*0Sstevel@tonic-gate } 33