*
* @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@
*/
/*
* Process a newly received packet.
*/
+void
rip_input(from, rip, size)
struct sockaddr *from;
register struct rip *rip;
if (count < sizeof (struct netinfo))
break;
count -= sizeof (struct netinfo);
-
-#if BSD < 198810
- if (sizeof(n->rip_dst.sa_family) > 1) /* XXX */
- n->rip_dst.sa_family = ntohs(n->rip_dst.sa_family);
-#else
-#define osa(x) ((struct osockaddr *)(&(x)))
- n->rip_dst.sa_family =
- ntohs(osa(n->rip_dst)->sa_family);
- n->rip_dst.sa_len = sizeof(n->rip_dst);
-#endif
n->rip_metric = ntohl(n->rip_metric);
/*
* A single entry with sa_family == AF_UNSPEC and
#define min(a, b) (a < b ? a : b)
n->rip_metric = rt == 0 ? HOPCNT_INFINITY :
min(rt->rt_metric + 1, HOPCNT_INFINITY);
-#if BSD < 198810
- if (sizeof(n->rip_dst.sa_family) > 1) /* XXX */
- n->rip_dst.sa_family = htons(n->rip_dst.sa_family);
-#else
- osa(n->rip_dst)->sa_family =
- htons(n->rip_dst.sa_family);
-#endif
n->rip_metric = htonl(n->rip_metric);
}
rip->rip_cmd = RIPCMD_RESPONSE;
for (; size > 0; size -= sizeof (struct netinfo), n++) {
if (size < sizeof (struct netinfo))
break;
-#if BSD < 198810
- if (sizeof(n->rip_dst.sa_family) > 1) /* XXX */
- n->rip_dst.sa_family =
- ntohs(n->rip_dst.sa_family);
-#else
- n->rip_dst.sa_family =
- ntohs(osa(n->rip_dst)->sa_family);
- n->rip_dst.sa_len = sizeof(n->rip_dst);
-#endif
n->rip_metric = ntohl(n->rip_metric);
if (n->rip_dst.sa_family >= af_max ||
(afp = &afswitch[n->rip_dst.sa_family])->af_hash ==
timercmp(&nextbcast, &now, <)) {
if (traceactions)
fprintf(ftrace, "send dynamic update\n");
- toall(supply, RTS_CHANGED, ifp);
+ toall((int (*)())supply, RTS_CHANGED, ifp);
lastbcast = now;
needupdate = 0;
nextbcast.tv_sec = 0;
delay = RANDOMDELAY();
if (traceactions)
fprintf(ftrace,
- "inhibit dynamic update for %d usec\n",
+ "inhibit dynamic update for %lu usec\n",
delay);
nextbcast.tv_sec = delay / 1000000;
nextbcast.tv_usec = delay % 1000000;