#include <stdio.h>
#include <strings.h>

static char const rcsid[] = "$Id: rv_inttoip.c,v 1.1 2002/08/15 23:15:48 ttraffic Exp $";

char* rv_inttoip (unsigned int ipno, char* point) {
/*    ============

   Converts an unsigned int ("0x01020304") into a standard IP number (1.2.3.4);
   Space for the string must have been alloced in the calling routine.

   $Author: ttraffic $
   $Date: 2002/08/15 23:15:48 $
   $Revision: 1.1 $

*/
   int byte[4], i;

   for (i=0 ; i<4 ; i++) {
      byte[i] = ipno & 0xFF;
      ipno = ipno / 0x100;
   }

   sprintf (point, "%d.%d.%d.%d", byte[3], byte[2], byte[1], byte[0]);

   return point;
}
