Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
/* posix */
2
#include <sys/types.h>
3
#include <unistd.h>
4
#include <stdlib.h>
5
#include <stdio.h>
6
 
7
/* bsd extensions */
8
#include <sys/uio.h>
9
#include <sys/socket.h>
10
#include <netinet/in.h>
11
#include <sys/un.h>
12
 
13
char*
14
inet_ntoa(struct in_addr in)
15
{
16
	static char s[18];
17
	unsigned char *p;	
18
 
19
	p = (unsigned char*)&in.s_addr;
20
	snprintf(s, sizeof s, "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
21
	return s;
22
}