[asterisk-commits] jpeeler: branch jpeeler/sip-dnsmgr r111775 - in /team/jpeeler/sip-dnsmgr: inc...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Mar 28 14:09:58 CDT 2008
Author: jpeeler
Date: Fri Mar 28 14:09:58 2008
New Revision: 111775
URL: http://svn.digium.com/view/asterisk?view=rev&rev=111775
Log:
more sockaddr_in additions
Modified:
team/jpeeler/sip-dnsmgr/include/asterisk/dnsmgr.h
team/jpeeler/sip-dnsmgr/main/dnsmgr.c
Modified: team/jpeeler/sip-dnsmgr/include/asterisk/dnsmgr.h
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/include/asterisk/dnsmgr.h?view=diff&rev=111775&r1=111774&r2=111775
==============================================================================
--- team/jpeeler/sip-dnsmgr/include/asterisk/dnsmgr.h (original)
+++ team/jpeeler/sip-dnsmgr/include/asterisk/dnsmgr.h Fri Mar 28 14:09:58 2008
@@ -53,7 +53,7 @@
*/
struct ast_dnsmgr_entry *ast_dnsmgr_get(const char *name, struct in_addr *result);
-struct ast_dnsmgr_entry *ast_dnsmgr_get_srv(const char *name, struct in_addr *result, unsigned short *portno, const char *service);
+struct ast_dnsmgr_entry *ast_dnsmgr_get_srv(const char *name, struct sockaddr_in *result, const char *service);
/*!
Modified: team/jpeeler/sip-dnsmgr/main/dnsmgr.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/sip-dnsmgr/main/dnsmgr.c?view=diff&rev=111775&r1=111774&r2=111775
==============================================================================
--- team/jpeeler/sip-dnsmgr/main/dnsmgr.c (original)
+++ team/jpeeler/sip-dnsmgr/main/dnsmgr.c Fri Mar 28 14:09:58 2008
@@ -102,21 +102,21 @@
}
-struct ast_dnsmgr_entry *ast_dnsmgr_get_srv(const char *name, struct in_addr *result, unsigned short *portno, const char *service)
+struct ast_dnsmgr_entry *ast_dnsmgr_get_srv(const char *name, struct sockaddr_in *result, const char *service)
{
struct ast_dnsmgr_entry *entry;
if (!result || ast_strlen_zero(name) || !(entry = ast_calloc(1, sizeof(*entry) + strlen(name))))
return NULL;
- entry->result = result;
- entry->result_portno = portno;
+ entry->result = &result->sin_addr;
+ entry->result_portno = &result->sin_port;
ast_mutex_init(&entry->lock);
strcpy(entry->name, name);
strcpy(entry->service, service);
- memcpy(&entry->last, result, sizeof(entry->last));
+ memcpy(&entry->last, &result->sin_addr, sizeof(entry->last));
ast_log(LOG_DEBUG, "******************* entry->last_portno@%p entry->last@%p", &entry->last_portno, &entry->last);
- entry->last_portno = *portno;
+ entry->last_portno = result->sin_port;
entry->dnssrv = 1;
AST_RWLIST_WRLOCK(&entry_list);
@@ -215,7 +215,7 @@
return 0;
ast_verb(3, "adding dns manager for '%s'\n", name);
- *dnsmgr = ast_dnsmgr_get_srv(name, &sin->sin_addr, &sin->sin_port, service);
+ *dnsmgr = ast_dnsmgr_get_srv(name, sin, service);
return !*dnsmgr;
}
More information about the asterisk-commits
mailing list