MIBs for Dummies - row context initialization question

This is a discussion on MIBs for Dummies - row context initialization question within the SNMP Users forums, part of the Networking and Network Related category; I'm trying to get used to the generated code from mib2c using the MIBs for Dummies config file, and ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2007
Josh Tolley
 
Posts: n/a
Default MIBs for Dummies - row context initialization question

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?p...rge&CID=DEVDEV
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:53 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0