Browse code

snmpstats Final fixes for IPv6 support.

Olle E. Johansson authored on 07/04/2013 07:53:24
Showing 2 changed files
... ...
@@ -173,7 +173,7 @@ static void createRowsFromIPList(int *theList, int listSize, int protocol,
173 173
 		int *snmpIndex, int family) {
174 174
 
175 175
 	kamailioSIPPortTable_context *currentRow;
176
-	
176
+	int num_octets = family == AF_INET ? NUM_IP_OCTETS : NUM_IPV6_OCTETS;
177 177
 	int curIndexOfIP;
178 178
 	int curSocketIdx;
179 179
 	int valueToAssign;
... ...
@@ -190,14 +190,6 @@ static void createRowsFromIPList(int *theList, int listSize, int protocol,
190 190
 	{
191 191
 		valueToAssign = TC_TRANSPORT_PROTOCOL_TLS;
192 192
 	}
193
-	else if (protocol == PROTO_WS)
194
-	{
195
-		valueToAssign = TC_TRANSPORT_PROTOCOL_WS;
196
-	}
197
-	else if (protocol == PROTO_WSS)
198
-	{
199
-		valueToAssign = TC_TRANSPORT_PROTOCOL_WSS;
200
-	}
201 193
 	else if (protocol == PROTO_SCTP)
202 194
 	{
203 195
 		valueToAssign = TC_SIP_TRANSPORT_PROTOCOL_SCTP;
... ...
@@ -210,7 +202,7 @@ static void createRowsFromIPList(int *theList, int listSize, int protocol,
210 202
 	/* Create all rows with respect to the given protocol */
211 203
 	for (curSocketIdx=0; curSocketIdx < listSize; curSocketIdx++) {
212 204
 
213
-		curIndexOfIP   = (NUM_IP_OCTETS + 1) * curSocketIdx;
205
+		curIndexOfIP   = (num_octets + 1) * curSocketIdx;
214 206
 		
215 207
 		/* Retrieve an existing row, or a new row if one doesn't
216 208
 		 * already exist. 
... ...
@@ -47,8 +47,7 @@ extern "C" {
47 47
 
48 48
 #include "../../config.h"
49 49
 
50
-// OLD #define SIP_PORT_TABLE_STR_INDEX_SIZE 10
51
-#define SIP_PORT_TABLE_STR_INDEX_SIZE 50
50
+#define SIP_PORT_TABLE_STR_INDEX_SIZE 22
52 51
 
53 52
 /* This structure represents a single row in the table. */
54 53
 typedef struct kamailioSIPPortTable_context_s