Fix ENUM documentation (bug #3698)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2005-03-02 05:17:13 +00:00
parent 0eab1fabcf
commit a5a45131bb
4 changed files with 101 additions and 42 deletions

14
dns.c
View File

@@ -89,9 +89,10 @@ static int skip_name(u_char *s, int len)
return x;
}
/*--- dns_parse_answer: Parse DNS lookup result, call callback */
static int dns_parse_answer(void *context,
int class, int type, u_char *answer, int len,
int (*callback)(void *context, u_char *answer, int len, u_char *fullanswer))
int class, int type, u_char *answer, int len,
int (*callback)(void *context, u_char *answer, int len, u_char *fullanswer))
{
u_char *fullanswer = answer;
struct dn_answer *ans;
@@ -160,9 +161,10 @@ AST_MUTEX_DEFINE_STATIC(res_lock);
#endif
#endif
/*--- ast_search_dns: Lookup record in DNS */
int ast_search_dns(void *context,
const char *dname, int class, int type,
int (*callback)(void *context, u_char *answer, int len, u_char *fullanswer))
const char *dname, int class, int type,
int (*callback)(void *context, u_char *answer, int len, u_char *fullanswer))
{
#ifdef HAS_RES_NINIT
struct __res_state dnsstate;
@@ -180,11 +182,11 @@ int ast_search_dns(void *context,
#endif
if (res > 0) {
if ((res = dns_parse_answer(context, class, type, answer, res, callback)) < 0) {
ast_log(LOG_WARNING, "Parse error\n");
ast_log(LOG_WARNING, "DNS Parse error for %s\n", dname);
ret = -1;
}
else if (ret == 0) {
ast_log(LOG_DEBUG, "No matches found\n");
ast_log(LOG_DEBUG, "No matches found in DNS for %s\n", dname);
ret = 0;
}
else