[AGENT++] Vb::get_value(...) and IP-address

Karl Abicht karl at abicht.info
Wed Aug 25 15:56:18 CEST 2004


Hello Frank,

good idea ==> works fine !

But, I have another problem using IpAddress.

see this:

            IpAddress ipa;
            ipa[0] = buffer[0];
            ipa[1] = buffer[1];
            ipa[2] = buffer[2];
            ipa[3] = buffer[3];
        
            vb.set_value(ipa);


If I return this vb to the browser(MG) I see an empty string. 
(of type ipaddress)

How can I make use of format_output() ?
I don't want to use any DNS lookups.
I just want i.e. 192.168.2.100.


Thanks,

Karl


> Hello Karl,
> 
> In case of an IpAddress syntax, you will have to use the 
> MibLeaf::get_value(SnmpSyntax&)
> method to extract the leaf's value. For example:
> 
> IpAddress ipAddress;
> myMibLeaf->get_value(ipAddress);
> 
> Hope this helps.
> 
> Best regards,
> Frank
> 
> Karl Abicht wrote:
> 
> >Hello Frank,
> >
> >how to get an IP-address from a Vb.
> >
> >My browser sends an IP-address, I receive a Vb of type
> sNMP_SYNTAX_IPADDR.
> >But, if I try to get the value with get_value(unsigned char *ptr,
> unsigned
> >long &len) it fails because the method expects sNMP_SYNTAX_OCTETS.
> >
> >
> >
> >Regards,
> >
> >Karl
> >
> >  
> >
> 
> 

-- 
Dipl.-Ing. Karl Abicht
Eichenweg 11
25582 Hohenaspe

mailto: karl at abicht.net
phone: +49 4893 373115
mobile: +49 172 4566432
site: http://www.abicht.net



-- 
Dipl.-Ing. Karl Abicht
Eichenweg 11
25582 Hohenaspe

mailto: karl at abicht.net
phone: +49 4893 373115
mobile: +49 172 4566432
site: http://www.abicht.net




More information about the AGENTPP mailing list