minor fixes
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Sat, 6 Mar 1982 06:07:13 +0000 (22:07 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Sat, 6 Mar 1982 06:07:13 +0000 (22:07 -0800)
SCCS-vsn: sys/deprecated/netimp/if_imp.c 4.11
SCCS-vsn: sys/netinet/in.h 4.10
SCCS-vsn: sys/net/raw_cb.c 4.4
SCCS-vsn: sys/deprecated/netimp/raw_imp.c 4.7
SCCS-vsn: sys/deprecated/netpup/raw_pup.c 4.6
SCCS-vsn: sys/net/raw_usrreq.c 4.8

usr/src/sys/deprecated/netimp/if_imp.c
usr/src/sys/deprecated/netimp/raw_imp.c
usr/src/sys/deprecated/netpup/raw_pup.c
usr/src/sys/net/raw_cb.c
usr/src/sys/net/raw_usrreq.c
usr/src/sys/netinet/in.h

index 9a86541..ec5b15a 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_imp.c        4.10    82/02/27        */
+/*     if_imp.c        4.11    82/03/05        */
 
 #include "imp.h"
 #if NIMP > 0
 
 #include "imp.h"
 #if NIMP > 0
@@ -87,7 +87,7 @@ COUNT(IMPATTACH);
        ifp->if_mtu = IMP_MTU;
        ifp->if_net = ui->ui_flags;
        /* the host and imp fields will be filled in by the imp */
        ifp->if_mtu = IMP_MTU;
        ifp->if_net = ui->ui_flags;
        /* the host and imp fields will be filled in by the imp */
-       ifp->if_addr.s_addr = if_makeaddr(ifp->if_net, 0);
+       ifp->if_addr = if_makeaddr(ifp->if_net, 0);
        ifp->if_init = impinit;
        ifp->if_output = impoutput;
        /* reset is handled at the hardware level */
        ifp->if_init = impinit;
        ifp->if_output = impoutput;
        /* reset is handled at the hardware level */
@@ -215,7 +215,7 @@ COUNT(IMPINPUT);
                        hostreset(sc->imp_if.if_net);   /* XXX */
                        impnoops(sc);
                }
                        hostreset(sc->imp_if.if_net);   /* XXX */
                        impnoops(sc);
                }
-               goto drop;
+               goto rawlinkin;
 
        /*
         * IMP going down.  Print message, and if not immediate,
 
        /*
         * IMP going down.  Print message, and if not immediate,
@@ -228,7 +228,7 @@ COUNT(IMPINPUT);
                        timeout(impdown, sc, 30 * hz);
                }
                impmsg(sc, "going down %s", impmessage[ip->il_link&IMP_DMASK]);
                        timeout(impdown, sc, 30 * hz);
                }
                impmsg(sc, "going down %s", impmessage[ip->il_link&IMP_DMASK]);
-               goto drop;
+               goto rawlinkin;
 
        /*
         * A NOP usually seen during the initialization sequence.
 
        /*
         * A NOP usually seen during the initialization sequence.
@@ -243,9 +243,9 @@ COUNT(IMPINPUT);
                        sc->imp_dropcnt = IMP_DROPCNT;
                }
                if (sc->imp_state != IMPS_INIT)
                        sc->imp_dropcnt = IMP_DROPCNT;
                }
                if (sc->imp_state != IMPS_INIT)
-                       goto drop;
+                       goto rawlinkin;
                if (--sc->imp_dropcnt > 0)
                if (--sc->imp_dropcnt > 0)
-                       goto drop;
+                       goto rawlinkin;
                sc->imp_state = IMPS_UP;
                sin = &sc->imp_if.if_addr;
                sc->imp_if.if_host[0] = sin->s_host = ip->il_host;
                sc->imp_state = IMPS_UP;
                sin = &sc->imp_if.if_addr;
                sc->imp_if.if_host[0] = sin->s_host = ip->il_host;
@@ -254,7 +254,7 @@ COUNT(IMPINPUT);
                        ntohs(ip->il_imp));
                /* restart output in case something was q'd */
                (*sc->imp_cb.ic_start)(sc->imp_if.if_unit);
                        ntohs(ip->il_imp));
                /* restart output in case something was q'd */
                (*sc->imp_cb.ic_start)(sc->imp_if.if_unit);
-               goto drop;
+               goto rawlinkin;
        }
 
        /*
        }
 
        /*
@@ -305,11 +305,11 @@ COUNT(IMPINPUT);
        case IMPTYPE_RESET:
                impmsg(sc, "interface reset");
                impnoops(sc);
        case IMPTYPE_RESET:
                impmsg(sc, "interface reset");
                impnoops(sc);
-               goto drop;
+               goto rawlinkin;
 
        default:
                sc->imp_if.if_collisions++;             /* XXX */
 
        default:
                sc->imp_if.if_collisions++;             /* XXX */
-               goto drop;
+               goto rawlinkin;
        }
 
        /*
        }
 
        /*
index 6ed92b3..f59b655 100644 (file)
@@ -1,4 +1,4 @@
-/*     raw_imp.c       4.6     82/02/16        */
+/*     raw_imp.c       4.7     82/03/05        */
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
@@ -10,7 +10,7 @@
 #include "../net/if.h"
 #include "../net/if_imp.h"
 #include "../net/raw_cb.h"
 #include "../net/if.h"
 #include "../net/if_imp.h"
 #include "../net/raw_cb.h"
-#include "/usr/include/errno.h"
+#include "../errno.h"
 
 /*
  * Raw interface to IMP.
 
 /*
  * Raw interface to IMP.
index b4c4ca2..65963da 100644 (file)
@@ -1,4 +1,4 @@
-/*     raw_pup.c       4.5     82/03/05        */
+/*     raw_pup.c       4.6     82/03/05        */
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
@@ -9,6 +9,7 @@
 #include "../net/in_systm.h"
 #include "../net/pup.h"
 #include "../net/raw_cb.h"
 #include "../net/in_systm.h"
 #include "../net/pup.h"
 #include "../net/raw_cb.h"
+#include "../net/if.h"
 #include "../errno.h"
 
 /*
 #include "../errno.h"
 
 /*
@@ -26,8 +27,8 @@ COUNT(RPUP_CTLINPUT);
  * Encapsulate packet in PUP header which is supplied by the
  * user.  This is done to allow user to specify PUP identifier.
  */
  * Encapsulate packet in PUP header which is supplied by the
  * user.  This is done to allow user to specify PUP identifier.
  */
-rpup_output(m0, so)
-       struct mbuf *m0;
+rpup_output(m, so)
+       register struct mbuf *m;
        struct socket *so;
 {
        register struct rawcb *rp = sotorawcb(so);
        struct socket *so;
 {
        register struct rawcb *rp = sotorawcb(so);
@@ -43,7 +44,7 @@ COUNT(RPUP_OUTPUT);
         * for the header and check parameters in it.
         */
        if ((m->m_off > MMAXOFF || m->m_len < sizeof(struct pup_header)) &&
         * for the header and check parameters in it.
         */
        if ((m->m_off > MMAXOFF || m->m_len < sizeof(struct pup_header)) &&
-           (m = m_pullup(m, sizeof(struct pup_header)) == 0) {
+           (m = m_pullup(m, sizeof(struct pup_header))) == 0)
                goto bad;
        pup = mtod(m, struct pup_header *);
        if (pup->pup_type == 0)
                goto bad;
        pup = mtod(m, struct pup_header *);
        if (pup->pup_type == 0)
@@ -59,7 +60,7 @@ COUNT(RPUP_OUTPUT);
        /*
         * Insure proper source address is included.
         */
        /*
         * Insure proper source address is included.
         */
-       spup = (struct sockadrr_pup *)rp->rcb_socket->so_addr;
+       spup = (struct sockadrr_pup *)&(rp->rcb_socket->so_addr);
        pup->pup_sport = spup->spup_addr;
        /* for now, assume user generates PUP checksum. */
 
        pup->pup_sport = spup->spup_addr;
        /* for now, assume user generates PUP checksum. */
 
index 9b77724..c132542 100644 (file)
@@ -1,4 +1,4 @@
-/*     raw_cb.c        4.3     82/02/12        */
+/*     raw_cb.c        4.4     82/03/05        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -10,7 +10,7 @@
 #include "../net/in_systm.h"
 #include "../net/if.h"
 #include "../net/raw_cb.h"
 #include "../net/in_systm.h"
 #include "../net/if.h"
 #include "../net/raw_cb.h"
-#include "/usr/include/errno.h"
+#include "../errno.h"
 
 /*
  * Routines to manage the raw protocol control blocks. 
 
 /*
  * Routines to manage the raw protocol control blocks. 
@@ -18,6 +18,7 @@
  * TODO:
  *     hash lookups by protocol family/protocol + address family
  *     take care of unique address problems per AF
  * TODO:
  *     hash lookups by protocol family/protocol + address family
  *     take care of unique address problems per AF
+ *     redo address binding to allow wildcards
  */
 
 /*
  */
 
 /*
@@ -49,6 +50,10 @@ COUNT(RAW_ATTACH);
                break;
                }
 
                break;
                }
 
+       case AF_PUP:
+               ifp = ifnet;
+               break;
+
        default:
                return (EAFNOSUPPORT);
        }
        default:
                return (EAFNOSUPPORT);
        }
index 93bb834..d19f471 100644 (file)
@@ -1,4 +1,4 @@
-/*     raw_usrreq.c    4.7     82/02/02        */
+/*     raw_usrreq.c    4.8     82/03/05        */
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
@@ -10,7 +10,7 @@
 #include "../net/in_systm.h"
 #include "../net/if.h"
 #include "../net/raw_cb.h"
 #include "../net/in_systm.h"
 #include "../net/if.h"
 #include "../net/raw_cb.h"
-#include "/usr/include/errno.h"
+#include "../errno.h"
 
 /*
  * Initialize raw connection block q.
 
 /*
  * Initialize raw connection block q.
@@ -102,9 +102,10 @@ next:
                so = rp->rcb_socket;
                pr = so->so_proto;
                if (pr->pr_family != sp->sp_family ||
                so = rp->rcb_socket;
                pr = so->so_proto;
                if (pr->pr_family != sp->sp_family ||
-                   pr->pr_protocol != sp->sp_protocol)
+                   (pr->pr_protocol && pr->pr_protocol != sp->sp_protocol))
                        continue;
                        continue;
-               if (sa->sa_family != so->so_addr.sa_family)
+               if (so->so_addr.sa_family && 
+                   sa->sa_family != so->so_addr.sa_family)
                        continue;
                /*
                 * We assume the lower level routines have
                        continue;
                /*
                 * We assume the lower level routines have
@@ -145,7 +146,10 @@ nospace:
        if (last == 0)
                goto drop;
        if (sbappendaddr(&last->so_rcv, &rawp->raw_src, m->m_next) == 0)
        if (last == 0)
                goto drop;
        if (sbappendaddr(&last->so_rcv, &rawp->raw_src, m->m_next) == 0)
+{
+printf("rawintr: sbappendaddr failed\n");
                goto drop;
                goto drop;
+}
        (void) m_free(m);       /* generic header */
        sorwakeup(last);
        goto next;
        (void) m_free(m);       /* generic header */
        sorwakeup(last);
        goto next;
index 7bbb47b..fa59aca 100644 (file)
@@ -1,4 +1,4 @@
-/* in.h 4.9 82/02/27 */
+/* in.h 4.10 82/03/05 */
 
 /*
  * Constants and structures defined by the internet system,
 
 /*
  * Constants and structures defined by the internet system,
@@ -65,6 +65,8 @@ struct in_addr {
 #define        s_host  S_un.S_un_b.s_b2        /* host on imp */
 #define        s_net   S_un.S_un_b.s_b1        /* network */
 #define        s_imp   S_un.S_un_w.s_w2        /* imp */
 #define        s_host  S_un.S_un_b.s_b2        /* host on imp */
 #define        s_net   S_un.S_un_b.s_b1        /* network */
 #define        s_imp   S_un.S_un_w.s_w2        /* imp */
+#define        s_impno S_un.S_un_b.s_b4        /* imp # */
+#define        s_lh    S_un.S_un_b.s_b3        /* logical host */
 #endif
 };
 
 #endif
 };