2
0
Эх сурвалжийг харах

snmpstats Final fixes for IPv6 support.

Olle E. Johansson 12 жил өмнө
parent
commit
f2c17f4325

+ 2 - 10
modules/snmpstats/snmpSIPPortTable.c

@@ -173,7 +173,7 @@ static void createRowsFromIPList(int *theList, int listSize, int protocol,
 		int *snmpIndex, int family) {
 
 	kamailioSIPPortTable_context *currentRow;
-	
+	int num_octets = family == AF_INET ? NUM_IP_OCTETS : NUM_IPV6_OCTETS;
 	int curIndexOfIP;
 	int curSocketIdx;
 	int valueToAssign;
@@ -190,14 +190,6 @@ static 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;
@@ -210,7 +202,7 @@ static void createRowsFromIPList(int *theList, int listSize, int protocol,
 	/* Create all rows with respect to the given protocol */
 	for (curSocketIdx=0; curSocketIdx < listSize; curSocketIdx++) {
 
-		curIndexOfIP   = (NUM_IP_OCTETS + 1) * curSocketIdx;
+		curIndexOfIP   = (num_octets + 1) * curSocketIdx;
 		
 		/* Retrieve an existing row, or a new row if one doesn't
 		 * already exist. 

+ 1 - 2
modules/snmpstats/snmpSIPPortTable.h

@@ -47,8 +47,7 @@ extern "C" {
 
 #include "../../config.h"
 
-// OLD #define SIP_PORT_TABLE_STR_INDEX_SIZE 10
-#define SIP_PORT_TABLE_STR_INDEX_SIZE 50
+#define SIP_PORT_TABLE_STR_INDEX_SIZE 22
 
 /* This structure represents a single row in the table. */
 typedef struct kamailioSIPPortTable_context_s