Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, and
[unix-history] / sys / netinet / in.c
index cf26175..c3a90c3 100644 (file)
  * SUCH DAMAGE.
  *
  *     from: @(#)in.c  7.17 (Berkeley) 4/20/91
  * SUCH DAMAGE.
  *
  *     from: @(#)in.c  7.17 (Berkeley) 4/20/91
- *     $Id$
+ *     $Id: in.c,v 1.5 1993/11/18 00:08:13 wollman Exp $
  */
 
 #include "param.h"
  */
 
 #include "param.h"
+#include "systm.h"
 #include "ioctl.h"
 #include "mbuf.h"
 #include "socket.h"
 #include "ioctl.h"
 #include "mbuf.h"
 #include "socket.h"
 #include "in_systm.h"
 #include "net/if.h"
 #include "net/route.h"
 #include "in_systm.h"
 #include "net/if.h"
 #include "net/route.h"
-#include "net/af.h"
 #include "in.h"
 #include "in_var.h"
 
 #ifdef INET
 #include "in.h"
 #include "in_var.h"
 
 #ifdef INET
+struct in_ifaddr *in_ifaddr;
+struct ifqueue ipintrq;
+
+static void in_ifscrub(struct ifnet *, struct in_ifaddr *);
+
 /*
  * Formulate an Internet address from network + host.
  */
 /*
  * Formulate an Internet address from network + host.
  */
@@ -106,6 +111,7 @@ in_netof(in)
 /*
  * Compute and save network mask as sockaddr from an internet address.
  */
 /*
  * Compute and save network mask as sockaddr from an internet address.
  */
+void
 in_sockmaskof(in, sockmask)
        struct in_addr in;
        register struct sockaddr_in *sockmask;
 in_sockmaskof(in, sockmask)
        struct in_addr in;
        register struct sockaddr_in *sockmask;
@@ -193,6 +199,7 @@ int subnetsarelocal = SUBNETSARELOCAL;
  * is true, this includes other subnets of the local net.
  * Otherwise, it includes only the directly-connected (sub)nets.
  */
  * is true, this includes other subnets of the local net.
  * Otherwise, it includes only the directly-connected (sub)nets.
  */
+int
 in_localaddr(in)
        struct in_addr in;
 {
 in_localaddr(in)
        struct in_addr in;
 {
@@ -216,6 +223,7 @@ in_localaddr(in)
  * that may not be forwarded, or whether datagrams to that destination
  * may be forwarded.
  */
  * that may not be forwarded, or whether datagrams to that destination
  * may be forwarded.
  */
+int
 in_canforward(in)
        struct in_addr in;
 {
 in_canforward(in)
        struct in_addr in;
 {
@@ -240,6 +248,7 @@ extern      struct ifnet loif;
  * Ifp is 0 if not an interface-specific ioctl.
  */
 /* ARGSUSED */
  * Ifp is 0 if not an interface-specific ioctl.
  */
 /* ARGSUSED */
+int
 in_control(so, cmd, data, ifp)
        struct socket *so;
        int cmd;
 in_control(so, cmd, data, ifp)
        struct socket *so;
        int cmd;
@@ -364,7 +373,8 @@ in_control(so, cmd, data, ifp)
                oldaddr = ia->ia_dstaddr;
                ia->ia_dstaddr = *(struct sockaddr_in *)&ifr->ifr_dstaddr;
                if (ifp->if_ioctl &&
                oldaddr = ia->ia_dstaddr;
                ia->ia_dstaddr = *(struct sockaddr_in *)&ifr->ifr_dstaddr;
                if (ifp->if_ioctl &&
-                   (error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, ia))) {
+                   (error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, 
+                                             (caddr_t)ia))) {
                        ia->ia_dstaddr = oldaddr;
                        return (error);
                }
                        ia->ia_dstaddr = oldaddr;
                        return (error);
                }
@@ -463,6 +473,7 @@ in_control(so, cmd, data, ifp)
 /*
  * Delete any existing route for an interface.
  */
 /*
  * Delete any existing route for an interface.
  */
+static void
 in_ifscrub(ifp, ia)
        register struct ifnet *ifp;
        register struct in_ifaddr *ia;
 in_ifscrub(ifp, ia)
        register struct ifnet *ifp;
        register struct in_ifaddr *ia;
@@ -481,10 +492,12 @@ in_ifscrub(ifp, ia)
  * Initialize an interface's internet address
  * and routing table entry.
  */
  * Initialize an interface's internet address
  * and routing table entry.
  */
+int
 in_ifinit(ifp, ia, sin, scrub)
        register struct ifnet *ifp;
        register struct in_ifaddr *ia;
        struct sockaddr_in *sin;
 in_ifinit(ifp, ia, sin, scrub)
        register struct ifnet *ifp;
        register struct in_ifaddr *ia;
        struct sockaddr_in *sin;
+       int scrub;
 {
        register u_long i = ntohl(sin->sin_addr.s_addr);
        struct sockaddr_in oldaddr;
 {
        register u_long i = ntohl(sin->sin_addr.s_addr);
        struct sockaddr_in oldaddr;
@@ -497,7 +510,8 @@ in_ifinit(ifp, ia, sin, scrub)
         * if this is its first address,
         * and to validate the address if necessary.
         */
         * if this is its first address,
         * and to validate the address if necessary.
         */
-       if (ifp->if_ioctl && (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, ia))) {
+       if (ifp->if_ioctl && (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, 
+                                                      (caddr_t)ia))) {
                splx(s);
                ia->ia_addr = oldaddr;
                return (error);
                splx(s);
                ia->ia_addr = oldaddr;
                return (error);
@@ -571,6 +585,7 @@ in_iaonnetof(net)
 /*
  * Return 1 if the address might be a local broadcast address.
  */
 /*
  * Return 1 if the address might be a local broadcast address.
  */
+int
 in_broadcast(in)
        struct in_addr in;
 {
 in_broadcast(in)
        struct in_addr in;
 {