]> git.saurik.com Git - apple/network_cmds.git/blobdiff - routed.tproj/input.c
network_cmds-307.1.1.tar.gz
[apple/network_cmds.git] / routed.tproj / input.c
index 443a4950c108bbf3ad633160c5c97588ddfb59bd..e6d2626264f51390b616d022f61babdb6fbbdb8a 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@
  */
@@ -67,6 +66,7 @@
 /*
  * Process a newly received packet.
  */
+void
 rip_input(from, rip, size)
        struct sockaddr *from;
        register struct rip *rip;
@@ -106,16 +106,6 @@ rip_input(from, rip, size)
                        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
@@ -138,13 +128,6 @@ rip_input(from, rip, size)
 #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;
@@ -226,15 +209,6 @@ rip_input(from, rip, size)
                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 ==
@@ -347,7 +321,7 @@ rip_input(from, rip, size)
                    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;
@@ -363,7 +337,7 @@ rip_input(from, rip, size)
                        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;