Module: sip-router Branch: master Commit: f2c17f4325d5b03697e76bd4b4ee8050d5e4d6c8 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f2c17f43...
Author: Olle E. Johansson oej@edvina.net Committer: Olle E. Johansson oej@edvina.net Date: Sun Apr 7 09:53:24 2013 +0200
snmpstats Final fixes for IPv6 support.
---
modules/snmpstats/snmpSIPPortTable.c | 12 ++---------- modules/snmpstats/snmpSIPPortTable.h | 3 +-- 2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/modules/snmpstats/snmpSIPPortTable.c b/modules/snmpstats/snmpSIPPortTable.c index 46410d8..17524aa 100644 --- a/modules/snmpstats/snmpSIPPortTable.c +++ b/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. diff --git a/modules/snmpstats/snmpSIPPortTable.h b/modules/snmpstats/snmpSIPPortTable.h index eb552dc..f2b9cdd 100644 --- a/modules/snmpstats/snmpSIPPortTable.h +++ b/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