| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

sock_ntoa

#include "sflsock.h"
char *
sock_ntoa (qbyte address)

Synopsis

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.

Source Code - (sflsock.c)

{
    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);
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation