[ECOS] IP stack: gethostbyname, gethostbyaddr

Andrew Lunn andrew.lunn@ascom.ch
Thu Mar 15 07:51:00 GMT 2001


On Thu, Mar 15, 2001 at 03:26:06PM +0100, Fano Ramparany wrote:
> Given that gethostbyname and gethostbyaddr (defined in file gethost.c)
> are not implemented yet, is there a way to make a tcp connection to a
> given host (I'd like to develop a client application on my target).

Yes. These functions just do address resolution using DNS and
/etc/hosts etc. If you know the IP address, eg, 192.168.9.32 call
inet_aton and it will return a value to put into an sockaddr structure
and pass to connect.

If you want to use names, thats another matter. There is no DNS
support yet. Its something i keep thinking about, but never get around
to. It should not be too hard to port resolv from bind.

        Andrew



More information about the Ecos-discuss mailing list