[sr-dev] git:master: snmpstats add support for ws, wss and sctp transports

Olle E. Johansson oej at edvina.net
Sun Feb 24 22:17:54 CET 2013


Module: sip-router
Branch: master
Commit: 39bffdd7db9c3118045eae9640659997bac4bf4e
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=39bffdd7db9c3118045eae9640659997bac4bf4e

Author: Olle E. Johansson <oej at edvina.net>
Committer: Olle E. Johansson <oej at edvina.net>
Date:   Sun Feb 24 22:17:25 2013 +0100

snmpstats add support for ws, wss and sctp transports

---

 modules/snmpstats/snmpSIPPortTable.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/modules/snmpstats/snmpSIPPortTable.c b/modules/snmpstats/snmpSIPPortTable.c
index 3eb91ed..5d57c2e 100644
--- a/modules/snmpstats/snmpSIPPortTable.c
+++ b/modules/snmpstats/snmpSIPPortTable.c
@@ -5,6 +5,9 @@
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder (jmagder at somanetworks.com)
  *
+ * Copyright (C) 2013 Edvina AB, Sollentuna, Sweden
+ * Modifications by: Olle E. Johansson (oej at edvina.net)
+ *
  * This file is part of Kamailio, a free SIP server.
  *
  * Kamailio is free software; you can redistribute it and/or modify it
@@ -25,6 +28,7 @@
  * History:
  * --------
  * 2006-11-23 initial version (jmagder)
+ * 2013-02-24 Added WS, WSS and SCTP support (oej)
  * 
  * Originally Generated with mib2c using mib2c.array-user.conf
  *
@@ -183,6 +187,18 @@ void createRowsFromIPList(int *theList, int listSize, int protocol,
 	{
 		valueToAssign = TC_TRANSPORT_PROTOCOL_TLS;
 	}
+	else if (protocol == PROTO_WS)
+	{
+		valueToAssign = TC_TRANSPORT_PROTOCOL_WS;
+	}
+	else if (protocol == PROTO_WSS)
+	{
+		valueToAssign = TC_TRANSPORT_PROTOCOL_WSS;
+	}
+	else if (protocol == PROTO_SCTP)
+	{
+		valueToAssign = TC_SIP_TRANSPORT_PROTOCOL_SCTP;
+	}
 	else 
 	{
 		valueToAssign = TC_TRANSPORT_PROTOCOL_OTHER;
@@ -224,15 +240,24 @@ void init_kamailioSIPPortTable(void)
 	int *UDPList = NULL;
 	int *TCPList = NULL;
 	int *TLSList = NULL;
+	int *WSList = NULL;
+	int *WSSList = NULL;
+	int *SCTPList = NULL;
 
 	int numUDPSockets;
 	int numTCPSockets; 
 	int numTLSSockets;
+	int numWSSockets;
+	int numWSSSockets;
+	int numSCTPSockets;
 	
 	/* Retrieve the list of the number of UDP and TCP sockets. */
 	numUDPSockets = get_socket_list_from_proto(&UDPList, PROTO_UDP);
 	numTCPSockets = get_socket_list_from_proto(&TCPList, PROTO_TCP);
 	numTLSSockets = get_socket_list_from_proto(&TLSList, PROTO_TLS);
+	numWSSockets = get_socket_list_from_proto(&WSList, PROTO_WS);
+	numWSSSockets = get_socket_list_from_proto(&WSSList, PROTO_WSS);
+	numSCTPSockets = get_socket_list_from_proto(&SCTPList, PROTO_SCTP);
 
 	/* Generate all rows, using all retrieved interfaces. */
 	createRowsFromIPList(UDPList, numUDPSockets, PROTO_UDP, &curSNMPIndex);
@@ -243,6 +268,15 @@ void init_kamailioSIPPortTable(void)
 
 	curSNMPIndex = 0;
 	createRowsFromIPList(TLSList, numTLSSockets, PROTO_TLS, &curSNMPIndex);
+
+	curSNMPIndex = 0;
+	createRowsFromIPList(WSList, numWSSockets, PROTO_WS, &curSNMPIndex);
+
+	curSNMPIndex = 0;
+	createRowsFromIPList(WSSList, numWSSSockets, PROTO_WSS, &curSNMPIndex);
+
+	curSNMPIndex = 0;
+	createRowsFromIPList(SCTPList, numSCTPSockets, PROTO_SCTP, &curSNMPIndex);
 }
 
  




More information about the sr-dev mailing list