summaryrefslogtreecommitdiffstats
path: root/rfc1035/rfc1035mxlist.h
blob: 7846cfbbd0a0f452dcbc76d6b2f39ac9db69e89e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef	rfc1035_mx_h
#define	rfc1035_mx_h

/*
** Copyright 1998 - 1999 Double Precision, Inc.
** See COPYING for distribution information.
*/

#if	HAVE_CONFIG_H
#include "config.h"
#endif

#include	<sys/types.h>
#include	<netinet/in.h>
#include	<arpa/inet.h>


#ifdef  __cplusplus
extern "C" {
#endif

#define	RFC1035_MX_OK		0	/* Ok, records follow */
#define	RFC1035_MX_SOFTERR	1	/* Soft DNS error */
#define	RFC1035_MX_HARDERR	2	/* Hard DNS error */
#define	RFC1035_MX_INTERNAL	3	/* Internal library error */
#define	RFC1035_MX_BADDNS	4	/* Bad DNS records */
#define RFC1035_MX_NONE		5	/* "MX ." record */

struct rfc1035_mxlist {
	struct rfc1035_mxlist *next;
	int	protocol;
#if	RFC1035_IPV6
	struct sockaddr_storage address;
#else
	struct sockaddr address;
#endif
	int priority;	/* -1 for plain old A records */
	int ad;
	char *hostname;
	} ;

struct rfc1035_res;

int rfc1035_mxlist_create(struct rfc1035_res *,
	const char *, struct rfc1035_mxlist **);
void rfc1035_mxlist_free(struct rfc1035_mxlist *);

int rfc1035_mxlist_create_x(struct rfc1035_res *,
			    const char *, int,
			    struct rfc1035_mxlist **);
#define RFC1035_MX_AFALLBACK 1
#define RFC1035_MX_IGNORESOFTERR 2
#define RFC1035_MX_QUERYALL 4

#ifdef  __cplusplus
}
#endif

#endif