Merged silc_1_0_branch to trunk.
[silc.git] / lib / silcutil / win32 / silcwin32net.c
index 0ff72b33d7cd8ee1917d40135aca819de0ae5dad..0bcd038dcc130de44b798611fa7bd1c3c3fb11ff 100644 (file)
@@ -4,12 +4,11 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 1997 - 2001 Pekka Riikonen
+  Copyright (C) 1997 - 2005 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
+  the Free Software Foundation; version 2 of the License.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,6 +18,8 @@
 */
 /* $Id$ */
 
+/* XXX IPv6 support missing */
+
 #include "silcincludes.h"
 #include "silcnet.h"
 
@@ -222,7 +223,7 @@ void silc_net_close_connection(int sock)
 /* Converts the IP number string from numbers-and-dots notation to
    binary form. */
 
-bool silc_net_addr2bin(const char *addr, void *bin, uint32 bin_len);
+bool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len)
 {
   unsigned long ret;
 
@@ -231,25 +232,7 @@ bool silc_net_addr2bin(const char *addr, void *bin, uint32 bin_len);
   if (bin_len < 4)
     return FALSE;
 
-  memcpy(bin, (unsigned char *)&tmp.s_addr, 4);
-  return ret != INADDR_NONE;
-}
-
-/* Converts the IP number string from numbers-and-dots notation to
-   binary form in network byte order. */
-
-bool silc_net_addr2bin_ne(const char *addr, unsigned char *bin,
-                         uint32 bin_len)
-{
-  unsigned long ret;
-
-  ret = inet_addr(addr);
-
-  if (bin_len < 4)
-    return FALSE;
-
-  SILC_PUT32_MSB(ret, bin);
-
+  memcpy(bin, (unsigned char *)&ret, 4);
   return ret != INADDR_NONE;
 }