xref: /original-bsd/usr.bin/uucp/vms/ntoa.c (revision e0399a72)
1 /*	inet_ntoa.c	4.1	83/06/12	*/
2 
3 /*
4  * Convert network-format internet address
5  * to base 256 d.d.d.d representation.
6  */
7 #include <sys/types.h>
8 #include <netinet/in.h>
9 
10 char *
11 inet_ntoa(in)
12 	struct in_addr in;
13 {
14 	static char b[18];
15 	register char *p;
16 
17 	p = (char *)&in;
18 #define	UC(b)	(((int)b)&0xff)
19 	sprintf(b, "%d.%d.%d.%d", UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3]));
20 	return (b);
21 }
22