[sr-dev] git:andrei/tcp_tls_changes: tls: added tls_info rpc

Andrei Pelinescu-Onciul andrei at iptel.org
Fri May 28 13:44:56 CEST 2010


Module: sip-router
Branch: andrei/tcp_tls_changes
Commit: bdc512a7e5416fa30d9760f50cc949281d0e71a1
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bdc512a7e5416fa30d9760f50cc949281d0e71a1

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Wed May 26 15:53:33 2010 +0200

tls: added tls_info rpc

The tls_info rpc should print various internal tls informations
and statistics. For now it prints the overall amount of write-queued
clear text.

---

 modules/tls/tls_rpc.c |   26 +++++++++++++++++++++-----
 modules/tls/tls_rpc.h |   14 ++++----------
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/modules/tls/tls_rpc.c b/modules/tls/tls_rpc.c
index 542500d..8351439 100644
--- a/modules/tls/tls_rpc.c
+++ b/modules/tls/tls_rpc.c
@@ -23,11 +23,10 @@
  * along with this program; if not, write to the Free Software 
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-/*!
- * \file
- * \brief SIP-router TLS support :: management interface
- * \ingroup tls
- * Module: \ref tls
+/** tls module management interface (rpc).
+ * @file tls_rpc.c
+ * @ingroup tls
+ * Module: @ref tls
  */
 
 
@@ -40,6 +39,7 @@
 #include "tls_config.h"
 #include "tls_util.h"
 #include "tls_server.h"
+#include "tls_ct_wrq.h"
 #include "tls_rpc.h"
 
 static const char* tls_reload_doc[2] = {
@@ -140,8 +140,24 @@ static void tls_list(rpc_t* rpc, void* c)
 
 
 
+static const char* tls_info_doc[2] = {
+	"Returns internal tls related info.",
+	0 };
+
+static void tls_info(rpc_t* rpc, void* c)
+{
+	void* handle;
+	rpc->add(c, "{", &handle);
+	rpc->struct_add(handle, "d",
+			"clear_text_write_queued_bytes", tls_ct_wq_total_bytes());
+}
+
+
+
+
 rpc_export_t tls_rpc[] = {
 	{"tls.reload", tls_reload, tls_reload_doc, 0},
 	{"tls.list",   tls_list,   tls_list_doc,   RET_ARRAY},
+	{"tls.info",   tls_info,   tls_info_doc, 0},
 	{0, 0, 0, 0}
 };
diff --git a/modules/tls/tls_rpc.h b/modules/tls/tls_rpc.h
index d7154f2..b292de1 100644
--- a/modules/tls/tls_rpc.h
+++ b/modules/tls/tls_rpc.h
@@ -14,11 +14,6 @@
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
- * For a license to use the sip-router software under conditions
- * other than those described here, or to purchase support for this
- * software, please contact iptel.org by e-mail at the following addresses:
- *    info at iptel.org
- *
  * sip-router is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -28,11 +23,10 @@
  * along with this program; if not, write to the Free Software 
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-/*!
- * \file
- * \brief SIP-router TLS support :: Management interface
- * \ingroup tls
- * Module: \ref tls
+/** tls module management interface (rpc).
+ * @file tls_rpc.h
+ * @ingroup tls
+ * Module: @ref tls
  */
 
 #ifndef _TLS_RPC_H




More information about the sr-dev mailing list