[ 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 <thazhaiara...@gmail.com> 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
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to