On Sun, 22 Jul 2001, Francois Deppierraz wrote:

> Etrangement on dirait que c'est plut�t la stack TCP/IP qui g�re les
> adresses IP encod�es sous cette forme.

aha :)

> francois@gollum:/tmp$ ping -c 1 3322253288
> PING 3322253288 (198.5.143.232) from 192.168.0.10 : 56(84) bytes of data.

et c'est encod� big endian, soit network order.

Petit programme de mon cru:

  <vulcan> schaefer:/usr/users/schaefer> virtual_connection 3322253288 80
   Trying to 8bit-connect to 3322253288 on port 80 ...
   Connected-8bit.

Donc

   server.sin_family = AF_INET;
   hp = gethostbyname(host);

� voir, malgr� la documentation de gethostbyname(3)

       Here name is either a
       host name, or an IPv4 address in standard dot notation, or
       an IPv6 address in colon (and possibly dot) notation. (See
       RFC 1884 for the description of IPv6 addresses.)

il semblerait que gethostbyname() support effectivement cela.

Marrant, on apprend tous les jours, quoi :)

--
http://www-internal.alphanet.ch/linux-leman/ avant de poser
une question. Ouais, pour se d�sabonner aussi.

Répondre à