expand parameters to functions; READDIR drops eofflag;
[unix-history] / usr / src / sys / netiso / esis.c
index b294103..9e5f6c1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)esis.c      7.18 (Berkeley) %G%
+ *     @(#)esis.c      7.21 (Berkeley) %G%
  */
 
 /***********************************************************
  */
 
 /***********************************************************
@@ -42,11 +42,9 @@ SOFTWARE.
 #include "mbuf.h"
 #include "domain.h"
 #include "protosw.h"
 #include "mbuf.h"
 #include "domain.h"
 #include "protosw.h"
-#include "user.h"
 #include "socket.h"
 #include "socketvar.h"
 #include "errno.h"
 #include "socket.h"
 #include "socketvar.h"
 #include "errno.h"
-#include "kernel.h"
 
 #include "../net/if.h"
 #include "../net/if_dl.h"
 
 #include "../net/if.h"
 #include "../net/if_dl.h"
@@ -62,6 +60,7 @@ SOFTWARE.
 #include "clnp_stat.h"
 #include "esis.h"
 #include "argo_debug.h"
 #include "clnp_stat.h"
 #include "esis.h"
 #include "argo_debug.h"
+#include "kernel.h"
 
 /*
  *     Global variables to esis implementation
 
 /*
  *     Global variables to esis implementation
@@ -73,6 +72,7 @@ SOFTWARE.
  *
  */
 struct rawcb   esis_pcb;
  *
  */
 struct rawcb   esis_pcb;
+int                            esis_config(), snpac_age();
 int                            esis_sendspace = 2048;
 int                            esis_recvspace = 2048;
 short                  esis_holding_time = ESIS_HT;
 int                            esis_sendspace = 2048;
 int                            esis_recvspace = 2048;
 short                  esis_holding_time = ESIS_HT;
@@ -106,7 +106,6 @@ esis_init()
 {
        extern struct clnl_protosw clnl_protox[256];
        int     esis_input(), isis_input();
 {
        extern struct clnl_protosw clnl_protox[256];
        int     esis_input(), isis_input();
-       int     esis_config(), snpac_age();
 #ifdef ISO_X25ESIS
        int     x25esis_input();
 #endif ISO_X25ESIS
 #ifdef ISO_X25ESIS
        int     x25esis_input();
 #endif ISO_X25ESIS
@@ -145,7 +144,7 @@ struct mbuf         *control;       /* optional control */
        struct rawcb *rp = sotorawcb(so);
        int error = 0;
 
        struct rawcb *rp = sotorawcb(so);
        int error = 0;
 
-       if (suser(u.u_cred, &u.u_acflag)) {
+       if ((so->so_state & SS_PRIV) == 0) {
                error = EACCES;
                goto release;
        }
                error = EACCES;
                goto release;
        }
@@ -418,7 +417,7 @@ struct rtentry              *rt;                    /* snpa cache info regarding next hop of
        siso.siso_nlen = 6 + 1; /* should be taken from snpa_hdr */
                                                                                /* +1 is for AFI */
        bcopy(inbound_shp->snh_shost, siso.siso_data + 1, 6);
        siso.siso_nlen = 6 + 1; /* should be taken from snpa_hdr */
                                                                                /* +1 is for AFI */
        bcopy(inbound_shp->snh_shost, siso.siso_data + 1, 6);
-       (ifp->if_output)(ifp, m0, &siso, 0);
+       (ifp->if_output)(ifp, m0, (struct sockaddr *)&siso, 0);
 }
 
 /*
 }
 
 /*
@@ -895,7 +894,7 @@ struct      iso_addr *isoa;
        siso.siso_data[0] = AFI_SNA;
        siso.siso_nlen = sn_len + 1;
        bcopy(sn_addr, siso.siso_data + 1, (unsigned)sn_len);
        siso.siso_data[0] = AFI_SNA;
        siso.siso_nlen = sn_len + 1;
        bcopy(sn_addr, siso.siso_data + 1, (unsigned)sn_len);
-       (ifp->if_output)(ifp, m0, &siso, 0);
+       (ifp->if_output)(ifp, m0, (struct sockaddr *)&siso, 0);
 }
 
 /*
 }
 
 /*
@@ -941,9 +940,9 @@ struct snpa_hdr     *shp;   /* subnetwork header */
                }
                if (mm = m_copy(m0, 0, M_COPYALL)) { /*can't block at interrupt level */
                        if (sbappendaddr(&rp->rcb_socket->so_rcv,
                }
                if (mm = m_copy(m0, 0, M_COPYALL)) { /*can't block at interrupt level */
                        if (sbappendaddr(&rp->rcb_socket->so_rcv,
-                                                         &esis_dl, mm, (struct mbuf *)0) != 0)
+                                                         &esis_dl, mm, (struct mbuf *)0) != 0) {
                                sorwakeup(rp->rcb_socket);
                                sorwakeup(rp->rcb_socket);
-                       else {
+                        } else {
                                IFDEBUG(D_ISISINPUT)
                                        printf("Error in sbappenaddr, mm = 0x%x\n", mm);
                                ENDDEBUG
                                IFDEBUG(D_ISISINPUT)
                                        printf("Error in sbappenaddr, mm = 0x%x\n", mm);
                                ENDDEBUG
@@ -969,7 +968,7 @@ struct mbuf *m;
        int error = 0;
        unsigned sn_len;
 
        int error = 0;
        unsigned sn_len;
 
-       ifa = ifa_ifwithnet(sdl);       /* extract ifp from sockaddr_dl */
+       ifa = ifa_ifwithnet((struct sockaddr *)sdl);    /* get ifp from sdl */
        if (ifa == 0) {
                IFDEBUG(D_ISISOUTPUT)
                        printf("isis_output: interface not found\n");
        if (ifa == 0) {
                IFDEBUG(D_ISISOUTPUT)
                        printf("isis_output: interface not found\n");