diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-04 15:17:53 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-04 15:17:53 +0000 |
commit | c217aa8750bebf75b4a4a0d020cc516e8efad7be (patch) | |
tree | 6147622e7fb3e893e9a4c3d4910a61d0c96f06d5 /src/include/gnunet_dnsparser_lib.h | |
parent | c8fe500945cd968e37f2e6c462689e0ada061bce (diff) | |
download | gnunet-c217aa8750bebf75b4a4a0d020cc516e8efad7be.tar.gz gnunet-c217aa8750bebf75b4a4a0d020cc516e8efad7be.zip |
-dns parser works now well-enough
Diffstat (limited to 'src/include/gnunet_dnsparser_lib.h')
-rw-r--r-- | src/include/gnunet_dnsparser_lib.h | 98 |
1 files changed, 92 insertions, 6 deletions
diff --git a/src/include/gnunet_dnsparser_lib.h b/src/include/gnunet_dnsparser_lib.h index ef2ec389f..70dc63326 100644 --- a/src/include/gnunet_dnsparser_lib.h +++ b/src/include/gnunet_dnsparser_lib.h | |||
@@ -41,8 +41,6 @@ | |||
41 | #define GNUNET_DNSPARSER_TYPE_MX 15 | 41 | #define GNUNET_DNSPARSER_TYPE_MX 15 |
42 | #define GNUNET_DNSPARSER_TYPE_TXT 16 | 42 | #define GNUNET_DNSPARSER_TYPE_TXT 16 |
43 | #define GNUNET_DNSPARSER_TYPE_AAAA 28 | 43 | #define GNUNET_DNSPARSER_TYPE_AAAA 28 |
44 | #define GNUNET_DNSPARSER_TYPE_IXFR 251 | ||
45 | #define GNUNET_DNSPARSER_TYPE_AXFR 252 | ||
46 | 44 | ||
47 | /** | 45 | /** |
48 | * A few common DNS classes (ok, only one is common, but I list a | 46 | * A few common DNS classes (ok, only one is common, but I list a |
@@ -158,6 +156,74 @@ struct GNUNET_DNSPARSER_Query | |||
158 | 156 | ||
159 | 157 | ||
160 | /** | 158 | /** |
159 | * Information from MX records (RFC 1035). | ||
160 | */ | ||
161 | struct GNUNET_DNSPARSER_MxRecord | ||
162 | { | ||
163 | |||
164 | /** | ||
165 | * Preference for this entry (lower value is higher preference). | ||
166 | */ | ||
167 | uint16_t preference; | ||
168 | |||
169 | /** | ||
170 | * Name of the mail server. | ||
171 | */ | ||
172 | char *mxhost; | ||
173 | |||
174 | }; | ||
175 | |||
176 | |||
177 | /** | ||
178 | * Information from SOA records (RFC 1035). | ||
179 | */ | ||
180 | struct GNUNET_DNSPARSER_SoaRecord | ||
181 | { | ||
182 | |||
183 | /** | ||
184 | *The domainname of the name server that was the | ||
185 | * original or primary source of data for this zone. | ||
186 | */ | ||
187 | char *mname; | ||
188 | |||
189 | /** | ||
190 | * A domainname which specifies the mailbox of the | ||
191 | * person responsible for this zone. | ||
192 | */ | ||
193 | char *rname; | ||
194 | |||
195 | /** | ||
196 | * The version number of the original copy of the zone. | ||
197 | */ | ||
198 | uint32_t serial; | ||
199 | |||
200 | /** | ||
201 | * Time interval before the zone should be refreshed. | ||
202 | */ | ||
203 | uint32_t refresh; | ||
204 | |||
205 | /** | ||
206 | * Time interval that should elapse before a failed refresh should | ||
207 | * be retried. | ||
208 | */ | ||
209 | uint32_t retry; | ||
210 | |||
211 | /** | ||
212 | * Time value that specifies the upper limit on the time interval | ||
213 | * that can elapse before the zone is no longer authoritative. | ||
214 | */ | ||
215 | uint32_t expire; | ||
216 | |||
217 | /** | ||
218 | * The bit minimum TTL field that should be exported with any RR | ||
219 | * from this zone. | ||
220 | */ | ||
221 | uint32_t minimum_ttl; | ||
222 | |||
223 | }; | ||
224 | |||
225 | |||
226 | /** | ||
161 | * A DNS response record. | 227 | * A DNS response record. |
162 | */ | 228 | */ |
163 | struct GNUNET_DNSPARSER_Record | 229 | struct GNUNET_DNSPARSER_Record |
@@ -168,10 +234,30 @@ struct GNUNET_DNSPARSER_Record | |||
168 | */ | 234 | */ |
169 | char *name; | 235 | char *name; |
170 | 236 | ||
171 | /** | 237 | union |
172 | * Raw data, NOT a 0-terminated string (at least not always). | 238 | { |
173 | */ | 239 | |
174 | char *data; | 240 | /** |
241 | * For NS, CNAME and PTR records, this is the uncompressed 0-terminated hostname. | ||
242 | */ | ||
243 | char *hostname; | ||
244 | |||
245 | /** | ||
246 | * SOA data for SOA records. | ||
247 | */ | ||
248 | struct GNUNET_DNSPARSER_SoaRecord *soa; | ||
249 | |||
250 | /** | ||
251 | * MX data for MX records. | ||
252 | */ | ||
253 | struct GNUNET_DNSPARSER_MxRecord *mx; | ||
254 | |||
255 | /** | ||
256 | * Raw data for all other types. | ||
257 | */ | ||
258 | char *raw; | ||
259 | |||
260 | } data; | ||
175 | 261 | ||
176 | /** | 262 | /** |
177 | * Number of bytes in data. | 263 | * Number of bytes in data. |