xref: /freebsd/contrib/tcpdump/getservent.h (revision ee67461e56828dd1f8de165947ba83f6d9148a87)
1*ee67461eSJoseph Mingrone /*
2*ee67461eSJoseph Mingrone * Copyright (c) 1983, 1993	The Regents of the University of California.
3*ee67461eSJoseph Mingrone * Copyright (c) 1993 Digital Equipment Corporation.
4*ee67461eSJoseph Mingrone * Copyright (c) 2012 G. Vanem <gvanem@yahoo.no>.
5*ee67461eSJoseph Mingrone * Copyright (c) 2017 Ali Abdulkadir <autostart.ini@gmail.com>.
6*ee67461eSJoseph Mingrone * All rights reserved.
7*ee67461eSJoseph Mingrone *
8*ee67461eSJoseph Mingrone * Redistribution and use in source and binary forms, with or without
9*ee67461eSJoseph Mingrone * modification, are permitted provided that the following conditions
10*ee67461eSJoseph Mingrone * are met:
11*ee67461eSJoseph Mingrone * 1. Redistributions of source code must retain the above copyright
12*ee67461eSJoseph Mingrone *    notice, this list of conditions and the following disclaimer.
13*ee67461eSJoseph Mingrone * 2. Redistributions in binary form must reproduce the above copyright
14*ee67461eSJoseph Mingrone *    notice, this list of conditions and the following disclaimer in the
15*ee67461eSJoseph Mingrone *    documentation and/or other materials provided with the distribution.
16*ee67461eSJoseph Mingrone * 3. All advertising materials mentioning features or use of this software
17*ee67461eSJoseph Mingrone *    must display the following acknowledgement:
18*ee67461eSJoseph Mingrone *	This product includes software developed by the University of
19*ee67461eSJoseph Mingrone *	California, Berkeley and its contributors.
20*ee67461eSJoseph Mingrone * 4. Neither the name of the University nor the names of its contributors
21*ee67461eSJoseph Mingrone *    may be used to endorse or promote products derived from this software
22*ee67461eSJoseph Mingrone *    without specific prior written permission.
23*ee67461eSJoseph Mingrone *
24*ee67461eSJoseph Mingrone * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25*ee67461eSJoseph Mingrone * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26*ee67461eSJoseph Mingrone * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27*ee67461eSJoseph Mingrone * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28*ee67461eSJoseph Mingrone * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29*ee67461eSJoseph Mingrone * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30*ee67461eSJoseph Mingrone * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31*ee67461eSJoseph Mingrone * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32*ee67461eSJoseph Mingrone * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33*ee67461eSJoseph Mingrone * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34*ee67461eSJoseph Mingrone * SUCH DAMAGE.
35*ee67461eSJoseph Mingrone */
36*ee67461eSJoseph Mingrone 
37*ee67461eSJoseph Mingrone #ifndef ND_GETSERVENT_H
38*ee67461eSJoseph Mingrone #define ND_GETSERVENT_H
39*ee67461eSJoseph Mingrone 
40*ee67461eSJoseph Mingrone #ifdef _NETDB_H_
41*ee67461eSJoseph Mingrone /* Just in case... */
42*ee67461eSJoseph Mingrone #error netdb.h and getservent.h are incompatible
43*ee67461eSJoseph Mingrone #else
44*ee67461eSJoseph Mingrone #define _NETDB_H_
45*ee67461eSJoseph Mingrone #endif
46*ee67461eSJoseph Mingrone 
47*ee67461eSJoseph Mingrone #ifdef _WIN32
48*ee67461eSJoseph Mingrone #define __PATH_SYSROOT "SYSTEMROOT"
49*ee67461eSJoseph Mingrone #define __PATH_ETC_INET "\\System32\\drivers\\etc\\"
50*ee67461eSJoseph Mingrone #define __PATH_SERVICES "services"
51*ee67461eSJoseph Mingrone #else
52*ee67461eSJoseph Mingrone /*
53*ee67461eSJoseph Mingrone * The idea here is to be able to replace "PREFIX" in __PATH_SYSROOT with a variable
54*ee67461eSJoseph Mingrone * that could, for example, point to an alternative install location.
55*ee67461eSJoseph Mingrone */
56*ee67461eSJoseph Mingrone #define __PATH_SYSROOT "PREFIX"
57*ee67461eSJoseph Mingrone #define __PATH_ETC_INET "/etc/"
58*ee67461eSJoseph Mingrone #define __PATH_SERVICES __PATH_ETC_INET"services"
59*ee67461eSJoseph Mingrone #endif
60*ee67461eSJoseph Mingrone 
61*ee67461eSJoseph Mingrone #define MAXALIASES 35
62*ee67461eSJoseph Mingrone 
63*ee67461eSJoseph Mingrone void endservent (void);
64*ee67461eSJoseph Mingrone struct servent *getservent(void);
65*ee67461eSJoseph Mingrone void setservent (int f);
66*ee67461eSJoseph Mingrone 
67*ee67461eSJoseph Mingrone #endif /* ! ND_GETSERVENT_H */
68