diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-05 12:17:50 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-05 12:17:50 +0000 |
commit | 2f26ab4c1a43a754fbb1d2cc3e27e82db272f81e (patch) | |
tree | 38d518fcdddb311e01207138bb1cae77237d5786 /src/include/gnunet_dnsparser_lib.h | |
parent | 8b7ec32a2fd246b2356a056abd7d17ebac81edcf (diff) | |
download | gnunet-2f26ab4c1a43a754fbb1d2cc3e27e82db272f81e.tar.gz gnunet-2f26ab4c1a43a754fbb1d2cc3e27e82db272f81e.zip |
-dns API improvements, towards serialization
Diffstat (limited to 'src/include/gnunet_dnsparser_lib.h')
-rw-r--r-- | src/include/gnunet_dnsparser_lib.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/include/gnunet_dnsparser_lib.h b/src/include/gnunet_dnsparser_lib.h index 70dc63326..6654394be 100644 --- a/src/include/gnunet_dnsparser_lib.h +++ b/src/include/gnunet_dnsparser_lib.h | |||
@@ -224,6 +224,24 @@ struct GNUNET_DNSPARSER_SoaRecord | |||
224 | 224 | ||
225 | 225 | ||
226 | /** | 226 | /** |
227 | * Binary record information (unparsed). | ||
228 | */ | ||
229 | struct GNUNET_DNSPARSER_RawRecord | ||
230 | { | ||
231 | |||
232 | /** | ||
233 | * Binary record data. | ||
234 | */ | ||
235 | void *data; | ||
236 | |||
237 | /** | ||
238 | * Number of bytes in data. | ||
239 | */ | ||
240 | size_t data_len; | ||
241 | }; | ||
242 | |||
243 | |||
244 | /** | ||
227 | * A DNS response record. | 245 | * A DNS response record. |
228 | */ | 246 | */ |
229 | struct GNUNET_DNSPARSER_Record | 247 | struct GNUNET_DNSPARSER_Record |
@@ -255,14 +273,10 @@ struct GNUNET_DNSPARSER_Record | |||
255 | /** | 273 | /** |
256 | * Raw data for all other types. | 274 | * Raw data for all other types. |
257 | */ | 275 | */ |
258 | char *raw; | 276 | struct GNUNET_DNSPARSER_RawRecord raw; |
259 | 277 | ||
260 | } data; | 278 | } data; |
261 | 279 | ||
262 | /** | ||
263 | * Number of bytes in data. | ||
264 | */ | ||
265 | size_t data_len; | ||
266 | 280 | ||
267 | /** | 281 | /** |
268 | * When does the record expire? | 282 | * When does the record expire? |
@@ -366,6 +380,7 @@ GNUNET_DNSPARSER_free_packet (struct GNUNET_DNSPARSER_Packet *p); | |||
366 | * Given a DNS packet, generate the corresponding UDP payload. | 380 | * Given a DNS packet, generate the corresponding UDP payload. |
367 | * | 381 | * |
368 | * @param p packet to pack | 382 | * @param p packet to pack |
383 | * @param max maximum allowed size for the resulting UDP payload | ||
369 | * @param buf set to a buffer with the packed message | 384 | * @param buf set to a buffer with the packed message |
370 | * @param buf_length set to the length of buf | 385 | * @param buf_length set to the length of buf |
371 | * @return GNUNET_SYSERR if 'p' is invalid | 386 | * @return GNUNET_SYSERR if 'p' is invalid |
@@ -373,7 +388,8 @@ GNUNET_DNSPARSER_free_packet (struct GNUNET_DNSPARSER_Packet *p); | |||
373 | * GNUNET_OK if 'p' was packed completely into '*buf' | 388 | * GNUNET_OK if 'p' was packed completely into '*buf' |
374 | */ | 389 | */ |
375 | int | 390 | int |
376 | GNUNET_DNSPARSER_pack (struct GNUNET_DNSPARSER_Packet *p, | 391 | GNUNET_DNSPARSER_pack (const struct GNUNET_DNSPARSER_Packet *p, |
392 | uint16_t max, | ||
377 | char **buf, | 393 | char **buf, |
378 | size_t *buf_length); | 394 | size_t *buf_length); |
379 | 395 | ||