]> git.saurik.com Git - apple/network_cmds.git/blobdiff - routed.tproj/inet.c
network_cmds-307.1.1.tar.gz
[apple/network_cmds.git] / routed.tproj / inet.c
index abdb24e071d3ed64ba83e77796e3f86df79e9eb1..6b031aa99a850c4c20ce10b0234390329d7b8a91 100644 (file)
@@ -3,22 +3,21 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
- * 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.
+ * "Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
+ * Reserved.  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 1.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.apple.com/publicsource 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
  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
+ * License for the specific language governing rights and limitations
+ * under the License."
  * 
  * @APPLE_LICENSE_HEADER_END@
  */
@@ -97,7 +96,7 @@ inet_makeaddr(net, host)
 /*
  * Return the network number from an internet address.
  */
-__private_extern__
+__private_extern__ int
 inet_netof(in)
        struct in_addr in;
 {
@@ -125,6 +124,7 @@ inet_netof(in)
 /*
  * Return the host portion of an internet address.
  */
+int
 inet_lnaof(in)
        struct in_addr in;
 {
@@ -150,12 +150,13 @@ inet_lnaof(in)
        for (ifp = ifnet; ifp; ifp = ifp->int_next)
                if ((ifp->int_netmask & net) == ifp->int_net)
                        return (host &~ ifp->int_subnetmask);
-       return (host);
+       return ((int)host);
 }
 
 /*
  * Return the netmask pertaining to an internet address.
  */
+int
 inet_maskof(inaddr)
        u_long inaddr;
 {
@@ -179,7 +180,7 @@ inet_maskof(inaddr)
        for (ifp = ifnet; ifp; ifp = ifp->int_next)
                if ((ifp->int_netmask & i) == ifp->int_net)
                        mask = ifp->int_subnetmask;
-       return (htonl(mask));
+       return ((int)htonl(mask));
 }
 
 /*
@@ -187,6 +188,7 @@ inet_maskof(inaddr)
  * for an Internet host, RTF_SUBNET for a subnet,
  * 0 for a network.
  */
+int
 inet_rtflags(sin)
        struct sockaddr_in *sin;
 {
@@ -229,6 +231,7 @@ inet_rtflags(sin)
  * Send it only if dst is on the same logical network if not "internal",
  * otherwise only if the route is the "internal" route for the logical net.
  */
+int
 inet_sendroute(rt, dst)
        struct rt_entry *rt;
        struct sockaddr_in *dst;