Browse code

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.

Andrei Pelinescu-Onciul authored on 26/05/2010 13:53:33
Showing 2 changed files
... ...
@@ -23,11 +23,10 @@
23 23
  * along with this program; if not, write to the Free Software 
24 24
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25 25
  */
26
-/*!
27
- * \file
28
- * \brief SIP-router TLS support :: management interface
29
- * \ingroup tls
30
- * Module: \ref tls
26
+/** tls module management interface (rpc).
27
+ * @file tls_rpc.c
28
+ * @ingroup tls
29
+ * Module: @ref tls
31 30
  */
32 31
 
33 32
 
... ...
@@ -40,6 +39,7 @@
40 39
 #include "tls_config.h"
41 40
 #include "tls_util.h"
42 41
 #include "tls_server.h"
42
+#include "tls_ct_wrq.h"
43 43
 #include "tls_rpc.h"
44 44
 
45 45
 static const char* tls_reload_doc[2] = {
... ...
@@ -140,8 +140,24 @@ static void tls_list(rpc_t* rpc, void* c)
140 140
 
141 141
 
142 142
 
143
+static const char* tls_info_doc[2] = {
144
+	"Returns internal tls related info.",
145
+	0 };
146
+
147
+static void tls_info(rpc_t* rpc, void* c)
148
+{
149
+	void* handle;
150
+	rpc->add(c, "{", &handle);
151
+	rpc->struct_add(handle, "d",
152
+			"clear_text_write_queued_bytes", tls_ct_wq_total_bytes());
153
+}
154
+
155
+
156
+
157
+
143 158
 rpc_export_t tls_rpc[] = {
144 159
 	{"tls.reload", tls_reload, tls_reload_doc, 0},
145 160
 	{"tls.list",   tls_list,   tls_list_doc,   RET_ARRAY},
161
+	{"tls.info",   tls_info,   tls_info_doc, 0},
146 162
 	{0, 0, 0, 0}
147 163
 };
... ...
@@ -14,11 +14,6 @@
14 14
  * the Free Software Foundation; either version 2 of the License, or
15 15
  * (at your option) any later version
16 16
  *
17
- * For a license to use the sip-router software under conditions
18
- * other than those described here, or to purchase support for this
19
- * software, please contact iptel.org by e-mail at the following addresses:
20
- *    info@iptel.org
21
- *
22 17
  * sip-router is distributed in the hope that it will be useful,
23 18
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 19
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
... ...
@@ -28,11 +23,10 @@
28 23
  * along with this program; if not, write to the Free Software 
29 24
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
30 25
  */
31
-/*!
32
- * \file
33
- * \brief SIP-router TLS support :: Management interface
34
- * \ingroup tls
35
- * Module: \ref tls
26
+/** tls module management interface (rpc).
27
+ * @file tls_rpc.h
28
+ * @ingroup tls
29
+ * Module: @ref tls
36 30
  */
37 31
 
38 32
 #ifndef _TLS_RPC_H