aboutsummaryrefslogtreecommitdiff
path: root/sys/netns
diff options
context:
space:
mode:
authorsvn2git <svn2git@FreeBSD.org>1994-05-01 08:00:00 +0000
committersvn2git <svn2git@FreeBSD.org>1994-05-01 08:00:00 +0000
commita16f65c7d117419bd266c28a1901ef129a337569 (patch)
tree2626602f66dc3551e7a7c7bc9ad763c3bc7ab40a /sys/netns
parent8503f4f13f77abf7adc8f7e329c6f9c1d52b6a20 (diff)
This commit was manufactured to restore the state of the 1.1-RELEASE image. Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
Diffstat (limited to 'sys/netns')
-rw-r--r--sys/netns/idp.h6
-rw-r--r--sys/netns/idp_usrreq.c34
-rw-r--r--sys/netns/idp_var.h22
-rw-r--r--sys/netns/ns.c28
-rw-r--r--sys/netns/ns.h59
-rw-r--r--sys/netns/ns_error.c16
-rw-r--r--sys/netns/ns_error.h8
-rw-r--r--sys/netns/ns_if.h12
-rw-r--r--sys/netns/ns_input.c59
-rw-r--r--sys/netns/ns_ip.c33
-rw-r--r--sys/netns/ns_output.c4
-rw-r--r--sys/netns/ns_pcb.c17
-rw-r--r--sys/netns/ns_pcb.h23
-rw-r--r--sys/netns/ns_proto.c30
-rw-r--r--sys/netns/sp.h6
-rw-r--r--sys/netns/spidp.h6
-rw-r--r--sys/netns/spp_debug.c12
-rw-r--r--sys/netns/spp_debug.h10
-rw-r--r--sys/netns/spp_timer.h6
-rw-r--r--sys/netns/spp_usrreq.c65
-rw-r--r--sys/netns/spp_var.h52
21 files changed, 384 insertions, 124 deletions
diff --git a/sys/netns/idp.h b/sys/netns/idp.h
index 9103c2dbc5d3..013eb9a61e70 100644
--- a/sys/netns/idp.h
+++ b/sys/netns/idp.h
@@ -31,9 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)idp.h 7.4 (Berkeley) 6/28/90
- * $Id: idp.h,v 1.2 1993/10/16 19:54:08 rgrimes Exp $
+ * $Id: idp.h,v 1.3 1993/11/07 17:50:19 wollman Exp $
*/
+#ifndef _NETNS_IDP_H_
+#define _NETNS_IDP_H_ 1
+
/*
* Definitions for NS(tm) Internet Datagram Protocol
*/
@@ -45,3 +48,4 @@ struct idp {
struct ns_addr idp_dna; /* Destination Network Address */
struct ns_addr idp_sna; /* Source Network Address */
};
+#endif /* _NETNS_IDP_H_ */
diff --git a/sys/netns/idp_usrreq.c b/sys/netns/idp_usrreq.c
index 3a99e5c96640..f79931162d60 100644
--- a/sys/netns/idp_usrreq.c
+++ b/sys/netns/idp_usrreq.c
@@ -31,10 +31,11 @@
* SUCH DAMAGE.
*
* from: @(#)idp_usrreq.c 7.11 (Berkeley) 6/27/91
- * $Id: idp_usrreq.c,v 1.2 1993/10/16 19:54:11 rgrimes Exp $
+ * $Id: idp_usrreq.c,v 1.5 1993/12/19 00:53:50 wollman Exp $
*/
#include "param.h"
+#include "systm.h"
#include "malloc.h"
#include "mbuf.h"
#include "protosw.h"
@@ -57,11 +58,13 @@
* IDP protocol implementation.
*/
+struct idpstat idpstat;
struct sockaddr_ns idp_ns = { sizeof(idp_ns), AF_NS };
/*
* This may also be called for raw listeners.
*/
+void
idp_input(m, nsp)
struct mbuf *m;
register struct nspcb *nsp;
@@ -102,8 +105,10 @@ bad:
m_freem(m);
}
-idp_abort(nsp)
+void
+idp_abort(nsp, errno)
struct nspcb *nsp;
+ int errno;
{
struct socket *so = nsp->nsp_socket;
@@ -114,7 +119,7 @@ idp_abort(nsp)
* Drop connection, reporting
* the specified error.
*/
-struct nspcb *
+void
idp_drop(nsp, errno)
register struct nspcb *nsp;
int errno;
@@ -136,6 +141,8 @@ idp_drop(nsp, errno)
}
int noIdpRoute;
+
+int
idp_output(nsp, m0)
struct nspcb *nsp;
struct mbuf *m0;
@@ -145,7 +152,7 @@ idp_output(nsp, m0)
register struct socket *so;
register int len = 0;
register struct route *ro;
- struct mbuf *mprev;
+ struct mbuf *mprev = 0;
extern int idpcksum;
/*
@@ -254,11 +261,12 @@ idp_output(nsp, m0)
}
}
nsp->nsp_lastdst = idp->idp_dna;
-#endif ancient_history
+#endif /* ancient_history */
if (noIdpRoute) ro = 0;
return (ns_output(m, ro, so->so_options & SO_BROADCAST));
}
/* ARGSUSED */
+int
idp_ctloutput(req, so, level, name, value)
int req, level;
struct socket *so;
@@ -358,7 +366,7 @@ idp_ctloutput(req, so, level, name, value)
case SO_NSIP_ROUTE:
error = nsip_route(*value);
break;
-#endif NSIP
+#endif /* NSIP */
default:
error = EINVAL;
}
@@ -370,10 +378,12 @@ idp_ctloutput(req, so, level, name, value)
}
/*ARGSUSED*/
-idp_usrreq(so, req, m, nam, control)
+int
+idp_usrreq(so, req, m, nam, control, dummy)
struct socket *so;
int req;
struct mbuf *m, *nam, *control;
+ struct mbuf *dummy;
{
struct nspcb *nsp = sotonspcb(so);
int error = 0;
@@ -454,7 +464,7 @@ idp_usrreq(so, req, m, nam, control)
case PRU_SEND:
{
struct ns_addr laddr;
- int s;
+ int s = 0;
if (nam) {
laddr = nsp->nsp_laddr;
@@ -531,11 +541,13 @@ release:
m_freem(m);
return (error);
}
-/*ARGSUSED*/
-idp_raw_usrreq(so, req, m, nam, control)
+
+int
+idp_raw_usrreq(so, req, m, nam, control, dummy)
struct socket *so;
int req;
struct mbuf *m, *nam, *control;
+ struct mbuf *dummy;
{
int error = 0;
struct nspcb *nsp = sotonspcb(so);
@@ -560,7 +572,7 @@ idp_raw_usrreq(so, req, m, nam, control)
nsp->nsp_flags = NSP_RAWIN | NSP_RAWOUT;
break;
default:
- error = idp_usrreq(so, req, m, nam, control);
+ error = idp_usrreq(so, req, m, nam, control, 0);
}
return (error);
}
diff --git a/sys/netns/idp_var.h b/sys/netns/idp_var.h
index 07672113f6d1..1833c9f5af64 100644
--- a/sys/netns/idp_var.h
+++ b/sys/netns/idp_var.h
@@ -31,9 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)idp_var.h 7.4 (Berkeley) 6/28/90
- * $Id: idp_var.h,v 1.2 1993/10/16 19:54:12 rgrimes Exp $
+ * $Id: idp_var.h,v 1.4 1993/12/19 00:53:53 wollman Exp $
*/
+#ifndef _NETNS_IDP_VAR_H_
+#define _NETNS_IDP_VAR_H_ 1
+
/*
* IDP Kernel Structures and Variables
*/
@@ -46,5 +49,18 @@ struct idpstat {
};
#ifdef KERNEL
-struct idpstat idpstat;
-#endif
+extern struct idpstat idpstat;
+struct nspcb;
+extern void idp_input(struct mbuf *, struct nspcb *);
+extern void idp_abort(struct nspcb *, int);
+extern void idp_drop(struct nspcb *, int);
+extern int idp_output(struct nspcb *, struct mbuf *);
+extern int idp_ctloutput(int, struct socket *, int, int, struct mbuf **);
+extern int idp_usrreq(struct socket *, int, struct mbuf *, struct mbuf *,
+ struct mbuf *, struct mbuf *);
+extern int idp_raw_usrreq(struct socket *, int, struct mbuf *, struct mbuf *,
+ struct mbuf *, struct mbuf *);
+
+
+#endif /* KERNEL */
+#endif /* _NETNS_IDP_VAR_H_ */
diff --git a/sys/netns/ns.c b/sys/netns/ns.c
index 63039ce261e5..e397e2107ad6 100644
--- a/sys/netns/ns.c
+++ b/sys/netns/ns.c
@@ -31,10 +31,11 @@
* SUCH DAMAGE.
*
* from: @(#)ns.c 7.8 (Berkeley) 6/27/91
- * $Id: ns.c,v 1.2 1993/10/16 19:54:14 rgrimes Exp $
+ * $Id: ns.c,v 1.5 1993/12/19 00:53:55 wollman Exp $
*/
#include "param.h"
+#include "systm.h"
#include "mbuf.h"
#include "ioctl.h"
#include "protosw.h"
@@ -45,21 +46,30 @@
#include "../net/if.h"
#include "../net/route.h"
-#include "../net/af.h"
#include "ns.h"
#include "ns_if.h"
#ifdef NS
+static void ns_ifscrub(struct ifnet *, struct ns_ifaddr *);
+
struct ns_ifaddr *ns_ifaddr;
+struct ifqueue nsintrq;
+
int ns_interfaces;
extern struct sockaddr_ns ns_netmask, ns_hostmask;
+union ns_host ns_thishost;
+union ns_host ns_zerohost;
+union ns_host ns_braodhost;
+union ns_net ns_zeronet;
+union ns_net ns_broadnet;
/*
* Generic internet control operations (ioctl's).
*/
/* ARGSUSED */
+int
ns_control(so, cmd, data, ifp)
struct socket *so;
int cmd;
@@ -173,7 +183,8 @@ ns_control(so, cmd, data, ifp)
ia->ia_flags &= ~IFA_ROUTE;
}
if (ifp->if_ioctl) {
- error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, ia);
+ error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR,
+ (caddr_t)ia);
if (error)
return (error);
}
@@ -185,6 +196,7 @@ ns_control(so, cmd, data, ifp)
(struct sockaddr_ns *)&ifr->ifr_addr, 1));
case SIOCDIFADDR:
+ error = 0;
ns_ifscrub(ifp, ia);
if ((ifa = ifp->if_addrlist) == (struct ifaddr *)ia)
ifp->if_addrlist = ifa->ifa_next;
@@ -219,6 +231,7 @@ ns_control(so, cmd, data, ifp)
return (0);
case SIOCAIFADDR:
+ error = 0;
dstIsNew = 0; hostIsNew = 1;
if (ia->ia_addr.sns_family == AF_NS) {
if (ifra->ifra_addr.sns_len == 0) {
@@ -250,6 +263,7 @@ ns_control(so, cmd, data, ifp)
/*
* Delete any previous route for an old address.
*/
+static void
ns_ifscrub(ifp, ia)
register struct ifnet *ifp;
register struct ns_ifaddr *ia;
@@ -266,10 +280,12 @@ ns_ifscrub(ifp, ia)
* Initialize an interface's internet address
* and routing table entry.
*/
+int
ns_ifinit(ifp, ia, sns, scrub)
register struct ifnet *ifp;
register struct ns_ifaddr *ia;
register struct sockaddr_ns *sns;
+ int scrub;
{
struct sockaddr_ns oldaddr;
register union ns_host *h = &ia->ia_addr.sns_addr.x_host;
@@ -294,7 +310,8 @@ ns_ifinit(ifp, ia, sns, scrub)
*/
if (ns_hosteqnh(ns_thishost, ns_zerohost)) {
if (ifp->if_ioctl &&
- (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, ia))) {
+ (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR,
+ (caddr_t)ia))) {
ia->ia_addr = oldaddr;
splx(s);
return (error);
@@ -304,7 +321,8 @@ ns_ifinit(ifp, ia, sns, scrub)
|| ns_hosteqnh(sns->sns_addr.x_host, ns_thishost)) {
*h = ns_thishost;
if (ifp->if_ioctl &&
- (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, ia))) {
+ (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR,
+ (caddr_t)ia))) {
ia->ia_addr = oldaddr;
splx(s);
return (error);
diff --git a/sys/netns/ns.h b/sys/netns/ns.h
index 93170c48ce72..e163bafd415e 100644
--- a/sys/netns/ns.h
+++ b/sys/netns/ns.h
@@ -31,9 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)ns.h 7.8 (Berkeley) 2/22/91
- * $Id: ns.h,v 1.2 1993/10/16 19:54:16 rgrimes Exp $
+ * $Id: ns.h,v 1.4 1993/12/19 00:53:56 wollman Exp $
*/
+#ifndef _NETNS_NS_H_
+#define _NETNS_NS_H_ 1
+
/*
* Constants and Structures defined by the Xerox Network Software
* per "Internet Transport Protocols", XSIS 028112, December 1981
@@ -134,12 +137,53 @@ struct sockaddr_ns {
#ifdef KERNEL
extern struct domain nsdomain;
-union ns_host ns_thishost;
-union ns_host ns_zerohost;
-union ns_host ns_broadhost;
-union ns_net ns_zeronet;
-union ns_net ns_broadnet;
+extern union ns_host ns_thishost;
+extern union ns_host ns_zerohost;
+extern union ns_host ns_broadhost;
+extern union ns_net ns_zeronet;
+extern union ns_net ns_broadnet;
u_short ns_cksum();
+extern int ns_err_x(int);
+extern void ns_error(struct mbuf *, int, int);
+extern void ns_printhost(struct ns_addr *);
+extern void ns_err_input(struct mbuf *);
+extern int ns_echo(struct mbuf *);
+extern void idpip_input(struct mbuf *, struct ifnet *);
+extern int nsip_route(struct mbuf *);
+extern void nsip_ctlinput(int, struct sockaddr *);
+struct in_addr;
+extern void nsip_rtchange(struct in_addr *);
+extern void ns_init(void);
+extern void nsintr(void);
+extern u_char nsctlerrmap[];
+extern void idp_ctlinput(int, caddr_t);
+struct route;
+extern int idp_do_route(struct ns_addr *, struct route *);
+extern void ns_watch_output(struct mbuf *, struct ifnet *);
+extern int ns_output(struct mbuf *, struct route *, int);
+
+struct nspcb;
+
+/* This is a pun for struct protosw in sys/protosw.h: */
+struct ns_protosw {
+ short pr_type; /* socket type used for */
+ struct domain *pr_domain; /* domain protocol a member of */
+ short pr_protocol; /* protocol number */
+ short pr_flags;
+ void (*pr_input)(struct mbuf *, struct nspcb *);
+ int (*pr_output)(struct nspcb *, struct mbuf *);
+ void (*pr_ctlinput)(int, caddr_t);
+ int (*pr_ctloutput)(int, struct socket *, int, int,
+ struct mbuf **);
+ int (*pr_usrreq)(struct socket *, int, struct mbuf *,
+ struct mbuf *, struct mbuf *, struct mbuf *);
+ void (*pr_init)(void); /* initialization hook */
+ void (*pr_fasttimo)(void); /* fast timeout (200ms) */
+ void (*pr_slowtimo)(void); /* slow timeout (500ms) */
+ void (*pr_drain)(void); /* flush any excess space possible */
+};
+
+extern struct ns_protosw nssw[];
#else
#include <sys/cdefs.h>
@@ -149,4 +193,5 @@ extern struct ns_addr ns_addr __P((const char *));
extern char *ns_ntoa __P((struct ns_addr));
__END_DECLS
-#endif
+#endif /* not KERNEL */
+#endif /* _NETNS_NS_H_ */
diff --git a/sys/netns/ns_error.c b/sys/netns/ns_error.c
index 7d6361fb05a6..77790edb7a54 100644
--- a/sys/netns/ns_error.c
+++ b/sys/netns/ns_error.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)ns_error.c 7.8 (Berkeley) 6/28/90
- * $Id: ns_error.c,v 1.3 1993/10/16 19:55:12 rgrimes Exp $
+ * $Id: ns_error.c,v 1.5 1993/11/25 01:36:29 wollman Exp $
*/
#include "param.h"
@@ -54,6 +54,8 @@
#define NS_ERRPRINTFS 1
#endif
+struct ns_errstat ns_errstat;
+
#ifdef NS_ERRPRINTFS
/*
* NS_ERR routines: error generation, receive packet processing, and
@@ -62,7 +64,9 @@
int ns_errprintfs = 0;
#endif
+int
ns_err_x(c)
+ int c;
{
register u_short *w, *lim, *base = ns_errstat.ns_es_codes;
u_short x = c;
@@ -86,10 +90,11 @@ ns_err_x(c)
* Generate an error packet of type error
* in response to bad packet.
*/
-
+void
ns_error(om, type, param)
struct mbuf *om;
int type;
+ int param;
{
register struct ns_epidp *ep;
struct mbuf *m;
@@ -165,8 +170,9 @@ freeit:
m_freem(om);
}
+void
ns_printhost(p)
-register struct ns_addr *p;
+ register struct ns_addr *p;
{
printf("<net:%x%x,host:%x%x%x,port:%x>",
@@ -182,6 +188,7 @@ register struct ns_addr *p;
/*
* Process a received NS_ERR message.
*/
+void
ns_err_input(m)
struct mbuf *m;
{
@@ -295,8 +302,9 @@ nstime()
}
#endif
+int
ns_echo(m)
-struct mbuf *m;
+ struct mbuf *m;
{
register struct idp *idp = mtod(m, struct idp *);
register struct echo {
diff --git a/sys/netns/ns_error.h b/sys/netns/ns_error.h
index 4819a1b33cba..3dbfb8cd4b1d 100644
--- a/sys/netns/ns_error.h
+++ b/sys/netns/ns_error.h
@@ -31,9 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)ns_error.h 7.5 (Berkeley) 6/28/90
- * $Id: ns_error.h,v 1.2 1993/10/16 19:54:20 rgrimes Exp $
+ * $Id: ns_error.h,v 1.3 1993/11/07 17:50:27 wollman Exp $
*/
+#ifndef _NETNS_NS_ERROR_H_
+#define _NETNS_NS_ERROR_H_ 1
+
/*
* Xerox NS error messages
*/
@@ -87,5 +90,6 @@ struct ns_errstat {
};
#ifdef KERNEL
-struct ns_errstat ns_errstat;
+extern struct ns_errstat ns_errstat;
#endif
+#endif /* _NETNS_NS_ERROR_H_ */
diff --git a/sys/netns/ns_if.h b/sys/netns/ns_if.h
index 1a5608c4ac51..835f2d4d4e04 100644
--- a/sys/netns/ns_if.h
+++ b/sys/netns/ns_if.h
@@ -31,9 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)ns_if.h 7.6 (Berkeley) 6/28/90
- * $Id: ns_if.h,v 1.2 1993/10/16 19:54:22 rgrimes Exp $
+ * $Id: ns_if.h,v 1.4 1993/11/18 00:10:52 wollman Exp $
*/
+#ifndef _NETNS_NS_IF_H_
+#define _NETNS_NS_IF_H_ 1
+
/*
* Interface address, xerox version. One of these structures
* is allocated for each interface with an internet address.
@@ -45,7 +48,7 @@ struct ns_ifaddr {
struct ifaddr ia_ifa; /* protocol-independent info */
#define ia_ifp ia_ifa.ifa_ifp
#define ia_flags ia_ifa.ifa_flags
-/* union ns_net ia_net; /* network number of interface */
+/* union ns_net ia_net;*/ /* network number of interface */
#define ia_net ia_addr.sns_addr.x_net
struct ns_ifaddr *ia_next; /* next in list of xerox addresses */
struct sockaddr_ns ia_addr; /* reserve space for my address */
@@ -79,7 +82,8 @@ struct nsip_req {
#endif
#ifdef KERNEL
-struct ns_ifaddr *ns_ifaddr;
+extern struct ns_ifaddr *ns_ifaddr;
struct ns_ifaddr *ns_iaonnetof();
-struct ifqueue nsintrq; /* XNS input packet queue */
+extern struct ifqueue nsintrq; /* XNS input packet queue */
#endif
+#endif /* _NETNS_NS_IF_H_ */
diff --git a/sys/netns/ns_input.c b/sys/netns/ns_input.c
index 827c4094b728..2d5d82220957 100644
--- a/sys/netns/ns_input.c
+++ b/sys/netns/ns_input.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)ns_input.c 7.8 (Berkeley) 6/27/91
- * $Id: ns_input.c,v 1.2 1993/10/16 19:54:23 rgrimes Exp $
+ * $Id: ns_input.c,v 1.5 1993/12/19 00:53:57 wollman Exp $
*/
#include "param.h"
@@ -57,6 +57,9 @@
#include "idp_var.h"
#include "ns_error.h"
+static void idp_forward(struct mbuf *);
+static void idp_undo_route(struct route *);
+
/*
* NS initialization.
*/
@@ -78,6 +81,7 @@ int nsqmaxlen = IFQ_MAXLEN;
int idpcksum = 1;
long ns_pexseq;
+void
ns_init()
{
extern struct timeval time;
@@ -100,6 +104,8 @@ ns_init()
*/
int nsintr_getpck = 0;
int nsintr_swtch = 0;
+
+void
nsintr()
{
register struct idp *idp;
@@ -236,24 +242,47 @@ bad:
}
u_char nsctlerrmap[PRC_NCMDS] = {
- ECONNABORTED, ECONNABORTED, 0, 0,
- 0, 0, EHOSTDOWN, EHOSTUNREACH,
- ENETUNREACH, EHOSTUNREACH, ECONNREFUSED, ECONNREFUSED,
- EMSGSIZE, 0, 0, 0,
- 0, 0, 0, 0
+ ECONNABORTED, /* ifdown */
+ ECONNABORTED, /* routedead */
+ 0, /* #2 */
+ 0, /* quench2 */
+ 0, /* quench */
+ EMSGSIZE, /* msgsize */
+ EHOSTDOWN, /* hostdead */
+ EHOSTUNREACH, /* hostunreach */
+ ENETUNREACH, /* unreachnet */
+ EHOSTUNREACH, /* unreachhost */
+ ECONNREFUSED, /* unreachproto */
+ ECONNREFUSED, /* unreachport */
+ EMSGSIZE, /* old needfrag */
+ 0, /* srcfail */
+ 0, /* netunknown */
+ 0, /* hostunknown */
+ 0, /* isolated */
+ 0, /* net admin. prohibited */
+ 0, /* host admin. prohibited */
+ 0, /* tos net unreach */
+ 0, /* tos host unreach */
+ 0, /* redirect net */
+ 0, /* redirect host */
+ 0, /* redirect tosnet */
+ 0, /* redirect toshost */
+ 0, /* time exceeded */
+ 0, /* reassembly timeout */
+ 0, /* parameter problem */
+ 0 /* required option missing */
};
int idp_donosocks = 1;
+void
idp_ctlinput(cmd, arg)
int cmd;
caddr_t arg;
{
struct ns_addr *ns;
struct nspcb *nsp;
- struct ns_errp *errp;
- int idp_abort();
- extern struct nspcb *idp_drop();
+ struct ns_errp *errp = 0;
int type;
if (cmd < 0 || cmd > PRC_NCMDS)
@@ -304,8 +333,9 @@ int idpforwarding = 1;
struct route idp_droute;
struct route idp_sroute;
+static void
idp_forward(m)
-struct mbuf *m;
+ struct mbuf *m;
{
register struct idp *idp = mtod(m, struct idp *);
register int error, type, code;
@@ -423,6 +453,7 @@ cleanup:
m_freem(mcopy);
}
+int
idp_do_route(src, ro)
struct ns_addr *src;
struct route *ro;
@@ -445,15 +476,17 @@ struct route *ro;
return (1);
}
+static void
idp_undo_route(ro)
-register struct route *ro;
+ register struct route *ro;
{
if (ro->ro_rt) {RTFREE(ro->ro_rt);}
}
+void
ns_watch_output(m, ifp)
-struct mbuf *m;
-struct ifnet *ifp;
+ struct mbuf *m;
+ struct ifnet *ifp;
{
register struct nspcb *nsp;
register struct ifaddr *ifa;
diff --git a/sys/netns/ns_ip.c b/sys/netns/ns_ip.c
index 918724865fe8..728da87a9994 100644
--- a/sys/netns/ns_ip.c
+++ b/sys/netns/ns_ip.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)ns_ip.c 7.6 (Berkeley) 6/28/90
- * $Id: ns_ip.c,v 1.2 1993/10/16 19:54:25 rgrimes Exp $
+ * $Id: ns_ip.c,v 1.3 1993/12/19 00:53:58 wollman Exp $
*/
/*
@@ -73,7 +73,12 @@ struct ifnet_en {
struct ifnet_en *ifen_next;
};
-int nsipoutput(), nsipioctl(), nsipstart();
+struct rtentry;
+static int nsipoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
+ struct rtentry *);
+static int nsipioctl(struct ifnet *, int, caddr_t);
+static void nsipstart(struct ifnet *);
+static void nsip_free(struct ifnet *);
#define LOMTU (1024+512);
struct ifnet nsipif;
@@ -118,7 +123,7 @@ nsipattach()
/*
* Process an ioctl request.
*/
-/* ARGSUSED */
+static int
nsipioctl(ifp, cmd, data)
register struct ifnet *ifp;
int cmd;
@@ -141,8 +146,10 @@ nsipioctl(ifp, cmd, data)
case SIOCSIFFLAGS:
ifr = (struct ifreq *)data;
- if ((ifr->ifr_flags & IFF_UP) == 0)
- error = nsip_free(ifp);
+ if ((ifr->ifr_flags & IFF_UP) == 0) {
+ nsip_free(ifp);
+ error = 0;
+ }
default:
@@ -155,6 +162,7 @@ struct mbuf *nsip_badlen;
struct mbuf *nsip_lastin;
int nsip_hold_input;
+void
idpip_input(m, ifp)
register struct mbuf *m;
struct ifnet *ifp;
@@ -234,13 +242,14 @@ bad:
return;
}
-/* ARGSUSED */
-nsipoutput(ifn, m, dst)
- struct ifnet_en *ifn;
+static int
+nsipoutput(ifp, m, dst, rt)
+ struct ifnet *ifp;
register struct mbuf *m;
struct sockaddr *dst;
+ struct rtentry *rt;
{
-
+ struct ifnet_en *ifn = (struct ifnet_en *)ifp;
register struct ip *ip;
register struct route *ro = &(ifn->ifen_route);
register int len = 0;
@@ -301,6 +310,7 @@ bad:
return (ENETUNREACH);
}
+static void
nsipstart(ifp)
struct ifnet *ifp;
{
@@ -309,6 +319,7 @@ struct ifnet *ifp;
struct ifreq ifr = {"nsip0"};
+int
nsip_route(m)
register struct mbuf *m;
{
@@ -383,6 +394,7 @@ nsip_route(m)
(struct ifnet *)ifn));
}
+void
nsip_free(ifp)
struct ifnet *ifp;
{
@@ -394,9 +406,9 @@ struct ifnet *ifp;
ro->ro_rt = 0;
}
ifp->if_flags &= ~IFF_UP;
- return (0);
}
+void
nsip_ctlinput(cmd, sa)
int cmd;
struct sockaddr *sa;
@@ -425,6 +437,7 @@ nsip_ctlinput(cmd, sa)
}
}
+void
nsip_rtchange(dst)
register struct in_addr *dst;
{
diff --git a/sys/netns/ns_output.c b/sys/netns/ns_output.c
index 1c353c89d839..ed60e6af715c 100644
--- a/sys/netns/ns_output.c
+++ b/sys/netns/ns_output.c
@@ -31,10 +31,11 @@
* SUCH DAMAGE.
*
* from: @(#)ns_output.c 7.8 (Berkeley) 12/16/90
- * $Id: ns_output.c,v 1.2 1993/10/16 19:54:26 rgrimes Exp $
+ * $Id: ns_output.c,v 1.4 1993/12/19 00:53:59 wollman Exp $
*/
#include "param.h"
+#include "systm.h"
#include "malloc.h"
#include "mbuf.h"
#include "errno.h"
@@ -57,6 +58,7 @@ int ns_copy_output = 0;
int ns_output_cnt = 0;
struct mbuf *ns_lastout;
+int
ns_output(m0, ro, flags)
struct mbuf *m0;
struct route *ro;
diff --git a/sys/netns/ns_pcb.c b/sys/netns/ns_pcb.c
index 9f1ec92e4a70..12e4f2603ca9 100644
--- a/sys/netns/ns_pcb.c
+++ b/sys/netns/ns_pcb.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)ns_pcb.c 7.11 (Berkeley) 6/27/91
- * $Id: ns_pcb.c,v 1.2 1993/10/16 19:54:28 rgrimes Exp $
+ * $Id: ns_pcb.c,v 1.5 1993/12/19 00:54:00 wollman Exp $
*/
#include "param.h"
@@ -50,7 +50,9 @@
#include "ns_pcb.h"
struct ns_addr zerons_addr;
+struct nspcb nspcb;
+int
ns_pcballoc(so, head)
struct socket *so;
struct nspcb *head;
@@ -68,6 +70,7 @@ ns_pcballoc(so, head)
return (0);
}
+int
ns_pcbbind(nsp, nam)
register struct nspcb *nsp;
struct mbuf *nam;
@@ -118,6 +121,7 @@ noname:
* If don't have a local address for this socket yet,
* then pick one.
*/
+int
ns_pcbconnect(nsp, nam)
struct nspcb *nsp;
struct mbuf *nam;
@@ -217,6 +221,7 @@ ns_pcbconnect(nsp, nam)
return (0);
}
+void
ns_pcbdisconnect(nsp)
struct nspcb *nsp;
{
@@ -226,6 +231,7 @@ ns_pcbdisconnect(nsp)
ns_pcbdetach(nsp);
}
+void
ns_pcbdetach(nsp)
struct nspcb *nsp;
{
@@ -239,6 +245,7 @@ ns_pcbdetach(nsp)
(void) m_free(dtom(nsp));
}
+void
ns_setsockaddr(nsp, nam)
register struct nspcb *nsp;
struct mbuf *nam;
@@ -253,6 +260,7 @@ ns_setsockaddr(nsp, nam)
sns->sns_addr = nsp->nsp_laddr;
}
+void
ns_setpeeraddr(nsp, nam)
register struct nspcb *nsp;
struct mbuf *nam;
@@ -274,10 +282,12 @@ ns_setpeeraddr(nsp, nam)
* Also pass an extra paramter via the nspcb. (which may in fact
* be a parameter list!)
*/
+void
ns_pcbnotify(dst, errno, notify, param)
register struct ns_addr *dst;
+ int errno;
+ ns_notify_func_t notify;
long param;
- int errno, (*notify)();
{
register struct nspcb *nsp, *oinp;
int s = splimp();
@@ -295,7 +305,7 @@ ns_pcbnotify(dst, errno, notify, param)
oinp = nsp;
nsp = nsp->nsp_next;
oinp->nsp_notify_param = param;
- (*notify)(oinp);
+ (*notify)(oinp, errno);
}
splx(s);
}
@@ -324,6 +334,7 @@ struct nspcb *
ns_pcblookup(faddr, lport, wildp)
struct ns_addr *faddr;
u_short lport;
+ int wildp;
{
register struct nspcb *nsp, *match = 0;
int matchwild = 3, wildcard;
diff --git a/sys/netns/ns_pcb.h b/sys/netns/ns_pcb.h
index 59bf6761fda4..affb5df5a6be 100644
--- a/sys/netns/ns_pcb.h
+++ b/sys/netns/ns_pcb.h
@@ -31,9 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)ns_pcb.h 7.4 (Berkeley) 6/28/90
- * $Id: ns_pcb.h,v 1.2 1993/10/16 19:54:30 rgrimes Exp $
+ * $Id: ns_pcb.h,v 1.5 1993/12/19 00:54:01 wollman Exp $
*/
+#ifndef _NETNS_NS_PCB_H_
+#define _NETNS_NS_PCB_H_ 1
+
/*
* Ns protocol interface control block.
*/
@@ -76,6 +79,18 @@ struct nspcb {
#ifdef KERNEL
-struct nspcb nspcb; /* head of list */
-struct nspcb *ns_pcblookup();
-#endif
+extern struct nspcb nspcb; /* head of list */
+
+extern int ns_pcballoc(struct socket *, struct nspcb *);
+extern int ns_pcbbind(struct nspcb *, struct mbuf *);
+extern int ns_pcbconnect(struct nspcb *, struct mbuf *);
+extern void ns_pcbdisconnect(struct nspcb *);
+extern void ns_pcbdetach(struct nspcb *);
+extern void ns_setsockaddr(struct nspcb *, struct mbuf *);
+extern void ns_setpeeraddr(struct nspcb *, struct mbuf *);
+typedef void (*ns_notify_func_t)(struct nspcb *, int);
+extern void ns_pcbnotify(struct ns_addr *, int, ns_notify_func_t, long);
+extern struct nspcb *ns_pcblookup(struct ns_addr *, int /*u_short*/, int);
+
+#endif /* KERNEL */
+#endif /* _NETNS_NS_PCB_H_ */
diff --git a/sys/netns/ns_proto.c b/sys/netns/ns_proto.c
index 6e00d372d084..de951788c315 100644
--- a/sys/netns/ns_proto.c
+++ b/sys/netns/ns_proto.c
@@ -31,10 +31,11 @@
* SUCH DAMAGE.
*
* from: @(#)ns_proto.c 7.4 (Berkeley) 6/28/90
- * $Id: ns_proto.c,v 1.2 1993/10/16 19:54:31 rgrimes Exp $
+ * $Id: ns_proto.c,v 1.3 1993/12/19 00:54:02 wollman Exp $
*/
#include "param.h"
+#include "systm.h"
#include "socket.h"
#include "protosw.h"
#include "domain.h"
@@ -42,20 +43,21 @@
#include "ns.h"
+#include "idp.h"
+#include "idp_var.h"
+#include "sp.h"
+#include "spidp.h"
+#include "spp_timer.h"
+#include "spp_var.h"
+
/*
* NS protocol family: IDP, ERR, PE, SPP, ROUTE.
*/
-int ns_init();
-int idp_input(), idp_output(), idp_ctlinput(), idp_usrreq();
-int idp_raw_usrreq(), idp_ctloutput();
-int spp_input(), spp_ctlinput();
-int spp_usrreq(), spp_usrreq_sp(), spp_ctloutput();
-int spp_init(), spp_fasttimo(), spp_slowtimo();
extern int raw_usrreq();
extern struct domain nsdomain;
-struct protosw nssw[] = {
+struct ns_protosw nssw[] = {
{ 0, &nsdomain, 0, 0,
0, idp_output, 0, 0,
0,
@@ -82,13 +84,15 @@ struct protosw nssw[] = {
0, 0, 0, 0,
},
{ SOCK_RAW, &nsdomain, NSPROTO_ERROR, PR_ATOMIC|PR_ADDR,
- idp_ctlinput, idp_output, 0, idp_ctloutput,
+ idp_input, idp_output, idp_ctlinput, idp_ctloutput,
idp_raw_usrreq,
0, 0, 0, 0,
},
};
-struct domain nsdomain =
- { AF_NS, "network systems", 0, 0, 0,
- nssw, &nssw[sizeof(nssw)/sizeof(nssw[0])] };
-
+struct domain nsdomain =
+{
+ AF_NS, "network systems", 0, 0, 0,
+ (struct protosw *)nssw,
+ (struct protosw *)&nssw[sizeof(nssw)/sizeof(nssw[0])]
+};
diff --git a/sys/netns/sp.h b/sys/netns/sp.h
index b5ab9a680e38..aab28b4be363 100644
--- a/sys/netns/sp.h
+++ b/sys/netns/sp.h
@@ -31,9 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)sp.h 7.4 (Berkeley) 6/28/90
- * $Id: sp.h,v 1.2 1993/10/16 19:54:32 rgrimes Exp $
+ * $Id: sp.h,v 1.3 1993/11/07 17:50:33 wollman Exp $
*/
+#ifndef _NETNS_SP_H_
+#define _NETNS_SP_H_ 1
+
/*
* Definitions for Xerox NS style sequenced packet protocol
*/
@@ -51,3 +54,4 @@ struct sphdr {
u_short sp_ack; /* acknowledge number */
u_short sp_alo; /* allocation number */
};
+#endif /* _NETNS_SP_H_ */
diff --git a/sys/netns/spidp.h b/sys/netns/spidp.h
index 04283e0ff5e0..def6c048fb69 100644
--- a/sys/netns/spidp.h
+++ b/sys/netns/spidp.h
@@ -31,9 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)spidp.h 7.4 (Berkeley) 6/28/90
- * $Id: spidp.h,v 1.2 1993/10/16 19:54:34 rgrimes Exp $
+ * $Id: spidp.h,v 1.3 1993/11/07 17:50:34 wollman Exp $
*/
+#ifndef _NETNS_SPIDP_H_
+#define _NETNS_SPIDP_H_ 1
+
/*
* Definitions for NS(tm) Internet Datagram Protocol
* containing a Sequenced Packet Protocol packet.
@@ -61,3 +64,4 @@ struct spidp_q {
#define si_seq si_s.sp_seq
#define si_ack si_s.sp_ack
#define si_alo si_s.sp_alo
+#endif /* _NETNS_SPIDP_H_ */
diff --git a/sys/netns/spp_debug.c b/sys/netns/spp_debug.c
index ce3752b97945..643ac028b804 100644
--- a/sys/netns/spp_debug.c
+++ b/sys/netns/spp_debug.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)spp_debug.c 7.7 (Berkeley) 6/28/90
- * $Id: spp_debug.c,v 1.2 1993/10/16 19:54:35 rgrimes Exp $
+ * $Id: spp_debug.c,v 1.5 1993/12/19 00:54:03 wollman Exp $
*/
#include "param.h"
@@ -58,10 +58,14 @@
#define SANAMES
#include "spp_debug.h"
+struct spp_debug spp_debug[SPP_NDEBUG];
+int spp_debx;
+
int sppconsdebug = 0;
/*
* spp debug routines
*/
+void
spp_trace(act, ostate, sp, si, req)
short act;
u_char ostate;
@@ -130,7 +134,7 @@ spp_trace(act, ostate, sp, si, req)
if (flags) {
char *cp = "<";
#ifndef lint
-#define pf(f) { if (flags&SP_/**/f) { printf("%s%s", cp, "f"); cp = ","; } }
+#define pf(f) { if (flags& SP_##f) { printf("%s" #f, cp); cp = ","; } }
pf(SP); pf(SA); pf(OB); pf(EM);
#else
cp = cp;
@@ -138,7 +142,7 @@ spp_trace(act, ostate, sp, si, req)
printf(">");
}
#ifndef lint
-#define p2(f) { printf("%s = %x, ", "f", si->si_/**/f); }
+#define p2(f) { printf("%s = %x, ", "f", si->si_##f); }
p2(sid);p2(did);p2(dt);p2(pt);
#endif
ns_printhost(&si->si_sna);
@@ -163,7 +167,7 @@ spp_trace(act, ostate, sp, si, req)
if (sp == 0)
return;
#ifndef lint
-#define p3(f) { printf("%s = %x, ", "f", sp->s_/**/f); }
+#define p3(f) { printf("%s = %x, ", "f", sp->s_##f); }
printf("\t"); p3(rack);p3(ralo);p3(smax);p3(flags); printf("\n");
#endif
#endif
diff --git a/sys/netns/spp_debug.h b/sys/netns/spp_debug.h
index f71569447ba3..6b871550b1c6 100644
--- a/sys/netns/spp_debug.h
+++ b/sys/netns/spp_debug.h
@@ -31,9 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)spp_debug.h 7.4 (Berkeley) 6/28/90
- * $Id: spp_debug.h,v 1.2 1993/10/16 19:54:36 rgrimes Exp $
+ * $Id: spp_debug.h,v 1.3 1993/11/07 17:50:36 wollman Exp $
*/
+#ifndef _NETNS_SPP_DEBUG_H_
+#define _NETNS_SPP_DEBUG_H_ 1
+
struct spp_debug {
u_long sd_time;
short sd_act;
@@ -56,5 +59,6 @@ char *sanames[] =
#endif
#define SPP_NDEBUG 100
-struct spp_debug spp_debug[SPP_NDEBUG];
-int spp_debx;
+extern struct spp_debug spp_debug[SPP_NDEBUG];
+extern int spp_debx;
+#endif /* _NETNS_SPP_DEBUG_H_ */
diff --git a/sys/netns/spp_timer.h b/sys/netns/spp_timer.h
index 49ea26512243..7aced135a966 100644
--- a/sys/netns/spp_timer.h
+++ b/sys/netns/spp_timer.h
@@ -31,9 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)spp_timer.h 7.3 (Berkeley) 6/28/90
- * $Id: spp_timer.h,v 1.2 1993/10/16 19:54:37 rgrimes Exp $
+ * $Id: spp_timer.h,v 1.3 1993/11/07 17:50:38 wollman Exp $
*/
+#ifndef _NETNS_SPP_TIMER_H_
+#define _NETNS_SPP_TIMER_H_ 1
+
/*
* Definitions of the SPP timers. These timers are counted
* down PR_SLOWHZ times a second.
@@ -121,3 +124,4 @@ char *spptimers[] =
#ifdef KERNEL
extern int spp_backoff[];
#endif
+#endif /* _NETNS_SPP_TIMER_H_ */
diff --git a/sys/netns/spp_usrreq.c b/sys/netns/spp_usrreq.c
index 5a9e55c84a71..2cbfb383c9e4 100644
--- a/sys/netns/spp_usrreq.c
+++ b/sys/netns/spp_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)spp_usrreq.c 7.15 (Berkeley) 6/27/91
- * $Id: spp_usrreq.c,v 1.2 1993/10/16 19:54:39 rgrimes Exp $
+ * $Id: spp_usrreq.c,v 1.5 1993/12/19 00:54:04 wollman Exp $
*/
#include "param.h"
@@ -58,9 +58,18 @@
#include "spp_var.h"
#include "spp_debug.h"
+static void spp_quench(struct nspcb *, int);
+static void spp_abort(struct nspcb *, int);
+static void spp_setpersist(struct sppcb *);
+static void spp_template(struct sppcb *);
+
+struct spp_istat spp_istat;
+u_short spp_iss;
+
/*
* SP protocol implementation.
*/
+void
spp_init()
{
@@ -74,6 +83,7 @@ int spp_use_delack = 0;
u_short spp_newchecks[50];
/*ARGSUSED*/
+void
spp_input(m, nsp)
register struct mbuf *m;
register struct nspcb *nsp;
@@ -81,7 +91,7 @@ spp_input(m, nsp)
register struct sppcb *cb;
register struct spidp *si = mtod(m, struct spidp *);
register struct socket *so;
- short ostate;
+ short ostate = 0;
int dropsocket = 0;
@@ -287,9 +297,10 @@ int spprexmtthresh = 3;
* but its function is somewhat different: It merely queues
* packets up, and suppresses duplicates.
*/
+int
spp_reass(cb, si)
-register struct sppcb *cb;
-register struct spidp *si;
+ register struct sppcb *cb;
+ register struct spidp *si;
{
register struct spidp_q *q;
register struct mbuf *m;
@@ -575,15 +586,13 @@ present:
return (0);
}
+void
spp_ctlinput(cmd, arg)
int cmd;
caddr_t arg;
{
struct ns_addr *na;
- extern u_char nsctlerrmap[];
- extern spp_abort(), spp_quench();
- extern struct nspcb *idp_drop();
- struct ns_errp *errp;
+ struct ns_errp *errp = 0;
struct nspcb *nsp;
struct sockaddr_ns *sns;
int type;
@@ -639,8 +648,10 @@ spp_ctlinput(cmd, arg)
* When a source quench is received, close congestion window
* to one packet. We will gradually open it again as we proceed.
*/
-spp_quench(nsp)
+static void
+spp_quench(nsp, errno)
struct nspcb *nsp;
+ int errno;
{
struct sppcb *cb = nstosppcb(nsp);
@@ -697,6 +708,7 @@ register struct nspcb *nsp;
}
#endif
+int
spp_output(cb, m0)
register struct sppcb *cb;
struct mbuf *m0;
@@ -1112,6 +1124,7 @@ send:
int spp_do_persist_panics = 0;
+static void
spp_setpersist(cb)
register struct sppcb *cb;
{
@@ -1129,10 +1142,13 @@ spp_setpersist(cb)
if (cb->s_rxtshift < SPP_MAXRXTSHIFT)
cb->s_rxtshift++;
}
+
/*ARGSUSED*/
+int
spp_ctloutput(req, so, level, name, value)
int req;
struct socket *so;
+ int level;
int name;
struct mbuf **value;
{
@@ -1255,13 +1271,15 @@ spp_ctloutput(req, so, level, name, value)
}
/*ARGSUSED*/
-spp_usrreq(so, req, m, nam, controlp)
+int
+spp_usrreq(so, req, m, nam, controlp, dummy)
struct socket *so;
int req;
struct mbuf *m, *nam, *controlp;
+ struct mbuf *dummy;
{
struct nspcb *nsp = sotonspcb(so);
- register struct sppcb *cb;
+ register struct sppcb *cb = 0;
int s = splnet();
int error = 0, ostate;
struct mbuf *mm;
@@ -1507,12 +1525,14 @@ release:
return (error);
}
-spp_usrreq_sp(so, req, m, nam, controlp)
+int
+spp_usrreq_sp(so, req, m, nam, controlp, dummy)
struct socket *so;
int req;
struct mbuf *m, *nam, *controlp;
+ struct mbuf *dummy;
{
- int error = spp_usrreq(so, req, m, nam, controlp);
+ int error = spp_usrreq(so, req, m, nam, controlp, dummy);
if (req == PRU_ATTACH && error == 0) {
struct nspcb *nsp = sotonspcb(so);
@@ -1528,6 +1548,7 @@ spp_usrreq_sp(so, req, m, nam, controlp)
* in a skeletal spp header (choosing connection id),
* minimizing the amount of work necessary when the connection is used.
*/
+static void
spp_template(cb)
register struct sppcb *cb;
{
@@ -1622,8 +1643,10 @@ spp_drop(cb, errno)
return (spp_close(cb));
}
-spp_abort(nsp)
+static void
+spp_abort(nsp, errno)
struct nspcb *nsp;
+ int errno;
{
(void) spp_close((struct sppcb *)nsp->nsp_pcb);
@@ -1634,6 +1657,7 @@ int spp_backoff[SPP_MAXRXTSHIFT+1] =
/*
* Fast timeout routine for processing delayed acks
*/
+void
spp_fasttimo()
{
register struct nspcb *nsp;
@@ -1658,6 +1682,7 @@ spp_fasttimo()
* Updates the timers in all active pcb's and
* causes finite state machine actions if timers expire.
*/
+void
spp_slowtimo()
{
register struct nspcb *ip, *ipnxt;
@@ -1681,9 +1706,11 @@ spp_slowtimo()
for (i = 0; i < SPPT_NTIMERS; i++) {
if (cb->s_timer[i] && --cb->s_timer[i] == 0) {
(void) spp_usrreq(cb->s_nspcb->nsp_socket,
- PRU_SLOWTIMO, (struct mbuf *)0,
- (struct mbuf *)i, (struct mbuf *)0,
- (struct mbuf *)0);
+ PRU_SLOWTIMO,
+ (struct mbuf *)0,
+ (struct mbuf *)i,
+ (struct mbuf *)0,
+ (struct mbuf *)0);
if (ipnxt->nsp_prev != ip)
goto tpgone;
}
@@ -1799,7 +1826,7 @@ spp_timers(cb, timer)
}
return (cb);
}
-#ifndef lint
+#if 0
int SppcbSize = sizeof (struct sppcb);
int NspcbSize = sizeof (struct nspcb);
-#endif lint
+#endif
diff --git a/sys/netns/spp_var.h b/sys/netns/spp_var.h
index a9d39e9ad4bd..d707570ba71e 100644
--- a/sys/netns/spp_var.h
+++ b/sys/netns/spp_var.h
@@ -31,9 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)spp_var.h 7.7 (Berkeley) 6/28/90
- * $Id: spp_var.h,v 1.2 1993/10/16 19:54:41 rgrimes Exp $
+ * $Id: spp_var.h,v 1.4 1993/12/19 00:54:05 wollman Exp $
*/
+#ifndef _NETNS_SPP_VAR_H_
+#define _NETNS_SPP_VAR_H_ 1
+
/*
* Sp control block, one per connection
*/
@@ -184,17 +187,15 @@ struct spp_istat {
};
#ifdef KERNEL
-struct spp_istat spp_istat;
+extern struct spp_istat spp_istat;
/* Following was struct sppstat sppstat; */
#ifndef sppstat
#define sppstat spp_istat.newstats
#endif
-u_short spp_iss;
-extern struct sppcb *spp_close(), *spp_disconnect(),
- *spp_usrclosed(), *spp_timers(), *spp_drop();
-#endif
+extern u_short spp_iss;
+#endif /* KERNEL */
#define SPP_ISSINCR 128
/*
@@ -202,15 +203,38 @@ extern struct sppcb *spp_close(), *spp_disconnect(),
* on with modular arithmetic. These macros can be
* used to compare such integers.
*/
-#ifdef sun
-short xnsCbug;
-#define SSEQ_LT(a,b) ((xnsCbug = (short)((a)-(b))) < 0)
-#define SSEQ_LEQ(a,b) ((xnsCbug = (short)((a)-(b))) <= 0)
-#define SSEQ_GT(a,b) ((xnsCbug = (short)((a)-(b))) > 0)
-#define SSEQ_GEQ(a,b) ((xnsCbug = (short)((a)-(b))) >= 0)
-#else
#define SSEQ_LT(a,b) (((short)((a)-(b))) < 0)
#define SSEQ_LEQ(a,b) (((short)((a)-(b))) <= 0)
#define SSEQ_GT(a,b) (((short)((a)-(b))) > 0)
#define SSEQ_GEQ(a,b) (((short)((a)-(b))) >= 0)
-#endif
+
+#ifdef KERNEL
+/* From spp_debug.c: */
+extern void spp_trace(int /*short*/, int /*u_char*/, struct sppcb *,
+ struct spidp *, int);
+
+/* From spp_usrreq.c: */
+extern struct spp_istat spp_istat;
+extern u_short spp_iss;
+extern void spp_init(void);
+extern void spp_input(struct mbuf *, struct nspcb *);
+extern int spprexmtthresh;
+extern int spp_reass(struct sppcb *, struct spidp *);
+extern void spp_ctlinput(int, caddr_t);
+extern int spp_output(struct sppcb *, struct mbuf *);
+extern int spp_do_persist_panics;
+extern int spp_ctloutput(int, struct socket *, int, int, struct mbuf **);
+extern int spp_usrreq(struct socket *, int, struct mbuf *, struct mbuf *,
+ struct mbuf *, struct mbuf *);
+extern int spp_usrreq_sp(struct socket *, int, struct mbuf *, struct mbuf *,
+ struct mbuf *, struct mbuf *);
+extern struct sppcb *spp_close(struct sppcb *);
+extern struct sppcb *spp_usrclosed(struct sppcb *);
+extern struct sppcb *spp_disconnect(struct sppcb *);
+extern struct sppcb *spp_drop(struct sppcb *, int);
+extern void spp_fasttimo(void);
+extern void spp_slowtimo(void);
+extern struct sppcb *spp_timers(struct sppcb *, int);
+
+#endif /* KERNEL */
+#endif /* _NETNS_SPP_VAR_H_ */