]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/libkern/inet_ntop.c
xnu-1228.tar.gz
[apple/xnu.git] / bsd / libkern / inet_ntop.c
index a41cd2ba9e12d42bd129c8d5d2ba389970779f26..dc07273181e745d499cacb5f820b9968e5546e68 100644 (file)
@@ -1,14 +1,19 @@
 /*
  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  *
- * @APPLE_LICENSE_HEADER_START@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ * 
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
  * 
  * The Original Code and all software distributed under the License are
  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
@@ -18,7 +23,7 @@
  * Please see the License for the specific language governing rights and
  * limitations under the License.
  * 
- * @APPLE_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 
 /*
@@ -58,7 +63,7 @@
 static const char *hexchars = "0123456789abcdef";
 
 static const char *
-inet_ntop4(const struct in_addr *addr, char *buf, size_t len)
+inet_ntop4(const struct in_addr *addr, char *buf, socklen_t len)
 {
        const u_int8_t *ap = (const u_int8_t *)&addr->s_addr;
        char tmp[MAX_IPv4_STR_LEN]; /* max length of ipv4 addr string */
@@ -81,7 +86,7 @@ inet_ntop4(const struct in_addr *addr, char *buf, size_t len)
 }
 
 static const char *
-inet_ntop6(const struct in6_addr *addr, char *dst, size_t size)
+inet_ntop6(const struct in6_addr *addr, char *dst, socklen_t size)
 {
        char hexa[8][5], tmp[MAX_IPv6_STR_LEN];
        int zr[8];
@@ -199,7 +204,7 @@ inet_ntop6(const struct in6_addr *addr, char *dst, size_t size)
 }
 
 const char *
-inet_ntop(int af, const void *addr, char *buf, size_t len)
+inet_ntop(int af, const void *addr, char *buf, socklen_t len)
 {
        if(af==AF_INET6)
                return inet_ntop6(addr, buf, len);