[asterisk-commits] seanbright: branch group/asterisk-cpp r168432 - /team/group/asterisk-cpp/main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Jan 10 22:19:37 CST 2009
Author: seanbright
Date: Sat Jan 10 22:19:37 2009
New Revision: 168432
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168432
Log:
dns.c compiles (just needed to change 'class' to 'dn_class')
Modified:
team/group/asterisk-cpp/main/dns.c
Modified: team/group/asterisk-cpp/main/dns.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/dns.c?view=diff&rev=168432&r1=168431&r2=168432
==============================================================================
--- team/group/asterisk-cpp/main/dns.c (original)
+++ team/group/asterisk-cpp/main/dns.c Sat Jan 10 22:19:37 2009
@@ -153,7 +153,7 @@
struct dn_answer {
unsigned short rtype;
- unsigned short class;
+ unsigned short dn_class;
unsigned int ttl;
unsigned short size;
} __attribute__((__packed__));
@@ -183,7 +183,7 @@
/*! \brief Parse DNS lookup result, call callback */
static int dns_parse_answer(void *context,
- int class, int type, unsigned char *answer, int len,
+ int dn_class, int type, unsigned char *answer, int len,
int (*callback)(void *context, unsigned char *answer, int len, unsigned char *fullanswer))
{
unsigned char *fullanswer = answer;
@@ -202,7 +202,7 @@
ast_log(LOG_WARNING, "Couldn't skip over name\n");
return -1;
}
- answer += res + 4; /* Skip name and QCODE / QCLASS */
+ answer += res + 4; /* Skip name and QCODE / QDN_CLASS */
len -= res + 4;
if (len < 0) {
ast_log(LOG_WARNING, "Strange query size\n");
@@ -229,7 +229,7 @@
return -1;
}
- if (ntohs(ans->class) == class && ntohs(ans->rtype) == type) {
+ if (ntohs(ans->dn_class) == dn_class && ntohs(ans->rtype) == type) {
if (callback) {
if ((res = callback(context, answer, ntohs(ans->size), fullanswer)) < 0) {
ast_log(LOG_WARNING, "Failed to parse result\n");
@@ -253,7 +253,7 @@
not work properly, Asterisk might not start properly or a channel may lock.
*/
int ast_search_dns(void *context,
- const char *dname, int class, int type,
+ const char *dname, int dn_class, int type,
int (*callback)(void *context, unsigned char *answer, int len, unsigned char *fullanswer))
{
#ifdef HAVE_RES_NINIT
@@ -265,14 +265,14 @@
#ifdef HAVE_RES_NINIT
memset(&dnsstate, 0, sizeof(dnsstate));
res_ninit(&dnsstate);
- res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer));
+ res = res_nsearch(&dnsstate, dname, dn_class, type, answer, sizeof(answer));
#else
ast_mutex_lock(&res_lock);
res_init();
- res = res_search(dname, class, type, answer, sizeof(answer));
+ res = res_search(dname, dn_class, type, answer, sizeof(answer));
#endif
if (res > 0) {
- if ((res = dns_parse_answer(context, class, type, answer, res, callback)) < 0) {
+ if ((res = dns_parse_answer(context, dn_class, type, answer, res, callback)) < 0) {
ast_log(LOG_WARNING, "DNS Parse error for %s\n", dname);
ret = -1;
} else if (res == 0) {
More information about the asterisk-commits
mailing list