Libinfo-173.1.tar.gz
[apple/libinfo.git] / lookup.subproj / lu_host.h
1 /*
2 * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Portions Copyright (c) 2002 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.1 (the "License"). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
12 * this file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
20 * under the License.
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24
25 #ifndef _LU_HOST_H_
26 #define _LU_HOST_H_
27
28 #include <sys/cdefs.h>
29
30
31 #define WANT_NOTHING 0xfeedface
32 #define WANT_A4_ONLY 0
33 #define WANT_A6_ONLY 1
34 #define WANT_A6_PLUS_MAPPED_A4 2
35 #define WANT_MAPPED_A4_ONLY 3
36
37 /* ONLY TO BE USED BY getipv6nodebyaddr */
38 #define WANT_A6_OR_MAPPED_A4_IF_NO_A6 -1
39
40
41 __BEGIN_DECLS
42
43 void free_host_data(struct hostent *h);
44 struct hostent * extract_host(XDR *xdr, int want, int *err);
45 struct hostent * fake_hostent(const char *name, struct in_addr addr);
46 struct hostent * fake_hostent6(const char *name, struct in6_addr addr);
47 int is_a4_mapped(const char *s);
48 int is_a4_compat(const char *s);
49
50 __END_DECLS
51
52 #endif /* ! _LU_HOST_H_ */