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

Karl Abicht karl at abicht.info
Thu Aug 26 08:57:51 CEST 2004


Hi,

setting "0.0.0.0" and 'valid' as default is good.

But, if a value is set by [] you should check all values and set the
'valid'-flag according to this.

If I do ip[0]=300 the flag should be false.


Regards,

Karl


> Hi,
> 
> you hit a bug in address classes.
> 
> > But, I have another problem using IpAddress.
> 
> >             IpAddress ipa;
> 
> The "valid" flag for a Address object created this way is "false"
> 
> >             ipa[0] = buffer[0];
> >             ipa[1] = buffer[1];
> >             ipa[2] = buffer[2];
> >             ipa[3] = buffer[3];
> 
> These set-functions don't change the "valid" flag, as they cannot know 
> when the address is valid.
> 
> >             vb.set_value(ipa);
> 
> So an invalid address is added to the Vb, which therefore hasn't a valid 
> value and returns a zero string for get_value().
> 
> The solution would be to define that an Address created like above 
> defaults to "0.0.0.0" which is a "valid" address. Additionally the valid 
> flag should be set to true whenever operator[] is called.
> 
> Any objections against these two changes? If yes, provide a better 
> solution ;-)
> 
> Regards,
>    Jochen
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://agentpp.org/mailman/listinfo/agentpp
> 

-- 
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



-- 
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