Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv21334/src
Modified Files:
Tag: rel-1_0
common.h tools.c
Log Message:
intoa() added (network byte order IP to normal dotted notation)
Index: common.h
===================================================================
RCS file: /cvsroot/srvx/services/src/common.h,v
retrieving revision 1.60.2.6
retrieving revision 1.60.2.7
diff -C2 -r1.60.2.6 -r1.60.2.7
*** common.h 2001/08/03 22:17:28 1.60.2.6
--- common.h 2001/08/12 22:18:58 1.60.2.7
***************
*** 194,197 ****
--- 194,198 ----
void intervalString(char *output, time_t interval);
int getipbyname(const char *name, unsigned long *ip);
+ char *intoa(unsigned long addr);
const char * preposition(char *word);
Index: tools.c
===================================================================
RCS file: /cvsroot/srvx/services/src/tools.c,v
retrieving revision 1.73.2.23
retrieving revision 1.73.2.24
diff -C2 -r1.73.2.23 -r1.73.2.24
*** tools.c 2001/08/07 17:30:44 1.73.2.23
--- tools.c 2001/08/12 22:18:58 1.73.2.24
***************
*** 44,47 ****
--- 44,54 ----
#include <sys/socket.h>
#endif
+ #ifdef HAVE_NETINET_IN_H
+ #include <netinet/in.h>
+ #endif
+ #ifdef HAVE_ARPA_INET_H
+ #include <arpa/inet.h>
+ #endif
+
#include "common.h"
***************
*** 927,929 ****
--- 934,943 ----
memmove(buf->list+from+repl_len, buf->list+from+len, strlen(buf->list+from+len));
strcpy(buf->list+from, repl);
+ }
+
+ char *intoa(unsigned long addr) {
+ struct in_addr in;
+
+ in.s_addr = addr;
+ return inet_ntoa(in);
}
|