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
-/* 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
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 */
hostreset(sc->imp_if.if_net); /* XXX */
impnoops(sc);
}
hostreset(sc->imp_if.if_net); /* XXX */
impnoops(sc);
}
/*
* IMP going down. Print message, and if not immediate,
/*
* IMP going down. Print message, and if not immediate,
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]);
/*
* A NOP usually seen during the initialization sequence.
/*
* A NOP usually seen during the initialization sequence.
sc->imp_dropcnt = IMP_DROPCNT;
}
if (sc->imp_state != IMPS_INIT)
sc->imp_dropcnt = IMP_DROPCNT;
}
if (sc->imp_state != IMPS_INIT)
if (--sc->imp_dropcnt > 0)
if (--sc->imp_dropcnt > 0)
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;
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);
case IMPTYPE_RESET:
impmsg(sc, "interface reset");
impnoops(sc);
case IMPTYPE_RESET:
impmsg(sc, "interface reset");
impnoops(sc);
default:
sc->imp_if.if_collisions++; /* XXX */
default:
sc->imp_if.if_collisions++; /* XXX */
-/* 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"
#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"
/*
* Raw interface to IMP.
/*
* Raw interface to IMP.
-/* 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"
#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"
* 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);
* 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)
/*
* 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. */
-/* 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"
#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"
/*
* Routines to manage the raw protocol control blocks.
/*
* Routines to manage the raw protocol control blocks.
* 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
+ case AF_PUP:
+ ifp = ifnet;
+ break;
+
default:
return (EAFNOSUPPORT);
}
default:
return (EAFNOSUPPORT);
}
-/* 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"
#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"
/*
* Initialize raw connection block q.
/*
* Initialize raw connection block q.
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))
- 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
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");
(void) m_free(m); /* generic header */
sorwakeup(last);
goto next;
(void) m_free(m); /* generic header */
sorwakeup(last);
goto next;
+/* in.h 4.10 82/03/05 */
/*
* Constants and structures defined by the internet system,
/*
* Constants and structures defined by the internet system,
#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 */