]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ipfilter/lib/optvalue.c
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / ipfilter / lib / optvalue.c
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 u_32_t getoptbyname(optname)
14         char *optname;
15 {
16         struct ipopt_names *io;
17
18         for (io = ionames; io->on_name; io++)
19                 if (!strcasecmp(optname, io->on_name))
20                         return io->on_bit;
21         return -1;
22 }
23
24
25 u_32_t getoptbyvalue(optval)
26         int optval;
27 {
28         struct ipopt_names *io;
29
30         for (io = ionames; io->on_name; io++)
31                 if (io->on_value == optval)
32                         return io->on_bit;
33         return -1;
34 }