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: }

Defined functions

inet_ntoa defined in line 10; used 1 times

Defined macros

UC defined in line 18; used 4 times
  • in line 19(4)
Last modified: 1986-01-11
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 745
Valid CSS Valid XHTML 1.0 Strict