1296047Soshogbo/*-
2296047Soshogbo * Copyright (c) 2012 The FreeBSD Foundation
3296047Soshogbo * All rights reserved.
4296047Soshogbo *
5296047Soshogbo * This software was developed by Pawel Jakub Dawidek under sponsorship from
6296047Soshogbo * the FreeBSD Foundation.
7296047Soshogbo *
8296047Soshogbo * Redistribution and use in source and binary forms, with or without
9296047Soshogbo * modification, are permitted provided that the following conditions
10296047Soshogbo * are met:
11296047Soshogbo * 1. Redistributions of source code must retain the above copyright
12296047Soshogbo *    notice, this list of conditions and the following disclaimer.
13296047Soshogbo * 2. Redistributions in binary form must reproduce the above copyright
14296047Soshogbo *    notice, this list of conditions and the following disclaimer in the
15296047Soshogbo *    documentation and/or other materials provided with the distribution.
16296047Soshogbo *
17296047Soshogbo * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
18296047Soshogbo * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19296047Soshogbo * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20296047Soshogbo * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
21296047Soshogbo * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22296047Soshogbo * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23296047Soshogbo * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24296047Soshogbo * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25296047Soshogbo * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26296047Soshogbo * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27296047Soshogbo * SUCH DAMAGE.
28296047Soshogbo *
29296047Soshogbo * $FreeBSD$
30296047Soshogbo */
31296047Soshogbo
32296047Soshogbo#ifndef	_CAP_DNS_H_
33296047Soshogbo#define	_CAP_DNS_H_
34296047Soshogbo
35296047Soshogbo#include <sys/socket.h>	/* socklen_t */
36296047Soshogbo
37296047Soshogbostruct addrinfo;
38296047Soshogbostruct hostent;
39296047Soshogbo
40296047Soshogbostruct hostent *cap_gethostbyname(cap_channel_t *chan, const char *name);
41296047Soshogbostruct hostent *cap_gethostbyname2(cap_channel_t *chan, const char *name,
42296047Soshogbo    int type);
43296047Soshogbostruct hostent *cap_gethostbyaddr(cap_channel_t *chan, const void *addr,
44296047Soshogbo    socklen_t len, int type);
45296047Soshogbo
46296047Soshogboint cap_getaddrinfo(cap_channel_t *chan, const char *hostname,
47296047Soshogbo    const char *servname, const struct addrinfo *hints, struct addrinfo **res);
48296047Soshogboint cap_getnameinfo(cap_channel_t *chan, const struct sockaddr *sa,
49296047Soshogbo    socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen,
50296047Soshogbo    int flags);
51296047Soshogbo
52296047Soshogboint cap_dns_type_limit(cap_channel_t *chan, const char * const *types,
53296047Soshogbo    size_t ntypes);
54296047Soshogboint cap_dns_family_limit(cap_channel_t *chan, const int *families,
55296047Soshogbo    size_t nfamilies);
56296047Soshogbo
57296047Soshogbo#endif	/* !_CAP_DNS_H_ */
58