Ethereal-dev: Re: [Ethereal-dev] Validating IPs?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Alex Kirk <alex@xxxxxxxxxxxx>
Date: Thu, 27 Jan 2005 14:22:17 -0500
Already had, actually. There's nothing that extracts IP addresses directly (at
least not that I can see), and getting the bytes individually with
tvb_get_guint8(), converting them to a string with dots, and then calling
inet_aton() seemed wasteful.

Am I missing something obvious in there?

Alex Kirk

> you might want to take a look at epan/tvbuff.h
> 
> 
> On Thu, 27 Jan 2005 13:46:43 -0500, Alex Kirk <alex@xxxxxxxxxxxx> wrote:
> > Hello Again,
> > 
> > Sorry if this is coming to the wrong list -- please let me know if there's
> > somewhere else I should be sending this message.
> > 
> > Anyway, very quick question: is there a generally accepted way of
> determining
> > whether a sequence of four bytes in a tvbuff represent an IP address?
> > inet_aton() isn't helpful, since it looks for a dotted decimal string, and
> I'm
> > not seeing much else I could use. I'm certain I'm not the first person to
> have
> > come across this, so pointers to existing docs that I may be missing would
> be
> > just as welcome as a quick "use this function."
> > 
> > Thanks,
> > Alex Kirk
> > 
> > _______________________________________________
> > Ethereal-dev mailing list
> > Ethereal-dev@xxxxxxxxxxxx
> > http://www.ethereal.com/mailman/listinfo/ethereal-dev
> >
> 
> _______________________________________________
> Ethereal-dev mailing list
> Ethereal-dev@xxxxxxxxxxxx
> http://www.ethereal.com/mailman/listinfo/ethereal-dev
>