regarding the "snmpNotifyFilterTable"

sanjaykumar <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi,

I have a doubt regarding the "snmpNotifyFilterTable"

I am trying to initialize the table with some default value

As i am going through the code,

which of the following function will be appropriate to initialize the
value of the table

-----------------------------------------------------------------------------------------------------------

int

snmpNotifyFilterTable_rowreq_ctx_init(snmpNotifyFilterTable_rowreq_ctx *

rowreq_ctx, void *user_init_ctx)

-----------------------------------------------------------------------------------------------------------

snmpNotifyFilterTable_rowreq_ctx *

snmpNotifyFilterTable_allocate_rowreq_ctx(void *user_init_ctx)

-----------------------------------------------------------------------------------------------------------

snmpNotifyFilterTable_data *

snmpNotifyFilterTable_allocate_data(void)

--------------------------------------------------------------------------------------------------------------

The definition of function I have copied for the quick reference

============================================================================

int

snmpNotifyFilterTable_rowreq_ctx_init(snmpNotifyFilterTable_rowreq_ctx *

rowreq_ctx, void *user_init_ctx)

{

int

snmpNotifyFilterTable_rowreq_ctx_init(snmpNotifyFilterTable_rowreq_ctx *

rowreq_ctx, void *user_init_ctx)

{

DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_rowreq_ctx_init",
"called\n"));

netsnmp_assert(NULL != rowreq_ctx);

/*

* TODO:210:o: |-> Perform extra snmpNotifyFilterTable rowreq
initialization. (eg DEFVALS)

*/

/*

* strings and oids are hard to handle automagically.

* so all we've got for you is a hint:

*

* memcpy(rowreq_ctx->data.snmpNotifyFilterMask, 0,

* len(0) * sizeof(snmpNotifyFilterMask[0]);

*/

rowreq_ctx->data.snmpNotifyFilterType =
SNMPNOTIFYFILTERTYPE_INCLUDED;

rowreq_ctx->data.snmpNotifyFilterStorageType =
STORAGETYPE_NONVOLATILE;

return MFD_SUCCESS;

}

==========================================================================

/*

*********************************************************************

* @internal

* allocate resources for a snmpNotifyFilterTable_rowreq_ctx

*/

snmpNotifyFilterTable_rowreq_ctx *

snmpNotifyFilterTable_allocate_rowreq_ctx(void *user_init_ctx)

{

snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =

SNMP_MALLOC_TYPEDEF(snmpNotifyFilterTable_rowreq_ctx);

DEBUGMSGTL(("internal:snmpNotifyFilterTable:snmpNotifyFilterTable_allocate_rowreq_ctx",
"called\n"));

if (NULL == rowreq_ctx) {

snmp_log(LOG_ERR, "Couldn't allocate memory for a "

"snmpNotifyFilterTable_rowreq_ctx.\n");

return NULL;

}

rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;

rowreq_ctx->snmpNotifyFilterTable_data_list = NULL;

/*

* if we allocated data, call init routine

*/

if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {

if (SNMPERR_SUCCESS !=

snmpNotifyFilterTable_rowreq_ctx_init(rowreq_ctx,

user_init_ctx)) {

snmpNotifyFilterTable_release_rowreq_ctx(rowreq_ctx);

rowreq_ctx = NULL;

}

}

return rowreq_ctx;

}

==================================================================

snmpNotifyFilterTable_data *

snmpNotifyFilterTable_allocate_data(void)

{

snmpNotifyFilterTable_data *rtn =

SNMP_MALLOC_TYPEDEF(snmpNotifyFilterTable_data);

DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_allocate_data",
"called\n"));

if (NULL == rtn) {

snmp_log(LOG_ERR, "unable to malloc memory for new "

"snmpNotifyFilterTable_data.\n");

}

return rtn;

} /* snmpNotifyFilterTable_allocate_data
*/

Thanks and Best Regards,

Sanjay

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.