MIBs for Dummies - row context initialization question
"Josh Tolley" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
I'm trying to get used to the generated code from mib2c using the MIBs
for Dummies config file, and I think I'm missing something that should
be obvious. In the main table header (eg. myTable.h) it defines a row
context structure, which contains among other things a table data
structure called data. That structure contains fields of appropriate
types for each of the non-index columns in the table, as well as
size_t fields to contain the length of each data field. For each table
row, the generated template code (myTable_data_access.c) generates a
new row context struct with myTable_allocate_rowreq_ctx(), calls
myTable_indexes_set() on the new context structure, and then in turn
sets each data member. The code looks like this:
if ((NULL == rowreq_ctx->data.myEntryName) ||
(rowreq_ctx->data.myEntryName_len < (myEntryName_len *
sizeof(rowreq_ctx->data.myEntryName[0])))) {
snmp_log(LOG_ERR,"not enough space for value\n");
return MFD_ERROR;
}
When I run this, I always get the "not enough space for value" error,
because, if I read this correctly, nothing has ever initialized the
rowreq_ctx->data.myEntryName_len value. Does that initialization
happen somewhere in the template code, and I just missed it? Do I have
to do it manually somewhere, and if so, where? Am I just reading it
completely wrong? Many thanks for any light you can shed on this for
me.
-Josh
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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