home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
network
/
netlib_1
/
NetLibSrc
/
c
/
ntoa
< prev
next >
Wrap
Text File
|
1995-02-28
|
398b
|
20 lines
#include <stdio.h>
#include "arpa/inet.h"
#include "netinet/in.h"
/*
* Format an internet address in string form
*/
char *inet_ntoa(struct in_addr in)
{
static char string[16];
/* Print the string into the buffer */
sprintf(string, "%ld.%ld.%ld.%ld", in.s_addr & 0xff,
(in.s_addr >> 8) & 0xff, (in.s_addr >> 16) & 0xff,
(in.s_addr >> 24) & 0xff);
return string;
}