|
@@ -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)
|