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