Re: Reg: where we can get snmpsettable value.

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
    [ First - *please* don't mail me privately, without copying
     any responses to the mailing list.  I don't have the time
     or inclination to offer private, unpaid, SNMP consultancy.
     Keep discussions to the list, where others can both learn
     and offer advice.  Thanks.   ]

On 22 July 2010 05:30, Thazhai Arasan <[email protected]> wrote:
>
>   Suppose if i want to pass the integer value "1" for another value, same
> thing happened (value is not set) do i need to write any function to convert
> the var_val to array of char ?

No - just cast the var_val parameter accordingly.
>From mibII/route_write.c:

     case IPROUTEMETRIC1:
         if ( action == RESERVE1 ) {
             if ( var_val_type != ASN_INTEGER)              [value
must be an integer]
                 // error

             long val  =   *((long *)var_val);
[extract the new value]

             if ( val < -1 )
 [is this new value valid]
                 // error
         }


Don't get confused by the var_val being 'char *'
It's probably better to think of this as 'void *'
It's a generic pointer, that points to the new value.

Dave

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
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.