[asterisk-commits] file: branch file/netsock2 r96446 - in /team/file/netsock2: include/asterisk/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 3 22:47:51 CST 2008


Author: file
Date: Thu Jan  3 22:47:50 2008
New Revision: 96446

URL: http://svn.digium.com/view/asterisk?view=rev&rev=96446
Log:
Add an API call, ast_netsock2_get_address, which returns the ast_netsock2_addr of a network socket. For child sockets this will be the remote party's information and for all other sockets it is the bound address.

Modified:
    team/file/netsock2/include/asterisk/netsock2.h
    team/file/netsock2/main/netsock2.c

Modified: team/file/netsock2/include/asterisk/netsock2.h
URL: http://svn.digium.com/view/asterisk/team/file/netsock2/include/asterisk/netsock2.h?view=diff&rev=96446&r1=96445&r2=96446
==============================================================================
--- team/file/netsock2/include/asterisk/netsock2.h (original)
+++ team/file/netsock2/include/asterisk/netsock2.h Thu Jan  3 22:47:50 2008
@@ -192,6 +192,12 @@
  */
 enum ast_netsock2_network_layer ast_netsock2_get_network_layer(const struct ast_netsock2_socket *socket);
 
+/*! \brief Get the ast_netsock2_addr structure of a network socket. For child sockets this is the remote address, for all other sockets it is the bound address.
+ * \param socket Socket to get the ast_netsock2_addr structure of
+ * \return Returns ast_netsock2_addr structure
+ */
+const struct ast_netsock2_addr *ast_netsock2_get_address(const struct ast_netsock2_socket *socket);
+
 /*! \brief Increment reference count of a socket
  * \param socket Socket to muck with
  */

Modified: team/file/netsock2/main/netsock2.c
URL: http://svn.digium.com/view/asterisk/team/file/netsock2/main/netsock2.c?view=diff&rev=96446&r1=96445&r2=96446
==============================================================================
--- team/file/netsock2/main/netsock2.c (original)
+++ team/file/netsock2/main/netsock2.c Thu Jan  3 22:47:50 2008
@@ -735,6 +735,15 @@
 	return socket->network_layer;
 }
 
+/*! \brief Get the ast_netsock2_addr structure of a network socket. For child sockets this is the remote address, for all other sockets it is the bound address.
+ * \param socket Socket to get the ast_netsock2_addr structure of
+ * \return Returns ast_netsock2_addr structure
+ */
+const struct ast_netsock2_addr *ast_netsock2_get_address(const struct ast_netsock2_socket *socket)
+{
+	return &socket->addr;
+}
+
 /*! \brief Increment reference count of a socket
  * \param socket Socket to muck with
  */




More information about the asterisk-commits mailing list