SCCS-vsn: sys/net/if.h 4.13
SCCS-vsn: sys/vax/if/if_ec.c 4.10
SCCS-vsn: sys/vax/if/if_en.c 4.60
SCCS-vsn: sys/vax/if/if_il.c 4.2
-/* if.h 4.12 82/03/30 */
+/* if.h 4.13 82/05/24 */
/*
* Structures defining a network interface, providing a packet
/*
* Structures defining a network interface, providing a packet
short if_net; /* network number of interface */
short if_flags; /* up/down, broadcast, etc. */
int if_host[2]; /* local net host number */
short if_net; /* network number of interface */
short if_flags; /* up/down, broadcast, etc. */
int if_host[2]; /* local net host number */
- struct sockaddr if_addr; /* internet address of interface */
- struct sockaddr if_broadaddr; /* broadcast address of interface */
+ struct sockaddr if_addr; /* address of interface */
+ union {
+ struct sockaddr ifu_broadaddr;
+ struct sockaddr ifu_dstaddr;
+ } if_ifu;
+#define if_broadaddr if_ifu.ifu_broadaddr /* broadcast address */
+#define if_dstaddr if_ifu.ifu_dstaddr /* other end of p-to-p link */
struct ifqueue {
struct mbuf *ifq_head;
struct mbuf *ifq_tail;
struct ifqueue {
struct mbuf *ifq_head;
struct mbuf *ifq_tail;
#define IFF_UP 0x1 /* interface is up */
#define IFF_BROADCAST 0x2 /* broadcast address valid */
#define IFF_DEBUG 0x4 /* turn on debugging */
#define IFF_UP 0x1 /* interface is up */
#define IFF_BROADCAST 0x2 /* broadcast address valid */
#define IFF_DEBUG 0x4 /* turn on debugging */
-#define IFF_ROUTE 0x8 /* routine entry installed */
+#define IFF_ROUTE 0x8 /* routing entry installed */
+#define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
/*
* Output queues (ifp->if_snd) and internetwork datagram level (pup level 1)
/*
* Output queues (ifp->if_snd) and internetwork datagram level (pup level 1)
-/* if_ec.c 4.9 82/05/21 */
+/* if_ec.c 4.10 82/05/24 */
#include "ec.h"
#include "imp.h"
#include "ec.h"
#include "imp.h"
#if NIMP == 0
/* here's one for you john baby.... */
if (ui->ui_flags &~ 0xff)
#if NIMP == 0
/* here's one for you john baby.... */
if (ui->ui_flags &~ 0xff)
- eclhinit((ui->ui_flags &~ 0xff) | 0x0a);
+ eclhinit(&es->es_if, (ui->ui_flags &~ 0xff) | 0x0a);
/*
* Called by localnet interface to allow logical
/*
* Called by localnet interface to allow logical
- * host interface to "attach". Nothing should ever
- * be sent locally to this interface, it's purpose
+ * host interface to "attach", it's purpose
* is simply to establish the host's arpanet address.
*/
* is simply to establish the host's arpanet address.
*/
+eclhinit(ecifp, addr)
+ struct ifnet *ecifp;
int addr;
{
register struct ifnet *ifp = &eclhif;
int addr;
{
register struct ifnet *ifp = &eclhif;
sin->sin_family = AF_INET;
sin->sin_addr.s_addr = addr;
ifp->if_net = sin->sin_addr.s_net;
sin->sin_family = AF_INET;
sin->sin_addr.s_addr = addr;
ifp->if_net = sin->sin_addr.s_net;
- ifp->if_flags = IFF_UP;
- ifp->if_output = eclhoutput; /* should never be used */
+ ifp->if_dstaddr = ecifp->if_addr;
+ ifp->if_flags = IFF_UP|IFF_POINTOPOINT;
+ ifp->if_output = looutput;
-}
-
-eclhoutput(ifp, m0, dst)
- struct ifnet *ifp;
- struct mbuf *m0;
- struct sockaddr *dst;
-{
-COUNT(ECLHOUTPUT);
- ifp->if_oerrors++;
- m_freem(m0);
- return (0);
+ rtinit(&ifp->if_addr, &ifp->if_addr, RTF_UP|RTF_DIRECT);
-/* if_en.c 4.59 82/04/24 */
+/* if_en.c 4.60 82/05/24 */
#include "en.h"
#include "imp.h"
#include "en.h"
#include "imp.h"
#include <errno.h>
#define ENMTU (1024+512)
#include <errno.h>
#define ENMTU (1024+512)
+#define ENMRU (1024+512+16) /* 16 is enough to receive trailer */
int enprobe(), enattach(), enrint(), enxint(), encollide();
struct uba_device *eninfo[NEN];
int enprobe(), enattach(), enrint(), enxint(), encollide();
struct uba_device *eninfo[NEN];
if_attach(&es->es_if);
#if NIMP == 0
/* here's one for you john baby.... */
if_attach(&es->es_if);
#if NIMP == 0
/* here's one for you john baby.... */
- if (ui->ui_flags &~ 0xff) {
- struct in_addr logicaladdr;
-
- logicaladdr.s_addr = ui->ui_flags; /* gateway */
- logicaladdr.s_lh = es->es_if.if_host[0];
- logicaladdr.s_net = 10;
- enlhinit(logicaladdr);
- }
+ if (ui->ui_flags &~ 0xff)
+ enlhinit(&es->es_if, (ui->ui_flags &~ 0xff) | 0x0a);
int s;
if (if_ubainit(&es->es_ifuba, ui->ui_ubanum,
int s;
if (if_ubainit(&es->es_ifuba, ui->ui_ubanum,
- sizeof (struct en_header), (int)btoc(ENMTU)) == 0) {
+ sizeof (struct en_header), (int)btoc(ENMRU)) == 0) {
printf("en%d: can't initialize\n", unit);
es->es_if.if_flags &= ~IFF_UP;
return;
printf("en%d: can't initialize\n", unit);
es->es_if.if_flags &= ~IFF_UP;
return;
*/
s = splimp();
addr->en_iba = es->es_ifuba.ifu_r.ifrw_info;
*/
s = splimp();
addr->en_iba = es->es_ifuba.ifu_r.ifrw_info;
- addr->en_iwc = -(sizeof (struct en_header) + ENMTU) >> 1;
+ addr->en_iwc = -(sizeof (struct en_header) + ENMRU) >> 1;
addr->en_istat = EN_IEN|EN_GO;
es->es_oactive = 1;
es->es_if.if_flags |= IFF_UP;
addr->en_istat = EN_IEN|EN_GO;
es->es_oactive = 1;
es->es_if.if_flags |= IFF_UP;
resid = addr->en_iwc;
if (resid)
resid |= 0176000;
resid = addr->en_iwc;
if (resid)
resid |= 0176000;
- len = (((sizeof (struct en_header) + ENMTU) >> 1) + resid) << 1;
+ len = (((sizeof (struct en_header) + ENMRU) >> 1) + resid) << 1;
len -= sizeof (struct en_header);
len -= sizeof (struct en_header);
goto setup; /* sanity */
en = (struct en_header *)(es->es_ifuba.ifu_r.ifrw_addr);
#define endataaddr(en, off, type) ((type)(((caddr_t)((en)+1)+(off))))
if (en->en_type >= ENPUP_TRAIL &&
en->en_type < ENPUP_TRAIL+ENPUP_NTRAILER) {
off = (en->en_type - ENPUP_TRAIL) * 512;
goto setup; /* sanity */
en = (struct en_header *)(es->es_ifuba.ifu_r.ifrw_addr);
#define endataaddr(en, off, type) ((type)(((caddr_t)((en)+1)+(off))))
if (en->en_type >= ENPUP_TRAIL &&
en->en_type < ENPUP_TRAIL+ENPUP_NTRAILER) {
off = (en->en_type - ENPUP_TRAIL) * 512;
goto setup; /* sanity */
en->en_type = *endataaddr(en, off, u_short *);
resid = *(endataaddr(en, off+2, u_short *));
goto setup; /* sanity */
en->en_type = *endataaddr(en, off, u_short *);
resid = *(endataaddr(en, off+2, u_short *));
* Reset for next packet.
*/
addr->en_iba = es->es_ifuba.ifu_r.ifrw_info;
* Reset for next packet.
*/
addr->en_iba = es->es_ifuba.ifu_r.ifrw_info;
- addr->en_iwc = -(sizeof (struct en_header) + ENMTU) >> 1;
+ addr->en_iwc = -(sizeof (struct en_header) + ENMRU) >> 1;
addr->en_istat = EN_IEN|EN_GO;
}
addr->en_istat = EN_IEN|EN_GO;
}
/*
* Called by localnet interface to allow logical
/*
* Called by localnet interface to allow logical
- * host interface to "attach". Nothing should ever
- * be sent locally to this interface, it's purpose
+ * host interface to "attach", it's purpose
* is simply to establish the host's arpanet address.
*/
* is simply to establish the host's arpanet address.
*/
+enlhinit(esifp, addr)
+ struct ifnet *esifp;
int addr;
{
register struct ifnet *ifp = &enlhif;
int addr;
{
register struct ifnet *ifp = &enlhif;
sin->sin_family = AF_INET;
sin->sin_addr.s_addr = addr;
ifp->if_net = sin->sin_addr.s_net;
sin->sin_family = AF_INET;
sin->sin_addr.s_addr = addr;
ifp->if_net = sin->sin_addr.s_net;
- ifp->if_flags = IFF_UP;
- ifp->if_output = enlhoutput; /* should never be used */
+ ifp->if_flags = IFF_UP|IFF_POINTOPOINT;
+ ifp->if_dstaddr = esifp->if_addr;
+ ifp->if_output = looutput;
-}
-
-enlhoutput(ifp, m0, dst)
- struct ifnet *ifp;
- struct mbuf *m0;
- struct sockaddr *dst;
-{
-COUNT(ENLHOUTPUT);
- ifp->if_oerrors++;
- m_freem(m0);
- return (0);
+ rtinit(&ifp->if_addr, &ifp->if_addr, RTF_UP|RTF_DIRECT);
-/* if_il.c 4.1 82/05/21 */
+/* if_il.c 4.2 82/05/24 */
#include "il.h"
#include "imp.h"
#include "il.h"
#include "imp.h"
if_attach(&is->is_if);
#if NIMP == 0
if (ui->ui_flags &~ 0xff)
if_attach(&is->is_if);
#if NIMP == 0
if (ui->ui_flags &~ 0xff)
- illhinit((ui->ui_flags &~ 0xff) | 0x0a);
+ illhinit(&is->is_if, (ui->ui_flags &~ 0xff) | 0x0a);
/*
* Called by localnet interface to allow logical
/*
* Called by localnet interface to allow logical
* be sent locally to this interface, it's purpose
* is simply to establish the host's arpanet address.
*/
* be sent locally to this interface, it's purpose
* is simply to establish the host's arpanet address.
*/
+illhinit(ilifp, addr)
+ struct ifnet *ilifp;
int addr;
{
register struct ifnet *ifp = &illhif;
int addr;
{
register struct ifnet *ifp = &illhif;
sin->sin_family = AF_INET;
sin->sin_addr.s_addr = addr;
ifp->if_net = sin->sin_addr.s_net;
sin->sin_family = AF_INET;
sin->sin_addr.s_addr = addr;
ifp->if_net = sin->sin_addr.s_net;
- ifp->if_flags = IFF_UP;
- ifp->if_output = illhoutput; /* should never be used */
+ ifp->if_dstaddr = ilifp->if_addr;
+ ifp->if_flags = IFF_UP|IFF_POINTOPOINT;
+ ifp->if_output = looutput;
-}
-
-illhoutput(ifp, m0, dst)
- struct ifnet *ifp;
- struct mbuf *m0;
- struct sockaddr *dst;
-{
-COUNT(ILLHOUTPUT);
- ifp->if_oerrors++;
- m_freem(m0);
- return (0);
+ rtinit(&ifp->if_addr, &ifp->if_addr, RTF_UP|RTF_DIRECT);