xref: /freebsd/usr.sbin/pkg/dns_utils.h (revision b3e76948)
129aaa961SBaptiste Daroussin /*-
24d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
31de7b4b8SPedro F. Giffuni  *
429aaa961SBaptiste Daroussin  * Copyright (c) 2012 Baptiste Daroussin <bapt@FreeBSD.org>
529aaa961SBaptiste Daroussin  * All rights reserved.
629aaa961SBaptiste Daroussin  *
729aaa961SBaptiste Daroussin  * Redistribution and use in source and binary forms, with or without
829aaa961SBaptiste Daroussin  * modification, are permitted provided that the following conditions
929aaa961SBaptiste Daroussin  * are met:
1029aaa961SBaptiste Daroussin  * 1. Redistributions of source code must retain the above copyright
1129aaa961SBaptiste Daroussin  *    notice, this list of conditions and the following disclaimer.
1229aaa961SBaptiste Daroussin  * 2. Redistributions in binary form must reproduce the above copyright
1329aaa961SBaptiste Daroussin  *    notice, this list of conditions and the following disclaimer in the
1429aaa961SBaptiste Daroussin  *    documentation and/or other materials provided with the distribution.
1529aaa961SBaptiste Daroussin  *
1629aaa961SBaptiste Daroussin  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1729aaa961SBaptiste Daroussin  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1829aaa961SBaptiste Daroussin  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1929aaa961SBaptiste Daroussin  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2029aaa961SBaptiste Daroussin  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2129aaa961SBaptiste Daroussin  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2229aaa961SBaptiste Daroussin  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2329aaa961SBaptiste Daroussin  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2429aaa961SBaptiste Daroussin  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2529aaa961SBaptiste Daroussin  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2629aaa961SBaptiste Daroussin  * SUCH DAMAGE.
2729aaa961SBaptiste Daroussin  */
2829aaa961SBaptiste Daroussin 
2929aaa961SBaptiste Daroussin #ifndef DNS_UTILS_H
3029aaa961SBaptiste Daroussin #define DNS_UTILS_H
3129aaa961SBaptiste Daroussin struct dns_srvinfo {
3229aaa961SBaptiste Daroussin 	unsigned int type;
3329aaa961SBaptiste Daroussin 	unsigned int class;
3429aaa961SBaptiste Daroussin 	unsigned int ttl;
3529aaa961SBaptiste Daroussin 	unsigned int priority;
3629aaa961SBaptiste Daroussin 	unsigned int weight;
3729aaa961SBaptiste Daroussin 	unsigned int port;
3835e07a7aSBaptiste Daroussin 	unsigned int finalweight;
3929aaa961SBaptiste Daroussin 	char host[MAXHOSTNAMELEN];
4029aaa961SBaptiste Daroussin 	struct dns_srvinfo *next;
4129aaa961SBaptiste Daroussin };
4229aaa961SBaptiste Daroussin 
4329aaa961SBaptiste Daroussin struct dns_srvinfo *
4429aaa961SBaptiste Daroussin 	dns_getsrvinfo(const char *zone);
4529aaa961SBaptiste Daroussin 
4629aaa961SBaptiste Daroussin #endif
47