aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_dnsparser_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-21 07:32:50 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-21 07:32:50 +0000
commite2931e9e5cffd9f3dc37b71b2a01ed151c0dd4e5 (patch)
tree8f8b3ee426c5e88bafa66e53d937fa64018e5d5f /src/include/gnunet_dnsparser_lib.h
parente615a940e0a60823c040f1df2ba4977018692d28 (diff)
downloadgnunet-e2931e9e5cffd9f3dc37b71b2a01ed151c0dd4e5.tar.gz
gnunet-e2931e9e5cffd9f3dc37b71b2a01ed151c0dd4e5.zip
-improving comments, towards implementing #2268
Diffstat (limited to 'src/include/gnunet_dnsparser_lib.h')
-rw-r--r--src/include/gnunet_dnsparser_lib.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/include/gnunet_dnsparser_lib.h b/src/include/gnunet_dnsparser_lib.h
index 28cc4c048..5a42baea6 100644
--- a/src/include/gnunet_dnsparser_lib.h
+++ b/src/include/gnunet_dnsparser_lib.h
@@ -41,6 +41,7 @@
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_SRV 33
44 45
45/** 46/**
46 * A few common DNS classes (ok, only one is common, but I list a 47 * A few common DNS classes (ok, only one is common, but I list a
@@ -173,6 +174,65 @@ struct GNUNET_DNSPARSER_MxRecord
173 174
174}; 175};
175 176
177
178/**
179 * Information from SRV records (RFC 2782). The 'service', 'proto'
180 * and 'domain_name' fields together give the DNS-name which for SRV
181 * records is of the form "_$SERVICE._$PROTO.$DOMAIN_NAME". The DNS
182 * parser provides the full name in 'struct DNSPARSER_Record' and the
183 * individual components in the respective fields of this struct.
184 * When serializing, you CAN set the 'name' field of 'struct
185 * GNUNET_DNSPARSER_Record' to NULL, in which case the DNSPARSER code
186 * will populate 'name' from the 'service', 'proto' and 'domain_name'
187 * fields in this struct.
188 */
189struct GNUNET_DNSPARSER_SrvRecord
190{
191
192 /**
193 * Preference for this entry (lower value is higher preference).
194 * Without the underscore (!). Note that RFC 6335 clarifies the
195 * set of legal characters for service names.
196 */
197 char *service;
198
199 /**
200 * Transport protocol (typcially "tcp" or "udp", but others might be allowed).
201 * Without the underscore (!).
202 */
203 char *proto;
204
205 /**
206 * Domain name for which the record is valid
207 */
208 char *domain_name;
209
210 /**
211 * Hostname offering the service.
212 */
213 char *target;
214
215 /**
216 * Preference for this entry (lower value is higher preference). Clients
217 * will contact hosts from the lowest-priority group first and fall back
218 * to higher priorities if the low-priority entries are unavailable.
219 */
220 uint16_t priority;
221
222 /**
223 * Relative weight for records with the same priority. Clients will use
224 * the hosts of the same (lowest) priority with a probability proportional
225 * to the weight given.
226 */
227 uint16_t weight;
228
229 /**
230 * TCP or UDP port of the service.
231 */
232 uint16_t port;
233
234};
235
176 236
177/** 237/**
178 * Information from SOA records (RFC 1035). 238 * Information from SOA records (RFC 1035).
@@ -252,6 +312,9 @@ struct GNUNET_DNSPARSER_Record
252 */ 312 */
253 char *name; 313 char *name;
254 314
315 /**
316 * Payload of the record (which one of these is valid depends on the 'type').
317 */
255 union 318 union
256 { 319 {
257 320
@@ -271,6 +334,11 @@ struct GNUNET_DNSPARSER_Record
271 struct GNUNET_DNSPARSER_MxRecord *mx; 334 struct GNUNET_DNSPARSER_MxRecord *mx;
272 335
273 /** 336 /**
337 * SRV data for SRV records.
338 */
339 struct GNUNET_DNSPARSER_SrvRecord *srv;
340
341 /**
274 * Raw data for all other types. 342 * Raw data for all other types.
275 */ 343 */
276 struct GNUNET_DNSPARSER_RawRecord raw; 344 struct GNUNET_DNSPARSER_RawRecord raw;