*
* @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@
*/
/*
* Return the network number from an internet address.
*/
-__private_extern__
+__private_extern__ int
inet_netof(in)
struct in_addr in;
{
/*
* Return the host portion of an internet address.
*/
+int
inet_lnaof(in)
struct in_addr 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;
{
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));
}
/*
* for an Internet host, RTF_SUBNET for a subnet,
* 0 for a network.
*/
+int
inet_rtflags(sin)
struct sockaddr_in *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;