Back to index

courier  0.68.2
rfc1035mxlist.h
Go to the documentation of this file.
00001 #ifndef       rfc1035_mx_h
00002 #define       rfc1035_mx_h
00003 
00004 /*
00005 ** Copyright 1998 - 1999 Double Precision, Inc.
00006 ** See COPYING for distribution information.
00007 */
00008 
00009 #if    HAVE_CONFIG_H
00010 #include "config.h"
00011 #endif
00012 
00013 #include      <sys/types.h>
00014 #include      <netinet/in.h>
00015 #include      <arpa/inet.h>
00016 
00017 
00018 #ifdef  __cplusplus
00019 extern "C" {
00020 #endif
00021 
00022 #define       RFC1035_MX_OK        0      /* Ok, records follow */
00023 #define       RFC1035_MX_SOFTERR   1      /* Soft DNS error */
00024 #define       RFC1035_MX_HARDERR   2      /* Hard DNS error */
00025 #define       RFC1035_MX_INTERNAL  3      /* Internal library error */
00026 #define       RFC1035_MX_BADDNS    4      /* Bad DNS records */
00027 
00028 struct rfc1035_mxlist {
00029        struct rfc1035_mxlist *next;
00030        int    protocol;
00031 #if    RFC1035_IPV6
00032        struct sockaddr_storage address;
00033 #else
00034        struct sockaddr address;
00035 #endif
00036        int priority; /* -1 for plain old A records */
00037        int ad;
00038        char *hostname;
00039        } ;
00040 
00041 struct rfc1035_res;
00042 
00043 int rfc1035_mxlist_create(struct rfc1035_res *,
00044        const char *, struct rfc1035_mxlist **);
00045 void rfc1035_mxlist_free(struct rfc1035_mxlist *);
00046 
00047 int rfc1035_mxlist_create_x(struct rfc1035_res *,
00048                          const char *, int,
00049                          struct rfc1035_mxlist **);
00050 #define RFC1035_MX_AFALLBACK 1
00051 #define RFC1035_MX_IGNORESOFTERR 2
00052 
00053 #ifdef  __cplusplus
00054 }
00055 #endif
00056 
00057 #endif