Quellcode durchsuchen

snmpstats: removed trailing spaces

Daniel-Constantin Mierla vor 1 Jahr
Ursprung
Commit
dfa5771273
35 geänderte Dateien mit 261 neuen und 261 gelöschten Zeilen
  1. 1 1
      src/modules/snmpstats/alarm_checks.h
  2. 8 8
      src/modules/snmpstats/hashTable.c
  3. 11 11
      src/modules/snmpstats/hashTable.h
  4. 10 10
      src/modules/snmpstats/interprocess_buffer.c
  5. 5 5
      src/modules/snmpstats/interprocess_buffer.h
  6. 1 1
      src/modules/snmpstats/kamailioNet.c
  7. 1 1
      src/modules/snmpstats/kamailioNet.h
  8. 2 2
      src/modules/snmpstats/kamailioNetConfig.c
  9. 2 2
      src/modules/snmpstats/kamailioServer.h
  10. 3 3
      src/modules/snmpstats/snmpMIBNotifications.c
  11. 4 4
      src/modules/snmpstats/snmpMIBNotifications.h
  12. 7 7
      src/modules/snmpstats/snmpObjects.c
  13. 1 1
      src/modules/snmpstats/snmpObjects.h
  14. 11 11
      src/modules/snmpstats/snmpSIPCommonObjects.c
  15. 1 1
      src/modules/snmpstats/snmpSIPCommonObjects.h
  16. 18 18
      src/modules/snmpstats/snmpSIPContactTable.c
  17. 15 15
      src/modules/snmpstats/snmpSIPContactTable.h
  18. 6 6
      src/modules/snmpstats/snmpSIPMethodSupportedTable.c
  19. 6 6
      src/modules/snmpstats/snmpSIPMethodSupportedTable.h
  20. 6 6
      src/modules/snmpstats/snmpSIPPortTable.c
  21. 3 3
      src/modules/snmpstats/snmpSIPPortTable.h
  22. 36 36
      src/modules/snmpstats/snmpSIPRegUserLookupTable.c
  23. 10 10
      src/modules/snmpstats/snmpSIPRegUserLookupTable.h
  24. 10 10
      src/modules/snmpstats/snmpSIPRegUserTable.c
  25. 11 11
      src/modules/snmpstats/snmpSIPRegUserTable.h
  26. 2 2
      src/modules/snmpstats/snmpSIPServerObjects.c
  27. 2 2
      src/modules/snmpstats/snmpSIPServerObjects.h
  28. 31 31
      src/modules/snmpstats/snmpSIPStatusCodesTable.c
  29. 18 18
      src/modules/snmpstats/snmpSIPStatusCodesTable.h
  30. 4 4
      src/modules/snmpstats/snmpstats.c
  31. 4 4
      src/modules/snmpstats/snmpstats.h
  32. 1 1
      src/modules/snmpstats/snmpstats_globals.h
  33. 3 3
      src/modules/snmpstats/sub_agent.c
  34. 1 1
      src/modules/snmpstats/sub_agent.h
  35. 6 6
      src/modules/snmpstats/utilities.h

+ 1 - 1
src/modules/snmpstats/alarm_checks.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *

+ 8 - 8
src/modules/snmpstats/hashTable.c

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -67,13 +67,13 @@ int calculateHashSlot(char *theString, int hashTableSize)
 
 /*! Searches the hash table specified as theTable, of size 'size', for a record
  * indexed with 'aor'.  If a match is found, then an aorToIndextStruct_t
- * structure is returned. 
+ * structure is returned.
  *
- * This function is called to discover the map between Kamailio's "aor" 
+ * This function is called to discover the map between Kamailio's "aor"
  * (Address of Records) indexing scheme, and the SNMPStats modules integer
- * indexing scheme for its contact/user data. 
+ * indexing scheme for its contact/user data.
  *
- * Returns: the aorToIndexStruct_t mapping structure if a match was found, 
+ * Returns: the aorToIndexStruct_t mapping structure if a match was found,
  *          or NULL otherwise.
  */
 aorToIndexStruct_t *findHashRecord(hashSlot_t *theTable, char *aor, int size)
@@ -150,7 +150,7 @@ void insertHashRecord(
 
 /*!
  * This function will search the provided hash table for an entry indexed by
- * 'aor'.  If an entry is found then: 
+ * 'aor'.  If an entry is found then:
  *
  *   - Its numContacts counter will be decremented.
  *   - If its numContacts counter reaches zero, then the entry will be removed
@@ -223,11 +223,11 @@ void deleteUser(hashSlot_t *theTable, char *aor, int hashTableSize)
 
 /*! Returns an aorToIndexStruct_t, holding the given 'userIndex' and 'aor'.  The
  * structure is used to map between the "aor" (Kamailio's way of indexing
- * users/contacts), and the SNMPStats user and contact integer indexes.  
+ * users/contacts), and the SNMPStats user and contact integer indexes.
  *
  * NOTE: that this record does not make a copy of aor, but instead points
  * directly to the parameter.  Therefore make sure that aor is not on the stack,
- * and is not going to disappear before this record is deleted. 
+ * and is not going to disappear before this record is deleted.
  */
 aorToIndexStruct_t *createHashRecord(int userIndex, char *aor)
 {

+ 11 - 11
src/modules/snmpstats/hashTable.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -30,7 +30,7 @@
  * between Kamailio's "aor" (Address of Record) and string indexing mechanisms,
  * and the SNMPStats modules integer indexing scheme for users and contacts.
  * While it would have been a more natural fit to use string indexes in the
- * SNMPStats module, SNMP limitations precluded this.  
+ * SNMPStats module, SNMP limitations precluded this.
  *
  * aorToIndexStruct: maps an aor to:
  *  - a userIndex, to uniquely identify each RegUserTable SNMP row
@@ -54,7 +54,7 @@
 
 /*!
  * Used to map between a 'contact' name (Kamailio's index) and a contact index.
- * (SNMPStats Index) 
+ * (SNMPStats Index)
  */
 typedef struct contactToIndexStruct
 {
@@ -70,7 +70,7 @@ typedef struct contactToIndexStruct
 /*!
  * Used to map between an 'aor' (Kamailio index) and a user index. (SNMPStats
  * index).  Since each user can have multiple contacts, the structure also has a
- * 'contactIndex', and a reference to the contactToIndexStruct list. 
+ * 'contactIndex', and a reference to the contactToIndexStruct list.
  */
 typedef struct aorToIndexStruct
 {
@@ -128,11 +128,11 @@ typedef struct hashSlot
 
 /*! Returns an aorToIndexStruct_t, holding the given 'userIndex' and 'aor'.  The
  * structure is used to map between the "aor" (Kamailio's way of indexing
- * users/contacts), and the SNMPStats user and contact integer indexes.  
+ * users/contacts), and the SNMPStats user and contact integer indexes.
  *
  * \note This record does not make a copy of aor, but instead points
  * directly to the parameter.  Therefore make sure that aor is not on the stack,
- * and is not going to disappear before this record is deleted. 
+ * and is not going to disappear before this record is deleted.
  */
 aorToIndexStruct_t *createHashRecord(int userIndex, char *aor);
 
@@ -151,13 +151,13 @@ int calculateHashSlot(char *theString, int hashTableSize);
 
 /*! Searches the hash table specified as theTable, of size 'size', for a record
  * indexed with 'aor'.  If a match is found, then an aorToIndextStruct_t
- * structure is returned. 
+ * structure is returned.
  *
- * This function is called to discover the map between Kamailio's "aor" 
+ * This function is called to discover the map between Kamailio's "aor"
  * (Address of Records) indexing scheme, and the SNMPStats modules integer
- * indexing scheme for its contact/user data. 
+ * indexing scheme for its contact/user data.
  *
- * Returns: the aorToIndexStruct_t mapping structure if a match was found, 
+ * Returns: the aorToIndexStruct_t mapping structure if a match was found,
  *          or NULL otherwise.
  */
 aorToIndexStruct_t *findHashRecord(hashSlot_t *theTable, char *aor, int size);
@@ -178,7 +178,7 @@ int deleteHashRecord(hashSlot_t *theTable, char *aor, int hashTableSize);
 
 /*!
  * This function will search the provided hash table for an entry indexed by
- * 'aor'.  If an entry is found then: 
+ * 'aor'.  If an entry is found then:
  *
  *   - Its numContacts counter will be decremented.
  *   - If its numContacts counter reaches zero, then the entry will be removed

+ 10 - 10
src/modules/snmpstats/interprocess_buffer.c

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -55,7 +55,7 @@
  *
  *    1) maps all aor's to snmp's UserIndex for help in deleting SNMP Rows.
  *
- *    2) maps a given aor to a contact list. 
+ *    2) maps a given aor to a contact list.
  */
 hashSlot_t *hashTable = NULL;
 
@@ -70,7 +70,7 @@ gen_lock_t *interprocessCBLock = NULL;
 /*!
  * This function takes an element of the interprocess buffer passed to it, and
  * handles populating the respective user and contact tables with its contained
- * data.  
+ * data.
  */
 static void executeInterprocessBufferCmd(interprocessBuffer_t *currentBuffer);
 
@@ -130,7 +130,7 @@ int initInterprocessBuffers(void)
  * The callback type will be passed in 'type', and the contact the callback
  * applies to will be supplied in 'contactInfo.  This information will be copied
  * into the interprocess buffer.  The interprocess buffer will be consumed at a
- * later time, when consumeInterprocessBuffer() is called.  
+ * later time, when consumeInterprocessBuffer() is called.
  *
  * This callback is thread safe with respect to the consumeInterprocessBuffer()
  * function.  Specifically, the interprocess buffer should not be corrupted by
@@ -151,7 +151,7 @@ void handleContactCallbacks(ucontact_t *contactInfo, int type, void *param)
 	}
 
 	/* We need to maintain our own copies of the AOR and contact address to
-	 * prevent the corruption of our internal data structures.  
+	 * prevent the corruption of our internal data structures.
 	 *
 	 * If we do not maintain our own copies, then the AOR and contact address
 	 * pointed to could be removed and reallocated to another thread before
@@ -203,11 +203,11 @@ error:
  * \note This function is believed to be thread safe.  Specifically, it protects
  *       corruption of the interprocess buffer through the interprocessCBLock.
  *       This ensures no corruption of the buffer by race conditions.  The lock
- *       has been designed to be occupied for as short a period as possible, so 
- *       as to prevent long waits.  Specifically, once we start consumption of 
+ *       has been designed to be occupied for as short a period as possible, so
+ *       as to prevent long waits.  Specifically, once we start consumption of
  *       the list, other processes are free to continue even before we are done.
  *       This is made possible by simply changing the head of the interprocess
- *       buffer, and then releasing the lock.  
+ *       buffer, and then releasing the lock.
  */
 void consumeInterprocessBuffer(void)
 {
@@ -253,7 +253,7 @@ void consumeInterprocessBuffer(void)
 /*!
  * This function takes an element of the interprocess buffer passed to it, and
  * handles populating the respective user and contact tables with its contained
- * data.  
+ * data.
  */
 static void executeInterprocessBufferCmd(interprocessBuffer_t *currentBuffer)
 {
@@ -262,7 +262,7 @@ static void executeInterprocessBufferCmd(interprocessBuffer_t *currentBuffer)
 	aorToIndexStruct_t *currentUser;
 
 	if(currentBuffer->callbackType == UL_CONTACT_INSERT) {
-		/* Add the user if the user doesn't exist, or increment its 
+		/* Add the user if the user doesn't exist, or increment its
 		 * contact index otherwise. */
 		updateUser(currentBuffer->stringName);
 	} else if(currentBuffer->callbackType != UL_CONTACT_EXPIRE) {

+ 5 - 5
src/modules/snmpstats/interprocess_buffer.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -92,7 +92,7 @@ int initInterprocessBuffers(void);
  * The callback type will be passed in 'type', and the contact the callback
  * applies to will be supplied in 'contactInfo.  This information will be copied
  * into the interprocess buffer.  The interprocess buffer will beconsumed at a
- * later time, when consumeInterprocessBuffer() is called.  
+ * later time, when consumeInterprocessBuffer() is called.
  *
  * This callback is thread safe with respect to the consumeInterprocessBuffer()
  * function.  Specifically, the interprocess buffer should not be corrupted by
@@ -113,11 +113,11 @@ void handleContactCallbacks(ucontact_t *contactInfo, int type, void *param);
  * Note: This function is believed to be thread safe.  Specifically, it protects
  *       corruption of the interprocess buffer through the interprocessCBLock.
  *       This ensures no corruption of the buffer by race conditions.  The lock
- *       has been designed to be occupied for as short a period as possible, so 
- *       as to prevent long waits.  Specifically, once we start consumption of 
+ *       has been designed to be occupied for as short a period as possible, so
+ *       as to prevent long waits.  Specifically, once we start consumption of
  *       the list, other processes are free to continue even before we are done.
  *       This is made possible by simply changing the head of the interprocess
- *       buffer, and then releasing the lock.  
+ *       buffer, and then releasing the lock.
  */
 void consumeInterprocessBuffer(void);
 

+ 1 - 1
src/modules/snmpstats/kamailioNet.c

@@ -22,7 +22,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
  * USA
  *
- * Note: this file originally auto-generated by mib2c 
+ * Note: this file originally auto-generated by mib2c
  *
  */
 /*!

+ 1 - 1
src/modules/snmpstats/kamailioNet.h

@@ -22,7 +22,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
  * USA
  *
- * Note: this file originally auto-generated by mib2c 
+ * Note: this file originally auto-generated by mib2c
  *
  */
 #ifndef KAMAILIONET_H

+ 2 - 2
src/modules/snmpstats/kamailioNetConfig.c

@@ -22,7 +22,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
  * USA
  *
- * Note: this file originally auto-generated by mib2c 
+ * Note: this file originally auto-generated by mib2c
  *
  */
 /*!
@@ -165,7 +165,7 @@ int handle_kamailioNetConfUdpDtlsTransport(netsnmp_mib_handler *handler,
 {
 
 	/* Note: This transport is not supported in Kamailio. This OID is just a place holder
-		for future work. 
+		for future work.
 	*/
 	int value = -1; /* Not implemented */
 

+ 2 - 2
src/modules/snmpstats/kamailioServer.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -24,7 +24,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
  * USA
  *
- * Note: this file originally auto-generated by mib2c 
+ * Note: this file originally auto-generated by mib2c
  *
  */
 #ifndef KAMAILIOSERVER_H

+ 3 - 3
src/modules/snmpstats/snmpMIBNotifications.c

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -24,7 +24,7 @@
  *        : mib2c.notify.conf,v 5.3 2004/04/15 12:29:19 dts12 Exp $
  *
  * This file contains functions for sending all traps supported by the SNMPStats
- * module.  
+ * module.
  */
 
 #include <net-snmp/net-snmp-config.h>
@@ -38,7 +38,7 @@
 
 static oid snmptrap_oid[] = {1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0};
 
-/* 
+/*
  * Sends off a kamailioMsgQueueDepthMinorEvent trap to the master agent,
  * assigning the following variable bindings:
  *

+ 4 - 4
src/modules/snmpstats/snmpMIBNotifications.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -20,12 +20,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
  * USA
  *
- * 
+ *
  * Note: this file originally auto-generated by mib2c using
  *        : mib2c.notify.conf,v 5.3 2004/04/15 12:29:19 dts12 Exp $
  *
  * This file contains function prototypes for sending all traps supported by the
- * SNMPStats module.  
+ * SNMPStats module.
  *
  */
 
@@ -33,7 +33,7 @@
 #define KAMAILIOMIBNOTIFICATIONS_H
 
 
-/* 
+/*
  * Sends off a kamailioMsgQueueDepthMinorEvent trap to the master agent,
  * assigning the following variable bindings:
  *

+ 7 - 7
src/modules/snmpstats/snmpObjects.c

@@ -210,18 +210,18 @@ void init_kamailioObjects(void)
 }
 
 
-/* 
+/*
  * The following are thresholds used by:
- * 
- * - The alarm monitoring process, to decide when to send out traps.  
+ *
+ * - The alarm monitoring process, to decide when to send out traps.
  * - All scalars involving alarm status' and thresholds.
  *
  * By default they are initialized to -1, which disables alarm checks.
  * These are set through the kamailio.cfg file with the following modparams to
  * the snmpstats module:
  *
- *  - dlg_minor_threshold  
- *  - dlg_major_threshold  
+ *  - dlg_minor_threshold
+ *  - dlg_major_threshold
  *
  *  - MsgQueueMinorThreshold
  *  - MsgQueueMajorThreshold
@@ -456,7 +456,7 @@ int handle_kamailioDialogUsageState(netsnmp_mib_handler *handler,
 		netsnmp_handler_registration *reginfo,
 		netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)
 {
-	/* Return value follows the X731UsageState Textual Convention 
+	/* Return value follows the X731UsageState Textual Convention
 	 *
 	 * We default to 'unknown' */
 	int usage_state = TC_USAGE_STATE_UNKNOWN;
@@ -580,7 +580,7 @@ static int set_if_valid_threshold(
 	return 0;
 }
 
-/* 
+/*
  * Parameter Configuration Functions
  */
 

+ 1 - 1
src/modules/snmpstats/snmpObjects.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *

+ 11 - 11
src/modules/snmpstats/snmpSIPCommonObjects.c

@@ -43,7 +43,7 @@
 static char *kamailioVersion = "SIP/2.0";
 static unsigned int kamailioEntityType = TC_SIP_ENTITY_ROLE_OTHER;
 
-/* 
+/*
  * Initializes the kamailioSIPCommonObjects MIB elements.  This involves:
  *
  *  - Registering all OID's
@@ -175,10 +175,10 @@ int handle_kamailioSIPProtocolVersion(netsnmp_mib_handler *handler,
 	return SNMP_ERR_GENERR;
 }
 
-/* 
+/*
  * The scalar represents what sysUpTime was when Kamailio first started.  This
  * data was stored in a file when SNMPStats first started up, as a result of a
- * call to spawn_sysUpTime_child() 
+ * call to spawn_sysUpTime_child()
  */
 int handle_kamailioSIPServiceStartTime(netsnmp_mib_handler *handler,
 		netsnmp_handler_registration *reginfo,
@@ -292,9 +292,9 @@ int handle_kamailioSIPSummaryOutResponses(netsnmp_mib_handler *handler,
 	/* We can find the number of outbound responses sent by adding three
 	 * sources
 	 *
-	 *   1) fwd_replies from core_stats 
-	 *   2) local_replies and relayed_replies from the tm module 
-	 *   3) sent_replies from the sl module. 
+	 *   1) fwd_replies from core_stats
+	 *   2) local_replies and relayed_replies from the tm module
+	 *   3) sent_replies from the sl module.
 	 */
 
 	int fwd_replies = get_statistic("fwd_replies");
@@ -317,7 +317,7 @@ int handle_kamailioSIPSummaryTotalTransactions(netsnmp_mib_handler *handler,
 		netsnmp_handler_registration *reginfo,
 		netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)
 {
-	/* We can find the total number of transactions by summing 
+	/* We can find the total number of transactions by summing
 	 * UAC_transactions and UAS_transactions.  We don't need to add
 	 * inuse_transactions because this will already be accounted for in the
 	 * two other statistics. */
@@ -398,15 +398,15 @@ int handle_kamailioSIPOtherwiseDiscardedMsgs(netsnmp_mib_handler *handler,
 }
 
 /*
- * Parameter Setting Functions 
+ * Parameter Setting Functions
  */
 
 /* If type==PARAM_STRING and stringParam is valid, this function will overwrite
- * kamailioEntityType with a bit value corresponding to the IETF's RFC  for 
+ * kamailioEntityType with a bit value corresponding to the IETF's RFC  for
  * the SIP MIB.  (Textual Convention SipEntityRole).  Anything else is
  * considered an error.
  *
- * Returns 0 on success, -1 on failure.  
+ * Returns 0 on success, -1 on failure.
  */
 int handleSipEntityType(modparam_t type, void *val)
 {
@@ -430,7 +430,7 @@ int handleSipEntityType(modparam_t type, void *val)
 
 	/* Begin our string comparison.  This isn't the most efficient approach,
 	 * but we don't expect this function to be called anywhere other than at
-	 * startup.  So our inefficiency is outweiged by simplicity 
+	 * startup.  So our inefficiency is outweiged by simplicity
 	 */
 	if(strcasecmp(strEntityType, "other") == 0) {
 		kamailioEntityType |= TC_SIP_ENTITY_ROLE_OTHER;

+ 1 - 1
src/modules/snmpstats/snmpSIPCommonObjects.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *

+ 18 - 18
src/modules/snmpstats/snmpSIPContactTable.c

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -21,7 +21,7 @@
  * USA
  *
  * Note: this file originally auto-generated by mib2c using
- *        mib2c.array-user.conf 
+ *        mib2c.array-user.conf
  *
  * This file contains the implementation of the kamailioSIPContact Table.  For a
  * full description of this structure, please see the KAMAILIO-SIP-SERVER-MIB.
@@ -31,14 +31,14 @@
  * We require Kamailios usrloc module to inform us when a contact is
  * added/removed.  The general callback process works as follows:
  *
- * 1) On startup, we register handleContactCallbacks() for USRLOC callbacks, so 
- *    we can be informed whenever a contact is added/removed from the system.  
- *    This registration happens with a call to registerForUSRLOCCallbacks().  
+ * 1) On startup, we register handleContactCallbacks() for USRLOC callbacks, so
+ *    we can be informed whenever a contact is added/removed from the system.
+ *    This registration happens with a call to registerForUSRLOCCallbacks().
  *    (This is actually called when the SNMPStats module is initialized)
  *
- * 2) Whenever we receive a contact callback, handleContactCallbacks() will 
+ * 2) Whenever we receive a contact callback, handleContactCallbacks() will
  *    quickly add the contact information and operation type to the
- *    interprocess buffer.  
+ *    interprocess buffer.
  *
  * 3) When we receive an SNMP request for user/contact information, we consume
  *    the interprocess buffer with consumeInterprocessBuffer().  The function
@@ -48,16 +48,16 @@
  *    until end of time. This is not good. A timer callback or something else is
  *    needed to process it.
  *
- * Notes: 
+ * Notes:
  *
  * - The interprocess buffer was necessary, because NetSNMP's containers can be
  *   very inefficient at adding large amounts of data at a time, such as when
  *   Kamailio first starts up.  It was decided it is better to make an SNMP manager
  *   wait for data, instead of slowing down the rest of Kamailio while the
- *   sub-agent processes the data. 
+ *   sub-agent processes the data.
  *
  * - It is important to send periodic SNMP requests to this table (or the user
- *   table), to make sure the process buffer doesn't get too large.  
+ *   table), to make sure the process buffer doesn't get too large.
  *
  */
 
@@ -88,9 +88,9 @@ oid kamailioSIPContactTable_oid[] = {kamailioSIPContactTable_TABLE_OID};
 size_t kamailioSIPContactTable_oid_len =
 		OID_LENGTH(kamailioSIPContactTable_oid);
 
-/* 
+/*
  * This function adds a new contactToIndexStruct_t record to the front of
- * 'contactRecord'.  
+ * 'contactRecord'.
  *
  * The structure is used to map a contact name to the SNMPStats modules integer
  * indexing scheme.  It will be used later when a delete command comes in, and
@@ -128,7 +128,7 @@ int insertContactRecord(
  * This function will remove the contactToIndexStruct_T record matching
  * 'contactName' from the users contactToIndexStruct_t linked-list, and return
  * the records index.  In the event that the record could not be found, 0 will
- * be returned. 
+ * be returned.
  */
 int deleteContactRecord(
 		contactToIndexStruct_t **contactRecord, char *contactName)
@@ -161,11 +161,11 @@ int deleteContactRecord(
 }
 
 
-/* 
+/*
  * Creates an SNMP row and inserts it into the contact table. This function
  * should only be called when the interprocess buffer is being consumed.
  *
- * Returns: 1 on success, and 0 otherwise. 
+ * Returns: 1 on success, and 0 otherwise.
  */
 int createContactRow(int userIndex, int contactIndex, char *contactName,
 		ucontact_t *contactInfo)
@@ -222,7 +222,7 @@ int createContactRow(int userIndex, int contactIndex, char *contactName,
 }
 
 
-/* 
+/*
  * Removes the row indexed by userIndex and contactIndex, and free's up the
  * memory allocated to it.  If the row could not be found, then nothing is done.
  */
@@ -435,8 +435,8 @@ int kamailioSIPContactTable_get_value(netsnmp_request_info *request,
 	return SNMP_ERR_NOERROR;
 }
 
-/* 
- * kamailioSIPContactTable_get_by_idx is an auto-generated function. 
+/*
+ * kamailioSIPContactTable_get_by_idx is an auto-generated function.
  */
 const kamailioSIPContactTable_context *kamailioSIPContactTable_get_by_idx(
 		netsnmp_index *hdr)

+ 15 - 15
src/modules/snmpstats/snmpSIPContactTable.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -29,29 +29,29 @@
  * We require Kamailios usrloc module to inform us when a contact is
  * added/removed.  The general callback process works as follows:
  *
- * 1) On startup, we register handleContactCallbacks() for USRLOC callbacks, so 
- *    we can be informed whenever a contact is added/removed from the system.  
- *    This registration happens with a call to registerForUSRLOCCallbacks().  
+ * 1) On startup, we register handleContactCallbacks() for USRLOC callbacks, so
+ *    we can be informed whenever a contact is added/removed from the system.
+ *    This registration happens with a call to registerForUSRLOCCallbacks().
  *    (This is actually called when the SNMPStats module is initialized)
  *
- * 2) Whenever we receive a contact callback, handleContactCallbacks() will 
+ * 2) Whenever we receive a contact callback, handleContactCallbacks() will
  *    quickly add the contact information and operation type to the
- *    interprocess buffer.  
+ *    interprocess buffer.
  *
  * 3) When we receive an SNMP request for user/contact information, we consume
  *    the interprocess buffer with consumeInterprocessBuffer().  The function
  *    will add/delete rows to the tables, and then service the SNMP request.
  *
- * Notes: 
+ * Notes:
  *
  * - The interprocess buffer was necessary, because NetSNMP's containers can be
  *   very inefficient at adding large amounts of data at a time, such as when
  *   Kamailio first starts up.  It was decided it is better to make an SNMP manager
  *   wait for data, instead of slowing down the rest of Kamailio while the
- *   sub-agent processes the data. 
+ *   sub-agent processes the data.
  *
  * - It is important to send periodic SNMP requests to this table (or the user
- *   table), to make sure the process buffer doesn't get too large.  
+ *   table), to make sure the process buffer doesn't get too large.
  */
 
 #ifndef KAMAILIOSIPCONTACTTABLE_H
@@ -100,25 +100,25 @@ extern "C"
 	/* Customized SNMP Prototypes */
 	/******************************/
 
-	/* 
+	/*
  * Creates an SNMP row and inserts it into the contact table. This function
  * should only be called when the interprocess buffer is being consumed.
  *
- * Returns: 1 on success, and 0 otherwise. 
+ * Returns: 1 on success, and 0 otherwise.
  */
 	int createContactRow(int userIndex, int contactIndex, char *contactName,
 			ucontact_t *contactInfo);
 
-	/* 
+	/*
  * Removes the row indexed by userIndex and contactIndex, and free's up the
  * memory allocated to it.  If the row could not be found, then nothing is done.
  */
 	void deleteContactRow(int userIndex, int contactIndex);
 
 
-	/* 
+	/*
  * This function adds a new contactToIndexStruct_t record to the front of
- * 'contactRecord'.  
+ * 'contactRecord'.
  *
  * The structure is used to map a contact name to the SNMPStats modules integer
  * indexing scheme.  It will be used later when a delete command comes in, and
@@ -131,7 +131,7 @@ extern "C"
  * This function will remove the contactToIndexStruct_T record matching
  * 'contactName' from the users contactToIndexStruct_t linked-list, and return
  * the records index.  In the event that the record could not be found, 0 will
- * be returned. 
+ * be returned.
  */
 	int deleteContactRecord(
 			contactToIndexStruct_t **contactRecord, char *contactName);

+ 6 - 6
src/modules/snmpstats/snmpSIPMethodSupportedTable.c

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -24,7 +24,7 @@
  * populated by looking to see which modules are loaded, and guessing what SIP
  * Methods they  provide.  It is quite possible that this initial implementation
  * is not very good at guessing.  This should be fixed in future releases as
- * more information becomes available.  
+ * more information becomes available.
  *
  * For full details, please see the KAMAILIO-SIP-COMMON-MIB.
  *
@@ -105,7 +105,7 @@ void createRow(int index, char *stringToRegister)
 }
 
 
-/* Initializes the kamailioSIPMethodSupportedTable, and populates the tables 
+/* Initializes the kamailioSIPMethodSupportedTable, and populates the tables
  * contents */
 void init_kamailioSIPMethodSupportedTable(void)
 {
@@ -130,7 +130,7 @@ void init_kamailioSIPMethodSupportedTable(void)
 	 *
 	 * We should keep these indices fixed.  For example if we don't support
 	 * METHOD_REGISTER but we do support METHOD_MESSAGE, then METHOD_MESSAGE
-	 * should still be at index 9.  
+	 * should still be at index 9.
 	 *
 	 * NOTE: My way of checking what METHODS we support is probably wrong.
 	 * Please feel free to correct it! */
@@ -216,10 +216,10 @@ void initialize_table_kamailioSIPMethodSupportedTable(void)
 			my_handler, table_info, &cb, cb.container, 1);
 }
 
-/* 
+/*
  * This routine is called to process get requests for elements of the table.
  *
- * The function is pretty much left as is from the auto-generated code. 
+ * The function is pretty much left as is from the auto-generated code.
  */
 int kamailioSIPMethodSupportedTable_get_value(netsnmp_request_info *request,
 		netsnmp_index *item, netsnmp_table_request_info *table_info)

+ 6 - 6
src/modules/snmpstats/snmpSIPMethodSupportedTable.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -40,9 +40,9 @@ extern "C"
 
 #include "../../core/config.h"
 
-	/* 
+	/*
  * This strucutre represents a single row in the SNMP table, and is mostly
- * auto-generated. 
+ * auto-generated.
  */
 	typedef struct kamailioSIPMethodSupportedTable_context_s
 	{
@@ -62,7 +62,7 @@ extern "C"
 	} kamailioSIPMethodSupportedTable_context;
 
 
-	/* Initializes the kamailioSIPMethodSupportedTable, and populates the tables 
+	/* Initializes the kamailioSIPMethodSupportedTable, and populates the tables
  * contents */
 	void init_kamailioSIPMethodSupportedTable(void);
 
@@ -70,10 +70,10 @@ extern "C"
 	void initialize_table_kamailioSIPMethodSupportedTable(void);
 
 
-	/* 
+	/*
  * This routine is called to process get requests for elements of the table.
  *
- * The function is pretty much left as is from the auto-generated code. 
+ * The function is pretty much left as is from the auto-generated code.
  */
 	int kamailioSIPMethodSupportedTable_get_value(netsnmp_request_info *,
 			netsnmp_index *, netsnmp_table_request_info *);

+ 6 - 6
src/modules/snmpstats/snmpSIPPortTable.c

@@ -56,7 +56,7 @@ size_t kamailioSIPPortTable_oid_len = OID_LENGTH(kamailioSIPPortTable_oid);
  * sizeOfOID will be assigned the length of the oid.
  *
  * Note: This function returns a newly allocated block of memory.  Make sure to
- * deallocate the memory when you no longer need it. 
+ * deallocate the memory when you no longer need it.
  */
 static oid *createIndex(int ipType, int *ipAddress, int *sizeOfOID)
 {
@@ -101,7 +101,7 @@ static oid *createIndex(int ipType, int *ipAddress, int *sizeOfOID)
  * return a new one otherwise.  If the row is new, then the provided index will be
  * assigned to the new row.
  *
- * Note: NULL will be returned on an error 
+ * Note: NULL will be returned on an error
  */
 kamailioSIPPortTable_context *getRow(int ipType, int *ipAddress)
 {
@@ -160,7 +160,7 @@ kamailioSIPPortTable_context *getRow(int ipType, int *ipAddress)
  * can point to any integer >= zero.  All rows created by this function will be
  * indexed starting at snmpIndex++.  The parameter is implemented as a pointer
  * to an integer so that if the function is called again with another
- * 'protocol', we can continue from the last index. 
+ * 'protocol', we can continue from the last index.
  */
 static void createRowsFromIPList(
 		int *theList, int listSize, int protocol, int *snmpIndex, int family)
@@ -190,7 +190,7 @@ static void createRowsFromIPList(
 		curIndexOfIP = (num_octets + 1) * curSocketIdx;
 
 		/* Retrieve an existing row, or a new row if one doesn't
-		 * already exist. 
+		 * already exist.
 		 * RFC 4001 defined IPv4 as 1, IPv6 as 2
 		*/
 		currentRow = getRow(family == AF_INET ? 1 : 2, &theList[curIndexOfIP]);
@@ -217,7 +217,7 @@ static int *_sr_snmp_TLS6List = NULL;
 static int *_sr_snmp_SCTP6List = NULL;
 
 /*
- * Initializes the kamailioSIPPortTable module.  
+ * Initializes the kamailioSIPPortTable module.
  *
  * Specifically, this function will define the tables structure, and then
  * populate it with the ports and transports that Kamailio is listening on.
@@ -349,7 +349,7 @@ void initialize_table_kamailioSIPPortTable(void)
 /*
  * This routine is called to process get requests for elements of the table.
  *
- * The function is mostly left in its auto-generated form 
+ * The function is mostly left in its auto-generated form
  */
 int kamailioSIPPortTable_get_value(netsnmp_request_info *request,
 		netsnmp_index *item, netsnmp_table_request_info *table_info)

+ 3 - 3
src/modules/snmpstats/snmpSIPPortTable.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -60,7 +60,7 @@ extern "C"
 
 
 	/*
- * Initializes the kamailioSIPPortTable module.  
+ * Initializes the kamailioSIPPortTable module.
  *
  * Specifically, this function will define the tables structure, and then
  * populate it with the ports and transports that Kamailio is listening on.
@@ -75,7 +75,7 @@ extern "C"
 
 	/*
  * This routine is called to process get requests for elements of the table.
- * The function is mostly left in its auto-generated form 
+ * The function is mostly left in its auto-generated form
  */
 	int kamailioSIPPortTable_get_value(netsnmp_request_info *, netsnmp_index *,
 			netsnmp_table_request_info *);

+ 36 - 36
src/modules/snmpstats/snmpSIPRegUserLookupTable.c

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
  * USA
  *
- * Note: this file originally auto-generated by mib2c using 
+ * Note: this file originally auto-generated by mib2c using
  * mib2c.array-user.conf
  *
  * This file implements the kamailioSIPRegUserLookupTable.  For a full
@@ -34,14 +34,14 @@
  * The functions that have been modified to implement this table are the
  * following:
  *
- * 1) kamailioSIPRegUserLookupTable_extract_index() 
+ * 1) kamailioSIPRegUserLookupTable_extract_index()
  *
  *    - Modified to fail if the index is invalid.  The index is invalid if it
  *      does not match up with the global userLookupCounter.
  *
  * 2) kamailioSIPRegUserLookupTable_can_[activate|deactivate|delete]()
- *   
- *    - Simplified to always allow activation/deactivation/deletion. 
+ *
+ *    - Simplified to always allow activation/deactivation/deletion.
  *
  * 3) kamailioSIPRegUserLookupTable_set_reserve1()
  *
@@ -55,9 +55,9 @@
  *    - The function was modified to populate the row with the userIndex of the
  *      supplied URI if that URI was found on the system, and set the rowStatus
  *      to 'active'.  If the URI was not found, the rowStatus is set to
- *      'notInService' 
+ *      'notInService'
  *
- * You can safely ignore the other functions.  
+ * You can safely ignore the other functions.
  */
 
 #include <net-snmp/net-snmp-config.h>
@@ -84,7 +84,7 @@ size_t kamailioSIPRegUserLookupTable_oid_len =
 /*
  * Initializes the kamailioSIPRegUserLookupTable table.  This step is easier
  * than in the other tables because there is no table population.  All table
- * population takes place during run time. 
+ * population takes place during run time.
  */
 void init_kamailioSIPRegUserLookupTable(void)
 {
@@ -125,7 +125,7 @@ static int kamailioSIPRegUserLookupTable_row_copy(
 }
 
 /*
- * the *_extract_index routine. (Mostly auto-generated) 
+ * the *_extract_index routine. (Mostly auto-generated)
  *
  * This routine is called when a set request is received for an index
  * that was not found in the table container. Here, we parse the oid
@@ -180,9 +180,9 @@ int kamailioSIPRegUserLookupTable_extract_index(
 			ctx->kamailioSIPRegUserLookupIndex =
 					*var_kamailioSIPRegUserLookupIndex.val.integer;
 
-			/* 
+			/*
 		 * Check to make sure that the index corresponds to the
-		 * global_userLookupCounter, as per the MIB specifications. 
+		 * global_userLookupCounter, as per the MIB specifications.
 		 */
 			if(*var_kamailioSIPRegUserLookupIndex.val.integer
 							!= global_UserLookupCounter
@@ -201,10 +201,10 @@ int kamailioSIPRegUserLookupTable_extract_index(
 }
 
 /*
- * This is an auto-generated function.  In general the *_can_activate routine 
+ * This is an auto-generated function.  In general the *_can_activate routine
  * is called when a row is changed to determine if all the values set are
  * consistent with the row's rules for a row status of ACTIVE.  If not, then 0
- * can be returned to prevent the row status from becomming final. 
+ * can be returned to prevent the row status from becomming final.
  *
  * For our purposes, we have no need for this check, so we always return 1.
  */
@@ -216,7 +216,7 @@ int kamailioSIPRegUserLookupTable_can_activate(
 	return 1;
 }
 
-/* 
+/*
  * This is an auto-generated function.  In general the *_can_deactivate routine
  * is called when a row that is currently ACTIVE is set to a state other than
  * ACTIVE. If there are conditions in which a row should not be allowed to
@@ -238,10 +238,10 @@ int kamailioSIPRegUserLookupTable_can_deactivate(
  * This is an auto-generated function.  In general the *_can_delete routine is
  * called to determine if a row can be deleted.  This usually involved checking
  * if it can be deactivated, and if it can be, then checking for other
- * conditions.  
+ * conditions.
  *
  * Since this table ha no reason why row deletion shouldn't be allowed, we
- * always return 1, unless we can't deactivate.  
+ * always return 1, unless we can't deactivate.
  */
 int kamailioSIPRegUserLookupTable_can_delete(
 		kamailioSIPRegUserLookupTable_context *undo_ctx,
@@ -255,15 +255,15 @@ int kamailioSIPRegUserLookupTable_can_delete(
 }
 
 /*
- * This is an auto-generated function.  
+ * This is an auto-generated function.
  *
  * The *_create_row routine is called by the table handler to create a new row
  * for a given index. This is the first stage of the row creation process.  The
  * *_set_reserve_* functions can be used to prevent the row from being inserted
- * into the table even if the row passes any preliminary checks set here. 
+ * into the table even if the row passes any preliminary checks set here.
  *
  * Returns a newly allocated kamailioSIPRegUserLookupTable_context structure (a
- * row in the table) if the indexes are legal.  NULL will be returned otherwise. 
+ * row in the table) if the indexes are legal.  NULL will be returned otherwise.
  */
 kamailioSIPRegUserLookupTable_context *kamailioSIPRegUserLookupTable_create_row(
 		netsnmp_index *hdr)
@@ -275,10 +275,10 @@ kamailioSIPRegUserLookupTable_context *kamailioSIPRegUserLookupTable_create_row(
 		return NULL;
 	}
 
-	/* 
+	/*
 	 * Extract the index.  The function has been modified from its original
 	 * auto-generated version in that the function will fail if index is
-	 * somehow invalid. 
+	 * somehow invalid.
 	 */
 	if(kamailioSIPRegUserLookupTable_extract_index(ctx, hdr)) {
 
@@ -299,7 +299,7 @@ kamailioSIPRegUserLookupTable_context *kamailioSIPRegUserLookupTable_create_row(
 	return ctx;
 }
 
-/* 
+/*
  * Auto-generated function.  The *_duplicate row routine
  */
 kamailioSIPRegUserLookupTable_context *
@@ -323,12 +323,12 @@ kamailioSIPRegUserLookupTable_duplicate_row(
 	return dup;
 }
 
-/* 
+/*
  * The *_delete_row method is auto-generated, and is called to delete a row.
  *
  * This will not be called if earlier checks said that this row can't be
  * deleted.  However, in our implementation there is never a reason why this
- * function can't be called. 
+ * function can't be called.
  */
 netsnmp_index *kamailioSIPRegUserLookupTable_delete_row(
 		kamailioSIPRegUserLookupTable_context *ctx)
@@ -352,20 +352,20 @@ netsnmp_index *kamailioSIPRegUserLookupTable_delete_row(
  * Large parts of this function have been auto-generated.  The functions purpose
  * is to check to make sure all SNMP set values for the given row, have been
  * valid.  If not, then the process is supposed to be aborted.  Otherwise, we
- * pass on to the *_reserve2 function.  
+ * pass on to the *_reserve2 function.
  *
  * For our purposes, our only check is to make sure that either of the following
- * conditions are true: 
+ * conditions are true:
  *
  * 1) If this row already exists, then the SET request is setting the rowStatus
  *    column to 'destroy'.
  *
- * 2) If this row does not already exist, then the SET request is setting the 
- *    rowStatus to 'createAndGo'. 
+ * 2) If this row does not already exist, then the SET request is setting the
+ *    rowStatus to 'createAndGo'.
  *
  * Since the MIB specified there are to be no other modifications to the row,
  * any other condition is considered illegal, and will result in an SNMP error
- * being returned. 
+ * being returned.
  */
 void kamailioSIPRegUserLookupTable_set_reserve1(netsnmp_request_group *rg)
 {
@@ -481,7 +481,7 @@ void kamailioSIPRegUserLookupTable_set_reserve2(netsnmp_request_group *rg)
 /*
  * This function is called only when all the *_reserve[1|2] functions were
  * successful.  Its purpose is to make any changes to the row before it is
- * inserted into the table.  
+ * inserted into the table.
  *
  * In the case of this table, this involves looking up the index of the
  * requested user in the URI to userIndex mapping hash table.  If the result is
@@ -621,17 +621,17 @@ void kamailioSIPRegUserLookupTable_set_commit(netsnmp_request_group *rg)
  * This function is called if the *_reserve[1|2] calls failed.  It is supposed to
  * free up any resources allocated earlier.  However, we already take care of
  * all these resources in earlier functions.  So for our purposes, the function
- * body is empty. 
+ * body is empty.
  */
 void kamailioSIPRegUserLookupTable_set_free(netsnmp_request_group *rg)
 {
 }
 
 
-/* 
+/*
  * This function is called if an ACTION phase fails, to do extra clean-up work.
  * We don't have anything complicated enough to warrant putting anything in this
- * function.  Therefore, its just left with an empty function body. 
+ * function.  Therefore, its just left with an empty function body.
  */
 void kamailioSIPRegUserLookupTable_set_undo(netsnmp_request_group *rg)
 {
@@ -640,7 +640,7 @@ void kamailioSIPRegUserLookupTable_set_undo(netsnmp_request_group *rg)
 
 /*
  * Initialize the kamailioSIPRegUserLookupTable table by defining how it is
- * structured. 
+ * structured.
  *
  * This function is mostly auto-generated.
  */
@@ -724,9 +724,9 @@ void initialize_table_kamailioSIPRegUserLookupTable(void)
 			my_handler, table_info, &cb, cb.container, 1);
 }
 
-/* 
+/*
  * This function was auto-generated and didn't need modifications from its
- * auto-generation.  It is called to handle an SNMP GET request. 
+ * auto-generation.  It is called to handle an SNMP GET request.
  */
 int kamailioSIPRegUserLookupTable_get_value(netsnmp_request_info *request,
 		netsnmp_index *item, netsnmp_table_request_info *table_info)

+ 10 - 10
src/modules/snmpstats/snmpSIPRegUserLookupTable.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -23,13 +23,13 @@
  * This file implements the kamailioSIPRegUserLookupTable.  For a full
  * description of the table, please see the KAMAILIO-SIP-SERVER-MIB.
  *
- * This file consists of many more functions than the other header files.  
+ * This file consists of many more functions than the other header files.
  * This is because this table is writable, bringing a lot of SNMP overhead.
  *
  * Most of the contents are auto-generated (aside from white space and comment
  * changes), and can be ignored.  The functions that have been modified are:
  *
- * 1) kamailioSIPRegUserLookupTable_extract_index() 
+ * 1) kamailioSIPRegUserLookupTable_extract_index()
  *
  * 2) kamailioSIPRegUserLookupTable_can_[activate|deactivate|delete]()
  *
@@ -38,7 +38,7 @@
  * 4) kamailioSIPRegUserLookupTable_set_action()
  *
  * Full details can be found in kamailioSIPRegUserLookupTable.c.  You can safely
- * ignore the other functions.  
+ * ignore the other functions.
  */
 
 #ifndef KAMAILIOSIPREGUSERLOOKUPTABLE_H
@@ -82,22 +82,22 @@ extern "C"
 	/*
  * Initializes the kamailioSIPRegUserLookupTable table.  This step is easier
  * than in the other tables because there is no table population.  All table
- * population takes place during run time. 
+ * population takes place during run time.
  */
 	void init_kamailioSIPRegUserLookupTable(void);
 
 
 	/*
  * Initialize the kamailioSIPRegUserLookupTable table by defining how it is
- * structured. 
+ * structured.
  *
  * This function is mostly auto-generated.
  */
 	void initialize_table_kamailioSIPRegUserLookupTable(void);
 
-	/* 
+	/*
  * This function was auto-generated and didn't need modifications from its
- * auto-generation.  It is called to handle an SNMP GET request. 
+ * auto-generation.  It is called to handle an SNMP GET request.
  */
 	int kamailioSIPRegUserLookupTable_get_value(netsnmp_request_info *,
 			netsnmp_index *, netsnmp_table_request_info *);
@@ -151,7 +151,7 @@ extern "C"
 	netsnmp_index *kamailioSIPRegUserLookupTable_delete_row(
 			kamailioSIPRegUserLookupTable_context *);
 
-	/* Used to check if there is a reason why a row can't be activated 
+	/* Used to check if there is a reason why a row can't be activated
  * (There is no reason in our implementation)
  */
 	int kamailioSIPRegUserLookupTable_can_activate(
@@ -159,7 +159,7 @@ extern "C"
 			kamailioSIPRegUserLookupTable_context *row_ctx,
 			netsnmp_request_group *rg);
 
-	/* Used to check if there is a reason why a row can't be deactivated 
+	/* Used to check if there is a reason why a row can't be deactivated
  * (There is no reason in our implementation)
  */
 	int kamailioSIPRegUserLookupTable_can_deactivate(

+ 10 - 10
src/modules/snmpstats/snmpSIPRegUserTable.c

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -35,7 +35,7 @@
  *
  * 2) We need a quick way of mapping usrloc indices to our integer indices.  For
  *    this reason a string indexed Hash Table was created, with each entry mapping
- *    to an integer user index. 
+ *    to an integer user index.
  *
  *    This hash table is used by the kamailioSIPContactTable (the hash table also
  *    maps a user to its contacts), as well as the kamailioSIPRegUserLookupTable.
@@ -48,19 +48,19 @@
  *    process.  Specifically:
  *
  *    - It can take a long time for the NetSNMP code base to populate a table with
- *      a large number of records. 
+ *      a large number of records.
  *
- *    - We rely on callbacks for updated user information. 
+ *    - We rely on callbacks for updated user information.
  *
  *    Clearly, using the SNMPStats module in this situation could lead to some
  *    big performance loses if we don't find another way to deal with this.  The
- *    solution was to use an interprocess communications buffer.  
+ *    solution was to use an interprocess communications buffer.
  *
  *    Instead of adding the record directly to the table, the callback functions
  *    now adds either an add/delete command to the interprocessBuffer.  When an
  *    snmp request is received by the SNMPStats sub-process, it will consume
  *    this interprocess buffer, adding and deleting users.  When it is finished,
- *    it can service the SNMP request.  
+ *    it can service the SNMP request.
  *
  *    This doesn't remove the NetSNMP inefficiency, but instead moves it to a
  *    non-critical path.  Such an approach allows SNMP support with almost no
@@ -156,9 +156,9 @@ void deleteRegUserRow(int userIndex)
  * Adds or updates a user:
  *
  *   - If a user with the name userName exists, its 'number of contacts' count
- *     will be incremented.  
+ *     will be incremented.
  *   - If the user doesn't exist, the user will be added to the table, and its
- *     number of contacts' count set to 1. 
+ *     number of contacts' count set to 1.
  */
 void updateUser(char *userName)
 {
@@ -203,14 +203,14 @@ void updateUser(char *userName)
 	/* Insert the new record of the mapping data structure into the hash
 	 * table */
 	/*insertHashRecord(hashTable,
-			createHashRecord(userIndex, userName), 
+			createHashRecord(userIndex, userName),
 			HASH_SIZE);*/
 
 	insertHashRecord(hashTable, newRecord, HASH_SIZE);
 }
 
 
-/* Creates a row and inserts it.  
+/* Creates a row and inserts it.
  *
  * Returns: The rows userIndex on success, and 0 otherwise. */
 int createRegUserRow(char *stringToRegister)

+ 11 - 11
src/modules/snmpstats/snmpSIPRegUserTable.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -32,7 +32,7 @@
  *
  * 2) We need a quick way of mapping usrloc indices to our integer indices.  For
  *    this reason a string indexed Hash Table was created, with each entry mapping
- *    to an integer user index. 
+ *    to an integer user index.
  *
  *    This hash table is used by the kamailioSIPContactTable (the hash table also
  *    maps a user to its contacts), as well as the kamailioSIPRegUserLookupTable.
@@ -45,19 +45,19 @@
  *    process.  Specifically:
  *
  *    - It can take a long time for the NetSNMP code base to populate a table with
- *      a large number of records. 
+ *      a large number of records.
  *
- *    - We rely on callbacks for updated user information. 
+ *    - We rely on callbacks for updated user information.
  *
  *    Clearly, using the SNMPStats module in this situation could lead to some
  *    big performance loses if we don't find another way to deal with this.  The
- *    solution was to use an interprocess communications buffer.  
+ *    solution was to use an interprocess communications buffer.
  *
  *    Instead of adding the record directly to the table, the callback functions
  *    now adds either an add/delete command to the interprocessBuffer.  When an
  *    snmp request is received by the SNMPStats sub-process, it will consume
  *    this interprocess buffer, adding and deleting users.  When it is finished,
- *    it can service the SNMP request.  
+ *    it can service the SNMP request.
  *
  *    This doesn't remove the NetSNMP inefficiency, but instead moves it to a
  *    non-critical path.  Such an approach allows SNMP support with almost no
@@ -104,15 +104,15 @@ extern "C"
 
 	/* If the usrloc module is loaded, this function will grab hooks into its
  * callback registration function, and add handleContactCallbacks() as the
- * callback for UL_CONTACT_INSERT and UL_CONTACT_EXPIRE. 
+ * callback for UL_CONTACT_INSERT and UL_CONTACT_EXPIRE.
  *
  * Returns 1 on success, and zero otherwise */
 	int registerForUSRLOCCallbacks(void);
 
 	/*
- * Creates a row and inserts it.  
+ * Creates a row and inserts it.
  *
- * Returns: The rows userIndex on success, and 0 otherwise. 
+ * Returns: The rows userIndex on success, and 0 otherwise.
  */
 	int createRegUserRow(char *stringToRegister);
 
@@ -129,9 +129,9 @@ extern "C"
  * Adds or updates a user:
  *
  *   - If a user with the name userName exists, its 'number of contacts' count
- *     will be incremented.  
+ *     will be incremented.
  *   - If the user doesn't exist, the user will be added to the table, and its
- *     number of contacts' count set to 1. 
+ *     number of contacts' count set to 1.
  */
 	void updateUser(char *userName);
 

+ 2 - 2
src/modules/snmpstats/snmpSIPServerObjects.c

@@ -44,7 +44,7 @@
 unsigned int global_UserLookupCounter;
 
 
-/* Initializes the kamailioSIPServerObjects module.  This involves: 
+/* Initializes the kamailioSIPServerObjects module.  This involves:
  *
  *  - Registering all OID's
  *  - Setting up handlers for all OID's
@@ -320,7 +320,7 @@ int handle_kamailioSIPRegUserLookupCounter(netsnmp_mib_handler *handler,
 
 	/* If we have had so many requests that we've hit our maximum index,
 	 * then we reset our counter back to 1.  For this not to cause problems,
-	 * it will be required that old rows belonging to the table 
+	 * it will be required that old rows belonging to the table
 	 * kamailioSIPRegUserLookupTable are eventually deleted. */
 	if(global_UserLookupCounter > MAX_USER_LOOKUP_COUNTER) {
 		global_UserLookupCounter = 1;

+ 2 - 2
src/modules/snmpstats/snmpSIPServerObjects.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
  * USA
  *
- * This file implements all scalars defined in the KAMAILIO-SIP-SERVER-MIB.  
+ * This file implements all scalars defined in the KAMAILIO-SIP-SERVER-MIB.
  * For a full description of the scalars, please see KAMAILIO-SIP-SERVER-MIB.
  *
  */

+ 31 - 31
src/modules/snmpstats/snmpSIPStatusCodesTable.c

@@ -86,10 +86,10 @@ size_t kamailioSIPStatusCodesTable_oid_len =
 		OID_LENGTH(kamailioSIPStatusCodesTable_oid);
 
 
-/* 
+/*
  * Initializes the kamailioSIPStatusCodesTable module.  This step is easier
  * than in the other tables because there is no table population.  All table
- * population takes place during run time. 
+ * population takes place during run time.
  */
 void init_kamailioSIPStatusCodesTable(void)
 {
@@ -133,13 +133,13 @@ static int kamailioSIPStatusCodesTable_row_copy(
 /*
  * the *_extract_index routine (Mostly auto-generated)
  *
- * This routine is called when a set request is received for an index that 
+ * This routine is called when a set request is received for an index that
  * was not found in the table container. Here, we parse the oid in the
- * individual index components and copy those indexes to the context. Then 
+ * individual index components and copy those indexes to the context. Then
  * we make sure the indexes for the new row are valid.
  *
  * It has been modified from its original form in that the indexes aren't
- * returned if they are invalid.  An index is invalid if it is not between 
+ * returned if they are invalid.  An index is invalid if it is not between
  * 100 and 699 (Inclusive).
  */
 int kamailioSIPStatusCodesTable_extract_index(
@@ -221,10 +221,10 @@ int kamailioSIPStatusCodesTable_extract_index(
 
 
 /*
- * This is an auto-generated function.  In general the *_can_activate routine 
+ * This is an auto-generated function.  In general the *_can_activate routine
  * is called when a row is changed to determine if all the values set are
  * consistent with the row's rules for a row status of ACTIVE.  If not, then 0
- * can be returned to prevent the row status from becomming final. 
+ * can be returned to prevent the row status from becomming final.
  *
  * For our purposes, we have no need for this check, so we always return 1.
  */
@@ -236,7 +236,7 @@ int kamailioSIPStatusCodesTable_can_activate(
 }
 
 
-/* 
+/*
  * This is an auto-generated function.  In general the *_can_deactivate routine
  * is called when a row that is currently ACTIVE is set to a state other than
  * ACTIVE. If there are conditions in which a row should not be allowed to
@@ -258,10 +258,10 @@ int kamailioSIPStatusCodesTable_can_deactivate(
  * This is an auto-generated function.  In general the *_can_delete routine is
  * called to determine if a row can be deleted.  This usually involved checking
  * if it can be deactivated, and if it can be, then checking for other
- * conditions.  
+ * conditions.
  *
  * Since this table ha no reason why row deletion shouldn't be allowed, we
- * always return 1, unless we can't deactivate.  
+ * always return 1, unless we can't deactivate.
  */
 int kamailioSIPStatusCodesTable_can_delete(
 		kamailioSIPStatusCodesTable_context *undo_ctx,
@@ -274,12 +274,12 @@ int kamailioSIPStatusCodesTable_can_delete(
 }
 
 /*
- * (Mostly auto-generated function) 
+ * (Mostly auto-generated function)
  *
  * The *_create_row routine is called by the table handler to create a new row
  * for a given index. This is the first stage of the row creation process.  The
  * *_set_reserve_* functions can be used to prevent the row from being inserted
- * into the table even if the row passes any preliminary checks set here. 
+ * into the table even if the row passes any preliminary checks set here.
  *
  * Returns a newly allocated kamailioSIPRegUserLookupTable_context structure (a
  * row in the table) if the indexes are legal.  NULL will be returned otherwise.
@@ -287,10 +287,10 @@ int kamailioSIPStatusCodesTable_can_delete(
  * The function has been modified from its original form, in that it will store
  * the number of messages 'in' to the system, and the number of messages 'out'
  * of the system, that had a status code matching this rows status code, at the
- * time this row was created.  
+ * time this row was created.
  *
  * This value will be used in the future to calculate the delta between now and
- * the time this row has been read.  
+ * the time this row has been read.
  * */
 kamailioSIPStatusCodesTable_context *kamailioSIPStatusCodesTable_create_row(
 		netsnmp_index *hdr)
@@ -342,7 +342,7 @@ kamailioSIPStatusCodesTable_context *kamailioSIPStatusCodesTable_create_row(
 }
 
 
-/* 
+/*
  * Auto-generated function.  The *_duplicate row routine
  */
 kamailioSIPStatusCodesTable_context *kamailioSIPStatusCodesTable_duplicate_row(
@@ -366,12 +366,12 @@ kamailioSIPStatusCodesTable_context *kamailioSIPStatusCodesTable_duplicate_row(
 }
 
 
-/* 
+/*
  * The *_delete_row method is auto-generated, and is called to delete a row.
  *
  * This will not be called if earlier checks said that this row can't be
  * deleted.  However, in our implementation there is never a reason why this
- * function can't be called. 
+ * function can't be called.
  */
 netsnmp_index *kamailioSIPStatusCodesTable_delete_row(
 		kamailioSIPStatusCodesTable_context *ctx)
@@ -389,20 +389,20 @@ netsnmp_index *kamailioSIPStatusCodesTable_delete_row(
  * Large parts of this function have been auto-generated.  The functions purpose
  * is to check to make sure all SNMP set values for the given row, have been
  * valid.  If not, then the process is supposed to be aborted.  Otherwise, we
- * pass on to the *_reserve2 function.  
+ * pass on to the *_reserve2 function.
  *
  * For our purposes, our only check is to make sure that either of the following
- * conditions are true: 
+ * conditions are true:
  *
  * 1) If this row already exists, then the SET request is setting the rowStatus
  *    column to 'destroy'.
  *
- * 2) If this row does not already exist, then the SET request is setting the 
- *    rowStatus to 'createAndGo'. 
+ * 2) If this row does not already exist, then the SET request is setting the
+ *    rowStatus to 'createAndGo'.
  *
  * Since the MIB specified there are to be no other modifications to the row,
  * any other condition is considered illegal, and will result in an SNMP error
- * being returned. 
+ * being returned.
  */
 void kamailioSIPStatusCodesTable_set_reserve1(netsnmp_request_group *rg)
 {
@@ -503,10 +503,10 @@ void kamailioSIPStatusCodesTable_set_reserve2(netsnmp_request_group *rg)
 /*
  * This function is called only when all the *_reserve[1|2] functions were
  * successful.  Its purpose is to make any changes to the row before it is
- * inserted into the table.  
+ * inserted into the table.
  *
  * In our case, we don't require any changes.  So we leave the original
- * auto-generated code as is.   
+ * auto-generated code as is.
  */
 void kamailioSIPStatusCodesTable_set_action(netsnmp_request_group *rg)
 {
@@ -593,17 +593,17 @@ void kamailioSIPStatusCodesTable_set_commit(netsnmp_request_group *rg)
  * This function is called if the *_reserve[1|2] calls failed.  It is supposed to
  * free up any resources allocated earlier.  However, we already take care of
  * all these resources in earlier functions.  So for our purposes, the function
- * body is empty. 
+ * body is empty.
  */
 void kamailioSIPStatusCodesTable_set_free(netsnmp_request_group *rg)
 {
 }
 
 
-/* 
+/*
  * This function is called if an ACTION phase fails, to do extra clean-up work.
  * We don't have anything complicated enough to warrant putting anything in this
- * function.  Therefore, its just left with an empty function body. 
+ * function.  Therefore, its just left with an empty function body.
  */
 void kamailioSIPStatusCodesTable_set_undo(netsnmp_request_group *rg)
 {
@@ -612,7 +612,7 @@ void kamailioSIPStatusCodesTable_set_undo(netsnmp_request_group *rg)
 
 /*
  * Initialize the kamailioSIPStatusCodesTable table by defining how it is
- * structured. 
+ * structured.
  *
  * This function is mostly auto-generated.
  */
@@ -711,17 +711,17 @@ void initialize_table_kamailioSIPStatusCodesTable(void)
 }
 
 /*
- * This function is called to handle SNMP GET requests.  
+ * This function is called to handle SNMP GET requests.
  *
  * The row which this function is called with, will store a message code.  The
  * function will retrieve the 'number of messages in' and 'number of messages
  * out' statistic for this particular message code from the statistics
- * framework.  
+ * framework.
  *
  * The function will then subtract from this value the value it was initialized
  * with when the row was first created.  In this sense, the row shows how many
  * ins and how many outs have been received (With respect to the message code)
- * since this row was created. 
+ * since this row was created.
  */
 int kamailioSIPStatusCodesTable_get_value(netsnmp_request_info *request,
 		netsnmp_index *item, netsnmp_table_request_info *table_info)

+ 18 - 18
src/modules/snmpstats/snmpSIPStatusCodesTable.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -26,7 +26,7 @@
  * The file implements the kamailioSIPStatusCodesTable.  For a full description
  * of the table, please see the KAMAILIO-SIP-COMMON-MIB.
  *
- * This file consists of many more functions than the other header files.  
+ * This file consists of many more functions than the other header files.
  * This is because this table is writable, bringing a lot of SNMP overhead.
  *
  * Most of the contents are auto-generated (aside from white space and comment
@@ -34,10 +34,10 @@
  *
  * 1) kamailioSIPStatusCodesTable_create_row()
  *
- * 2) kamailioSIPStatusCodesTable_extract_index() 
+ * 2) kamailioSIPStatusCodesTable_extract_index()
  *
  * 3) kamailioSIPStatusCodesTable_can_[activate|deactivate|delete]()
- *   
+ *
  * 4) kamailioSIPStatusCodesTable_set_reserve1()
  *
  * 5) kamailioSIPStatusCodesTable_get_value()
@@ -62,15 +62,15 @@ extern "C"
 
 #include "../../core/config.h"
 
-	/* 
+	/*
  * The structure has been mostly auto-generated, but its semantics have been
- * changed.  
+ * changed.
  *
  * Specifically, the kamailioSIPStatusCodeIns and kamailioSIPStatusCodeOuts
  * variables don't store the total number of messages sent or received from the
  * system at the time of a SNMP GET request.  Instead, they store the number of
  * messages in or out (with respect to the message code specified by
- * kamailioSIPStatusCodeValue) at the time of the rows *creation*. 
+ * kamailioSIPStatusCodeValue) at the time of the rows *creation*.
  *
  * When the get request is received, the statistics framework will be queried,
  * and these values subtracted from that query.  This effectively gives us how
@@ -89,16 +89,16 @@ extern "C"
 		/* The second index, specifying which status code to monitor */
 		unsigned long kamailioSIPStatusCodeValue;
 
-		/* Stores the current status code value - startingInStatusCodeValue 
+		/* Stores the current status code value - startingInStatusCodeValue
 	 * (at the time this row was created)  */
 		unsigned long kamailioSIPStatusCodeIns;
 
-		/* Stores the current status code value - startingOutStatusCodeValue 
+		/* Stores the current status code value - startingOutStatusCodeValue
 	 * (at the time this row was created)  */
 		unsigned long kamailioSIPStatusCodeOuts;
 
 		/* Initialized to zero at startup to signify uninitialized.  This can
-	 * only be assigned createAndGo(4) at this point.  It can also be 
+	 * only be assigned createAndGo(4) at this point.  It can also be
 	 * assigned destroy(6), but only if the value is in the active(1) state.
 	 */
 		long kamailioSIPStatusCodeRowStatus;
@@ -111,33 +111,33 @@ extern "C"
 
 	} kamailioSIPStatusCodesTable_context;
 
-	/* 
+	/*
  * Initializes the kamailioSIPStatusCodesTable module.  This step is easier
  * than in the other tables because there is no table population.  All table
- * population takes place during run time. 
+ * population takes place during run time.
  */
 	void init_kamailioSIPStatusCodesTable(void);
 
 	/*
  * Initialize the kamailioSIPStatusCodesTable table by defining how it is
- * structured. 
+ * structured.
  *
  * This function is mostly auto-generated.
  */
 	void initialize_table_kamailioSIPStatusCodesTable(void);
 
 	/*
- * This function is called to handle SNMP GET requests.  
+ * This function is called to handle SNMP GET requests.
  *
  * The row which this function is called with, will store a message code.  The
  * function will retrieve the 'number of messages in' and 'number of messages
  * out' statistic for this particular message code from the statistics
- * framework.  
+ * framework.
  *
  * The function will then subtract from this value the value it was initialized
  * with when the row was first created.  In this sense, the row shows how many
  * ins and how many outs have been received (With respect to the message code)
- * since this row was created. 
+ * since this row was created.
  */
 	int kamailioSIPStatusCodesTable_get_value(netsnmp_request_info *,
 			netsnmp_index *, netsnmp_table_request_info *);
@@ -189,7 +189,7 @@ extern "C"
 	netsnmp_index *kamailioSIPStatusCodesTable_delete_row(
 			kamailioSIPStatusCodesTable_context *);
 
-	/* Used to check if there is a reason why a row can't be activated 
+	/* Used to check if there is a reason why a row can't be activated
  * (There is no reason in our implementation)
  */
 	int kamailioSIPStatusCodesTable_can_activate(
@@ -197,7 +197,7 @@ extern "C"
 			kamailioSIPStatusCodesTable_context *row_ctx,
 			netsnmp_request_group *rg);
 
-	/* Used to check if there is a reason why a row can't be deactivated 
+	/* Used to check if there is a reason why a row can't be deactivated
  * (There is no reason in our implementation)
  */
 	int kamailioSIPStatusCodesTable_can_deactivate(

+ 4 - 4
src/modules/snmpstats/snmpstats.c

@@ -405,8 +405,8 @@ static void mod_destroy(void)
 
 
 /*! The SNMPStats module forks off a child process to run an snmp command via
- * execve(). We need a customized handler to catch and ignore its SIGCHLD when 
- * it terminates. We also need to make sure to forward other processes 
+ * execve(). We need a customized handler to catch and ignore its SIGCHLD when
+ * it terminates. We also need to make sure to forward other processes
  * SIGCHLD's to Kamailio's usual SIGCHLD handler.  We do this by resetting back
  * Kamailio's own signal handlers after we caught our appropriate SIGCHLD. */
 static void sigchld_handler(int signal)
@@ -450,9 +450,9 @@ static void sigchld_handler(int signal)
  * handler to ignore the SIGCHLD for only this process. (See sigchld_handler
  * above).
  *
- * \note sysUpTime is a scalar provided by netsnmp.  It is not the same thing as 
+ * \note sysUpTime is a scalar provided by netsnmp.  It is not the same thing as
  *       a normal system uptime. Support for this has been provided to try to
- *       match the IETF Draft SIP MIBs as closely as possible. 
+ *       match the IETF Draft SIP MIBs as closely as possible.
  */
 static int spawn_sysUpTime_child(void)
 {

+ 4 - 4
src/modules/snmpstats/snmpstats.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -19,7 +19,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
  * USA
- * 
+ *
  * Structure and prototype definitions for the SNMPStats module.
  *
  * There are some important points to understanding the SNMPStat modules
@@ -28,7 +28,7 @@
  * 1) The SNMPStats module will fork off a new process in mod_child_init when
  *    the rank is equal to PROC_MAIN_PROCESS.  The sub-process will be
  *    responsible for registering with a master agent (the source of snmp
- *    requests), and handling all received requests. 
+ *    requests), and handling all received requests.
  *
  * 2) The Module will register a periodic alarm checking function with a sip
  *    timer using register_timer().  This function checks for alarm conditions,
@@ -40,7 +40,7 @@
  *    spawning a short-lived process.  For this reason, the module temporarily
  *    installs a new SIGCHLD handler to deal specifically with this process.  It
  *    does not change the normal SIGCHLD behaviour for any process except for
- *    this short lived sysUpTime process. 
+ *    this short lived sysUpTime process.
  *
  * 4) mod_init() will initialize some interprocess communication buffers, as
  *    well as callback mechanisms for the usrloc module.  To understand what the

+ 1 - 1
src/modules/snmpstats/snmpstats_globals.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *

+ 3 - 3
src/modules/snmpstats/sub_agent.c

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -79,11 +79,11 @@ static void sigterm_handler(int signal)
  *
  *   1) Registers itself with the Master Agent
  *   2) Initializes all of the SNMPStats modules scalars and tables, while
- *      simultaneously registering their respective SNMP OID's and handlers 
+ *      simultaneously registering their respective SNMP OID's and handlers
  *      with the master agent.
  *   3) Repeatedly checks for new SNMP messages to process
  *
- * \note This function never returns, so it should always be called from a 
+ * \note This function never returns, so it should always be called from a
  *       sub-process.
  */
 static int initialize_agentx(void)

+ 1 - 1
src/modules/snmpstats/sub_agent.h

@@ -1,5 +1,5 @@
 /*
- * SNMPStats Module 
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *

+ 6 - 6
src/modules/snmpstats/utilities.h

@@ -1,5 +1,5 @@
-/* 
- * SNMPStats Module 
+/*
+ * SNMPStats Module
  * Copyright (C) 2006 SOMA Networks, INC.
  * Written by: Jeffrey Magder ([email protected])
  *
@@ -43,11 +43,11 @@
 
 /*!
  * This function copies a Kamailio "str" datatype into a '\\0' terminated char*
- * string. 
+ * string.
  *
  * \note Make sure to free the memory allocated to *copiedString, when you no
  *       longer have any use for it. (It is allocated with shm_malloc(), so make
- *       sure to deallocate it with shm_free()) 
+ *       sure to deallocate it with shm_free())
  */
 int convertStrToCharString(str *strToConvert, char **copiedString);
 
@@ -58,7 +58,7 @@ int stringHandlerSanityCheck(modparam_t type, void *val, char *parameterName);
 /*!
  * This function is a wrapper around the standard statistic framework.  It will
  * return the value of the statistic denoted with statName, or zero if the
- * statistic was not found. 
+ * statistic was not found.
  */
 int get_statistic(char *statName);
 
@@ -67,7 +67,7 @@ int get_statistic(char *statName);
  * counted on to be around if this function is called again. */
 char *convertTMToSNMPDateAndTime(struct tm *timeStructure);
 
-/*! \brief Get config framework variable 
+/*! \brief Get config framework variable
  * type will return cfg_type - CFG_VAR_INT, CFG_VAR_STRING, CFG_VAR_STR
  * If type is CFG_VAR_UNSET then call failed and return value should be ignored.
 */