On Tue, 01 Nov 2005 09:07:49 +0000 Dave wrote:
DS> An IPv4 address is a fixed-length *binary* string,

Actually, he's asking about InetAddress, which is ip version neutral, so it
is a variable length string.

DS> So this code would actually be more like:
DS> 
DS>    char  localhost[4];
DS>    localhost[0] = 127;
DS>    localhost[1] = 0;
DS>    localhost[2] = 0;
DS>    localhost[3] = 1;

So the correct code would be:

    char  localhost[5];
    localhost[0] = 4;
    localhost[1] = 127;
    localhost[2] = 0;
    localhost[3] = 0;
    localhost[4] = 1;
  
    snmp_set_var_typed_value( var, ASN_OCTET_STR,
                                   localhost, 5);


-- 
NOTE: messages sent directly to me, instead of the lists, will be deleted
      unless they are requests for paid consulting services.

Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to