00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of either: 00004 * 00005 * a) The GNU Lesser General Public License as published by the Free 00006 * Software Foundation; either version 2.1, or (at your option) any 00007 * later version, 00008 * 00009 * OR 00010 * 00011 * b) The two-clause BSD license. 00012 * 00013 * These licenses can be found with the distribution in the file LICENSES 00014 */ 00015 00016 00017 00018 00019 #ifndef INC_SPF_DNS_RR 00020 #define INC_SPF_DNS_RR 00021 00022 #include "spf_dns.h" 00023 00030 typedef 00031 union 00032 { 00033 struct in_addr a; 00034 char ptr[1]; 00035 char mx[1]; 00036 char txt[1]; 00037 struct in6_addr aaaa; 00038 } SPF_dns_rr_data_t; 00039 00049 typedef 00050 struct SPF_dns_rr_struct 00051 { 00052 /* query information */ 00053 char *domain; 00054 size_t domain_buf_len; 00056 ns_type rr_type; 00058 /* answer information */ 00059 int num_rr; 00060 SPF_dns_rr_data_t **rr; 00061 size_t *rr_buf_len; 00062 int rr_buf_num; 00064 time_t ttl; 00065 time_t utc_ttl; 00066 SPF_dns_stat_t herrno; 00068 /* misc information */ 00069 void *hook; 00070 SPF_dns_server_t *source; 00071 } SPF_dns_rr_t; 00072 00073 SPF_dns_rr_t *SPF_dns_rr_new(void); 00074 void SPF_dns_rr_free(SPF_dns_rr_t *spfrr); 00075 SPF_dns_rr_t *SPF_dns_rr_new_init(SPF_dns_server_t *spf_dns_server, 00076 const char *domain, 00077 ns_type rr_type, int ttl, 00078 SPF_dns_stat_t herrno); 00079 SPF_dns_rr_t *SPF_dns_rr_new_nxdomain(SPF_dns_server_t *spf_dns_server, 00080 const char *domain); 00081 00082 SPF_errcode_t SPF_dns_rr_buf_realloc(SPF_dns_rr_t *spfrr, 00083 int idx, size_t len ); 00084 SPF_errcode_t SPF_dns_rr_dup(SPF_dns_rr_t **dstp, SPF_dns_rr_t *src); 00085 00086 00087 #endif