diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-06-06 12:20:59 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-06-06 12:20:59 +0000 |
commit | 44aff2650f4c3d033049049ebbf08eed88b2b434 (patch) | |
tree | fc334cc4847e4e011562128a78e97c8499d199d7 /src/include/gnunet_dnsparser_lib.h | |
parent | 62e273beeae391a44615e350e48f4ee40f2eab7a (diff) | |
download | gnunet-44aff2650f4c3d033049049ebbf08eed88b2b434.tar.gz gnunet-44aff2650f4c3d033049049ebbf08eed88b2b434.zip |
towards sanity in SRV handling
Diffstat (limited to 'src/include/gnunet_dnsparser_lib.h')
-rw-r--r-- | src/include/gnunet_dnsparser_lib.h | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/src/include/gnunet_dnsparser_lib.h b/src/include/gnunet_dnsparser_lib.h index 6dc75b9a4..fc4b7444e 100644 --- a/src/include/gnunet_dnsparser_lib.h +++ b/src/include/gnunet_dnsparser_lib.h | |||
@@ -109,45 +109,12 @@ struct GNUNET_DNSPARSER_MxRecord | |||
109 | 109 | ||
110 | 110 | ||
111 | /** | 111 | /** |
112 | * Information from SRV records (RFC 2782). The 'service', 'proto' | 112 | * Information from SRV records (RFC 2782). |
113 | * and 'domain_name' fields together give the DNS-name which for SRV | ||
114 | * records is of the form "_$SERVICE._$PROTO.$DOMAIN_NAME". The DNS | ||
115 | * parser provides the full name in `struct DNSPARSER_Record` and the | ||
116 | * individual components in the respective fields of this struct. | ||
117 | * When serializing, you CAN set the 'name' field of 'struct | ||
118 | * GNUNET_DNSPARSER_Record' to NULL, in which case the DNSPARSER code | ||
119 | * will populate 'name' from the 'service', 'proto' and 'domain_name' | ||
120 | * fields in this struct. | ||
121 | */ | 113 | */ |
122 | struct GNUNET_DNSPARSER_SrvRecord | 114 | struct GNUNET_DNSPARSER_SrvRecord |
123 | { | 115 | { |
124 | 116 | ||
125 | /** | 117 | /** |
126 | * Service name without the underscore (!). Note that RFC 6335 clarifies the | ||
127 | * set of legal characters for service names. | ||
128 | * In UTF-8 format. The library will convert from and to DNS-IDNA | ||
129 | * as necessary. Use #GNUNET_DNSPARSER_check_label() to test if an | ||
130 | * individual label is well-formed. If a given name is not well-formed, | ||
131 | * creating the DNS packet will fail. | ||
132 | */ | ||
133 | char *service; | ||
134 | |||
135 | /** | ||
136 | * Transport protocol (typcially "tcp" or "udp", but others might be allowed). | ||
137 | * Without the underscore (!). | ||
138 | */ | ||
139 | char *proto; | ||
140 | |||
141 | /** | ||
142 | * Domain name for which the record is valid | ||
143 | * In UTF-8 format. The library will convert from and to DNS-IDNA | ||
144 | * as necessary. Use #GNUNET_DNSPARSER_check_label() to test if an | ||
145 | * individual label is well-formed. If a given name is not well-formed, | ||
146 | * creating the DNS packet will fail. | ||
147 | */ | ||
148 | char *domain_name; | ||
149 | |||
150 | /** | ||
151 | * Hostname offering the service. | 118 | * Hostname offering the service. |
152 | * In UTF-8 format. The library will convert from and to DNS-IDNA | 119 | * In UTF-8 format. The library will convert from and to DNS-IDNA |
153 | * as necessary. Use #GNUNET_DNSPARSER_check_label() to test if an | 120 | * as necessary. Use #GNUNET_DNSPARSER_check_label() to test if an |
@@ -834,7 +801,6 @@ GNUNET_DNSPARSER_parse_mx (const char *udp_payload, | |||
834 | /** | 801 | /** |
835 | * Parse a DNS SRV record. | 802 | * Parse a DNS SRV record. |
836 | * | 803 | * |
837 | * @param r_name name of the SRV record | ||
838 | * @param udp_payload reference to UDP packet | 804 | * @param udp_payload reference to UDP packet |
839 | * @param udp_payload_length length of @a udp_payload | 805 | * @param udp_payload_length length of @a udp_payload |
840 | * @param off pointer to the offset of the query to parse in the SRV record (to be | 806 | * @param off pointer to the offset of the query to parse in the SRV record (to be |
@@ -842,8 +808,7 @@ GNUNET_DNSPARSER_parse_mx (const char *udp_payload, | |||
842 | * @return the parsed SRV record, NULL on error | 808 | * @return the parsed SRV record, NULL on error |
843 | */ | 809 | */ |
844 | struct GNUNET_DNSPARSER_SrvRecord * | 810 | struct GNUNET_DNSPARSER_SrvRecord * |
845 | GNUNET_DNSPARSER_parse_srv (const char *r_name, | 811 | GNUNET_DNSPARSER_parse_srv (const char *udp_payload, |
846 | const char *udp_payload, | ||
847 | size_t udp_payload_length, | 812 | size_t udp_payload_length, |
848 | size_t *off); | 813 | size_t *off); |
849 | 814 | ||