1 #ifndef	rfc1035_mx_h
2 #define	rfc1035_mx_h
3 
4 /*
5 ** Copyright 1998 - 1999 Double Precision, Inc.
6 ** See COPYING for distribution information.
7 */
8 
9 #if	HAVE_CONFIG_H
10 #include "config.h"
11 #endif
12 
13 #include	<sys/types.h>
14 #include	<netinet/in.h>
15 #include	<arpa/inet.h>
16 
17 
18 #ifdef  __cplusplus
19 extern "C" {
20 #endif
21 
22 #define	RFC1035_MX_OK		0	/* Ok, records follow */
23 #define	RFC1035_MX_SOFTERR	1	/* Soft DNS error */
24 #define	RFC1035_MX_HARDERR	2	/* Hard DNS error */
25 #define	RFC1035_MX_INTERNAL	3	/* Internal library error */
26 #define	RFC1035_MX_BADDNS	4	/* Bad DNS records */
27 
28 struct rfc1035_mxlist {
29 	struct rfc1035_mxlist *next;
30 	int	protocol;
31 #if	RFC1035_IPV6
32 	struct sockaddr_storage address;
33 #else
34 	struct sockaddr address;
35 #endif
36 	int priority;	/* -1 for plain old A records */
37 	int ad;
38 	char *hostname;
39 	} ;
40 
41 struct rfc1035_res;
42 
43 int rfc1035_mxlist_create(struct rfc1035_res *,
44 	const char *, struct rfc1035_mxlist **);
45 void rfc1035_mxlist_free(struct rfc1035_mxlist *);
46 
47 int rfc1035_mxlist_create_x(struct rfc1035_res *,
48 			    const char *, int,
49 			    struct rfc1035_mxlist **);
50 #define RFC1035_MX_AFALLBACK 1
51 #define RFC1035_MX_IGNORESOFTERR 2
52 #define RFC1035_MX_QUERYALL 4
53 
54 #ifdef  __cplusplus
55 }
56 #endif
57 
58 #endif
59