Re: on 64 bit

This is a discussion on Re: on 64 bit within the SNMP Coders forums, part of the Networking and Network Related category; On Fri, 4 Jan 2008 10:37:16 +0530 deepak wrote: DB>void clSnmpOidCpy(ClSNMPRequestInfoT * pReqInfo, ClUint32T * pOid) Here ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-04-2008
Robert Story
 
Posts: n/a
Default Re: on 64 bit

On Fri, 4 Jan 2008 10:37:16 +0530 deepak wrote:
DB>void clSnmpOidCpy(ClSNMPRequestInfoT * pReqInfo, ClUint32T * pOid)

Here is one major problem.. An OID array is an array of longs, not int32. On a
64 bit system this means 8 bytes each, not 32, You should use the 'oid' type
defined in the net-snmp headers.

DB> /* COPY COLUMN OID FROM reqVar->name TO requestInfo.oid */
DB> /* oidLen is tableoid length + depth till attribute oid. So, in this case depth till column will be 2.
DB> 1-entry oid of table
DB> 2-actual column. */
DB> requestInfo.oidLen = OID_LENGTH (smCfgTblSim1TableOid) + 2;
DB> clSnmpOidCpy(&requestInfo, (ClUint32T *) reqVar->name);

I think this code is also troublesome, depending on what you are doing with
requestInfo. Here, you are copying reqVar->name, which is the OID from the
incoming request. This OID may have nothing to do with your table! Now, I
haven't played with an iterator helper in a while, so it may be that the
iterator helper, being its helpful self, has updated the requestVar with the
correct OID. But in general, handler shouldn't examine this value.

DB> index = table_info->indexes;
DB> [...]
DB> memcpy(& (requestInfo.index.smCfgTblSim1TableInfo.smCfgTblS im1IntIdx1),
DB> (void *)index->val.integer, index->val_len);

The same hold here. The table_info->indexes are the indexes of the incoming
request, not the indexes for the current row. If you are using this value to
figure out which object to get, you might be getting the wrong data.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders
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 06:55 AM.


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