Bluehost.com Web Hosting $6.95

Problem with sprint_realloc_iteger()

This is a discussion on Problem with sprint_realloc_iteger() within the SNMP Users forums, part of the Networking and Network Related category; This is a multi-part message in MIME format. --------------000307020406030803040508 Content-Type: text/plain; charset=us-ascii; format=flowed Content-...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-15-2006
Rashmi M Bangera
 
Posts: n/a
Default Problem with sprint_realloc_iteger()

This is a multi-part message in MIME format.
--------------000307020406030803040508
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I am implementing ethernetlike interface mib.I compiled the
MIB file using mib2c iterate_access.conf. I have used ioctl calls to
fetch the data and it is set in the get_first_data_item and
get_next_data_item.
The problem is, when i use snmptable command, the code fails at
sprintf() statement in the sprint_realloc_integer() function.

case MODE_GET:
switch (table_info->colnum) {
case COLUMN_DOT3STATSINDEX:
{
long *index;
size_t len;
index = getIndex(data_context,&len);
smp_set_var_typed_value(var, ASN_INTEGER,
(u_char *)index
,len);
}
break;

i am using net-snmp version 5.1.3

Thanks,
-Rashmi

--------------000307020406030803040508
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="adobe-courier-iso10646-1">I am implementing
ethernetlike interface mib.</font></font><font size="-1"><font
face="adobe-courier-iso10646-1">I compiled the<br>
MIB file using mib2c iterate_access.conf. I have used ioctl calls to<br>
fetch the data and it is set in the get_first_data_item and
get_next_data_item.<br>
The problem is, when i use snmptable command, the code fails at<br>
sprintf() statement in the sprint_realloc_integer() function.</font></font><font
size="-1"><font face="adobe-courier-iso10646-1">
<br>
<br>
case MODE_GET:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp; switch (table_info-&gt;colnum) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp; case COLUMN_DOT3STATSINDEX:<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; long *index;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; size_t len;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; index = getIndex(data_context,&amp;len);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; smp_set_var_typed_value(var, ASN_INTEGER,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (u_char *)index<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ,len);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
<br>
i am using net-snmp version 5.1.3<br>
<br>
Thanks,<br>
-Rashmi</font></font>
</body>
</html>

--------------000307020406030803040508--


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=...720&dat=121642
_______________________________________________
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 03:32 AM.


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