| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
#include "sflsock.h" char * sock_ntoa (qbyte address)
Converts an IP address in network order to a string in dotted format. The string is stored in a statically-allocated buffer that is overwritten by each call.
{ static char string [16]; /* xxx.xxx.xxx.xxx */ byte *part; /* Network order is high-low so we can address the bytes in order */ part = (byte *) &address; snprintf (string, sizeof (string), "%d.%d.%d.%d", part [0], part [1], part [2], part [3]); return (string); }
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |