summaryrefslogtreecommitdiff
path: root/cleopatre/application/spidnetsnmp/agent
diff options
context:
space:
mode:
authorJun Xiang2012-05-12 18:16:05 +0800
committerJun Xiang2012-05-25 21:08:57 +0800
commit4e962b4c493a0d9afb72002e341d6ab251c105fe (patch)
tree4f2dd051a79a4b59543204134c65620d58723684 /cleopatre/application/spidnetsnmp/agent
parent3c00d8c1f5b713089107d36f6cc177933d85227e (diff)
cleo/app/snmp[eoc]: implement the eocCNUGRoup/eocCNUService, closes #3020
Diffstat (limited to 'cleopatre/application/spidnetsnmp/agent')
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService.h4
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.c87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable.h10
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.c60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.h91
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.c592
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.h15
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get.c60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set.c1417
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_enums.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.c468
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.h5
14 files changed, 2278 insertions, 546 deletions
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup.h
index 78ca8518a1..accbebdaa8 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup.h
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup.h
@@ -1,4 +1,4 @@
-//config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService)
config_require(mstar-eoc-mib/eocCNUGroup/eocCNUPort)
//config_require(mstar-eoc-mib/eocCNUGroup/eocCNU)
config_require(mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService.h
index bd353fedd9..f50b82ae40 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService.h
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService.h
@@ -1,2 +1,2 @@
-//config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable)
-//config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.c
index c4830240d7..c52fab8eae 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.c
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.c
@@ -30,19 +30,20 @@ handle_eocCNUServiceAmountLimitation(netsnmp_mib_handler *handler,
netsnmp_request_info *requests)
{
int ret;
+ int amount_limit = LIBSPID_SERVICE_AMOUNT_LIMIT;
/* We are never called for a GETNEXT if it's registered as a
- "instance", as it's "magically" handled for us. */
+ * "instance", as it's "magically" handled for us. */
/* a instance handler also only hands us one request at a time, so
- we don't need to loop over a list of requests; we'll only get one. */
-
- switch(reqinfo->mode) {
+ * we don't need to loop over a list of requests; we'll only get one. */
- case MODE_GET:
- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
- (u_char *) /* XXX: a pointer to the scalar's data */,
- /* XXX: the length of the data in bytes */);
- break;
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & amount_limit,
+ sizeof (amount_limit));
+ break;
/*
* SET REQUEST
@@ -50,54 +51,38 @@ handle_eocCNUServiceAmountLimitation(netsnmp_mib_handler *handler,
* multiple states in the transaction. See:
* http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
*/
- case MODE_SET_RESERVE1:
- /* or you could use netsnmp_check_vb_type_and_size instead */
- ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
- if ( ret != SNMP_ERR_NOERROR ) {
- netsnmp_set_request_error(reqinfo, requests, ret );
- }
- break;
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ break;
- case MODE_SET_RESERVE2:
- /* XXX malloc "undo" storage buffer */
- if (/* XXX if malloc, or whatever, failed: */) {
- netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
- }
- break;
+ case MODE_SET_RESERVE2:
+ break;
- case MODE_SET_FREE:
- /* XXX: free resources allocated in RESERVE1 and/or
- RESERVE2. Something failed somewhere, and the states
- below won't be called. */
- break;
+ case MODE_SET_FREE:
+ /* XXX: free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called. */
+ break;
- case MODE_SET_ACTION:
- /* XXX: perform the value change here */
- if (/* XXX: error? */) {
- netsnmp_set_request_error(reqinfo, requests, /* some error */);
- }
- break;
+ case MODE_SET_ACTION:
+ /* XXX: perform the value change here */
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_NOTWRITABLE);
+ break;
- case MODE_SET_COMMIT:
- /* XXX: delete temporary storage */
- if (/* XXX: error? */) {
- /* try _really_really_ hard to never get to this point */
- netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
- }
- break;
+ case MODE_SET_COMMIT:
+ /* XXX: delete temporary storage */
+ break;
- case MODE_SET_UNDO:
- /* XXX: UNDO and return to previous value for the object */
- if (/* XXX: error? */) {
- /* try _really_really_ hard to never get to this point */
- netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
- }
- break;
+ case MODE_SET_UNDO:
+ /* XXX: UNDO and return to previous value for the object */
+ break;
- default:
- /* we should never get here, so this is a really bad error */
- snmp_log(LOG_ERR, "unknown mode (%d) in handle_eocCNUServiceAmountLimitation\n", reqinfo->mode );
- return SNMP_ERR_GENERR;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCNUServiceAmountLimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
}
return SNMP_ERR_NOERROR;
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.h
index cc5140564b..c1d4fa878f 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.h
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.h
@@ -5,6 +5,7 @@
#ifndef EOCCNUSERVICE_H
#define EOCCNUSERVICE_H
+#include "EoCCommon.h"
/* function declarations */
void init_eocCNUService(void);
Netsnmp_Node_Handler handle_eocCNUServiceAmountLimitation;
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable.h
index 56feabd09d..d6a82edd9c 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable.h
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable.h
@@ -1,5 +1,5 @@
-//config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set)
-//config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable)
-//config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface)
-//config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access)
-//config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.c
index 9f5ae66a76..8c9d7fbe3a 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.c
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.c
@@ -1,6 +1,6 @@
/*
* Note: this file originally auto-generated by mib2c using
- * version : 14170 $ of $
+ * version : 14170 $ of $
*
* $Id:$
*/
@@ -22,6 +22,10 @@
#include "eocCNUServiceTable_interface.h"
+#ifdef USING_SPC300_EOC_MIB_MODULE
+/* header for SPC300 table extension */
+#include "spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable.h"
+#endif /* USING_SPC300_EOC_MIB_MODULE */
oid eocCNUServiceTable_oid[] = { EOCCNUSERVICETABLE_OID };
int eocCNUServiceTable_oid_size = OID_LENGTH(eocCNUServiceTable_oid);
@@ -37,19 +41,35 @@ void shutdown_table_eocCNUServiceTable(void);
void
init_eocCNUServiceTable(void)
{
- DEBUGMSGTL(("verbose:eocCNUServiceTable:init_eocCNUServiceTable","called\n"));
+ static int eocCNUServiceTable_did_init = 0;
+
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:init_eocCNUServiceTable",
+ "called\n"));
/*
* TODO:300:o: Perform eocCNUServiceTable one-time module initialization.
*/
-
+ if (++eocCNUServiceTable_did_init != 1)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable:init_eocCNUServiceTable",
+ "ignoring duplicate call\n"));
+ return;
+ }
+
/*
* here we initialize all the tables we're planning on supporting
*/
- if (should_init("eocCNUServiceTable"))
- initialize_table_eocCNUServiceTable();
+ if (should_init ("eocCNUServiceTable"))
+ {
+ initialize_table_eocCNUServiceTable ();
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ if (should_init ("spc300EoCSlaveServiceTable"))
+ initialize_table_spc300EoCSlaveServiceTable ();
+#endif
+ }
-} /* init_eocCNUServiceTable */
+} /* init_eocCNUServiceTable */
/**
* Shut-down the eocCNUServiceTable module (agent is exiting)
@@ -63,7 +83,7 @@ shutdown_eocCNUServiceTable(void)
}
/**
- * Initialize the table eocCNUServiceTable
+ * Initialize the table eocCNUServiceTable
* (Define its contents and how it's structured)
*/
void
@@ -87,14 +107,15 @@ initialize_table_eocCNUServiceTable(void)
* a netsnmp_data_list is a simple way to store void pointers. A simple
* string token is used to add, find or remove pointers.
*/
- user_context = netsnmp_create_data_list("eocCNUServiceTable", NULL, NULL);
-
+ user_context =
+ netsnmp_create_data_list ("eocCNUServiceTable", NULL, NULL);
+
/*
* No support for any flags yet, but in the future you would
* set any flags here.
*/
flags = 0;
-
+
/*
* call interface initialization code
*/
@@ -102,7 +123,7 @@ initialize_table_eocCNUServiceTable(void)
} /* initialize_table_eocCNUServiceTable */
/**
- * Shutdown the table eocCNUServiceTable
+ * Shutdown the table eocCNUServiceTable
*/
void
shutdown_table_eocCNUServiceTable(void)
@@ -123,13 +144,13 @@ shutdown_table_eocCNUServiceTable(void)
* @retval MFD_ERROR : error (context allocate will fail)
*/
int
-eocCNUServiceTable_rowreq_ctx_init(eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
- void *user_init_ctx)
+eocCNUServiceTable_rowreq_ctx_init (eocCNUServiceTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
{
DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_rowreq_ctx_init","called\n"));
netsnmp_assert(NULL != rowreq_ctx);
-
+
/*
* TODO:210:o: |-> Perform extra eocCNUServiceTable rowreq initialization. (eg DEFVALS)
*/
@@ -146,11 +167,16 @@ void eocCNUServiceTable_rowreq_ctx_cleanup(eocCNUServiceTable_rowreq_ctx *rowreq
DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_rowreq_ctx_cleanup","called\n"));
netsnmp_assert(NULL != rowreq_ctx);
-
+
/*
* TODO:211:o: |-> Perform extra eocCNUServiceTable rowreq cleanup.
*/
-} /* eocCNUServiceTable_rowreq_ctx_cleanup */
+ if (NULL != rowreq_ctx->data)
+ {
+ eocCNUServiceTable_release_data (rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+ }
+} /* eocCNUServiceTable_rowreq_ctx_cleanup */
/**
* pre-request callback
@@ -207,7 +233,7 @@ eocCNUServiceTable_post_request(eocCNUServiceTable_registration * user_context,
* save changed rows, if you haven't already
*/
}
-
+
eocCNUServiceTable_dirty_set(0); /* clear table dirty flag */
}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.h
index c5c3816b59..2651cdb013 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.h
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.h
@@ -18,14 +18,6 @@ extern "C" {
*/
#include <net-snmp/library/asn1.h>
-/* other required module components */
- /* *INDENT-OFF* */
-config_add_mib(NSCRTV-EPONEOC-MOD-EOC-MIB)
-config_require(NSCRTV-EPONEOC-MOD-EOC-MIB/eocCNUServiceTable/eocCNUServiceTable_interface)
-config_require(NSCRTV-EPONEOC-MOD-EOC-MIB/eocCNUServiceTable/eocCNUServiceTable_data_access)
-config_require(NSCRTV-EPONEOC-MOD-EOC-MIB/eocCNUServiceTable/eocCNUServiceTable_data_get)
-config_require(NSCRTV-EPONEOC-MOD-EOC-MIB/eocCNUServiceTable/eocCNUServiceTable_data_set)
- /* *INDENT-ON* */
/* OID and column number definitions for eocCNUServiceTable */
#include "eocCNUServiceTable_oids.h"
@@ -33,6 +25,13 @@ config_require(NSCRTV-EPONEOC-MOD-EOC-MIB/eocCNUServiceTable/eocCNUServiceTable_
/* enum definions */
#include "eocCNUServiceTable_enums.h"
+#ifdef USING_SPC300_EOC_MIB_MODULE
+/* includes for columns in SPC300 table extension */
+#include "spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_oids.h"
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+/* include common header */
+#include "EoCCommon.h"
/* *********************************************************************
* function declarations
*/
@@ -76,54 +75,73 @@ typedef netsnmp_data_list eocCNUServiceTable_registration;
* eocCNUServiceTable.
*/
typedef struct eocCNUServiceTable_data_s {
-
- /*
- * eocCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
- */
+
+ /* fields added to use for container iteration */
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid st_index; /* arbitrary index */
+
+ /* field added for index written in service configuration file */
+ long eocCNUServiceConfIndex;
+ /*
+ * eocCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
char eocCNUServiceName[255];
size_t eocCNUServiceName_len; /* # of char elements, not bytes */
-
+
/*
* eocCNUServiceType(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
*/
long eocCNUServiceType;
-
+
/*
* eocCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
*/
long eocCNUServiceQOSPrio;
-
+
/*
* eocCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
*/
long eocCNUServiceDBADownstreamPIR;
-
+
/*
* eocCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
*/
long eocCNUServiceDBAUpstreamPIR;
-
+
/*
* eocCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
*/
long eocCNUServiceDBADownstreamCIR;
-
+
/*
* eocCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
*/
long eocCNUServiceDBAUpstreamCIR;
-
+
/*
* eocCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
*/
long eocCNUServiceMaxLatency;
-
+
/*
* eocCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
*/
- u_long eocCNUServiceRowStatus;
-
-} eocCNUServiceTable_data;
+ u_long eocCNUServiceRowStatus;
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* fields specific to SPC300EoC Service Table extension */
+ /*
+ * spc300EoCSlaveServiceMaxJitter(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long spc300EoCSlaveServiceMaxJitter;
+
+ /*
+ * spc300EoCSlaveServiceACSEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long spc300EoCSlaveServiceACSEn;
+
+#endif
+ /* USING_SPC300_EOC_MIB_MODULE */
+ } eocCNUServiceTable_data;
/* *********************************************************************
@@ -164,15 +182,15 @@ typedef struct eocCNUServiceTable_mib_index_s {
typedef struct eocCNUServiceTable_rowreq_ctx_s {
/** this must be first for container compare to work */
- netsnmp_index oid_idx;
- oid oid_tmp[MAX_eocCNUServiceTable_IDX_LEN];
-
- eocCNUServiceTable_mib_index tbl_idx;
-
- eocCNUServiceTable_data data;
- unsigned int column_exists_flags; /* flags for existence */
- eocCNUServiceTable_undo_data * undo;
- unsigned int column_set_flags; /* flags for set columns */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocCNUServiceTable_IDX_LEN];
+
+ eocCNUServiceTable_mib_index tbl_idx;
+
+ eocCNUServiceTable_data *data;
+ unsigned int column_exists_flags; /* flags for existence */
+ eocCNUServiceTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
/*
@@ -184,11 +202,13 @@ typedef struct eocCNUServiceTable_rowreq_ctx_s {
/*
* TODO:131:o: | |-> Add useful data to eocCNUServiceTable rowreq context.
*/
-
+
+ /* NOTE: change of template - field for undo reference count added (as in ifTable_rowreq_ctx) */
+ u_char undo_ref_count;
/*
* storage for future expansion
*/
- netsnmp_data_list *eocCNUServiceTable_data_list;
+ netsnmp_data_list *eocCNUServiceTable_data_list;
} eocCNUServiceTable_rowreq_ctx;
@@ -207,6 +227,8 @@ typedef struct eocCNUServiceTable_ref_rowreq_ctx_s {
void *user_init_ctx);
void eocCNUServiceTable_rowreq_ctx_cleanup(eocCNUServiceTable_rowreq_ctx *rowreq_ctx);
+ int eocCNUServiceTable_check_dependencies (eocCNUServiceTable_rowreq_ctx *
+ rowreq_ctx);
int eocCNUServiceTable_commit(eocCNUServiceTable_rowreq_ctx * rowreq_ctx);
eocCNUServiceTable_rowreq_ctx *
@@ -215,6 +237,7 @@ typedef struct eocCNUServiceTable_ref_rowreq_ctx_s {
extern oid eocCNUServiceTable_oid[];
extern int eocCNUServiceTable_oid_size;
+ extern int eoccnu_adding_service;
#include "eocCNUServiceTable_interface.h"
#include "eocCNUServiceTable_data_access.h"
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.c
index 23ff98ab74..14e2d0c46c 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.c
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.c
@@ -1,6 +1,6 @@
/*
* Note: this file originally auto-generated by mib2c using
- * version : 14170 $ of $
+ * version : 14170 $ of $
*
* $Id:$
*/
@@ -15,12 +15,14 @@
#include "eocCNUServiceTable_data_access.h"
+/* indication of row being added to the table */
+int eoccnu_adding_service;
/** @ingroup interface
* @addtogroup data_access data_access: Routines to access data
*
* These routines are used to locate the data used to satisfy
* requests.
- *
+ *
* @{
*/
/**********************************************************************
@@ -96,7 +98,7 @@ eocCNUServiceTable_container_init(netsnmp_container **container_ptr_ptr,
netsnmp_cache *cache)
{
DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_container_init","called\n"));
-
+
if (NULL == container_ptr_ptr) {
snmp_log(LOG_ERR,"bad container param to eocCNUServiceTable_container_init\n");
return;
@@ -122,6 +124,8 @@ eocCNUServiceTable_container_init(netsnmp_container **container_ptr_ptr,
* cache->enabled to 0.
*/
cache->timeout = EOCCNUSERVICETABLE_CACHE_TIMEOUT; /* seconds */
+ /* initialize row adding indication */
+ eoccnu_adding_service = 0;
} /* eocCNUServiceTable_container_init */
/**
@@ -144,7 +148,7 @@ void
eocCNUServiceTable_container_shutdown(netsnmp_container *container_ptr)
{
DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_container_shutdown","called\n"));
-
+
if (NULL == container_ptr) {
snmp_log(LOG_ERR,"bad params to eocCNUServiceTable_container_shutdown\n");
return;
@@ -152,6 +156,381 @@ eocCNUServiceTable_container_shutdown(netsnmp_container *container_ptr)
} /* eocCNUServiceTable_container_shutdown */
+static void
+_service_update_entry (eocCNUServiceTable_data *lhs,
+ eocCNUServiceTable_data *rhs)
+{
+ if (lhs->eocCNUServiceName_len != rhs->eocCNUServiceName_len)
+ {
+ lhs->eocCNUServiceName_len = rhs->eocCNUServiceName_len;
+ memcpy (lhs->eocCNUServiceName, rhs->eocCNUServiceName,
+ rhs->eocCNUServiceName_len);
+ }
+ else if (memcmp (lhs->eocCNUServiceName, rhs->eocCNUServiceName,
+ rhs->eocCNUServiceName_len) != 0)
+ {
+ memcpy (lhs->eocCNUServiceName, rhs->eocCNUServiceName,
+ rhs->eocCNUServiceName_len);
+ }
+
+ if (lhs->eocCNUServiceType != rhs->eocCNUServiceType)
+ {
+ lhs->eocCNUServiceType = rhs->eocCNUServiceType;
+ }
+
+ if (lhs->eocCNUServiceQOSPrio != rhs->eocCNUServiceQOSPrio)
+ {
+ lhs->eocCNUServiceQOSPrio = rhs->eocCNUServiceQOSPrio;
+ }
+
+ if (lhs->eocCNUServiceDBADownstreamPIR !=
+ rhs->eocCNUServiceDBADownstreamPIR)
+ {
+ lhs->eocCNUServiceDBADownstreamPIR =
+ rhs->eocCNUServiceDBADownstreamPIR;
+ }
+
+ if (lhs->eocCNUServiceDBAUpstreamPIR != rhs->eocCNUServiceDBAUpstreamPIR)
+ {
+ lhs->eocCNUServiceDBAUpstreamPIR = rhs->eocCNUServiceDBAUpstreamPIR;
+ }
+
+ if (lhs->eocCNUServiceDBADownstreamCIR !=
+ rhs->eocCNUServiceDBADownstreamCIR)
+ {
+ lhs->eocCNUServiceDBADownstreamCIR =
+ rhs->eocCNUServiceDBADownstreamCIR;
+ }
+
+ if (lhs->eocCNUServiceDBAUpstreamCIR != rhs->eocCNUServiceDBAUpstreamCIR)
+ {
+ lhs->eocCNUServiceDBAUpstreamCIR = rhs->eocCNUServiceDBAUpstreamCIR;
+ }
+
+ if (lhs->eocCNUServiceMaxLatency != rhs->eocCNUServiceMaxLatency)
+ {
+ lhs->eocCNUServiceMaxLatency = rhs->eocCNUServiceMaxLatency;
+ }
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ if (lhs->spc300EoCSlaveServiceMaxJitter !=
+ rhs->spc300EoCSlaveServiceMaxJitter)
+ {
+ lhs->spc300EoCSlaveServiceMaxJitter =
+ rhs->spc300EoCSlaveServiceMaxJitter;
+ }
+
+ if (lhs->spc300EoCSlaveServiceACSEn != rhs->spc300EoCSlaveServiceACSEn)
+ {
+ lhs->spc300EoCSlaveServiceACSEn = rhs->spc300EoCSlaveServiceACSEn;
+ }
+#endif
+}
+
+static int
+_service_container_load (netsnmp_container *container)
+{
+ eocCNUServiceTable_data *entry;
+ int rc = MFD_SUCCESS;
+
+
+ /* service entries read from config file */
+ libspid_eoc_service_entry_t service_entries[LIBSPID_SERVICE_AMOUNT_LIMIT];
+
+ int i, j;
+ int tmp;
+
+ int service_count;
+
+ /* initial row status is set to active by default */
+ int init_row_status = ROWSTATUS_ACTIVE;
+
+ DEBUGMSGTL (("eocCNUServiceTable:access",
+ "_service_container_load called \n"));
+
+ if (NULL == container)
+ {
+ snmp_log (LOG_ERR, "no container specified/found for"
+ " _service_container_load\n");
+ return MFD_ERROR;
+ }
+
+ memset (service_entries, 0x0, sizeof (service_entries));
+
+ /* check errors in contents of service list prior to reading */
+ /* if errors are found, log message and set initial row status to notInService for all entries */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service config file,"
+ " refer to syslog\n");
+ init_row_status = ROWSTATUS_NOTINSERVICE;
+ }
+
+ /* get current contents of service config file */
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_service_get_list (service_entries, &service_count))
+ {
+ snmp_log (LOG_ERR, "service config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == service_count)
+ {
+ rc = MFD_END_OF_DATA;
+ }
+
+
+ for (i = 0; i < service_count; i++)
+ {
+
+ /* call interface function for allocating service table data */
+ if (NULL == (entry = eocCNUServiceTable_allocate_data ()))
+ {
+ snmp_log (LOG_ERR, "service entry allocation error\n");
+ return MFD_ERROR;
+ }
+
+
+ /* set row status to initial value */
+ entry->eocCNUServiceRowStatus = init_row_status;
+
+ /* parse service index from service entry */
+ tmp = sscanf (service_entries[i].service_index, "%ld",
+ &entry->eocCNUServiceConfIndex);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting service index "
+ "field to invalid\n");
+ entry->eocCNUServiceConfIndex = INVALID_EOCCNUSERVICECONFINDEX;
+ }
+
+ /* parse service name from service entry */
+ if ((NULL == service_entries[i].service_name)
+ || (!strcmp (service_entries[i].service_name, "")))
+ {
+ snmp_log (LOG_ERR, "empty service name field\n");
+ entry->eocCNUServiceName[0] = '\0';
+ }
+ else
+ {
+ strncpy (entry->eocCNUServiceName,
+ service_entries[i].service_name, 255);
+ entry->eocCNUServiceName_len = strlen (entry->eocCNUServiceName);
+ }
+
+ /* parse service type from service entry */
+ tmp = sscanf (service_entries[i].service_type, "%ld",
+ &entry->eocCNUServiceType);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting service type"
+ " field to invalid\n");
+ entry->eocCNUServiceType = INVALID_EOCCNUSERVICESERVICETYPE;
+ }
+
+ /* parse QOS Prio from service entry */
+ tmp = sscanf (service_entries[i].qos_prio, "%ld",
+ &entry->eocCNUServiceQOSPrio);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting QOS Prio "
+ "field to invalid\n");
+ entry->eocCNUServiceQOSPrio = INVALID_EOCCNUSERVICEQOSPRIO;
+ }
+
+ /* parse downstream PIR from service entry */
+ tmp = sscanf (service_entries[i].dba_dl_pir, "%ld",
+ &entry->eocCNUServiceDBADownstreamPIR);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting downstream PIR"
+ " field to invalid\n");
+ entry->eocCNUServiceDBADownstreamPIR =
+ INVALID_EOCCNUSERVICEDBADOWNSTREAMPIR;
+ }
+
+ /* parse upstream PIR from service entry */
+ tmp = sscanf (service_entries[i].dba_ul_pir, "%ld",
+ &entry->eocCNUServiceDBAUpstreamPIR);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting upstream PIR "
+ "field to invalid\n");
+ entry->eocCNUServiceDBAUpstreamPIR =
+ INVALID_EOCCNUSERVICEDBAUPSTREAMPIR;
+ }
+
+ /* parse downstream CIR from service entry */
+ tmp = sscanf (service_entries[i].dba_dl_cir, "%ld",
+ &entry->eocCNUServiceDBADownstreamCIR);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting downstream CIR"
+ " field to invalid\n");
+ entry->eocCNUServiceDBADownstreamCIR =
+ INVALID_EOCCNUSERVICEDBADOWNSTREAMCIR;
+ }
+
+ /* parse upstream CIR from service entry */
+ tmp = sscanf (service_entries[i].dba_ul_cir, "%ld",
+ &entry->eocCNUServiceDBAUpstreamCIR);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting upstream CIR"
+ " field to invalid\n");
+ entry->eocCNUServiceDBAUpstreamCIR =
+ INVALID_EOCCNUSERVICEDBAUPSTREAMCIR;
+ }
+
+ /* parse max latency from service entry */
+ tmp = sscanf (service_entries[i].max_latency, "%ld",
+ &entry->eocCNUServiceMaxLatency);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting max latency"
+ " field to invalid\n");
+ entry->eocCNUServiceMaxLatency = INVALID_EOCCNUSERVICEMAXLATENCY;
+ }
+
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* read data from SPC300 table */
+ /* parse max jitter from service entry */
+ tmp = sscanf (service_entries[i].max_jitter, "%ld",
+ &entry->spc300EoCSlaveServiceMaxJitter);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting max jitter field "
+ "to invalid\n");
+ entry->spc300EoCSlaveServiceMaxJitter =
+ INVALID_SPC300EOCSLAVESERVICEMAXJITTER;
+ }
+ /* parse ACS enable from service entry */
+ tmp = sscanf (service_entries[i].acs_en, "%ld",
+ &entry->spc300EoCSlaveServiceACSEn);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting ACS Enable field"
+ " to invalid\n");
+ entry->spc300EoCSlaveServiceACSEn =
+ INVALID_SPC300EOCSLAVESERVICEACSEN;
+ }
+#endif
+
+ /* set entry index for container comparison */
+ entry->st_index = i + 1;
+
+ /*
+ * add entry to container
+ */
+ CONTAINER_INSERT (container, entry);
+ }
+ return rc;
+}
+
+/**
+ * check entry for update
+ */
+
+static void
+_eoccnu_service_check_entry_for_updates (eocCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ void **magic)
+{
+ netsnmp_container *service_container = magic[0];
+ netsnmp_container *to_delete = (netsnmp_container *) magic[1];
+
+ DEBUGMSGTL (("eocCNUServiceTable:access",
+ "checking entry for updates\n"));
+
+ netsnmp_assert (NULL != service_container);
+ netsnmp_assert (NULL != rowreq_ctx);
+ netsnmp_assert (NULL != rowreq_ctx->data);
+ /*
+ * check for matching entries to be deleted
+ */
+ eocCNUServiceTable_data *service_entry =
+ CONTAINER_FIND (service_container, rowreq_ctx->data);
+ if (NULL == service_entry)
+ {
+
+ if (NULL == to_delete)
+ {
+ magic[1] = to_delete = netsnmp_container_find ("lifo");
+ if (NULL == to_delete)
+ snmp_log (LOG_ERR, "couldn't create delete container\n");
+ }
+ if (NULL != to_delete)
+ CONTAINER_INSERT (to_delete, rowreq_ctx);
+ }
+ else
+ {
+ /* check for updates for editable columns from service table */
+ _service_update_entry (rowreq_ctx->data, service_entry);
+
+ /*
+ * remove entry from temporary service container
+ */
+ CONTAINER_REMOVE (service_container, service_entry);
+ free (service_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_eoccnu_service_add_new_entry (eocCNUServiceTable_data * service_entry,
+ netsnmp_container * container)
+{
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ DEBUGMSGTL (("eocCNUServiceTable:access", "creating new entry\n"));
+
+ netsnmp_assert (NULL != service_entry);
+ netsnmp_assert (NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx = eocCNUServiceTable_allocate_rowreq_ctx (service_entry, NULL);
+
+ if ((NULL != rowreq_ctx)
+ && (MFD_SUCCESS ==
+ eocCNUServiceTable_indexes_set (rowreq_ctx,
+ service_entry->
+ eocCNUServiceConfIndex)))
+ {
+ if (CONTAINER_INSERT (container, rowreq_ctx) < 0)
+ {
+ snmp_log (LOG_ERR, "eocCNUServiceTable container insert failed"
+ " for new entry\n");
+ eocCNUServiceTable_release_rowreq_ctx (rowreq_ctx);
+ return;
+ }
+ ++count;
+ }
+ else
+ {
+ if (NULL != rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocCNUServiceTable cache.\n");
+ eocCNUServiceTable_release_rowreq_ctx (rowreq_ctx);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "memory allocation failed while loading "
+ "eocCNUServiceTable cache.\n");
+ free (service_entry);
+ }
+
+ return;
+ }
+ rowreq_ctx->data->eocCNUServiceRowStatus =
+ service_entry->eocCNUServiceRowStatus;
+}
+
/**
* load initial data
*
@@ -188,143 +567,88 @@ eocCNUServiceTable_container_shutdown(netsnmp_container *container_ptr)
int
eocCNUServiceTable_container_load(netsnmp_container *container)
{
- eocCNUServiceTable_rowreq_ctx *rowreq_ctx;
- size_t count = 0;
-
- /*
- * temporary storage for index values
- */
- /*
- * eocCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
- */
- long eocCNUServiceIndex;
-
-
- DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_container_load","called\n"));
-
+ int rc = MFD_SUCCESS;
+ netsnmp_container *service_container;
+ void *tmp_ptr[2];
/*
* TODO:351:M: |-> Load/update data in the eocCNUServiceTable container.
* loop over your eocCNUServiceTable data, allocate a rowreq context,
* set the index(es) [and data, optionally] and insert into
* the container.
*/
- while( 1 ) {
- /*
- * check for end of data; bail out if there is no more data
- */
- if( 1 )
- break;
+ /* create temporary container for fresh service data */
+ service_container =
+ netsnmp_container_find ("service_temp:table_container");
- /*
- * TODO:352:M: | |-> set indexes in new eocCNUServiceTable rowreq context.
- * data context will be set from the param (unless NULL,
- * in which case a new data context will be allocated)
- */
- rowreq_ctx = eocCNUServiceTable_allocate_rowreq_ctx(NULL);
- if (NULL == rowreq_ctx) {
- snmp_log(LOG_ERR, "memory allocation failed\n");
- return MFD_RESOURCE_UNAVAILABLE;
- }
- if(MFD_SUCCESS != eocCNUServiceTable_indexes_set(rowreq_ctx
- , eocCNUServiceIndex
- )) {
- snmp_log(LOG_ERR,"error setting index while loading "
- "eocCNUServiceTable data.\n");
- eocCNUServiceTable_release_rowreq_ctx(rowreq_ctx);
- continue;
- }
- /*
- * TODO:352:r: | |-> populate eocCNUServiceTable data context.
- * Populate data context here. (optionally, delay until row prep)
- */
- /*
- * TRANSIENT or semi-TRANSIENT data:
- * copy data or save any info needed to do it in row_prep.
- */
- /*
- * setup/save data for eocCNUServiceName
- * eocCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
- */
- /** no mapping */
- /*
- * make sure there is enough space for eocCNUServiceName data
- */
- if ((NULL == rowreq_ctx->data.eocCNUServiceName) ||
- (rowreq_ctx->data.eocCNUServiceName_len <
- (eocCNUServiceName_len* sizeof(eocCNUServiceName[0])))) {
- snmp_log(LOG_ERR,"not enough space for value\n");
+ if (NULL == service_container)
+ {
+ snmp_log (LOG_ERR, "service temp container not found\n");
return MFD_ERROR;
}
- rowreq_ctx->data.eocCNUServiceName_len = eocCNUServiceName_len* sizeof(eocCNUServiceName[0]);
- memcpy( rowreq_ctx->data.eocCNUServiceName, eocCNUServiceName, eocCNUServiceName_len* sizeof(eocCNUServiceName[0]) );
-
- /*
- * setup/save data for eocCNUServiceType
- * eocCNUServiceType(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
- */
- /** no mapping */
- rowreq_ctx->data.eocCNUServiceType = eocCNUServiceType;
-
- /*
- * setup/save data for eocCNUServiceQOSPrio
- * eocCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
- */
- /** no mapping */
- rowreq_ctx->data.eocCNUServiceQOSPrio = eocCNUServiceQOSPrio;
-
- /*
- * setup/save data for eocCNUServiceDBADownstreamPIR
- * eocCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
- */
- /** no mapping */
- rowreq_ctx->data.eocCNUServiceDBADownstreamPIR = eocCNUServiceDBADownstreamPIR;
-
- /*
- * setup/save data for eocCNUServiceDBAUpstreamPIR
- * eocCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
- */
- /** no mapping */
- rowreq_ctx->data.eocCNUServiceDBAUpstreamPIR = eocCNUServiceDBAUpstreamPIR;
-
- /*
- * setup/save data for eocCNUServiceDBADownstreamCIR
- * eocCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
- */
- /** no mapping */
- rowreq_ctx->data.eocCNUServiceDBADownstreamCIR = eocCNUServiceDBADownstreamCIR;
-
+
+ /* load fresh service data into temp container */
+ rc = _service_container_load (service_container);
+ if (MFD_ERROR == rc)
+ {
+ snmp_log (LOG_ERR, "service container load error\n");
+ return MFD_ERROR;
+ }
+
+ tmp_ptr[0] = service_container;
+ tmp_ptr[1] = NULL;
+
+ /* check if eocCNUServiceTable container needs updates */
+ /* (this is not called if table container is empty) */
+ CONTAINER_FOR_EACH (container, (netsnmp_container_obj_func *)
+ _eoccnu_service_check_entry_for_updates, tmp_ptr);
/*
- * setup/save data for eocCNUServiceDBAUpstreamCIR
- * eocCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ * add new entries to eocCNUServiceTable container
*/
- /** no mapping */
- rowreq_ctx->data.eocCNUServiceDBAUpstreamCIR = eocCNUServiceDBAUpstreamCIR;
-
+ CONTAINER_FOR_EACH (service_container,
+ (netsnmp_container_obj_func *) _eoccnu_service_add_new_entry,
+ container);
+
/*
- * setup/save data for eocCNUServiceMaxLatency
- * eocCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ * free temporary container. we've either claimed each entry, or released it,
+ * so we don't need to call CONTAINER_CLEAR to clear the container.
*/
- /** no mapping */
- rowreq_ctx->data.eocCNUServiceMaxLatency = eocCNUServiceMaxLatency;
-
+ CONTAINER_FREE (service_container);
+
/*
- * setup/save data for eocCNUServiceRowStatus
- * eocCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ * remove deleted items from eocCNUServiceTable container
*/
- /** no mapping */
- rowreq_ctx->data.eocCNUServiceRowStatus = eocCNUServiceRowStatus;
-
-
+ if (NULL != tmp_ptr[1])
+ {
+ netsnmp_container *tmp_container = (netsnmp_container *) tmp_ptr[1];
+ eocCNUServiceTable_rowreq_ctx *tmp_ctx;
+
/*
- * insert into table container
+ * this works because the tmp_container is a linked list,
+ * which can be used like a stack...
*/
- CONTAINER_INSERT(container, rowreq_ctx);
- ++count;
+ while (CONTAINER_SIZE (tmp_container))
+ {
+ /*
+ * get from delete list
+ */
+ tmp_ctx = CONTAINER_FIRST (tmp_container);
+
+ /*
+ * release context, delete from table container
+ */
+ CONTAINER_REMOVE (container, tmp_ctx);
+ eocCNUServiceTable_release_rowreq_ctx (tmp_ctx);
+
+ /*
+ * pop off delete list
+ */
+ CONTAINER_REMOVE (tmp_container, NULL);
+ }
}
DEBUGMSGT(("verbose:eocCNUServiceTable:eocCNUServiceTable_container_load",
- "inserted %d records\n", count));
+ "inserted records\n"));
return MFD_SUCCESS;
} /* eocCNUServiceTable_container_load */
@@ -435,6 +759,14 @@ eocCNUServiceIndex_check_index( eocCNUServiceTable_rowreq_ctx *rowreq_ctx )
* check that index value in the table context is legal.
* (rowreq_ctx->tbl_index.eocCNUServiceIndex)
*/
+ /* checking additional index restrictions - indexes must not exceed
+ * value of service amount limitation */
+ if ((rowreq_ctx->tbl_idx.eocCNUServiceIndex < 0)
+ || (rowreq_ctx->tbl_idx.eocCNUServiceIndex >
+ LIBSPID_SERVICE_AMOUNT_LIMIT))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
return MFD_SUCCESS; /* eocCNUServiceIndex index ok */
} /* eocCNUServiceIndex_check_index */
@@ -451,7 +783,7 @@ eocCNUServiceIndex_check_index( eocCNUServiceTable_rowreq_ctx *rowreq_ctx )
* is the place to make sure they are valid as a whole when combined. If
* you only have one index, then you probably don't need to do anything else
* here.
- *
+ *
* @note Keep in mind that if the indexes refer to a row in this or
* some other table, you can't check for that row here to make
* decisions, since that row might not be created yet, but may
@@ -483,9 +815,10 @@ eocCNUServiceTable_validate_index( eocCNUServiceTable_registration * eocCNUServi
/*
* TODO:430:M: |-> Validate potential eocCNUServiceTable index.
*/
- if(1) {
- snmp_log(LOG_WARNING,"invalid index for a new row in the "
- "eocCNUServiceTable table.\n");
+ if (0)
+ {
+ snmp_log (LOG_WARNING, "invalid index for a new row in the "
+ "eocCNUServiceTable table.\n");
/*
* determine failure type.
*
@@ -494,13 +827,20 @@ eocCNUServiceTable_validate_index( eocCNUServiceTable_registration * eocCNUServi
* (even though it could be created under other circumstances),
* return MFD_NOT_NOW.
*/
- if(0) {
+ if (0)
+ {
return MFD_CANNOT_CREATE_EVER;
}
- else {
+ else
+ {
return MFD_CANNOT_CREATE_NOW;
}
}
+ else
+ {
+ rowreq_ctx->data->eocCNUServiceConfIndex =
+ rowreq_ctx->tbl_idx.eocCNUServiceIndex;
+ }
return rc;
} /* eocCNUServiceTable_validate_index */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.h
index d6fc0f1438..9cf19e5f92 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.h
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.h
@@ -11,7 +11,20 @@
extern "C" {
#endif
-
+/* definitions for invalid input value markers */
+#define INVALID_EOCCNUSERVICECONFINDEX (-2)
+#define INVALID_EOCCNUSERVICESERVICETYPE (-1)
+#define INVALID_EOCCNUSERVICEQOSPRIO (-1)
+#define INVALID_EOCCNUSERVICEDBADOWNSTREAMPIR (-1)
+#define INVALID_EOCCNUSERVICEDBAUPSTREAMPIR (-1)
+#define INVALID_EOCCNUSERVICEDBADOWNSTREAMCIR (-1)
+#define INVALID_EOCCNUSERVICEDBAUPSTREAMCIR (-1)
+#define INVALID_EOCCNUSERVICEMAXLATENCY (-1)
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+#define INVALID_SPC300EOCSLAVESERVICEMAXJITTER (-1)
+#define INVALID_SPC300EOCSLAVESERVICEACSEN 2
+#endif /* USING_SPC300_EOC_MIB_MODULE */
/* *********************************************************************
* function declarations
*/
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get.c
index a85ef966f3..7059aa7410 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get.c
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get.c
@@ -1,6 +1,6 @@
/*
* Note: this file originally auto-generated by mib2c using
- * version : 12088 $ of $
+ * version : 12088 $ of $
*
* $Id:$
*/
@@ -63,7 +63,7 @@ eocCNUServiceTable_indexes_set_tbl_idx(eocCNUServiceTable_mib_index *tbl_idx, lo
/* eocCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
tbl_idx->eocCNUServiceIndex = eocCNUServiceIndex_val;
-
+
return MFD_SUCCESS;
} /* eocCNUServiceTable_indexes_set_tbl_idx */
@@ -170,20 +170,30 @@ eocCNUServiceName_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, char **eocCNUS
/*
* make sure there is enough space for eocCNUServiceName data
*/
- if ((NULL == (* eocCNUServiceName_val_ptr_ptr )) ||
- ((* eocCNUServiceName_val_ptr_len_ptr ) <
- (rowreq_ctx->data.eocCNUServiceName_len* sizeof(rowreq_ctx->data.eocCNUServiceName[0])))) {
+ if ((NULL == (*eocCNUServiceName_val_ptr_ptr)) ||
+ ((*eocCNUServiceName_val_ptr_len_ptr) <
+ (rowreq_ctx->data->eocCNUServiceName_len *
+ sizeof (rowreq_ctx->data->eocCNUServiceName[0]))))
+ {
/*
* allocate space for eocCNUServiceName data
*/
- (* eocCNUServiceName_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCNUServiceName_len* sizeof(rowreq_ctx->data.eocCNUServiceName[0]));
- if(NULL == (* eocCNUServiceName_val_ptr_ptr )) {
- snmp_log(LOG_ERR,"could not allocate memory\n");
+ (*eocCNUServiceName_val_ptr_ptr) =
+ malloc (rowreq_ctx->data->eocCNUServiceName_len *
+ sizeof (rowreq_ctx->data->eocCNUServiceName[0]));
+ if (NULL == (*eocCNUServiceName_val_ptr_ptr))
+ {
+ snmp_log (LOG_ERR, "could not allocate memory\n");
return MFD_ERROR;
}
}
- (* eocCNUServiceName_val_ptr_len_ptr ) = rowreq_ctx->data.eocCNUServiceName_len* sizeof(rowreq_ctx->data.eocCNUServiceName[0]);
- memcpy( (* eocCNUServiceName_val_ptr_ptr ), rowreq_ctx->data.eocCNUServiceName, rowreq_ctx->data.eocCNUServiceName_len* sizeof(rowreq_ctx->data.eocCNUServiceName[0]) );
+ (*eocCNUServiceName_val_ptr_len_ptr) =
+ rowreq_ctx->data->eocCNUServiceName_len *
+ sizeof (rowreq_ctx->data->eocCNUServiceName[0]);
+ memcpy ((*eocCNUServiceName_val_ptr_ptr),
+ rowreq_ctx->data->eocCNUServiceName,
+ rowreq_ctx->data->eocCNUServiceName_len *
+ sizeof (rowreq_ctx->data->eocCNUServiceName[0]));
return MFD_SUCCESS;
} /* eocCNUServiceName_get */
@@ -194,7 +204,7 @@ eocCNUServiceName_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, char **eocCNUS
* Its status is Current, and its access level is ReadWrite.
* OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.3
* Description:
- CNUÒµÎñÀàÐÍ¡£¡¯1¡¯=VLAN Id, ¡®2¡¯=COS, ¡®3¡¯=TOS
+ CNUÒµÎñÀàÐÍ¡£¡¯1¡¯=VLAN Id, ¡®2¡¯=COS, ¡®3¡¯=TOS
*
* Attributes:
* accessible 1 isscalar 0 enums 0 hasdefval 0
@@ -234,7 +244,7 @@ eocCNUServiceType_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUS
* TODO:231:o: |-> Extract the current value of the eocCNUServiceType data.
* copy (* eocCNUServiceType_val_ptr ) from rowreq_ctx->data
*/
- (* eocCNUServiceType_val_ptr ) = rowreq_ctx->data.eocCNUServiceType;
+ (* eocCNUServiceType_val_ptr ) = rowreq_ctx->data->eocCNUServiceType;
return MFD_SUCCESS;
} /* eocCNUServiceType_get */
@@ -286,7 +296,7 @@ eocCNUServiceQOSPrio_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocC
* TODO:231:o: |-> Extract the current value of the eocCNUServiceQOSPrio data.
* copy (* eocCNUServiceQOSPrio_val_ptr ) from rowreq_ctx->data
*/
- (* eocCNUServiceQOSPrio_val_ptr ) = rowreq_ctx->data.eocCNUServiceQOSPrio;
+ (* eocCNUServiceQOSPrio_val_ptr ) = rowreq_ctx->data->eocCNUServiceQOSPrio;
return MFD_SUCCESS;
} /* eocCNUServiceQOSPrio_get */
@@ -297,7 +307,7 @@ eocCNUServiceQOSPrio_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocC
* Its status is Current, and its access level is ReadWrite.
* OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.5
* Description:
-CNUÒµÎñÏÂÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
+CNUÒµÎñÏÂÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
*
* Attributes:
* accessible 1 isscalar 0 enums 0 hasdefval 0
@@ -337,7 +347,8 @@ eocCNUServiceDBADownstreamPIR_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, lo
* TODO:231:o: |-> Extract the current value of the eocCNUServiceDBADownstreamPIR data.
* copy (* eocCNUServiceDBADownstreamPIR_val_ptr ) from rowreq_ctx->data
*/
- (* eocCNUServiceDBADownstreamPIR_val_ptr ) = rowreq_ctx->data.eocCNUServiceDBADownstreamPIR;
+ (*eocCNUServiceDBADownstreamPIR_val_ptr) =
+ rowreq_ctx->data->eocCNUServiceDBADownstreamPIR;
return MFD_SUCCESS;
} /* eocCNUServiceDBADownstreamPIR_get */
@@ -348,7 +359,7 @@ eocCNUServiceDBADownstreamPIR_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, lo
* Its status is Current, and its access level is ReadWrite.
* OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.6
* Description:
-CNUÒµÎñÉÏÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
+CNUÒµÎñÉÏÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
*
* Attributes:
* accessible 1 isscalar 0 enums 0 hasdefval 0
@@ -388,7 +399,8 @@ eocCNUServiceDBAUpstreamPIR_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long
* TODO:231:o: |-> Extract the current value of the eocCNUServiceDBAUpstreamPIR data.
* copy (* eocCNUServiceDBAUpstreamPIR_val_ptr ) from rowreq_ctx->data
*/
- (* eocCNUServiceDBAUpstreamPIR_val_ptr ) = rowreq_ctx->data.eocCNUServiceDBAUpstreamPIR;
+ (*eocCNUServiceDBAUpstreamPIR_val_ptr) =
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR;
return MFD_SUCCESS;
} /* eocCNUServiceDBAUpstreamPIR_get */
@@ -439,7 +451,8 @@ eocCNUServiceDBADownstreamCIR_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, lo
* TODO:231:o: |-> Extract the current value of the eocCNUServiceDBADownstreamCIR data.
* copy (* eocCNUServiceDBADownstreamCIR_val_ptr ) from rowreq_ctx->data
*/
- (* eocCNUServiceDBADownstreamCIR_val_ptr ) = rowreq_ctx->data.eocCNUServiceDBADownstreamCIR;
+ (*eocCNUServiceDBADownstreamCIR_val_ptr) =
+ rowreq_ctx->data->eocCNUServiceDBADownstreamCIR;
return MFD_SUCCESS;
} /* eocCNUServiceDBADownstreamCIR_get */
@@ -490,7 +503,8 @@ eocCNUServiceDBAUpstreamCIR_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long
* TODO:231:o: |-> Extract the current value of the eocCNUServiceDBAUpstreamCIR data.
* copy (* eocCNUServiceDBAUpstreamCIR_val_ptr ) from rowreq_ctx->data
*/
- (* eocCNUServiceDBAUpstreamCIR_val_ptr ) = rowreq_ctx->data.eocCNUServiceDBAUpstreamCIR;
+ (*eocCNUServiceDBAUpstreamCIR_val_ptr) =
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR;
return MFD_SUCCESS;
} /* eocCNUServiceDBAUpstreamCIR_get */
@@ -541,7 +555,8 @@ eocCNUServiceMaxLatency_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * e
* TODO:231:o: |-> Extract the current value of the eocCNUServiceMaxLatency data.
* copy (* eocCNUServiceMaxLatency_val_ptr ) from rowreq_ctx->data
*/
- (* eocCNUServiceMaxLatency_val_ptr ) = rowreq_ctx->data.eocCNUServiceMaxLatency;
+ (*eocCNUServiceMaxLatency_val_ptr) =
+ rowreq_ctx->data->eocCNUServiceMaxLatency;
return MFD_SUCCESS;
} /* eocCNUServiceMaxLatency_get */
@@ -558,7 +573,7 @@ eocCNUServiceMaxLatency_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * e
notInService(3)- ״̬δ¼¤»î£»
notReady(4)- ²»Äܱ»¼¤»î״̬£»
createAndGo(5)- ´´½¨²¢¼¤»î£»
- createAndWait(6)- ´´½¨£¬µ«²»¼¤»î£»
+ createAndWait(6)- ´´½¨£¬µ«²»¼¤»î£»
destory(7)- Ïú»Ù¸ÃÐС£
*
* Attributes:
@@ -591,7 +606,8 @@ eocCNUServiceRowStatus_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, u_long *
/** we should have a non-NULL pointer */
netsnmp_assert( NULL != eocCNUServiceRowStatus_val_ptr );
- (* eocCNUServiceRowStatus_val_ptr ) = rowreq_ctx->data.eocCNUServiceRowStatus;
+ (* eocCNUServiceRowStatus_val_ptr ) =
+ rowreq_ctx->data->eocCNUServiceRowStatus;
return MFD_SUCCESS;
} /* eocCNUServiceRowStatus_get */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set.c
index 0826dd860a..71318cdd4b 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set.c
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set.c
@@ -18,7 +18,7 @@
*
* These routines are used to set the value for individual objects. The
* row context is passed, along with the new value.
- *
+ *
* @{
*/
/**********************************************************************
@@ -144,6 +144,9 @@ eocCNUServiceTable_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* set up eocCNUServiceTable undo information, in preparation for a set.
* Undo storage is in (* eocCNUServiceRowStatus_val_ptr )*
*/
+ /* copy data context to undo context */
+ memcpy (rowreq_ctx->undo, rowreq_ctx->data,
+ sizeof (eocCNUServiceTable_data));
return rc;
} /* eocCNUServiceTable_undo_setup */
@@ -244,12 +247,23 @@ int
eocCNUServiceTable_commit( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
{
int rc = MFD_SUCCESS;
- int save_flags;
+ int save_flags;
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+
+ int ret;
+ int i;
+ int tmp;
+
+ char *placeholder = "0";
- DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_commit","called\n"));
+ libspid_eoc_service_entry_t service_entry;
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:eocCNUServiceTable_commit",
+ "called\n"));
/** we should have a non-NULL pointer */
- netsnmp_assert( NULL != rowreq_ctx );
+ netsnmp_assert (NULL != rowreq_ctx);
/*
* save flags, then clear until we actually do something
@@ -264,159 +278,460 @@ eocCNUServiceTable_commit( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* 3) set the column's flag in column_set_flags if it needs undo
* processing in case of a failure.
*/
- if (save_flags & COLUMN_EOCCNUSERVICENAME_FLAG) {
- save_flags &= ~COLUMN_EOCCNUSERVICENAME_FLAG; /* clear eocCNUServiceName */
- /*
- * TODO:482:o: |-> commit column eocCNUServiceName.
- */
- rc = -1;
- if(-1 == rc) {
- snmp_log(LOG_ERR,"eocCNUServiceTable column eocCNUServiceName commit failed\n");
- }
- else {
- /*
- * set flag, in case we need to undo eocCNUServiceName
- */
- rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICENAME_FLAG;
- }
+
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable:eocCNUServiceTable_commit",
+ "no change\n"));
+ return MFD_SUCCESS;
}
- if (save_flags & COLUMN_EOCCNUSERVICETYPE_FLAG) {
- save_flags &= ~COLUMN_EOCCNUSERVICETYPE_FLAG; /* clear eocCNUServiceType */
- /*
- * TODO:482:o: |-> commit column eocCNUServiceType.
- */
- rc = -1;
- if(-1 == rc) {
- snmp_log(LOG_ERR,"eocCNUServiceTable column eocCNUServiceType commit failed\n");
- }
- else {
- /*
- * set flag, in case we need to undo eocCNUServiceType
- */
- rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICETYPE_FLAG;
- }
+ if (save_flags & COLUMN_EOCCNUSERVICENAME_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICENAME_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceName.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICENAME_FLAG;
}
- if (save_flags & COLUMN_EOCCNUSERVICEQOSPRIO_FLAG) {
- save_flags &= ~COLUMN_EOCCNUSERVICEQOSPRIO_FLAG; /* clear eocCNUServiceQOSPrio */
- /*
- * TODO:482:o: |-> commit column eocCNUServiceQOSPrio.
- */
- rc = -1;
- if(-1 == rc) {
- snmp_log(LOG_ERR,"eocCNUServiceTable column eocCNUServiceQOSPrio commit failed\n");
- }
- else {
- /*
- * set flag, in case we need to undo eocCNUServiceQOSPrio
- */
- rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEQOSPRIO_FLAG;
- }
+
+ if (save_flags & COLUMN_EOCCNUSERVICETYPE_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICETYPE_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceType.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICETYPE_FLAG;
}
- if (save_flags & COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG) {
- save_flags &= ~COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG; /* clear eocCNUServiceDBADownstreamPIR */
- /*
- * TODO:482:o: |-> commit column eocCNUServiceDBADownstreamPIR.
- */
- rc = -1;
- if(-1 == rc) {
- snmp_log(LOG_ERR,"eocCNUServiceTable column eocCNUServiceDBADownstreamPIR commit failed\n");
- }
- else {
- /*
- * set flag, in case we need to undo eocCNUServiceDBADownstreamPIR
- */
- rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
- }
+ if (save_flags & COLUMN_EOCCNUSERVICEQOSPRIO_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEQOSPRIO_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceQOSPrio.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEQOSPRIO_FLAG;
}
- if (save_flags & COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG) {
- save_flags &= ~COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG; /* clear eocCNUServiceDBAUpstreamPIR */
- /*
- * TODO:482:o: |-> commit column eocCNUServiceDBAUpstreamPIR.
- */
- rc = -1;
- if(-1 == rc) {
- snmp_log(LOG_ERR,"eocCNUServiceTable column eocCNUServiceDBAUpstreamPIR commit failed\n");
- }
- else {
- /*
- * set flag, in case we need to undo eocCNUServiceDBAUpstreamPIR
- */
- rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
- }
+ if (save_flags & COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceDBADownstreamPIR.
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
}
- if (save_flags & COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG) {
- save_flags &= ~COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG; /* clear eocCNUServiceDBADownstreamCIR */
- /*
- * TODO:482:o: |-> commit column eocCNUServiceDBADownstreamCIR.
- */
- rc = -1;
- if(-1 == rc) {
- snmp_log(LOG_ERR,"eocCNUServiceTable column eocCNUServiceDBADownstreamCIR commit failed\n");
- }
- else {
- /*
- * set flag, in case we need to undo eocCNUServiceDBADownstreamCIR
- */
- rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
- }
+ if (save_flags & COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceDBAUpstreamPIR.
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+
}
- if (save_flags & COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG) {
- save_flags &= ~COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG; /* clear eocCNUServiceDBAUpstreamCIR */
- /*
- * TODO:482:o: |-> commit column eocCNUServiceDBAUpstreamCIR.
- */
- rc = -1;
- if(-1 == rc) {
- snmp_log(LOG_ERR,"eocCNUServiceTable column eocCNUServiceDBAUpstreamCIR commit failed\n");
- }
- else {
- /*
- * set flag, in case we need to undo eocCNUServiceDBAUpstreamCIR
- */
- rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
- }
+ if (save_flags & COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceDBADownstreamCIR.
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
}
- if (save_flags & COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG) {
- save_flags &= ~COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG; /* clear eocCNUServiceMaxLatency */
- /*
- * TODO:482:o: |-> commit column eocCNUServiceMaxLatency.
- */
- rc = -1;
- if(-1 == rc) {
- snmp_log(LOG_ERR,"eocCNUServiceTable column eocCNUServiceMaxLatency commit failed\n");
- }
- else {
- /*
- * set flag, in case we need to undo eocCNUServiceMaxLatency
- */
- rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG;
- }
+ if (save_flags & COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceDBAUpstreamCIR.
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
}
- if (save_flags & COLUMN_EOCCNUSERVICEROWSTATUS_FLAG) {
- save_flags &= ~COLUMN_EOCCNUSERVICEROWSTATUS_FLAG; /* clear eocCNUServiceRowStatus */
- /*
- * TODO:482:o: |-> commit column eocCNUServiceRowStatus.
- */
- rc = -1;
- if(-1 == rc) {
- snmp_log(LOG_ERR,"eocCNUServiceTable column eocCNUServiceRowStatus commit failed\n");
- }
- else {
- /*
- * set flag, in case we need to undo eocCNUServiceRowStatus
- */
- rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEROWSTATUS_FLAG;
- }
+ if (save_flags & COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG;
+ /*
+ * set flag, in case we need to undo eocCNUServiceMaxLatency
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG;
}
+ if (save_flags & COLUMN_EOCCNUSERVICEROWSTATUS_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEROWSTATUS_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceRowStatus.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEROWSTATUS_FLAG;
+ }
+ /* handle row addition or deletion (similarly as in ipAddressTable) */
+ /*
+ * pass everything to data access
+ * let data access know what columns are set
+ */
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICEROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:eocCNUServiceTable_commit", "new row created!\n"));
+ }
+ else if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* check if deleting unvalidated row */
+ /* a row can be unvalidated either before being added to
+ configuration file, or to mark invalid line
+ in configuration file */
+ if ((rowreq_ctx->undo->eocCNUServiceRowStatus
+ & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:eocCNUServi"
+ "ceTable_commit",
+ "deleting unvalidated row!\n"));
+ /* convert index to string to serve as key for possible
+ * removing of invalid line */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocCNUServiceConfIndex);
+ /* remove line with given index from service
+ * configuration file, if existing */
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_service_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR, "unvalidated row not in "
+ "configuration file\n");
+ }
+ return MFD_SUCCESS;
+ }
+
+ /* convert index to string to serve as key for removing line */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocCNUServiceConfIndex);
+
+ /* check configuration files before attempting
+ * synchronization of services and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in port "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS != libspid_eoc_storm_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in storm "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* remove line with given index from service configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_remove error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync ();
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync succeeded\n");
+ }
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* this case covers modifying row status to active - ie.
+ * validating the row */
+ /* row can be either newly added from the agent,
+ * or having row status notInService to mark invalid line in
+ * configuration file */
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:eocCNUServiceTable_"
+ "commit", "validating row\n"));
+
+ /* convert index to string to serve as key for row */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocCNUServiceConfIndex);
+
+ /* copy service index to service entry */
+ strcpy (service_entry.service_index, key_buffer);
+
+ /* copy service name to service entry */
+ strncpy (service_entry.service_name,
+ rowreq_ctx->data->eocCNUServiceName,
+ rowreq_ctx->data->eocCNUServiceName_len);
+ /* add terminal 0 to service name */
+ service_entry.service_name[rowreq_ctx->
+ data->eocCNUServiceName_len] = '\0';
+
+ /* copy service type to service entry */
+ sprintf (service_entry.service_type, "%ld",
+ rowreq_ctx->data->eocCNUServiceType);
+
+ sprintf (service_entry.matching_value, "%s", "0");
+
+ /* copy QOS Prio to service entry */
+ sprintf (service_entry.qos_prio, "%ld",
+ rowreq_ctx->data->eocCNUServiceQOSPrio);
+
+ /* copy downstream PIR to service entry */
+ sprintf (service_entry.dba_dl_pir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBADownstreamPIR);
+
+ /* copy upstream PIR to service entry */
+ sprintf (service_entry.dba_ul_pir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR);
+
+ /* copy downstream CIR to service entry */
+ sprintf (service_entry.dba_dl_cir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBADownstreamCIR);
+
+ /* copy upstream CIR to service entry */
+ sprintf (service_entry.dba_ul_cir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR);
+
+ /* copy max latency to service entry */
+ sprintf (service_entry.max_latency, "%ld",
+ rowreq_ctx->data->eocCNUServiceMaxLatency);
+ /* if validating new row, copy placeholder string to
+ * service entry fields not covered in SARFT MIB, otherwise copy table entry */
+ if (1 == eoccnu_adding_service)
+ {
+ sprintf (service_entry.max_jitter, placeholder);
+ sprintf (service_entry.acs_en, placeholder);
+ }
+ else
+ {
+ /* copy max jitter to service entry */
+ sprintf (service_entry.max_jitter, "%ld",
+ rowreq_ctx->data->spc300EoCSlaveServiceMaxJitter);
+ /* copy ACS Enable to service entry */
+ sprintf (service_entry.acs_en, "%ld",
+ rowreq_ctx->data->spc300EoCSlaveServiceACSEn);
+ }
+ /* check configuration file before attempting synchronization
+ * of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write completed line to service file */
+ ret = libspid_eoc_service_set (key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync ();
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync succeeded\n");
+ }
+
+ /* if commit has successfully passed, clear
+ * service adding indication */
+ eoccnu_adding_service = 0;
+ }
+
+ }
+ else
+ {
+ /* this case covers modifying columns without modifying row status */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocCNUServiceRowStatus))
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "trying to change data for service "
+ "table index: %ld \n",
+ rowreq_ctx->data->eocCNUServiceConfIndex));
+ /* convert index to string to serve as key for line
+ * in configuration file */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocCNUServiceConfIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_service_get (key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICENAME_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "service name read from rowreq context: %s\n",
+ rowreq_ctx->data->eocCNUServiceName));
+ /* copy service name to service entry */
+ strncpy (service_entry.service_name,
+ rowreq_ctx->data->eocCNUServiceName,
+ rowreq_ctx->data->eocCNUServiceName_len);
+ /* add terminal 0 to service name */
+ service_entry.service_name[rowreq_ctx->
+ data->eocCNUServiceName_len] = '\0';
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICETYPE_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "service type read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocCNUServiceType));
+ /* copy service type to service entry */
+ sprintf (service_entry.service_type, "%ld",
+ rowreq_ctx->data->eocCNUServiceType);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEQOSPRIO_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "QOS Prio read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocCNUServiceQOSPrio));
+ /* copy QOS Prio to service entry */
+ sprintf (service_entry.qos_prio, "%ld",
+ rowreq_ctx->data->eocCNUServiceQOSPrio);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit", "downstream "
+ "PIR read from rowreq context: %ld\n",
+ rowreq_ctx->data->
+ eocCNUServiceDBADownstreamPIR));
+ /* copy downstream PIR to service entry */
+ sprintf (service_entry.dba_dl_pir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBADownstreamPIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "upstream PIR read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR));
+ /* copy upstream PIR to service entry */
+ sprintf (service_entry.dba_ul_pir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "downstream CIR read from rowreq context: %ld\n",
+ rowreq_ctx->data->
+ eocCNUServiceDBADownstreamCIR));
+ /* copy downstream CIR to service entry */
+ sprintf (service_entry.dba_dl_cir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBADownstreamCIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "upstream CIR read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR));
+ /* copy upstream CIR to service entry */
+ sprintf (service_entry.dba_ul_cir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "max latency read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocCNUServiceMaxLatency));
+ /* copy max latency to service entry */
+ sprintf (service_entry.max_latency, "%ld",
+ rowreq_ctx->data->eocCNUServiceMaxLatency);
+ }
+
+ /* check configuration file before attempting synchronization
+ * of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_service_set (key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync ();
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync succeeded\n");
+ }
+ }
+ }
/*
* if we successfully commited this row, set the dirty flag.
*/
@@ -451,12 +766,20 @@ int
eocCNUServiceTable_undo_commit( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
{
int rc = MFD_SUCCESS;
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+ int i;
+ int tmp;
+ libspid_eoc_service_entry_t service_entry;
DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_undo_commit","called\n"));
/** we should have a non-NULL pointer */
netsnmp_assert( NULL != rowreq_ctx );
+ /* initialize service entry */
+ memset (&service_entry, 0, sizeof (service_entry));
/*
* TODO:485:M: |-> Undo eocCNUServiceTable commit.
* check the column's flag in rowreq_ctx->column_set_flags to see
@@ -465,7 +788,338 @@ eocCNUServiceTable_undo_commit( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
*/
-
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICEROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* when row is created and not validated, there is nothing to do */
+ if ((rowreq_ctx->undo->eocCNUServiceRowStatus
+ & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:"
+ "eocCNUServiceTable_commit",
+ "removing unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ }
+ else if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* if a row was deleted, restore it */
+ /* if restoring unvalidated row, there is nothing to do */
+ if ((rowreq_ctx->undo->eocCNUServiceRowStatus
+ & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:"
+ "eocCNUServiceTable_commit",
+ "restoring unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "service table index to undo: %ld \n",
+ rowreq_ctx->undo->eocCNUServiceConfIndex));
+
+ /* convert index to string to serve as key for restoring line */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->undo->eocCNUServiceConfIndex);
+
+ /* copy service index to service entry */
+ strcpy (service_entry.service_index, key_buffer);
+
+ /* copy service name to service entry */
+ strncpy (service_entry.service_name,
+ rowreq_ctx->undo->eocCNUServiceName,
+ rowreq_ctx->undo->eocCNUServiceName_len);
+
+ /* copy service type to service entry */
+ sprintf (service_entry.service_type, "%ld",
+ rowreq_ctx->undo->eocCNUServiceType);
+
+ sprintf (service_entry.matching_value, "%s", "0");
+
+ /* copy QOS Prio to service entry */
+ sprintf (service_entry.qos_prio, "%ld",
+ rowreq_ctx->undo->eocCNUServiceQOSPrio);
+
+
+ /* copy downstream PIR to service entry */
+ sprintf (service_entry.dba_dl_pir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR);
+
+ /* copy upstream PIR to service entry */
+ sprintf (service_entry.dba_ul_pir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR);
+
+ /* copy downstream CIR to service entry */
+ sprintf (service_entry.dba_dl_cir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR);
+
+ /* copy upstream CIR to service entry */
+ sprintf (service_entry.dba_ul_cir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR);
+
+ /* copy max latency to service entry */
+ sprintf (service_entry.max_latency, "%ld",
+ rowreq_ctx->undo->eocCNUServiceMaxLatency);
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* copy max jitter to service entry */
+ sprintf (service_entry.max_jitter, "%ld",
+ rowreq_ctx->undo->spc300EoCSlaveServiceMaxJitter);
+ /* copy ACS Enable to service entry */
+ sprintf (service_entry.acs_en, "%ld",
+ rowreq_ctx->undo->spc300EoCSlaveServiceACSEn);
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+ /* clear flag for deletion */
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DELETED;
+
+ /* check configuration file before attempting synchronization of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write completed line to service file */
+ ret = libspid_eoc_service_set (key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+
+
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:"
+ "eocCNUServiceTable_undo_commit",
+ "removing newly validated row!\n"));
+ /* if a row was validated (its status set to active)
+ * revert its status to notInService */
+ rowreq_ctx->data->eocCNUServiceRowStatus =
+ rowreq_ctx->undo->eocCNUServiceRowStatus;
+ /* also remove row data from config file */
+ /* convert index to string to serve as key for removing line */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->undo->eocCNUServiceConfIndex);
+
+
+
+ /* check configuration files before attempting
+ * synchronization of services and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in port "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_storm_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in storm "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* if a new row was added, remove line with given
+ * index from service configuration file */
+ if (1 == eoccnu_adding_service)
+ {
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_service_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_remove error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+ /* if undo has successfully passed, clear service
+ * adding indication */
+ eoccnu_adding_service = 0;
+ }
+ }
+ }
+ else
+ {
+ /* this case covers restoring modified columns
+ * (without row status modified) */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE == rowreq_ctx->undo->eocCNUServiceRowStatus))
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "undoing data for index: %ld \n",
+ rowreq_ctx->data->eocCNUServiceConfIndex));
+
+ /* convert index to string to serve as key for
+ * line in configuration file */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocCNUServiceConfIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_service_get (key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICENAME_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "service name to be restored: %s\n",
+ rowreq_ctx->undo->eocCNUServiceName));
+ /* copy service name to service entry */
+ strncpy (service_entry.service_name,
+ rowreq_ctx->undo->eocCNUServiceName,
+ rowreq_ctx->undo->eocCNUServiceName_len);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICETYPE_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "service type to be restored: %ld\n",
+ rowreq_ctx->undo->eocCNUServiceType));
+ /* copy service type to service entry */
+ sprintf (service_entry.service_type, "%ld",
+ rowreq_ctx->undo->eocCNUServiceType);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEQOSPRIO_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "QOS Prio to be restored: %ld\n",
+ rowreq_ctx->undo->eocCNUServiceQOSPrio));
+ /* copy QOS Prio to service entry */
+ sprintf (service_entry.qos_prio, "%ld",
+ rowreq_ctx->undo->eocCNUServiceQOSPrio);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "downstream PIR to be restored: %ld\n",
+ rowreq_ctx->undo->
+ eocCNUServiceDBADownstreamPIR));
+ /* copy downstream PIR to service entry */
+ sprintf (service_entry.dba_dl_pir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "upstream PIR to be restored: %ld\n",
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR));
+ /* copy upstream PIR to service entry */
+ sprintf (service_entry.dba_ul_pir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "downstream CIR to be restored: %ld\n",
+ rowreq_ctx->undo->
+ eocCNUServiceDBADownstreamCIR));
+ /* copy downstream CIR to service entry */
+ sprintf (service_entry.dba_dl_cir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "upstream CIR read from rowreq context: %ld\n",
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR));
+ /* copy upstream CIR to service entry */
+ sprintf (service_entry.dba_ul_cir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "max latency read from rowreq context: %ld\n",
+ rowreq_ctx->undo->eocCNUServiceMaxLatency));
+ /* copy max latency to service entry */
+ sprintf (service_entry.max_latency, "%ld",
+ rowreq_ctx->undo->eocCNUServiceMaxLatency);
+ }
+
+ /* check configuration file before attempting synchronization
+ * of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_service_set (key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+ }
+ }
/*
* if we successfully un-commited this row, clear the dirty flag.
*/
@@ -522,12 +1176,12 @@ CNUÒµÎñÃû³Æ¡£
* You should check that the requested change between the undo value and the
* new value is legal (ie, the transistion from one value to another
* is legal).
- *
+ *
*@note
* This check is only to determine if the new value
* is \b potentially valid. This is the first check of many, and
* is one of the simplest ones.
- *
+ *
*@note
* this is not the place to do any checks for values
* which depend on some other value in the mib. Those
@@ -592,9 +1246,12 @@ eocCNUServiceName_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* copy eocCNUServiceName and eocCNUServiceName_len data
* set rowreq_ctx->undo->eocCNUServiceName from rowreq_ctx->data.eocCNUServiceName
*/
- memcpy( rowreq_ctx->undo->eocCNUServiceName, rowreq_ctx->data.eocCNUServiceName,
- (rowreq_ctx->data.eocCNUServiceName_len * sizeof(rowreq_ctx->undo->eocCNUServiceName[0])));
- rowreq_ctx->undo->eocCNUServiceName_len = rowreq_ctx->data.eocCNUServiceName_len;
+ memcpy (rowreq_ctx->undo->eocCNUServiceName,
+ rowreq_ctx->data->eocCNUServiceName,
+ (rowreq_ctx->data->eocCNUServiceName_len
+ * sizeof(rowreq_ctx->undo->eocCNUServiceName[0])));
+ rowreq_ctx->undo->eocCNUServiceName_len =
+ rowreq_ctx->data->eocCNUServiceName_len;
return MFD_SUCCESS;
@@ -625,9 +1282,13 @@ eocCNUServiceName_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, char *eocCNUSe
* TODO:461:M: |-> Set eocCNUServiceName value.
* set eocCNUServiceName value in rowreq_ctx->data
*/
- memcpy( rowreq_ctx->data.eocCNUServiceName, eocCNUServiceName_val_ptr, eocCNUServiceName_val_ptr_len );
+ memcpy (rowreq_ctx->data->eocCNUServiceName,
+ eocCNUServiceName_val_ptr,
+ eocCNUServiceName_val_ptr_len);
/** convert bytes to number of char */
- rowreq_ctx->data.eocCNUServiceName_len = eocCNUServiceName_val_ptr_len / sizeof(eocCNUServiceName_val_ptr[0]);
+ rowreq_ctx->data->eocCNUServiceName_len =
+ eocCNUServiceName_val_ptr_len / sizeof (eocCNUServiceName_val_ptr[0]);
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCCNUSERVICENAME_FLAG;
return MFD_SUCCESS;
} /* eocCNUServiceName_set */
@@ -653,11 +1314,14 @@ eocCNUServiceName_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* copy eocCNUServiceName and eocCNUServiceName_len data
* set rowreq_ctx->data.eocCNUServiceName from rowreq_ctx->undo->eocCNUServiceName
*/
- memcpy( rowreq_ctx->data.eocCNUServiceName, rowreq_ctx->undo->eocCNUServiceName,
- (rowreq_ctx->undo->eocCNUServiceName_len * sizeof(rowreq_ctx->data.eocCNUServiceName[0])));
- rowreq_ctx->data.eocCNUServiceName_len = rowreq_ctx->undo->eocCNUServiceName_len;
+ memcpy (rowreq_ctx->data->eocCNUServiceName,
+ rowreq_ctx->undo->eocCNUServiceName,
+ (rowreq_ctx->undo->eocCNUServiceName_len
+ * sizeof(rowreq_ctx->data->eocCNUServiceName[0])));
+ rowreq_ctx->data->eocCNUServiceName_len =
+ rowreq_ctx->undo->eocCNUServiceName_len;
+
-
return MFD_SUCCESS;
} /* eocCNUServiceName_undo */
@@ -667,7 +1331,7 @@ eocCNUServiceName_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* Its status is Current, and its access level is ReadWrite.
* OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.3
* Description:
- CNUÒµÎñÀàÐÍ¡£¡¯1¡¯=VLAN Id, ¡®2¡¯=COS, ¡®3¡¯=TOS
+ CNUÒµÎñÀàÐÍ¡£¡¯1¡¯=VLAN Id, ¡®2¡¯=COS, ¡®3¡¯=TOS
*
* Attributes:
* accessible 1 isscalar 0 enums 0 hasdefval 0
@@ -697,12 +1361,12 @@ eocCNUServiceName_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* You should check that the requested change between the undo value and the
* new value is legal (ie, the transistion from one value to another
* is legal).
- *
+ *
*@note
* This check is only to determine if the new value
* is \b potentially valid. This is the first check of many, and
* is one of the simplest ones.
- *
+ *
*@note
* this is not the place to do any checks for values
* which depend on some other value in the mib. Those
@@ -726,6 +1390,12 @@ eocCNUServiceType_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long e
/*
* TODO:441:o: |-> Check for valid eocCNUServiceType value.
*/
+ if ((eocCNUServiceType_val < 0)
+ || (eocCNUServiceType_val
+ > LIBSPID_SERVICE_TYPE_TOS))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
return MFD_SUCCESS; /* eocCNUServiceType value not illegal */
} /* eocCNUServiceType_check_value */
@@ -764,7 +1434,7 @@ eocCNUServiceType_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* copy eocCNUServiceType data
* set rowreq_ctx->undo->eocCNUServiceType from rowreq_ctx->data.eocCNUServiceType
*/
- rowreq_ctx->undo->eocCNUServiceType = rowreq_ctx->data.eocCNUServiceType;
+ rowreq_ctx->undo->eocCNUServiceType = rowreq_ctx->data->eocCNUServiceType;
return MFD_SUCCESS;
@@ -792,7 +1462,9 @@ eocCNUServiceType_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUSer
* TODO:461:M: |-> Set eocCNUServiceType value.
* set eocCNUServiceType value in rowreq_ctx->data
*/
- rowreq_ctx->data.eocCNUServiceType = eocCNUServiceType_val;
+ rowreq_ctx->data->eocCNUServiceType = eocCNUServiceType_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCCNUSERVICETYPE_FLAG;
return MFD_SUCCESS;
} /* eocCNUServiceType_set */
@@ -818,9 +1490,9 @@ eocCNUServiceType_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* copy eocCNUServiceType data
* set rowreq_ctx->data.eocCNUServiceType from rowreq_ctx->undo->eocCNUServiceType
*/
- rowreq_ctx->data.eocCNUServiceType = rowreq_ctx->undo->eocCNUServiceType;
+ rowreq_ctx->data->eocCNUServiceType = rowreq_ctx->undo->eocCNUServiceType;
+
-
return MFD_SUCCESS;
} /* eocCNUServiceType_undo */
@@ -861,12 +1533,12 @@ CNUÒµÎñµÄQOSÓÅÏȼ¶£¬0-7¡£
* You should check that the requested change between the undo value and the
* new value is legal (ie, the transistion from one value to another
* is legal).
- *
+ *
*@note
* This check is only to determine if the new value
* is \b potentially valid. This is the first check of many, and
* is one of the simplest ones.
- *
+ *
*@note
* this is not the place to do any checks for values
* which depend on some other value in the mib. Those
@@ -929,7 +1601,8 @@ eocCNUServiceQOSPrio_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* copy eocCNUServiceQOSPrio data
* set rowreq_ctx->undo->eocCNUServiceQOSPrio from rowreq_ctx->data.eocCNUServiceQOSPrio
*/
- rowreq_ctx->undo->eocCNUServiceQOSPrio = rowreq_ctx->data.eocCNUServiceQOSPrio;
+ rowreq_ctx->undo->eocCNUServiceQOSPrio =
+ rowreq_ctx->data->eocCNUServiceQOSPrio;
return MFD_SUCCESS;
@@ -957,7 +1630,9 @@ eocCNUServiceQOSPrio_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNU
* TODO:461:M: |-> Set eocCNUServiceQOSPrio value.
* set eocCNUServiceQOSPrio value in rowreq_ctx->data
*/
- rowreq_ctx->data.eocCNUServiceQOSPrio = eocCNUServiceQOSPrio_val;
+ rowreq_ctx->data->eocCNUServiceQOSPrio = eocCNUServiceQOSPrio_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCCNUSERVICEQOSPRIO_FLAG;
return MFD_SUCCESS;
} /* eocCNUServiceQOSPrio_set */
@@ -981,11 +1656,11 @@ eocCNUServiceQOSPrio_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
*/
/*
* copy eocCNUServiceQOSPrio data
- * set rowreq_ctx->data.eocCNUServiceQOSPrio from rowreq_ctx->undo->eocCNUServiceQOSPrio
+ * set rowreq_ctx->data->eocCNUServiceQOSPrio from rowreq_ctx->undo->eocCNUServiceQOSPrio
*/
- rowreq_ctx->data.eocCNUServiceQOSPrio = rowreq_ctx->undo->eocCNUServiceQOSPrio;
+ rowreq_ctx->data->eocCNUServiceQOSPrio = rowreq_ctx->undo->eocCNUServiceQOSPrio;
+
-
return MFD_SUCCESS;
} /* eocCNUServiceQOSPrio_undo */
@@ -995,7 +1670,7 @@ eocCNUServiceQOSPrio_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* Its status is Current, and its access level is ReadWrite.
* OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.5
* Description:
-CNUÒµÎñÏÂÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
+CNUÒµÎñÏÂÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
*
* Attributes:
* accessible 1 isscalar 0 enums 0 hasdefval 0
@@ -1025,12 +1700,12 @@ CNUÒµÎñÏÂÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
* You should check that the requested change between the undo value and the
* new value is legal (ie, the transistion from one value to another
* is legal).
- *
+ *
*@note
* This check is only to determine if the new value
* is \b potentially valid. This is the first check of many, and
* is one of the simplest ones.
- *
+ *
*@note
* this is not the place to do any checks for values
* which depend on some other value in the mib. Those
@@ -1054,6 +1729,14 @@ eocCNUServiceDBADownstreamPIR_check_value( eocCNUServiceTable_rowreq_ctx *rowreq
/*
* TODO:441:o: |-> Check for valid eocCNUServiceDBADownstreamPIR value.
*/
+ /* check that proposed DownstreamPIR value is non-negative
+ * integer and below limit */
+ if ((eocCNUServiceDBADownstreamPIR_val < 0)
+ || (eocCNUServiceDBADownstreamPIR_val
+ > LIBSPID_SERVICE_MAX_DBA_DL_PIR))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
return MFD_SUCCESS; /* eocCNUServiceDBADownstreamPIR value not illegal */
} /* eocCNUServiceDBADownstreamPIR_check_value */
@@ -1092,7 +1775,7 @@ eocCNUServiceDBADownstreamPIR_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_
* copy eocCNUServiceDBADownstreamPIR data
* set rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR from rowreq_ctx->data.eocCNUServiceDBADownstreamPIR
*/
- rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR = rowreq_ctx->data.eocCNUServiceDBADownstreamPIR;
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR = rowreq_ctx->data->eocCNUServiceDBADownstreamPIR;
return MFD_SUCCESS;
@@ -1120,8 +1803,12 @@ eocCNUServiceDBADownstreamPIR_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, lo
* TODO:461:M: |-> Set eocCNUServiceDBADownstreamPIR value.
* set eocCNUServiceDBADownstreamPIR value in rowreq_ctx->data
*/
- rowreq_ctx->data.eocCNUServiceDBADownstreamPIR = eocCNUServiceDBADownstreamPIR_val;
+ rowreq_ctx->data->eocCNUServiceDBADownstreamPIR =
+ eocCNUServiceDBADownstreamPIR_val;
+
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
return MFD_SUCCESS;
} /* eocCNUServiceDBADownstreamPIR_set */
@@ -1146,9 +1833,10 @@ eocCNUServiceDBADownstreamPIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* copy eocCNUServiceDBADownstreamPIR data
* set rowreq_ctx->data.eocCNUServiceDBADownstreamPIR from rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR
*/
- rowreq_ctx->data.eocCNUServiceDBADownstreamPIR = rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR;
+ rowreq_ctx->data->eocCNUServiceDBADownstreamPIR =
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR;
+
-
return MFD_SUCCESS;
} /* eocCNUServiceDBADownstreamPIR_undo */
@@ -1158,7 +1846,7 @@ eocCNUServiceDBADownstreamPIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* Its status is Current, and its access level is ReadWrite.
* OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.6
* Description:
-CNUÒµÎñÉÏÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
+CNUÒµÎñÉÏÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
*
* Attributes:
* accessible 1 isscalar 0 enums 0 hasdefval 0
@@ -1188,12 +1876,12 @@ CNUÒµÎñÉÏÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
* You should check that the requested change between the undo value and the
* new value is legal (ie, the transistion from one value to another
* is legal).
- *
+ *
*@note
* This check is only to determine if the new value
* is \b potentially valid. This is the first check of many, and
* is one of the simplest ones.
- *
+ *
*@note
* this is not the place to do any checks for values
* which depend on some other value in the mib. Those
@@ -1217,6 +1905,12 @@ eocCNUServiceDBAUpstreamPIR_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_c
/*
* TODO:441:o: |-> Check for valid eocCNUServiceDBAUpstreamPIR value.
*/
+ /* check that proposed UpstreamPIR value is non-negative integer and below limit */
+ if ((eocCNUServiceDBAUpstreamPIR_val < 0)
+ || (eocCNUServiceDBAUpstreamPIR_val > LIBSPID_SERVICE_MAX_DBA_UL_PIR))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
return MFD_SUCCESS; /* eocCNUServiceDBAUpstreamPIR value not illegal */
} /* eocCNUServiceDBAUpstreamPIR_check_value */
@@ -1255,7 +1949,8 @@ eocCNUServiceDBAUpstreamPIR_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ct
* copy eocCNUServiceDBAUpstreamPIR data
* set rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR from rowreq_ctx->data.eocCNUServiceDBAUpstreamPIR
*/
- rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR = rowreq_ctx->data.eocCNUServiceDBAUpstreamPIR;
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR =
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR;
return MFD_SUCCESS;
@@ -1283,8 +1978,12 @@ eocCNUServiceDBAUpstreamPIR_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long
* TODO:461:M: |-> Set eocCNUServiceDBAUpstreamPIR value.
* set eocCNUServiceDBAUpstreamPIR value in rowreq_ctx->data
*/
- rowreq_ctx->data.eocCNUServiceDBAUpstreamPIR = eocCNUServiceDBAUpstreamPIR_val;
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR =
+ eocCNUServiceDBAUpstreamPIR_val;
+
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
return MFD_SUCCESS;
} /* eocCNUServiceDBAUpstreamPIR_set */
@@ -1307,11 +2006,13 @@ eocCNUServiceDBAUpstreamPIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
*/
/*
* copy eocCNUServiceDBAUpstreamPIR data
- * set rowreq_ctx->data.eocCNUServiceDBAUpstreamPIR from rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR
+ * set rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR
+ * from rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR
*/
- rowreq_ctx->data.eocCNUServiceDBAUpstreamPIR = rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR;
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR =
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR;
+
-
return MFD_SUCCESS;
} /* eocCNUServiceDBAUpstreamPIR_undo */
@@ -1351,12 +2052,12 @@ CNUÒµÎñÏÂÐб£ÕÏ´ø¿í£¬µ¥Î»kbps¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
* You should check that the requested change between the undo value and the
* new value is legal (ie, the transistion from one value to another
* is legal).
- *
+ *
*@note
* This check is only to determine if the new value
* is \b potentially valid. This is the first check of many, and
* is one of the simplest ones.
- *
+ *
*@note
* this is not the place to do any checks for values
* which depend on some other value in the mib. Those
@@ -1380,6 +2081,14 @@ eocCNUServiceDBADownstreamCIR_check_value( eocCNUServiceTable_rowreq_ctx *rowreq
/*
* TODO:441:o: |-> Check for valid eocCNUServiceDBADownstreamCIR value.
*/
+ /* check that proposed DownstreamCIR value is non-negative
+ * integer and below limit */
+ if ((eocCNUServiceDBADownstreamCIR_val < 0)
+ || (eocCNUServiceDBADownstreamCIR_val
+ > LIBSPID_SERVICE_MAX_DBA_DL_CIR))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
return MFD_SUCCESS; /* eocCNUServiceDBADownstreamCIR value not illegal */
} /* eocCNUServiceDBADownstreamCIR_check_value */
@@ -1416,9 +2125,9 @@ eocCNUServiceDBADownstreamCIR_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_
*/
/*
* copy eocCNUServiceDBADownstreamCIR data
- * set rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR from rowreq_ctx->data.eocCNUServiceDBADownstreamCIR
+ * set rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR from rowreq_ctx->data->eocCNUServiceDBADownstreamCIR
*/
- rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR = rowreq_ctx->data.eocCNUServiceDBADownstreamCIR;
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR = rowreq_ctx->data->eocCNUServiceDBADownstreamCIR;
return MFD_SUCCESS;
@@ -1446,8 +2155,12 @@ eocCNUServiceDBADownstreamCIR_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, lo
* TODO:461:M: |-> Set eocCNUServiceDBADownstreamCIR value.
* set eocCNUServiceDBADownstreamCIR value in rowreq_ctx->data
*/
- rowreq_ctx->data.eocCNUServiceDBADownstreamCIR = eocCNUServiceDBADownstreamCIR_val;
+ rowreq_ctx->data->eocCNUServiceDBADownstreamCIR =
+ eocCNUServiceDBADownstreamCIR_val;
+
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
return MFD_SUCCESS;
} /* eocCNUServiceDBADownstreamCIR_set */
@@ -1470,11 +2183,13 @@ eocCNUServiceDBADownstreamCIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
*/
/*
* copy eocCNUServiceDBADownstreamCIR data
- * set rowreq_ctx->data.eocCNUServiceDBADownstreamCIR from rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR
+ * set rowreq_ctx->data->eocCNUServiceDBADownstreamCIR from
+ * rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR
*/
- rowreq_ctx->data.eocCNUServiceDBADownstreamCIR = rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR;
+ rowreq_ctx->data->eocCNUServiceDBADownstreamCIR =
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR;
+
-
return MFD_SUCCESS;
} /* eocCNUServiceDBADownstreamCIR_undo */
@@ -1514,12 +2229,12 @@ CNUÒµÎñÉÏÐб£ÕÏ´ø¿í£¬µ¥Î»kbps¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
* You should check that the requested change between the undo value and the
* new value is legal (ie, the transistion from one value to another
* is legal).
- *
+ *
*@note
* This check is only to determine if the new value
* is \b potentially valid. This is the first check of many, and
* is one of the simplest ones.
- *
+ *
*@note
* this is not the place to do any checks for values
* which depend on some other value in the mib. Those
@@ -1543,6 +2258,12 @@ eocCNUServiceDBAUpstreamCIR_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_c
/*
* TODO:441:o: |-> Check for valid eocCNUServiceDBAUpstreamCIR value.
*/
+ /* check that proposed UpstreamCIR value is non-negative integer and below limit */
+ if ((eocCNUServiceDBAUpstreamCIR_val < 0)
+ || (eocCNUServiceDBAUpstreamCIR_val > LIBSPID_SERVICE_MAX_DBA_UL_CIR))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
return MFD_SUCCESS; /* eocCNUServiceDBAUpstreamCIR value not illegal */
} /* eocCNUServiceDBAUpstreamCIR_check_value */
@@ -1579,9 +2300,11 @@ eocCNUServiceDBAUpstreamCIR_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ct
*/
/*
* copy eocCNUServiceDBAUpstreamCIR data
- * set rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR from rowreq_ctx->data.eocCNUServiceDBAUpstreamCIR
+ * set rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR from
+ * rowreq_ctx->data.eocCNUServiceDBAUpstreamCIR
*/
- rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR = rowreq_ctx->data.eocCNUServiceDBAUpstreamCIR;
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR =
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR;
return MFD_SUCCESS;
@@ -1609,7 +2332,11 @@ eocCNUServiceDBAUpstreamCIR_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long
* TODO:461:M: |-> Set eocCNUServiceDBAUpstreamCIR value.
* set eocCNUServiceDBAUpstreamCIR value in rowreq_ctx->data
*/
- rowreq_ctx->data.eocCNUServiceDBAUpstreamCIR = eocCNUServiceDBAUpstreamCIR_val;
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR =
+ eocCNUServiceDBAUpstreamCIR_val;
+
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
return MFD_SUCCESS;
} /* eocCNUServiceDBAUpstreamCIR_set */
@@ -1633,11 +2360,13 @@ eocCNUServiceDBAUpstreamCIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
*/
/*
* copy eocCNUServiceDBAUpstreamCIR data
- * set rowreq_ctx->data.eocCNUServiceDBAUpstreamCIR from rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR
+ * set rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR from
+ * rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR
*/
- rowreq_ctx->data.eocCNUServiceDBAUpstreamCIR = rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR;
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR =
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR;
+
-
return MFD_SUCCESS;
} /* eocCNUServiceDBAUpstreamCIR_undo */
@@ -1677,12 +2406,12 @@ eocCNUServiceDBAUpstreamCIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* You should check that the requested change between the undo value and the
* new value is legal (ie, the transistion from one value to another
* is legal).
- *
+ *
*@note
* This check is only to determine if the new value
* is \b potentially valid. This is the first check of many, and
* is one of the simplest ones.
- *
+ *
*@note
* this is not the place to do any checks for values
* which depend on some other value in the mib. Those
@@ -1706,6 +2435,12 @@ eocCNUServiceMaxLatency_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
/*
* TODO:441:o: |-> Check for valid eocCNUServiceMaxLatency value.
*/
+ /* check that proposed MaxLatency value is non-negative integer and below limit */
+ if ((eocCNUServiceMaxLatency_val < 0)
+ || (eocCNUServiceMaxLatency_val > LIBSPID_SERVICE_MAX_LATENCY))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
return MFD_SUCCESS; /* eocCNUServiceMaxLatency value not illegal */
} /* eocCNUServiceMaxLatency_check_value */
@@ -1744,7 +2479,8 @@ eocCNUServiceMaxLatency_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* copy eocCNUServiceMaxLatency data
* set rowreq_ctx->undo->eocCNUServiceMaxLatency from rowreq_ctx->data.eocCNUServiceMaxLatency
*/
- rowreq_ctx->undo->eocCNUServiceMaxLatency = rowreq_ctx->data.eocCNUServiceMaxLatency;
+ rowreq_ctx->undo->eocCNUServiceMaxLatency =
+ rowreq_ctx->data->eocCNUServiceMaxLatency;
return MFD_SUCCESS;
@@ -1772,7 +2508,9 @@ eocCNUServiceMaxLatency_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eoc
* TODO:461:M: |-> Set eocCNUServiceMaxLatency value.
* set eocCNUServiceMaxLatency value in rowreq_ctx->data
*/
- rowreq_ctx->data.eocCNUServiceMaxLatency = eocCNUServiceMaxLatency_val;
+ rowreq_ctx->data->eocCNUServiceMaxLatency = eocCNUServiceMaxLatency_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG;
return MFD_SUCCESS;
} /* eocCNUServiceMaxLatency_set */
@@ -1796,11 +2534,13 @@ eocCNUServiceMaxLatency_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
*/
/*
* copy eocCNUServiceMaxLatency data
- * set rowreq_ctx->data.eocCNUServiceMaxLatency from rowreq_ctx->undo->eocCNUServiceMaxLatency
+ * set rowreq_ctx->data->eocCNUServiceMaxLatency from
+ * rowreq_ctx->undo->eocCNUServiceMaxLatency
*/
- rowreq_ctx->data.eocCNUServiceMaxLatency = rowreq_ctx->undo->eocCNUServiceMaxLatency;
+ rowreq_ctx->data->eocCNUServiceMaxLatency =
+ rowreq_ctx->undo->eocCNUServiceMaxLatency;
+
-
return MFD_SUCCESS;
} /* eocCNUServiceMaxLatency_undo */
@@ -1816,7 +2556,7 @@ eocCNUServiceMaxLatency_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
notInService(3)- ״̬δ¼¤»î£»
notReady(4)- ²»Äܱ»¼¤»î״̬£»
createAndGo(5)- ´´½¨²¢¼¤»î£»
- createAndWait(6)- ´´½¨£¬µ«²»¼¤»î£»
+ createAndWait(6)- ´´½¨£¬µ«²»¼¤»î£»
destory(7)- Ïú»Ù¸ÃÐС£
*
* Attributes:
@@ -1848,12 +2588,12 @@ eocCNUServiceMaxLatency_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
* You should check that the requested change between the undo value and the
* new value is legal (ie, the transistion from one value to another
* is legal).
- *
+ *
*@note
* This check is only to determine if the new value
* is \b potentially valid. This is the first check of many, and
* is one of the simplest ones.
- *
+ *
*@note
* this is not the place to do any checks for values
* which depend on some other value in the mib. Those
@@ -1878,6 +2618,12 @@ eocCNUServiceRowStatus_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, u
/*
* TODO:441:o: |-> Check for valid eocCNUServiceRowStatus value.
*/
+ /* check for unsupported row status values */
+ if (ROWSTATUS_CREATEANDGO == eocCNUServiceRowStatus_val)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable", "createAndGo not supported\n"));
+ return MFD_NOT_VALID_EVER;
+ }
return MFD_SUCCESS; /* eocCNUServiceRowStatus value not illegal */
} /* eocCNUServiceRowStatus_check_value */
@@ -1914,9 +2660,11 @@ eocCNUServiceRowStatus_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
*/
/*
* copy eocCNUServiceRowStatus data
- * set rowreq_ctx->undo->eocCNUServiceRowStatus from rowreq_ctx->data.eocCNUServiceRowStatus
+ * set rowreq_ctx->undo->eocCNUServiceRowStatus from
+ * rowreq_ctx->data->eocCNUServiceRowStatus
*/
- rowreq_ctx->undo->eocCNUServiceRowStatus = rowreq_ctx->data.eocCNUServiceRowStatus;
+ rowreq_ctx->undo->eocCNUServiceRowStatus =
+ rowreq_ctx->data->eocCNUServiceRowStatus;
return MFD_SUCCESS;
@@ -1944,7 +2692,7 @@ eocCNUServiceRowStatus_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, u_long eo
* TODO:461:M: |-> Set eocCNUServiceRowStatus value.
* set eocCNUServiceRowStatus value in rowreq_ctx->data
*/
- rowreq_ctx->data.eocCNUServiceRowStatus = eocCNUServiceRowStatus_val;
+ rowreq_ctx->data->eocCNUServiceRowStatus = eocCNUServiceRowStatus_val;
return MFD_SUCCESS;
} /* eocCNUServiceRowStatus_set */
@@ -1968,12 +2716,257 @@ eocCNUServiceRowStatus_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
*/
/*
* copy eocCNUServiceRowStatus data
- * set rowreq_ctx->data.eocCNUServiceRowStatus from rowreq_ctx->undo->eocCNUServiceRowStatus
+ * set rowreq_ctx->data->eocCNUServiceRowStatus from
+ * rowreq_ctx->undo->eocCNUServiceRowStatus
*/
- rowreq_ctx->data.eocCNUServiceRowStatus = rowreq_ctx->undo->eocCNUServiceRowStatus;
+ rowreq_ctx->data->eocCNUServiceRowStatus =
+ rowreq_ctx->undo->eocCNUServiceRowStatus;
+
-
return MFD_SUCCESS;
} /* eocCNUServiceRowStatus_undo */
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUServiceTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-eocCNUServiceTable if you don't have dependencies)
+ */
+int
+eocCNUServiceTable_check_dependencies (eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_check_dependencies","called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check eocCNUServiceTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICEROWSTATUS_FLAG)
+ {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition (rowreq_ctx->undo->
+ eocCNUServiceRowStatus,
+ rowreq_ctx->data->
+ eocCNUServiceRowStatus);
+
+ if (MFD_SUCCESS != rc)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "row status transition from %d to %d\n",
+ rowreq_ctx->undo->eocCNUServiceRowStatus,
+ rowreq_ctx->data->eocCNUServiceRowStatus));
+ return rc;
+ }
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* this case permits creating row with rowstatus
+ * 'destroy' - row is created and immediately deleted */
+ if (ROWSTATUS_DESTROY == rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ }
+ else if (ROWSTATUS_CREATEANDWAIT ==
+ rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* set row adding indication */
+ eoccnu_adding_service = 1;
+ rowreq_ctx->data->eocCNUServiceRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ }
+ else
+ {
+ /* check that DL CIR is not greater than DL PIR
+ * (if both are given during row creation) */
+ if ((rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG)
+ && (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG))
+ {
+ if (rowreq_ctx->data->eocCNUServiceDBADownstreamCIR
+ > rowreq_ctx->data->eocCNUServiceDBADownstreamPIR)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Downstream CIR must not be greater"
+ " than Downstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+ /* check that UL CIR is not greater than UL PIR
+ * (if both are given during row creation) */
+ if ((rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG)
+ && (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG))
+ {
+ if (rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR
+ > rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Upstream CIR must not be greater"
+ " than Upstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+ rowreq_ctx->data->eocCNUServiceRowStatus = ROWSTATUS_ACTIVE;
+ }
+ } /* row creation */
+ else
+ {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY == rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ if (rowreq_ctx->column_set_flags
+ & ~COLUMN_EOCCNUSERVICEROWSTATUS_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "destroy must be only varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+ else if (ROWSTATUS_NOTINSERVICE ==
+ rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* do not permit invalidating once validated row */
+ if (rowreq_ctx->undo->eocCNUServiceRowStatus
+ & ROWSTATUS_ACTIVE)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Row status can't be changed from Active "
+ "to Not In Service!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* before setting row to active, check that all columns
+ * are filled */
+ if ((rowreq_ctx->column_exists_flags
+ & EOCCNUSERVICETABLE_REQUIRED_COLS) !=
+ EOCCNUSERVICETABLE_REQUIRED_COLS)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "required columns from eocCNU table "
+ "missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_exists_flags,
+ EOCCNUSERVICETABLE_REQUIRED_COLS));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->data->eocCNUServiceRowStatus = ROWSTATUS_ACTIVE;
+ }
+ } /* row change */
+ }
+ else
+ {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* check that DL CIR is not greater than DL PIR */
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG)
+ {
+ if (rowreq_ctx->data->eocCNUServiceDBADownstreamCIR
+ > rowreq_ctx->data->eocCNUServiceDBADownstreamPIR)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Downstream CIR must not be greater than"
+ " Downstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG)
+ {
+ if (rowreq_ctx->data->eocCNUServiceDBADownstreamCIR
+ > rowreq_ctx->data->eocCNUServiceDBADownstreamPIR)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Downstream CIR must not be greater than"
+ " Downstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+
+ /* check that UL CIR is not greater than UL PIR */
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG)
+ {
+ if (rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR
+ > rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Upstream CIR must not be greater than"
+ " Upstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG)
+ {
+ if (rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR
+ > rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Upstream CIR must not be greater than "
+ "Upstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return rc;
+} /* eocCNUServiceTable_check_dependencies */
+
/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_enums.h
index d591aec831..40c2b6cee5 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_enums.h
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_enums.h
@@ -41,12 +41,12 @@ extern "C" {
#ifndef ROWSTATUS_ENUMS
#define ROWSTATUS_ENUMS
-#define ROWSTATUS_ACTIVE 1
-#define ROWSTATUS_NOTINSERVICE 2
-#define ROWSTATUS_NOTREADY 3
-#define ROWSTATUS_CREATEANDGO 4
-#define ROWSTATUS_CREATEANDWAIT 5
-#define ROWSTATUS_DESTROY 6
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
#endif /* ROWSTATUS_ENUMS */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.c
index 335f9ea8a0..35f7eff835 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.c
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.c
@@ -1,6 +1,6 @@
/*
* Note: this file originally auto-generated by mib2c using
- * version : 15899 $ of $
+ * version : 15899 $ of $
*
* $Id:$
*/
@@ -60,7 +60,7 @@ typedef struct eocCNUServiceTable_interface_ctx_s {
netsnmp_cache *cache;
eocCNUServiceTable_registration * user_ctx;
-
+
netsnmp_table_registration_info tbl_info;
netsnmp_baby_steps_access_methods access_multiplexer;
@@ -133,6 +133,8 @@ static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_undo_values;
static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_commit;
static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_undo_commit;
static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_irreversible_commit;
+/* change from template: added check for dependencies */
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_check_dependencies;
NETSNMP_STATIC_INLINE int _eocCNUServiceTable_undo_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
netsnmp_variable_list *var, int column );
@@ -142,8 +144,29 @@ NETSNMP_STATIC_INLINE int _eocCNUServiceTable_check_indexes(eocCNUServiceTable_r
eocCNUServiceTable_data *eocCNUServiceTable_allocate_data(void);
/**
+ * common init of container for eocCNUServiceTable and spc300EoCSlaveServiceTable
+ */
+void
+eoccnu_service_container_init (void)
+{
+ static int done = 0;
+
+ if (done)
+ return;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:eoccnu_service_container_init", "called\n"));
+
+ done = 1;
+
+ /*
+ * set up the container
+ */
+ _eocCNUServiceTable_container_init (&eocCNUServiceTable_if_ctx);
+}
+
+/**
* @internal
- * Initialize the table eocCNUServiceTable
+ * Initialize the table eocCNUServiceTable
* (Define its contents and how it's structured)
*/
void
@@ -158,6 +181,9 @@ _eocCNUServiceTable_initialize_interface(eocCNUServiceTable_registration * reg_p
DEBUGMSGTL(("internal:eocCNUServiceTable:_eocCNUServiceTable_initialize_interface","called\n"));
+ (void) eoccnu_service_container_init ();
+ if (NULL == eocCNUServiceTable_if_ctx.container)
+ return; /* msg already logged */
/*************************************************
*
@@ -193,7 +219,7 @@ _eocCNUServiceTable_initialize_interface(eocCNUServiceTable_registration * reg_p
snmp_log(LOG_ERR,"could not initialize container for eocCNUServiceTable\n");
return;
}
-
+
/*
* access_multiplexer: REQUIRED wrapper for get request handling
*/
@@ -223,12 +249,22 @@ _eocCNUServiceTable_initialize_interface(eocCNUServiceTable_registration * reg_p
access_multiplexer->undo_commit = _mfd_eocCNUServiceTable_undo_commit;
access_multiplexer->irreversible_commit = _mfd_eocCNUServiceTable_irreversible_commit;
+ /* change from template: added check for dependencies */
+ /*
+ * REQUIRED for tables with dependencies
+ */
+
+ access_multiplexer->consistency_checks =
+ _mfd_eocCNUServiceTable_check_dependencies;
+
+
+
/*************************************************
*
* Create a registration, save our reg data, register table.
*/
DEBUGMSGTL(("eocCNUServiceTable:init_eocCNUServiceTable",
- "Registering eocCNUServiceTable as a mibs-for-dummies table.\n"));
+ "Registering eocCNUServiceTable as a mibs-for-dummies table.\n"));
handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
reginfo = netsnmp_handler_registration_create("eocCNUServiceTable", handler,
eocCNUServiceTable_oid,
@@ -259,14 +295,14 @@ _eocCNUServiceTable_initialize_interface(eocCNUServiceTable_registration * reg_p
mfd_modes |= BABY_STEP_PRE_REQUEST;
if( access_multiplexer->post_request )
mfd_modes |= BABY_STEP_POST_REQUEST;
-
+
if( access_multiplexer->undo_setup )
mfd_modes |= BABY_STEP_UNDO_SETUP;
if( access_multiplexer->undo_cleanup )
mfd_modes |= BABY_STEP_UNDO_CLEANUP;
if( access_multiplexer->undo_sets )
mfd_modes |= BABY_STEP_UNDO_SETS;
-
+
if( access_multiplexer->row_creation )
mfd_modes |= BABY_STEP_ROW_CREATE;
if( access_multiplexer->consistency_checks )
@@ -275,7 +311,7 @@ _eocCNUServiceTable_initialize_interface(eocCNUServiceTable_registration * reg_p
mfd_modes |= BABY_STEP_COMMIT;
if( access_multiplexer->undo_commit )
mfd_modes |= BABY_STEP_UNDO_COMMIT;
-
+
handler = netsnmp_baby_steps_handler_get(mfd_modes);
netsnmp_inject_handler(reginfo, handler);
@@ -340,7 +376,7 @@ eocCNUServiceTable_index_to_oid(netsnmp_index *oid_idx,
eocCNUServiceTable_mib_index *mib_idx)
{
int err = SNMP_ERR_NOERROR;
-
+
/*
* temp storage for parsing indexes
*/
@@ -392,7 +428,7 @@ eocCNUServiceTable_index_from_oid(netsnmp_index *oid_idx,
eocCNUServiceTable_mib_index *mib_idx)
{
int err = SNMP_ERR_NOERROR;
-
+
/*
* temp storage for parsing indexes
*/
@@ -454,6 +490,12 @@ eocCNUServiceTable_allocate_data(void)
snmp_log(LOG_ERR, "unable to malloc memory for new "
"eocCNUServiceTable_data.\n");
}
+ else
+ {
+ /* initialization of fields added for container comparison */
+ rtn->oid_index.len = 1;
+ rtn->oid_index.oids = &rtn->st_index;
+ }
return rtn;
} /* eocCNUServiceTable_allocate_data */
@@ -468,6 +510,8 @@ eocCNUServiceTable_release_data(eocCNUServiceTable_data *data)
{
DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_release_data","called\n"));
+ if (NULL == data)
+ return;
free(data);
} /* eocCNUServiceTable_release_data */
@@ -476,18 +520,194 @@ eocCNUServiceTable_release_data(eocCNUServiceTable_data *data)
* allocate resources for a eocCNUServiceTable_rowreq_ctx
*/
eocCNUServiceTable_rowreq_ctx *
-eocCNUServiceTable_allocate_rowreq_ctx(void *user_init_ctx)
+eocCNUServiceTable_allocate_rowreq_ctx(eocCNUServiceTable_data * data,
+ void *user_init_ctx)
{
eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
SNMP_MALLOC_TYPEDEF(eocCNUServiceTable_rowreq_ctx);
- DEBUGMSGTL(("internal:eocCNUServiceTable:eocCNUServiceTable_allocate_rowreq_ctx","called\n"));
-
- if(NULL == rowreq_ctx) {
- snmp_log(LOG_ERR,"Couldn't allocate memory for a "
- "eocCNUServiceTable_rowreq_ctx.\n");
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "Couldn't allocate memory for a "
+ "eocCNUServiceTable_rowreq_ctx.\n");
return NULL;
}
+ else
+ {
+ if (NULL != data)
+ {
+ /*
+ * track if we got data from user
+ */
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "data got from user\n"));
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+
+ /* TEMP: maybe set column_exists_flags somewhere else? */
+ /* TODO: check if index flag can be set here? */
+
+ if (INVALID_EOCCNUSERVICECONFINDEX ==
+ rowreq_ctx->data->eocCNUServiceConfIndex)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "config file index invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEINDEX_FLAG;
+ }
+
+ if (NULL == rowreq_ctx->data->eocCNUServiceName)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "service name null\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICENAME_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICESERVICETYPE ==
+ rowreq_ctx->data->eocCNUServiceType)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "service type invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICETYPE_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICEQOSPRIO ==
+ rowreq_ctx->data->eocCNUServiceQOSPrio)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "QOS Prio invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEQOSPRIO_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICEDBADOWNSTREAMPIR ==
+ rowreq_ctx->data->eocCNUServiceDBADownstreamPIR)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "Downstream PIR invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICEDBAUPSTREAMPIR ==
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "Upstream PIR invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICEDBADOWNSTREAMCIR ==
+ rowreq_ctx->data->eocCNUServiceDBADownstreamCIR)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "Downstream CIR invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICEDBAUPSTREAMCIR ==
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "Upstream CIR invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICEMAXLATENCY ==
+ rowreq_ctx->data->eocCNUServiceMaxLatency)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "max latency invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG;
+ }
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* fields specific to SPC300EoC Service Table extension */
+ if (INVALID_SPC300EOCSLAVESERVICEMAXJITTER ==
+ rowreq_ctx->data->spc300EoCSlaveServiceMaxJitter)
+ {
+ DEBUGMSGTL (("internal:spc300EoCSlaveServiceTable:"
+ "spc300EoCSlaveServiceTable_allocate_rowreq_ctx",
+ "max jitter invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG;
+ }
+
+ if (INVALID_SPC300EOCSLAVESERVICEACSEN ==
+ rowreq_ctx->data->spc300EoCSlaveServiceACSEn)
+ {
+ DEBUGMSGTL (("internal:spc300EoCSlaveServiceTable:"
+ "spc300EoCSlaveServiceTable_allocate_rowreq_ctx",
+ "ACS Enable invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG;
+ }
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+ /* Row Status flag set to existing for allocation purposes */
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEROWSTATUS_FLAG;
+ }
+ else if (NULL == (rowreq_ctx->data =
+ eocCNUServiceTable_allocate_data ()))
+ {
+ SNMP_FREE (rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
@@ -517,12 +737,22 @@ eocCNUServiceTable_release_rowreq_ctx(eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
DEBUGMSGTL(("internal:eocCNUServiceTable:eocCNUServiceTable_release_rowreq_ctx","called\n"));
netsnmp_assert(NULL != rowreq_ctx);
-
+
eocCNUServiceTable_rowreq_ctx_cleanup(rowreq_ctx);
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ {
+ eocCNUServiceTable_release_data (rowreq_ctx->data);
+ }
- if(rowreq_ctx->undo)
- eocCNUServiceTable_release_data(rowreq_ctx->undo);
-
+ if (rowreq_ctx->undo)
+ {
+ eocCNUServiceTable_release_data (rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
/*
* free index oid pointer
*/
@@ -546,13 +776,13 @@ _mfd_eocCNUServiceTable_pre_request(netsnmp_mib_handler *handler,
DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_pre_request",
"called\n"));
-
+
if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
DEBUGMSGTL(("internal:eocCNUServiceTable",
"skipping additional pre_request\n"));
return SNMP_ERR_NOERROR;
}
-
+
rc = eocCNUServiceTable_pre_request(eocCNUServiceTable_if_ctx.user_ctx);
if (MFD_SUCCESS != rc) {
/*
@@ -562,7 +792,7 @@ _mfd_eocCNUServiceTable_pre_request(netsnmp_mib_handler *handler,
"eocCNUServiceTable_pre_request\n", rc));
netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
}
-
+
return SNMP_ERR_NOERROR;
} /* _mfd_eocCNUServiceTable_pre_request */
@@ -597,7 +827,7 @@ _mfd_eocCNUServiceTable_post_request(netsnmp_mib_handler *handler,
"waiting for last post_request\n"));
return SNMP_ERR_NOERROR;
}
-
+
packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
if ((MFD_SUCCESS != packet_rc) && eocCNUServiceTable_dirty_get()) {
/*
@@ -616,7 +846,7 @@ _mfd_eocCNUServiceTable_post_request(netsnmp_mib_handler *handler,
DEBUGMSGTL(("eocCNUServiceTable","error %d from "
"eocCNUServiceTable_post_request\n", rc));
}
-
+
return SNMP_ERR_NOERROR;
} /* _mfd_eocCNUServiceTable_post_request */
@@ -639,7 +869,7 @@ _mfd_eocCNUServiceTable_rowreq_from_index(netsnmp_index *oid_idx, int * rc_ptr)
*rc_ptr = MFD_SUCCESS;
memset(&mib_idx, 0x0, sizeof(mib_idx));
-
+
/*
* try to parse oid
*/
@@ -652,12 +882,12 @@ _mfd_eocCNUServiceTable_rowreq_from_index(netsnmp_index *oid_idx, int * rc_ptr)
/*
* allocate new context
*/
- rowreq_ctx = eocCNUServiceTable_allocate_rowreq_ctx(NULL);
+ rowreq_ctx = eocCNUServiceTable_allocate_rowreq_ctx (NULL, NULL);
if (NULL == rowreq_ctx) {
*rc_ptr = MFD_ERROR;
return NULL; /* msg already logged */
}
-
+
memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
/*
@@ -694,7 +924,7 @@ _mfd_eocCNUServiceTable_object_lookup(netsnmp_mib_handler *handler,
int rc = SNMP_ERR_NOERROR;
eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
netsnmp_container_table_row_extract(requests);
-
+
DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_object_lookup","called\n"));
/*
@@ -752,7 +982,7 @@ _eocCNUServiceTable_get_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
netsnmp_variable_list *var, int column )
{
int rc = SNMPERR_SUCCESS;
-
+
DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_column",
"called for %d\n", column));
@@ -915,7 +1145,7 @@ _mfd_eocCNUServiceTable_get_values(netsnmp_mib_handler *handler,
DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_values","called\n"));
netsnmp_assert(NULL != rowreq_ctx);
-
+
DEBUGMSGTL(("9:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_values",
"exists %p\n", (void*)rowreq_ctx->column_exists_flags));
@@ -940,7 +1170,7 @@ _mfd_eocCNUServiceTable_get_values(netsnmp_mib_handler *handler,
tri = netsnmp_extract_table_info(requests);
if(NULL == tri)
continue;
-
+
rc = _eocCNUServiceTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
if(rc) {
if(MFD_SKIP == rc) {
@@ -1015,7 +1245,7 @@ _eocCNUServiceTable_check_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
netsnmp_variable_list *var, int column )
{
int rc = SNMPERR_SUCCESS;
-
+
DEBUGMSGTL(("internal:eocCNUServiceTable:_eocCNUServiceTable_check_column",
"called for %d\n", column));
@@ -1030,7 +1260,7 @@ _eocCNUServiceTable_check_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
/* eocCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
case COLUMN_EOCCNUSERVICENAME:
rc = netsnmp_check_vb_type_and_max_size( var, ASN_OCTET_STR,
- sizeof( rowreq_ctx->data.eocCNUServiceName ) );
+ sizeof (rowreq_ctx->data->eocCNUServiceName));
/* check defined range(s). */
if( (SNMPERR_SUCCESS == rc)
&& ((var->val_len < 0) || (var->val_len > 255))
@@ -1054,7 +1284,7 @@ _eocCNUServiceTable_check_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
/* eocCNUServiceType(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
case COLUMN_EOCCNUSERVICETYPE:
rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
- sizeof( rowreq_ctx->data.eocCNUServiceType ) );
+ sizeof (rowreq_ctx->data->eocCNUServiceType));
if(SNMPERR_SUCCESS != rc) {
DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceType",
"varbind validation failed (eg bad type or size)\n"));
@@ -1072,7 +1302,7 @@ _eocCNUServiceTable_check_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
/* eocCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
case COLUMN_EOCCNUSERVICEQOSPRIO:
rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
- sizeof( rowreq_ctx->data.eocCNUServiceQOSPrio ) );
+ sizeof (rowreq_ctx->data->eocCNUServiceQOSPrio));
/* check defined range(s). */
if( (SNMPERR_SUCCESS == rc)
&& ((*var->val.integer < 0) || (*var->val.integer > 7))
@@ -1096,7 +1326,7 @@ _eocCNUServiceTable_check_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
/* eocCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
case COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR:
rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
- sizeof( rowreq_ctx->data.eocCNUServiceDBADownstreamPIR ) );
+ sizeof (rowreq_ctx->data->eocCNUServiceDBADownstreamPIR));
if(SNMPERR_SUCCESS != rc) {
DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceDBADownstreamPIR",
"varbind validation failed (eg bad type or size)\n"));
@@ -1114,7 +1344,7 @@ _eocCNUServiceTable_check_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
/* eocCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
case COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR:
rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
- sizeof( rowreq_ctx->data.eocCNUServiceDBAUpstreamPIR ) );
+ sizeof (rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR));
if(SNMPERR_SUCCESS != rc) {
DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceDBAUpstreamPIR",
"varbind validation failed (eg bad type or size)\n"));
@@ -1132,7 +1362,7 @@ _eocCNUServiceTable_check_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
/* eocCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
case COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR:
rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
- sizeof( rowreq_ctx->data.eocCNUServiceDBADownstreamCIR ) );
+ sizeof (rowreq_ctx->data->eocCNUServiceDBADownstreamCIR));
if(SNMPERR_SUCCESS != rc) {
DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceDBADownstreamCIR",
"varbind validation failed (eg bad type or size)\n"));
@@ -1150,7 +1380,7 @@ _eocCNUServiceTable_check_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
/* eocCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
case COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR:
rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
- sizeof( rowreq_ctx->data.eocCNUServiceDBAUpstreamCIR ) );
+ sizeof (rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR));
if(SNMPERR_SUCCESS != rc) {
DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceDBAUpstreamCIR",
"varbind validation failed (eg bad type or size)\n"));
@@ -1168,7 +1398,7 @@ _eocCNUServiceTable_check_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
/* eocCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
case COLUMN_EOCCNUSERVICEMAXLATENCY:
rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
- sizeof( rowreq_ctx->data.eocCNUServiceMaxLatency ) );
+ sizeof (rowreq_ctx->data->eocCNUServiceMaxLatency));
if(SNMPERR_SUCCESS != rc) {
DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceMaxLatency",
"varbind validation failed (eg bad type or size)\n"));
@@ -1222,7 +1452,7 @@ _mfd_eocCNUServiceTable_check_objects(netsnmp_mib_handler *handler,
DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_check_objects","called\n"));
netsnmp_assert(NULL != rowreq_ctx);
-
+
for(;requests; requests = requests->next) {
/*
@@ -1246,6 +1476,42 @@ _mfd_eocCNUServiceTable_check_objects(netsnmp_mib_handler *handler,
/*----------------------------------------------------------------------
*
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_eocCNUServiceTable_check_dependencies (netsnmp_mib_handler * handler,
+ netsnmp_handler_registration *
+ reginfo,
+ netsnmp_agent_request_info *
+ agtreq_info,
+ netsnmp_request_info * requests)
+{
+ int rc;
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract (requests);
+ DEBUGMSGTL (("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable"
+ "_check_dependencies", "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ rc = eocCNUServiceTable_check_dependencies (rowreq_ctx);
+ if (rc)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable:mfd", "error %d from "
+ "eocCNUServiceTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all (requests, SNMP_VALIDATE_ERR (rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUServiceTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
* SET: Undo setup
*
*---------------------------------------------------------------------*/
@@ -1257,7 +1523,7 @@ NETSNMP_STATIC_INLINE int
_eocCNUServiceTable_undo_setup_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, int column )
{
int rc = SNMPERR_SUCCESS;
-
+
DEBUGMSGTL(("internal:eocCNUServiceTable:_eocCNUServiceTable_undo_setup_column",
"called for %d\n", column));
@@ -1327,6 +1593,40 @@ _eocCNUServiceTable_undo_setup_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx
return rc;
} /* _eocCNUServiceTable_undo_setup_column */
+/* TODO: check if this is really necessary? */
+int
+_mfd_eocCNUServiceTable_undo_setup_allocate (eocCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ if (NULL == rowreq_ctx)
+ return MFD_ERROR;
+
+ /*
+ * other tables share our container/context and call
+ * this function. so we need to check and see if
+ * someone else already allocated data
+ */
+ if (NULL == rowreq_ctx->undo)
+ {
+ rowreq_ctx->undo = eocCNUServiceTable_allocate_data ();
+ if (NULL == rowreq_ctx->undo)
+ {
+ /** msg already logged */
+ rc = SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ else
+ {
+ /* TODO: check if something should be done here? */
+ }
+ }
+ ++rowreq_ctx->undo_ref_count;
+ DEBUGMSGTL (("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_undo_setup_allocate",
+ "++undo_refcount = %d\n", rowreq_ctx->undo_ref_count));
+
+ return rc;
+}
/**
* @internal
@@ -1378,7 +1678,7 @@ _mfd_eocCNUServiceTable_undo_setup(netsnmp_mib_handler *handler,
tri = netsnmp_extract_table_info(requests);
if(NULL == tri)
continue;
-
+
rc = _eocCNUServiceTable_undo_setup_column(rowreq_ctx, tri->colnum);
if(MFD_SUCCESS != rc) {
DEBUGMSGTL(("eocCNUServiceTable:mfd","error %d from "
@@ -1387,10 +1687,29 @@ _mfd_eocCNUServiceTable_undo_setup(netsnmp_mib_handler *handler,
}
} /* for results */
}
-
+
return SNMP_ERR_NOERROR;
} /* _mfd_eocCNUServiceTable_undo_setup */
+void
+_mfd_eocCNUServiceTable_undo_setup_release (eocCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL (("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable"
+ "_undo_setup_release", "called\n"));
+
+ netsnmp_assert (rowreq_ctx->undo_ref_count > 0);
+ --rowreq_ctx->undo_ref_count;
+ snmp_log (LOG_ERR, "undo_refcount at %d\n", rowreq_ctx->undo_ref_count);
+
+ if (0 == rowreq_ctx->undo_ref_count)
+ {
+ eocCNUServiceTable_release_data (rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+}
+
+
/**
* @internal
* undo setup
@@ -1428,10 +1747,7 @@ _mfd_eocCNUServiceTable_undo_cleanup(netsnmp_mib_handler *handler,
/*
* release undo context, if needed
*/
- if(rowreq_ctx->undo) {
- eocCNUServiceTable_release_data(rowreq_ctx->undo);
- rowreq_ctx->undo = NULL;
- }
+ _mfd_eocCNUServiceTable_undo_setup_release (rowreq_ctx);
return SNMP_ERR_NOERROR;
@@ -1451,7 +1767,7 @@ _eocCNUServiceTable_set_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
netsnmp_variable_list *var, int column )
{
int rc = SNMPERR_SUCCESS;
-
+
DEBUGMSGTL(("internal:eocCNUServiceTable:_eocCNUServiceTable_set_column",
"called for %d\n", column));
@@ -1518,7 +1834,7 @@ _eocCNUServiceTable_set_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
rc = SNMP_ERR_GENERR;
break;
}
-
+
return rc;
} /* _eocCNUServiceTable_set_column */
@@ -1536,7 +1852,7 @@ _mfd_eocCNUServiceTable_set_values(netsnmp_mib_handler *handler,
DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_set_values","called\n"));
netsnmp_assert(NULL != rowreq_ctx);
-
+
rowreq_ctx->column_set_flags = 0;
for(;requests; requests = requests->next) {
/*
@@ -1545,7 +1861,7 @@ _mfd_eocCNUServiceTable_set_values(netsnmp_mib_handler *handler,
tri = netsnmp_extract_table_info(requests);
if(NULL == tri)
continue;
-
+
rc = _eocCNUServiceTable_set_column(rowreq_ctx,
requests->requestvb, tri->colnum);
if(MFD_SUCCESS != rc) {
@@ -1580,7 +1896,7 @@ _mfd_eocCNUServiceTable_commit(netsnmp_mib_handler *handler,
DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_commit","called\n"));
netsnmp_assert(NULL != rowreq_ctx);
-
+
rc = eocCNUServiceTable_commit(rowreq_ctx);
if (MFD_SUCCESS != rc) {
DEBUGMSGTL(("eocCNUServiceTable:mfd","error %d from "
@@ -1653,7 +1969,7 @@ _eocCNUServiceTable_undo_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
netsnmp_variable_list *var, int column )
{
int rc = SNMPERR_SUCCESS;
-
+
DEBUGMSGTL(("internal:eocCNUServiceTable:_eocCNUServiceTable_undo_column",
"called for %d\n", column));
@@ -1728,7 +2044,7 @@ _mfd_eocCNUServiceTable_undo_values(netsnmp_mib_handler *handler,
DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_undo_values","called\n"));
netsnmp_assert(NULL != rowreq_ctx);
-
+
rc = eocCNUServiceTable_undo(rowreq_ctx);
if (MFD_SUCCESS != rc) {
/*
@@ -1737,7 +2053,7 @@ _mfd_eocCNUServiceTable_undo_values(netsnmp_mib_handler *handler,
DEBUGMSGTL(("eocCNUServiceTable:mfd","error %d from "
"eocCNUServiceTable_undo\n", rc));
}
-
+
for(;requests; requests = requests->next) {
/*
* set column data
@@ -1745,7 +2061,7 @@ _mfd_eocCNUServiceTable_undo_values(netsnmp_mib_handler *handler,
tri = netsnmp_extract_table_info(requests);
if(NULL == tri)
continue;
-
+
rc = _eocCNUServiceTable_undo_column(rowreq_ctx, requests->requestvb,
tri->colnum);
if (MFD_SUCCESS != rc) {
@@ -1777,11 +2093,11 @@ _mfd_eocCNUServiceTable_irreversible_commit(netsnmp_mib_handler *handler,
{
eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
netsnmp_container_table_row_extract(requests);
-
+
DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_irreversible:commit","called\n"));
-
+
netsnmp_assert(NULL != rowreq_ctx);
-
+
/*
* check for and handle row creation/deletion
* and update column exist flags...
@@ -1833,12 +2149,22 @@ _cache_load(netsnmp_cache *cache, void *vmagic)
/** should only be called for an invalid or expired cache */
netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
-
+
/*
* call user code
*/
- return eocCNUServiceTable_container_load((netsnmp_container*)cache->magic);
-} /* _cache_load */
+ if (eoccnu_adding_service)
+ {
+ snmp_log (LOG_ERR, "skipping eocCNUServiceTable_cache_load, "
+ "row adding in progress\n");
+ return SNMP_ERR_NOERROR;
+ }
+ else
+ {
+ return eocCNUServiceTable_container_load ((netsnmp_container *)
+ cache->magic);
+ }
+} /* _cache_load */
/**
* @internal
@@ -1857,8 +2183,16 @@ _cache_free(netsnmp_cache *cache, void *magic)
container = (netsnmp_container*)cache->magic;
- _container_free(container);
-} /* _cache_free */
+ if (!eoccnu_adding_service)
+ {
+ _container_free (container);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "skipping eocCNUServiceTable_cache_free, "
+ "row adding in progress\n");
+ }
+} /* _cache_free */
/**
* @internal
@@ -1891,7 +2225,7 @@ _container_free(netsnmp_container *container)
* call user code
*/
eocCNUServiceTable_container_free(container);
-
+
/*
* free all items. inefficient, but easy.
*/
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.h
index 28fbcd7319..e0591e5f11 100644
--- a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.h
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.h
@@ -9,7 +9,7 @@
* \warning This code should not be modified, called directly,
* or used to interpret functionality. It is subject to
* change at any time.
- *
+ *
* @{
*/
/*
@@ -65,7 +65,8 @@ int eocCNUServiceTable_container_size( void );
u_int eocCNUServiceTable_dirty_get( void );
void eocCNUServiceTable_dirty_set( u_int status );
- eocCNUServiceTable_rowreq_ctx * eocCNUServiceTable_allocate_rowreq_ctx(void *);
+eocCNUServiceTable_rowreq_ctx *
+eocCNUServiceTable_allocate_rowreq_ctx(eocCNUServiceTable_data *, void *);
void eocCNUServiceTable_release_rowreq_ctx(eocCNUServiceTable_rowreq_ctx *rowreq_ctx);
int eocCNUServiceTable_index_to_oid(netsnmp_index *oid_idx,