Submitted by: john hay

patches to merge the two IPX packages to work with each other and to
not break make-world :)

IPXrouted should be working now, (or at least compiling) :)
This commit is contained in:
Julian Elischer 1995-10-27 10:48:31 +00:00
parent 2ef81f4909
commit 09fa32d305
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=11840
7 changed files with 39 additions and 30 deletions

View File

@ -1,5 +1,5 @@
# from: @(#)Makefile 5.11 (Berkeley) 5/21/91
# $Id: Makefile,v 1.122 1995/10/22 21:26:52 ache Exp $
# $Id: Makefile,v 1.123 1995/10/26 10:05:55 ache Exp $
# disktab may be wrong -- hcx9 is a tahoe, but gets its own.
# -rw-r--r--
@ -444,7 +444,7 @@ distrib-dirs:
mtree -deU -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
mtree -deU -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
# Compatibility stuff, remove obsoleted links, if exists
if [ -d ${DESTDIR}/usr/share/locale ] ; \
-if [ -d ${DESTDIR}/usr/share/locale ] ; \
then \
cd ${DESTDIR}/usr/share/locale; \
for l in ${LATIN1LINKS} ; do \

View File

@ -2,7 +2,7 @@
PROG= ifconfig
MAN8= ifconfig.8
LDADD= -lkvm
LDADD= -lkvm -lipx
DPADD= ${LIBKVM}
.include <bsd.prog.mk>

View File

@ -7,7 +7,7 @@ CFLAGS+=-I/sys # -g
.PATH: ${.CURDIR}/../../sys/netiso
BINGRP= kmem
BINMODE=2555
LDADD= -lkvm
LDADD= -lkvm -lipx
DPADD= ${LIBKVM}
.include <bsd.prog.mk>

View File

@ -34,7 +34,7 @@
*
* @(#)defs.h 8.1 (Berkeley) 6/5/93
*
* $Id: defs.h,v 1.5 1995/10/11 18:57:12 jhay Exp $
* $Id: defs.h,v 1.1 1995/10/26 21:28:14 julian Exp $
*/
#include <sys/types.h>
@ -42,7 +42,6 @@
#include <net/route.h>
#include <netipx/ipx.h>
#include <netipx/ipxdp.h>
#if defined(vax) || defined(pdp11)
#define xnnet(x) ((u_long) (x)->rip_dst[1] << 16 | (u_long) (x)->rip_dst[0] )
#else
@ -88,7 +87,7 @@ extern int r; /* Routing socket to install updates with */
extern int gateway;
extern struct sockaddr_ipx ipx_netmask; /* Used in installing routes */
extern char packet[MAXPACKETSIZE+sizeof(struct ipxdp)+1];
extern char packet[MAXPACKETSIZE+sizeof(struct ipx)+1];
extern struct rip *msg;
extern char **argv0;

View File

@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: main.c,v 1.6 1995/10/11 18:57:21 jhay Exp $
* $Id: main.c,v 1.1 1995/10/26 21:28:19 julian Exp $
*/
#ifndef lint
@ -79,16 +79,16 @@ int noteremoterequests; /* squawk on requests from non-local nets */
int r; /* Routing socket to install updates with */
struct sockaddr_ipx ipx_netmask; /* Used in installing routes */
char packet[MAXPACKETSIZE+sizeof(struct ipxdp)+1];
char packet[MAXPACKETSIZE+sizeof(struct ipx)+1];
char **argv0;
int supplier = -1; /* process should supply updates */
int dosap = 1; /* By default do SAP services. */
struct rip *msg = (struct rip *) &packet[sizeof (struct ipxdp)];
struct rip *msg = (struct rip *) &packet[sizeof (struct ipx)];
struct sap_packet *sap_msg =
(struct sap_packet *) &packet[sizeof (struct ipxdp)];
(struct sap_packet *) &packet[sizeof (struct ipx)];
void hup(), fkexit(), timer();
void process(int fd, int pkt_type);
int getsocket(int type, int proto, struct sockaddr_ipx *sipx);
@ -248,7 +248,7 @@ process(fd, pkt_type)
{
struct sockaddr from;
int fromlen = sizeof (from), cc, omask;
struct ipxdp *ipxdp = (struct ipxdp *)packet;
struct ipx *ipxdp = (struct ipx *)packet;
cc = recvfrom(fd, packet, sizeof (packet), 0, &from, &fromlen);
if (cc <= 0) {
@ -258,22 +258,22 @@ process(fd, pkt_type)
}
if (tracepackets > 1 && ftrace) {
fprintf(ftrace,"rcv %d bytes on %s ",
cc, ipxdp_ntoa(&ipxdp->ipxdp_dna));
fprintf(ftrace," from %s\n", ipxdp_ntoa(&ipxdp->ipxdp_sna));
cc, ipxdp_ntoa(&ipxdp->ipx_dna));
fprintf(ftrace," from %s\n", ipxdp_ntoa(&ipxdp->ipx_sna));
}
if (noteremoterequests &&
!ipx_neteqnn(ipxdp->ipxdp_sna.x_net, ipx_zeronet) &&
!ipx_neteq(ipxdp->ipxdp_sna, ipxdp->ipxdp_dna))
!ipx_neteqnn(ipxdp->ipx_sna.x_net, ipx_zeronet) &&
!ipx_neteq(ipxdp->ipx_sna, ipxdp->ipx_dna))
{
syslog(LOG_ERR,
"net of interface (%s) != net on ether (%s)!\n",
ipxdp_nettoa(ipxdp->ipxdp_dna.x_net),
ipxdp_nettoa(ipxdp->ipxdp_sna.x_net));
ipxdp_nettoa(ipxdp->ipx_dna.x_net),
ipxdp_nettoa(ipxdp->ipx_sna.x_net));
}
/* We get the IPX header in front of the RIF packet*/
cc -= sizeof (struct ipxdp);
cc -= sizeof (struct ipx);
#define mask(s) (1<<((s)-1))
omask = sigblock(mask(SIGALRM));
switch(pkt_type) {
@ -309,15 +309,15 @@ getsocket(type, proto, sipx)
if (retry == 0)
return (-1);
if (domain==AF_IPX) {
struct ipxdp ipxdp;
struct ipx ipxdp;
if (setsockopt(s, 0, SO_HEADERS_ON_INPUT, &on, sizeof(on))) {
syslog(LOG_ERR, "setsockopt SEE HEADERS: %m");
exit(1);
}
if (ntohs(sipx->sipx_addr.x_port) == IPXPORT_RIP)
ipxdp.ipxdp_pt = IPXPROTO_RI;
ipxdp.ipx_pt = IPXPROTO_RI;
else if (ntohs(sipx->sipx_addr.x_port) == IPXPORT_SAP)
ipxdp.ipxdp_pt = IPXPROTO_SAP;
ipxdp.ipx_pt = IPXPROTO_SAP;
else {
syslog(LOG_ERR, "port should be either RIP or SAP");
exit(1);

View File

@ -28,11 +28,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: sap.h,v 1.5 1995/10/11 18:57:26 jhay Exp $
* $Id: sap.h,v 1.1 1995/10/26 21:28:22 julian Exp $
*/
#ifndef _SAP_H_
#define _SAP_H_
#define IPXPROTO_SAP IPXPROTO_PXP
#define SAP_REQ 1
#define SAP_RESP 2
#define SAP_REQ_NEAR 3

View File

@ -37,7 +37,7 @@
*
* @(#)trace.h 8.1 (Berkeley) 6/5/93
*
* $Id: trace.h,v 1.4 1995/10/11 18:57:34 jhay Exp $
* $Id: trace.h,v 1.1 1995/10/26 21:28:30 julian Exp $
*/
/*
@ -83,30 +83,38 @@ FILE *ftrace; /* output trace file */
if (tracing) { \
ifp = if_iflookup(src); \
if (ifp) \
trace(&ifp->int_input, src, &packet[sizeof(struct ipxdp)], size, \
trace(&ifp->int_input, src, \
&packet[sizeof(struct ipx)], size, \
ntohl(ifp->int_metric)); \
} \
if (tracepackets && ftrace) \
dumppacket(ftrace, "from", src, &packet[sizeof(struct ipxdp)], size); \
dumppacket(ftrace, "from", src, \
&packet[sizeof(struct ipx)], size); \
}
#define TRACE_OUTPUT(ifp, dst, size) { \
if (tracing) { \
ifp = if_iflookup(dst); \
if (ifp) \
trace(&ifp->int_output, dst, &packet[sizeof(struct ipxdp)], size, ifp->int_metric); \
trace(&ifp->int_output, dst, \
&packet[sizeof(struct ipx)], \
size, ifp->int_metric); \
} \
if (tracepackets && ftrace) \
dumppacket(ftrace, "to", dst, &packet[sizeof(struct ipxdp)], size); \
dumppacket(ftrace, "to", dst, \
&packet[sizeof(struct ipx)], size); \
}
#define TRACE_SAP_OUTPUT(ifp, dst, size) { \
if (tracing) { \
ifp = if_iflookup(dst); \
if (ifp) \
trace(&ifp->int_output, dst, &packet[sizeof(struct ipxdp)], size, ifp->int_metric); \
trace(&ifp->int_output, dst, \
&packet[sizeof(struct ipx)], \
size, ifp->int_metric); \
} \
if (tracepackets && ftrace) \
dumpsappacket(ftrace, "to", dst, &packet[sizeof(struct ipxdp)], size); \
dumpsappacket(ftrace, "to", dst, \
&packet[sizeof(struct ipx)], size); \
}
void traceinit(struct interface *);