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: Jaap Keuter <jaap.keuter@xxxxxxxxx>
Date: Fri, 28 Jan 2005 00:11:45 +0100 (CET)
On Thu, 27 Jan 2005, Alex Kirk wrote:

Check out ip_to_str() in epan/to_str.c
If it's for presentation purposes use FT_IPv4.

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