MEDIUM: dns: extract options
DNS selection preferences are actually declared inline in the
struct server. There are copied from the server struct to the
dns_resolution struct for each resolution.
Next patchs adds new preferences options, and it is not a good
way to copy all the configuration information before each dns
resolution.
This patch extract the configuration preference from the struct
server and declares a new dedicated struct. Only a pointer to this
new striuict will be copied before each dns resolution.
diff --git a/include/proto/dns.h b/include/proto/dns.h
index 4ccbfa0..170eefa 100644
--- a/include/proto/dns.h
+++ b/include/proto/dns.h
@@ -34,8 +34,8 @@
uint16_t dns_rnd16(void);
int dns_validate_dns_response(unsigned char *resp, unsigned char *bufend, char *dn_name, int dn_name_len);
int dns_get_ip_from_response(unsigned char *resp, unsigned char *resp_end,
- char *dn_name, int dn_name_len, void *currentip,
- short currentip_sin_family, int family_priority,
+ struct dns_resolution *resol, void *currentip,
+ short currentip_sin_family,
void **newip, short *newip_sin_family);
void dns_resolve_send(struct dgram_conn *dgram);
void dns_resolve_recv(struct dgram_conn *dgram);