aboutsummaryrefslogtreecommitdiff
path: root/sys/netiso
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/netiso
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/netiso')
-rw-r--r--sys/netiso/argo_debug.h3
-rw-r--r--sys/netiso/clnl.h9
-rw-r--r--sys/netiso/clnp.h52
-rw-r--r--sys/netiso/clnp_debug.c4
-rw-r--r--sys/netiso/clnp_er.c23
-rw-r--r--sys/netiso/clnp_frag.c104
-rw-r--r--sys/netiso/clnp_input.c13
-rw-r--r--sys/netiso/clnp_options.c25
-rw-r--r--sys/netiso/clnp_output.c5
-rw-r--r--sys/netiso/clnp_raw.c9
-rw-r--r--sys/netiso/clnp_stat.h6
-rw-r--r--sys/netiso/clnp_subr.c84
-rw-r--r--sys/netiso/clnp_timer.c5
-rw-r--r--sys/netiso/cltp_usrreq.c16
-rw-r--r--sys/netiso/cltp_var.h10
-rw-r--r--sys/netiso/cons.h8
-rw-r--r--sys/netiso/cons_pcb.h14
-rw-r--r--sys/netiso/eonvar.h12
-rw-r--r--sys/netiso/esis.c76
-rw-r--r--sys/netiso/esis.h33
-rw-r--r--sys/netiso/if_cons.c51
-rw-r--r--sys/netiso/if_eon.c47
-rw-r--r--sys/netiso/iso.c59
-rw-r--r--sys/netiso/iso_chksum.c140
-rw-r--r--sys/netiso/iso_errno.h4
-rw-r--r--sys/netiso/iso_map.h6
-rw-r--r--sys/netiso/iso_pcb.h6
-rw-r--r--sys/netiso/iso_proto.c34
-rw-r--r--sys/netiso/iso_snpac.c85
-rw-r--r--sys/netiso/iso_snpac.h28
-rw-r--r--sys/netiso/iso_var.h30
-rw-r--r--sys/netiso/tp_astring.c4
-rw-r--r--sys/netiso/tp_clnp.h4
-rw-r--r--sys/netiso/tp_cons.c17
-rw-r--r--sys/netiso/tp_driver.c6
-rw-r--r--sys/netiso/tp_emit.c10
-rw-r--r--sys/netiso/tp_events.h94
-rw-r--r--sys/netiso/tp_inet.c29
-rw-r--r--sys/netiso/tp_input.c39
-rw-r--r--sys/netiso/tp_ip.h4
-rw-r--r--sys/netiso/tp_iso.c19
-rw-r--r--sys/netiso/tp_meas.c6
-rw-r--r--sys/netiso/tp_meas.h8
-rw-r--r--sys/netiso/tp_output.c4
-rw-r--r--sys/netiso/tp_param.h16
-rw-r--r--sys/netiso/tp_pcb.c56
-rw-r--r--sys/netiso/tp_pcb.h78
-rw-r--r--sys/netiso/tp_seq.h4
-rw-r--r--sys/netiso/tp_stat.h19
-rw-r--r--sys/netiso/tp_states.h6
-rw-r--r--sys/netiso/tp_subr.c25
-rw-r--r--sys/netiso/tp_subr2.c27
-rw-r--r--sys/netiso/tp_timer.c3
-rw-r--r--sys/netiso/tp_timer.h4
-rw-r--r--sys/netiso/tp_tpdu.h54
-rw-r--r--sys/netiso/tp_trace.h19
-rw-r--r--sys/netiso/tp_user.h14
-rw-r--r--sys/netiso/tp_usrreq.c12
58 files changed, 876 insertions, 706 deletions
diff --git a/sys/netiso/argo_debug.h b/sys/netiso/argo_debug.h
index 1d751462bad3..40d1c0407768 100644
--- a/sys/netiso/argo_debug.h
+++ b/sys/netiso/argo_debug.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)argo_debug.h 7.4 (Berkeley) 5/6/91
- * $Id: argo_debug.h,v 1.2 1993/10/16 21:04:39 rgrimes Exp $
+ * $Id: argo_debug.h,v 1.3 1993/11/25 01:35:35 wollman Exp $
*/
/*****************************************************************
@@ -172,6 +172,7 @@ if( !(phrase) ) printf("ASSERTION NOT VALID at line %d file %s\n",__LINE__,__FIL
#define D_REASS '\21'
/* clnp reassembly */
+extern void Dump_buf(char *, int);
char *clnp_iso_addrp();
/***********************************************
diff --git a/sys/netiso/clnl.h b/sys/netiso/clnl.h
index 5280a5d9fc8f..3008e958a460 100644
--- a/sys/netiso/clnl.h
+++ b/sys/netiso/clnl.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)clnl.h 7.3 (Berkeley) 5/6/91
- * $Id: clnl.h,v 1.2 1993/10/16 21:04:41 rgrimes Exp $
+ * $Id: clnl.h,v 1.4 1993/11/25 01:35:37 wollman Exp $
*/
/***********************************************************
@@ -57,9 +57,14 @@ SOFTWARE.
******************************************************************/
+#ifndef _NETISO_CLNL_H_
+#define _NETISO_CLNL_H_ 1
+
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
struct clnl_protosw {
- int (*clnl_input)(); /* input routine */
+ void (*clnl_input)(struct mbuf *, struct snpa_hdr *);
+ /* input routine */
};
+#endif /* _NETISO_CLNL_H_ */
diff --git a/sys/netiso/clnp.h b/sys/netiso/clnp.h
index 9a28d0c9d3a8..ffba45674b19 100644
--- a/sys/netiso/clnp.h
+++ b/sys/netiso/clnp.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)clnp.h 7.8 (Berkeley) 5/6/91
- * $Id: clnp.h,v 1.2 1993/10/16 21:04:42 rgrimes Exp $
+ * $Id: clnp.h,v 1.5 1993/12/19 00:53:03 wollman Exp $
*/
/***********************************************************
@@ -57,28 +57,15 @@ SOFTWARE.
******************************************************************/
+#ifndef _NETISO_CLNP_H_
+#define _NETISO_CLNP_H_ 1
+
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-#ifndef BYTE_ORDER
-/*
- * Definitions for byte order,
- * according to byte significance from low address to high.
- */
-#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax) */
-#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
-#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */
-
-#ifdef vax
-#define BYTE_ORDER LITTLE_ENDIAN
-#else
-#define BYTE_ORDER BIG_ENDIAN /* mc68000, tahoe, most others */
-#endif
-#endif BYTE_ORDER
+#include <machine/endian.h>
-/* should be config option but cpp breaks with too many #defines */
-#define DECBIT
/*
* Return true if the mbuf is a cluster mbuf
@@ -403,7 +390,7 @@ struct troll {
- trollctl.tr_mtu_adj)
#ifdef KERNEL
-extern float troll_random;
+extern float troll_random __P((void));
#endif
#else /* NO TROLL */
@@ -414,7 +401,7 @@ extern float troll_random;
#define SN_MTU(ifp, rt) (((rt && rt->rt_rmx.rmx_mtu) ?\
rt->rt_rmx.rmx_mtu : clnp_badmtu(ifp, rt, __LINE__, __FILE__)))
-#endif TROLL
+#endif /* not TROLL */
/*
* Macro to remove an address from a clnp header
@@ -472,6 +459,25 @@ caddr_t clnp_insert_addr();
struct iso_addr *clnp_srcaddr();
struct mbuf *clnp_reass();
#ifdef TROLL
-struct troll trollctl;
-#endif TROLL
-#endif KERNEL
+extern struct troll trollctl;
+#endif /* TROLL */
+
+extern void clnp_emit_er(struct mbuf *, int /*char*/);
+extern void clnp_discard(struct mbuf *, int);
+
+/* From clnp_subr.h: */
+struct snpa_hdr; struct route_iso;
+extern struct mbuf *clnp_data_ck(struct mbuf *, int);
+extern int clnp_ours(struct iso_addr *);
+extern void clnp_forward(struct mbuf *, int, struct iso_addr *,
+ struct clnp_optidx *, int, struct snpa_hdr *);
+extern int clnp_route(struct iso_addr *, struct route_iso *, int,
+ struct sockaddr **, struct iso_ifaddr **);
+extern int clnp_srcroute(struct mbuf *, struct clnp_optidx *,
+ struct route_iso *, struct sockaddr **,
+ struct iso_ifaddr **, struct iso_addr *);
+extern int clnp_badmtu(struct ifnet *, struct rtentry *, int, const char *);
+extern void clnp_ypocb(caddr_t, caddr_t, u_int);
+
+#endif /* KERNEL */
+#endif /* _NETISO_CLNP_H_ */
diff --git a/sys/netiso/clnp_debug.c b/sys/netiso/clnp_debug.c
index 600bc1f2e520..76bcb82575af 100644
--- a/sys/netiso/clnp_debug.c
+++ b/sys/netiso/clnp_debug.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)clnp_debug.c 7.8 (Berkeley) 5/27/91
- * $Id: clnp_debug.c,v 1.2 1993/10/16 21:04:44 rgrimes Exp $
+ * $Id: clnp_debug.c,v 1.3 1993/12/19 00:53:05 wollman Exp $
*/
/***********************************************************
@@ -61,8 +61,8 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-#include "types.h"
#include "param.h"
+#include "systm.h"
#include "mbuf.h"
#include "domain.h"
#include "protosw.h"
diff --git a/sys/netiso/clnp_er.c b/sys/netiso/clnp_er.c
index 34d14512273e..3be4eaeede67 100644
--- a/sys/netiso/clnp_er.c
+++ b/sys/netiso/clnp_er.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)clnp_er.c 7.7 (Berkeley) 5/6/91
- * $Id: clnp_er.c,v 1.2 1993/10/16 21:04:45 rgrimes Exp $
+ * $Id: clnp_er.c,v 1.4 1993/12/19 00:53:07 wollman Exp $
*/
/***********************************************************
@@ -62,6 +62,7 @@ SOFTWARE.
*/
#include "param.h"
+#include "systm.h"
#include "mbuf.h"
#include "domain.h"
#include "protosw.h"
@@ -101,10 +102,11 @@ static struct clnp_fixed er_template = {
*
* NOTES:
*/
+void
clnp_er_input(m, src, reason)
-struct mbuf *m; /* ptr to packet itself */
-struct iso_addr *src; /* ptr to src of er */
-u_char reason; /* reason code of er */
+ struct mbuf *m; /* ptr to packet itself */
+ struct iso_addr *src; /* ptr to src of er */
+ u_char reason; /* reason code of er */
{
int cmd = -1;
extern u_char clnp_protox[];
@@ -189,9 +191,10 @@ u_char reason; /* reason code of er */
* NOTES: This code assumes that we have previously tried to pull
* up the header of the datagram into one mbuf.
*/
+void
clnp_discard(m, reason)
-struct mbuf *m; /* header of packet to discard */
-char reason; /* reason for discard */
+ struct mbuf *m; /* header of packet to discard */
+ char reason; /* reason for discard */
{
IFDEBUG(D_DISCARD)
printf("clnp_discard: m x%x, reason x%x\n", m, reason);
@@ -228,9 +231,10 @@ char reason; /* reason for discard */
* was created by us; in this case, do not send
* an ER.
*/
+void
clnp_emit_er(m, reason)
-struct mbuf *m; /* header of packet to discard */
-char reason; /* reason for discard */
+ struct mbuf *m; /* header of packet to discard */
+ char reason; /* reason for discard */
{
register struct clnp_fixed *clnp = mtod(m, struct clnp_fixed *);
register struct clnp_fixed *er;
@@ -361,8 +365,9 @@ done:
RTFREE(route.ro_rt);
}
+int
clnp_er_index(p)
-u_char p;
+ u_char p;
{
register u_char *cp = clnp_er_codes + CLNP_ERRORS;
while (cp > clnp_er_codes) {
diff --git a/sys/netiso/clnp_frag.c b/sys/netiso/clnp_frag.c
index 1c1ca21fc7d5..6554bef7ac12 100644
--- a/sys/netiso/clnp_frag.c
+++ b/sys/netiso/clnp_frag.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)clnp_frag.c 7.12 (Berkeley) 5/6/91
- * $Id: clnp_frag.c,v 1.3 1993/10/16 21:04:46 rgrimes Exp $
+ * $Id: clnp_frag.c,v 1.5 1993/12/19 00:53:10 wollman Exp $
*/
/***********************************************************
@@ -82,57 +82,61 @@ SOFTWARE.
/* all fragments are hung off this list */
struct clnp_fragl *clnp_frags = NULL;
+static void clnp_insert_frag(struct clnp_fragl *, struct mbuf *, struct clnp_segment *);
+
+
struct mbuf *clnp_comp_pdu();
/*
- * FUNCTION: clnp_fragment
+ * FUNCTION: clnp_fragment
*
- * PURPOSE: Fragment a datagram, and send the itty bitty pieces
- * out over an interface.
+ * PURPOSE: Fragment a datagram, and send the itty bitty pieces
+ * out over an interface.
*
- * RETURNS: success - 0
- * failure - unix error code
+ * RETURNS: success - 0
+ * failure - unix error code
*
* SIDE EFFECTS:
*
- * NOTES: If there is an error sending the packet, clnp_discard
- * is called to discard the packet and send an ER. If
- * clnp_fragment was called from clnp_output, then
- * we generated the packet, and should not send an
- * ER -- clnp_emit_er will check for this. Otherwise,
- * the packet was fragmented during forwarding. In this
- * case, we ought to send an ER back.
+ * NOTES: If there is an error sending the packet, clnp_discard
+ * is called to discard the packet and send an ER. If
+ * clnp_fragment was called from clnp_output, then
+ * we generated the packet, and should not send an
+ * ER -- clnp_emit_er will check for this. Otherwise,
+ * the packet was fragmented during forwarding. In this
+ * case, we ought to send an ER back.
*/
+int
clnp_fragment(ifp, m, first_hop, total_len, segoff, flags, rt)
-struct ifnet *ifp; /* ptr to outgoing interface */
-struct mbuf *m; /* ptr to packet */
-struct sockaddr *first_hop; /* ptr to first hop */
-int total_len; /* length of datagram */
-int segoff; /* offset of segpart in hdr */
-int flags; /* flags passed to clnp_output */
-struct rtentry *rt; /* route if direct ether */
+ struct ifnet *ifp; /* ptr to outgoing interface */
+ struct mbuf *m; /* ptr to packet */
+ struct sockaddr *first_hop; /* ptr to first hop */
+ int total_len; /* length of datagram */
+ int segoff; /* offset of segpart in hdr */
+ int flags; /* flags passed to clnp_output */
+ struct rtentry *rt; /* route if direct ether */
{
- struct clnp_fixed *clnp = mtod(m, struct clnp_fixed *);
- int hdr_len = (int)clnp->cnf_hdr_len;
- int frag_size = (SN_MTU(ifp, rt) - hdr_len) & ~7;
+ struct clnp_fixed *clnp = mtod(m, struct clnp_fixed *);
+ int hdr_len = (int)clnp->cnf_hdr_len;
+ int frag_size = (SN_MTU(ifp, rt) - hdr_len) & ~7;
total_len -= hdr_len;
if ((clnp->cnf_type & CNF_SEG_OK) &&
(total_len >= 8) &&
(frag_size > 8 || (frag_size == 8 && !(total_len & 7)))) {
- struct mbuf *hdr = NULL; /* save copy of clnp hdr */
- struct mbuf *frag_hdr = NULL;
- struct mbuf *frag_data = NULL;
- struct clnp_segment seg_part; /* segmentation header */
- int frag_base;
- int error = 0;
+ struct mbuf *hdr = NULL; /* save copy of clnp hdr */
+ struct mbuf *frag_hdr = NULL;
+ struct mbuf *frag_data = NULL;
+ struct clnp_segment seg_part; /* segmentation header */
+ int frag_base;
+ int error = 0;
INCSTAT(cns_fragmented);
- (void) bcopy(segoff + mtod(m, caddr_t), (caddr_t)&seg_part,
- sizeof(seg_part));
+ (void) bcopy(segoff + mtod(m, caddr_t), (caddr_t)&seg_part,
+ sizeof(seg_part));
frag_base = ntohs(seg_part.cng_off);
/*
* Duplicate header, and remove from packet
@@ -246,33 +250,33 @@ struct rtentry *rt; /* route if direct ether */
#endif TROLL
/*
- * Tough situation: if the error occured on the last
- * fragment, we can not send an ER, as the if_output
- * routine consumed the packet. If the error occured
- * on any intermediate packets, we can send an ER
- * because we still have the original header in (m).
+ * Tough situation: if the error occured on the last
+ * fragment, we can not send an ER, as the if_output
+ * routine consumed the packet. If the error occured
+ * on any intermediate packets, we can send an ER
+ * because we still have the original header in (m).
*/
if (error) {
if (frag_hdr != hdr) {
- /*
- * The error was not on the last fragment. We must
- * free hdr and m before returning
- */
+ /*
+ * The error was not on the last fragment. We must
+ * free hdr and m before returning
+ */
clnp_discard(hdr, GEN_NOREAS);
m_freem(m);
}
return(error);
}
- /* bump segment offset, trim data mbuf, and decrement count left */
+/* bump segment offset, trim data mbuf, and decrement count left */
#ifdef TROLL
- /*
- * Decrement frag_size by some fraction. This will cause the
- * next fragment to start 'early', thus duplicating the end
- * of the current fragment. troll.tr_dup_size controls
- * the fraction. If positive, it specifies the fraction. If
- * negative, a random fraction is used.
- */
+ /*
+ * Decrement frag_size by some fraction. This will cause the
+ * next fragment to start 'early', thus duplicating the end
+ * of the current fragment. troll.tr_dup_size controls
+ * the fraction. If positive, it specifies the fraction. If
+ * negative, a random fraction is used.
+ */
if ((trollctl.tr_ops & TR_DUPEND) && (!last_frag)) {
int num_bytes = frag_size;
@@ -381,6 +385,7 @@ struct clnp_segment *seg; /* segment part of fragment header */
*
* NOTES: Failure is only due to insufficient resources.
*/
+int
clnp_newpkt(m, src, dst, seg)
struct mbuf *m; /* new fragment */
struct iso_addr *src; /* src of new fragment */
@@ -445,6 +450,7 @@ struct clnp_segment *seg; /* segment part of fragment header */
* The clnp_frag structure actually lies on top of
* part of the old clnp header.
*/
+static void
clnp_insert_frag(cfh, m, seg)
struct clnp_fragl *cfh; /* header of list of packet fragments */
struct mbuf *m; /* new fragment */
@@ -819,6 +825,7 @@ float troll_random()
* NOTES: The operation of this procedure is regulated by the
* troll control structure (Troll).
*/
+int
troll_output(ifp, m, dst, rt)
struct ifnet *ifp;
struct mbuf *m;
@@ -853,6 +860,7 @@ struct rtentry *rt;
err = (*ifp->if_output)(ifp, m, dst, rt);
return(err);
}
+ return 0;
}
#endif TROLL
diff --git a/sys/netiso/clnp_input.c b/sys/netiso/clnp_input.c
index a1fcb62a2eee..d55a84357521 100644
--- a/sys/netiso/clnp_input.c
+++ b/sys/netiso/clnp_input.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)clnp_input.c 7.13 (Berkeley) 5/6/91
- * $Id: clnp_input.c,v 1.2 1993/10/16 21:04:48 rgrimes Exp $
+ * $Id: clnp_input.c,v 1.4 1993/12/19 00:53:11 wollman Exp $
*/
/***********************************************************
@@ -61,8 +61,8 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-#include "types.h"
#include "param.h"
+#include "systm.h"
#include "mbuf.h"
#include "domain.h"
#include "protosw.h"
@@ -94,9 +94,7 @@ struct clnl_protosw clnl_protox[256];
int clnpqmaxlen = IFQ_MAXLEN; /* RAH? why is this a variable */
struct mbuf *clnp_data_ck();
-int clnp_input();
-
-int esis_input();
+void clnp_input(struct mbuf *, struct snpa_hdr *);
#ifdef ISO_X25ESIS
int x25esis_input();
@@ -114,6 +112,7 @@ int x25esis_input();
*
* NOTES:
*/
+void
clnp_init()
{
register struct protosw *pr;
@@ -150,6 +149,7 @@ clnp_init()
*
* NOTES:
*/
+void
clnlintr()
{
register struct mbuf *m; /* ptr to first mbuf of pkt */
@@ -279,6 +279,7 @@ next:
* TODO: I would like to make seg_part a pointer into the mbuf, but
* will it be correctly aligned?
*/
+void
clnp_input(m, shp)
struct mbuf *m; /* ptr to first mbuf of pkt */
struct snpa_hdr *shp; /* subnetwork header */
@@ -560,4 +561,4 @@ struct snpa_hdr *shp; /* subnetwork header */
break;
}
}
-#endif ISO
+#endif /* ISO */
diff --git a/sys/netiso/clnp_options.c b/sys/netiso/clnp_options.c
index e622e86abed9..3ce19a9ad0ee 100644
--- a/sys/netiso/clnp_options.c
+++ b/sys/netiso/clnp_options.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)clnp_options.c 7.8 (Berkeley) 5/6/91
- * $Id: clnp_options.c,v 1.2 1993/10/16 21:04:50 rgrimes Exp $
+ * $Id: clnp_options.c,v 1.4 1993/12/19 00:53:12 wollman Exp $
*/
/***********************************************************
@@ -64,6 +64,7 @@ SOFTWARE.
#ifdef ISO
#include "types.h"
+#include "systm.h"
#include "param.h"
#include "mbuf.h"
#include "domain.h"
@@ -93,6 +94,7 @@ SOFTWARE.
*
* NOTES: If source routing has been terminated, do nothing.
*/
+void
clnp_update_srcrt(options, oidx)
struct mbuf *options; /* ptr to options mbuf */
struct clnp_optidx *oidx; /* ptr to option index */
@@ -140,6 +142,7 @@ struct clnp_optidx *oidx; /* ptr to option index */
*
* NOTES:
*/
+void
clnp_dooptions(options, oidx, ifp, isoa)
struct mbuf *options; /* ptr to options mbuf */
struct clnp_optidx *oidx; /* ptr to option index */
@@ -214,6 +217,7 @@ struct iso_addr *isoa; /* ptr to our address for this ifp */
*
* NOTES:
*/
+int
clnp_set_opts(options, data)
struct mbuf **options; /* target for option information */
struct mbuf **data; /* source of option information */
@@ -268,17 +272,18 @@ struct mbuf **data; /* source of option information */
* the offset from the beginning of the mbuf data, not the
* actual address.
*/
+int
clnp_opt_sanity(m, opts, len, oidx)
-struct mbuf *m; /* mbuf options reside in */
-caddr_t opts; /* ptr to buffer containing options */
-int len; /* length of buffer */
-struct clnp_optidx *oidx; /* RETURN: filled in with option idx info */
+ struct mbuf *m; /* mbuf options reside in */
+ caddr_t opts; /* ptr to buffer containing options */
+ int len; /* length of buffer */
+ struct clnp_optidx *oidx; /* RETURN: filled in with option idx info */
{
- u_char opcode; /* code of particular option */
- u_char oplen; /* length of a particular option */
- caddr_t opts_end; /* ptr to end of options */
+ u_char opcode = 0; /* code of particular option */
+ u_char oplen; /* length of a particular option */
+ caddr_t opts_end; /* ptr to end of options */
u_char pad = 0, secure = 0, srcrt = 0, recrt = 0, qos = 0, prior = 0;
- /* flags for catching duplicate options */
+ /* flags for catching duplicate options */
IFDEBUG(D_OPTIONS)
printf("clnp_opt_sanity: checking %d bytes of data:\n", len);
@@ -529,4 +534,4 @@ struct clnp_optidx *oidx; /* RETURN: filled in with option idx info */
ENDDEBUG
return(0);
}
-#endif ISO
+#endif /* ISO */
diff --git a/sys/netiso/clnp_output.c b/sys/netiso/clnp_output.c
index e1b8dad44b8d..deb7e8d5d7f7 100644
--- a/sys/netiso/clnp_output.c
+++ b/sys/netiso/clnp_output.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)clnp_output.c 7.10 (Berkeley) 5/6/91
- * $Id: clnp_output.c,v 1.2 1993/10/16 21:04:52 rgrimes Exp $
+ * $Id: clnp_output.c,v 1.4 1993/12/19 00:53:13 wollman Exp $
*/
/***********************************************************
@@ -62,6 +62,7 @@ SOFTWARE.
*/
#include "param.h"
+#include "systm.h"
#include "mbuf.h"
#include "domain.h"
#include "protosw.h"
@@ -164,6 +165,7 @@ int clnp_id = 0; /* id for segmented dgrams */
* to have clnp check that the route has the same dest, but
* by avoiding this check, we save a call to iso_addrmatch1.
*/
+int
clnp_output(m0, isop, datalen, flags)
struct mbuf *m0; /* data for the packet */
struct isopcb *isop; /* iso pcb */
@@ -545,4 +547,5 @@ done:
int clnp_ctloutput()
{
+ return EINVAL;
}
diff --git a/sys/netiso/clnp_raw.c b/sys/netiso/clnp_raw.c
index 7a3f488d7358..d85336e0d2b3 100644
--- a/sys/netiso/clnp_raw.c
+++ b/sys/netiso/clnp_raw.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)clnp_raw.c 7.8 (Berkeley) 5/6/91
- * $Id: clnp_raw.c,v 1.2 1993/10/16 21:04:53 rgrimes Exp $
+ * $Id: clnp_raw.c,v 1.4 1993/12/19 00:53:15 wollman Exp $
*/
/***********************************************************
@@ -62,6 +62,7 @@ SOFTWARE.
*/
#include "param.h"
+#include "systm.h"
#include "mbuf.h"
#include "domain.h"
#include "protosw.h"
@@ -97,6 +98,7 @@ struct sockproto rclnp_proto = { PF_ISO, 0 };
* NOTES: The protocol field of rclnp_proto is set to zero indicating
* no protocol.
*/
+void
rclnp_input(m, src, dst, hdrlen)
struct mbuf *m; /* ptr to packet */
struct sockaddr_iso *src; /* ptr to src address */
@@ -131,6 +133,7 @@ int hdrlen; /* length (in bytes) of clnp header */
*
* NOTES:
*/
+int
rclnp_output(m0, so)
struct mbuf *m0; /* packet to send */
struct socket *so; /* socket to send from */
@@ -184,6 +187,7 @@ bad:
*
* NOTES:
*/
+int
rclnp_ctloutput(op, so, level, optname, m)
int op; /* type of operation */
struct socket *so; /* ptr to socket */
@@ -271,6 +275,7 @@ struct mbuf **m; /* ptr to ptr to option data */
}
/*ARGSUSED*/
+int
clnp_usrreq(so, req, m, nam, control)
register struct socket *so;
int req;
@@ -347,7 +352,7 @@ clnp_usrreq(so, req, m, nam, control)
return (0);
}
}
- error = raw_usrreq(so, req, m, nam, control);
+ error = raw_usrreq(so, req, m, nam, control, 0);
if (error && req == PRU_ATTACH && so->so_pcb)
free((caddr_t)rp, M_PCB);
diff --git a/sys/netiso/clnp_stat.h b/sys/netiso/clnp_stat.h
index f5d539ad215a..5c34feaa4cd3 100644
--- a/sys/netiso/clnp_stat.h
+++ b/sys/netiso/clnp_stat.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)clnp_stat.h 7.4 (Berkeley) 5/6/91
- * $Id: clnp_stat.h,v 1.2 1993/10/16 21:04:55 rgrimes Exp $
+ * $Id: clnp_stat.h,v 1.3 1993/11/07 17:49:24 wollman Exp $
*/
/***********************************************************
@@ -92,7 +92,9 @@ struct clnp_stat {
int cns_congest_rcvd; /* congestion experienced bit received */
int cns_er_inhist[CLNP_ERRORS + 1];
int cns_er_outhist[CLNP_ERRORS + 1];
-} clnp_stat ;
+} ;
+
+extern struct clnp_stat clnp_stat;
#ifdef INCSTAT
#undef INCSTAT
diff --git a/sys/netiso/clnp_subr.c b/sys/netiso/clnp_subr.c
index 20da605fe0eb..c1f577311a7e 100644
--- a/sys/netiso/clnp_subr.c
+++ b/sys/netiso/clnp_subr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)clnp_subr.c 7.13 (Berkeley) 5/6/91
- * $Id: clnp_subr.c,v 1.3 1993/10/16 21:04:56 rgrimes Exp $
+ * $Id: clnp_subr.c,v 1.6 1993/12/19 00:53:16 wollman Exp $
*/
/***********************************************************
@@ -86,6 +86,12 @@ SOFTWARE.
#include "clnp_stat.h"
#include "argo_debug.h"
+#ifdef TROLL
+struct troll trollctl;
+#endif
+struct clnp_stat clnp_stat;
+
+
/*
* FUNCTION: clnp_data_ck
*
@@ -103,9 +109,9 @@ SOFTWARE.
*/
struct mbuf *
clnp_data_ck(m, length)
-register struct mbuf *m; /* ptr to mbuf chain containing hdr & data */
-int length; /* length (in bytes) of packet */
- {
+ register struct mbuf *m; /* ptr to mbuf chain containing hdr & data */
+ int length; /* length (in bytes) of packet */
+{
register int len; /* length of data */
register struct mbuf *mhead; /* ptr to head of chain */
@@ -185,7 +191,7 @@ register struct iso_addr *destp; /* ptr to destination address buffer */
else
return (caddr_t) 0;
}
-#endif notdef
+#endif /* notdef */
/*
* FUNCTION: clnp_ours
@@ -200,8 +206,9 @@ register struct iso_addr *destp; /* ptr to destination address buffer */
*
* NOTES:
*/
+int
clnp_ours(dst)
-register struct iso_addr *dst; /* ptr to destination address */
+ register struct iso_addr *dst; /* ptr to destination address */
{
register struct iso_ifaddr *ia; /* scan through interface addresses */
@@ -233,7 +240,7 @@ int congest_threshold = 0;
* clnpintr guarantees that the header will be
* contigious (a cluster mbuf will be used if necessary).
*
- * If oidx is NULL, no options are present.
+ * If oidx is NULL, no options are present.
*
* RETURNS: nothing
*
@@ -241,13 +248,14 @@ int congest_threshold = 0;
*
* NOTES:
*/
+void
clnp_forward(m, len, dst, oidx, seg_off, inbound_shp)
-struct mbuf *m; /* pkt to forward */
-int len; /* length of pkt */
-struct iso_addr *dst; /* destination address */
-struct clnp_optidx *oidx; /* option index */
-int seg_off;/* offset of segmentation part */
-struct snpa_hdr *inbound_shp; /* subnetwork header of inbound packet */
+ struct mbuf *m; /* pkt to forward */
+ int len; /* length of pkt */
+ struct iso_addr *dst; /* destination address */
+ struct clnp_optidx *oidx; /* option index */
+ int seg_off; /* offset of segmentation part */
+ struct snpa_hdr *inbound_shp; /* subnetwork header of inbound packet */
{
struct clnp_fixed *clnp; /* ptr to fixed part of header */
int error; /* return value of route function */
@@ -364,7 +372,7 @@ struct snpa_hdr *inbound_shp; /* subnetwork header of inbound packet */
}
}
}
-#endif DECBIT
+#endif /* DECBIT */
/*
* Dispatch the datagram if it is small enough, otherwise fragment
@@ -414,7 +422,7 @@ register struct iso_addr *dstp; /* ptr to dst addr */
return bufp;
}
-#endif notdef
+#endif /* notdef */
/*
* FUNCTION: clnp_route
@@ -435,12 +443,13 @@ register struct iso_addr *dstp; /* ptr to dst addr */
* NOTES: It is up to the caller to free the routing entry
* allocated in route.
*/
+int
clnp_route(dst, ro, flags, first_hop, ifa)
- struct iso_addr *dst; /* ptr to datagram destination */
- register struct route_iso *ro; /* existing route structure */
- int flags; /* flags for routing */
- struct sockaddr **first_hop; /* result: fill in with ptr to firsthop */
- struct iso_ifaddr **ifa; /* result: fill in with ptr to interface */
+ struct iso_addr *dst; /* ptr to datagram destination */
+ register struct route_iso *ro; /* existing route structure */
+ int flags; /* flags for routing */
+ struct sockaddr **first_hop; /* result: fill in with ptr to firsthop */
+ struct iso_ifaddr **ifa; /* result: fill in with ptr to interface */
{
if (flags & SO_DONTROUTE) {
struct iso_ifaddr *ia;
@@ -530,13 +539,14 @@ clnp_route(dst, ro, flags, first_hop, ifa)
* NOTES: Remember that option index pointers are really
* offsets from the beginning of the mbuf.
*/
+int
clnp_srcroute(options, oidx, ro, first_hop, ifa, final_dst)
-struct mbuf *options; /* ptr to options */
-struct clnp_optidx *oidx; /* index to options */
-struct route_iso *ro; /* route structure */
-struct sockaddr **first_hop; /* RETURN: fill in with ptr to firsthop */
-struct iso_ifaddr **ifa; /* RETURN: fill in with ptr to interface */
-struct iso_addr *final_dst; /* final destination */
+ struct mbuf *options; /* ptr to options */
+ struct clnp_optidx *oidx; /* index to options */
+ struct route_iso *ro; /* route structure */
+ struct sockaddr **first_hop; /* RETURN: fill in with ptr to firsthop */
+ struct iso_ifaddr **ifa; /* RETURN: fill in with ptr to interface */
+ struct iso_addr *final_dst; /* final destination */
{
struct iso_addr dst; /* first hop specified by src rt */
int error = 0; /* return code */
@@ -586,17 +596,18 @@ struct iso_addr *final_dst; /* final destination */
*
* SIDE EFFECTS: prints notice, slows down system.
*/
+int
clnp_badmtu(ifp, rt, line, file)
-struct ifnet *ifp; /* outgoing interface */
-struct rtentry *rt; /* dst route */
-int line; /* where the dirty deed occured */
-char *file; /* where the dirty deed occured */
+ struct ifnet *ifp; /* outgoing interface */
+ struct rtentry *rt; /* dst route */
+ int line; /* where the dirty deed occured */
+ const char *file; /* where the dirty deed occured */
{
printf("sending on route %x with no mtu, line %s of file %s\n",
rt, line, file);
#ifdef ARGO_DEBUG
printf("route dst is");
- dump_isoaddr(rt_key(rt));
+ dump_isoaddr((struct sockaddr_iso *)rt_key(rt));
#endif
return ifp->if_mtu;
}
@@ -612,12 +623,15 @@ char *file; /* where the dirty deed occured */
*
* NOTES: No attempt has been made to make this efficient
*/
+void
clnp_ypocb(from, to, len)
-caddr_t from; /* src buffer */
-caddr_t to; /* dst buffer */
-u_int len; /* number of bytes */
+ caddr_t from; /* src buffer */
+ caddr_t to; /* dst buffer */
+ u_int len; /* number of bytes */
{
while (len--)
*(to + len) = *(from + len);
}
-#endif ISO
+#endif /* ISO */
+
+
diff --git a/sys/netiso/clnp_timer.c b/sys/netiso/clnp_timer.c
index 18e2c841234b..5e14c0dc1a13 100644
--- a/sys/netiso/clnp_timer.c
+++ b/sys/netiso/clnp_timer.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)clnp_timer.c 7.5 (Berkeley) 5/6/91
- * $Id: clnp_timer.c,v 1.2 1993/10/16 21:04:57 rgrimes Exp $
+ * $Id: clnp_timer.c,v 1.4 1993/12/19 00:53:17 wollman Exp $
*/
/***********************************************************
@@ -62,6 +62,7 @@ SOFTWARE.
*/
#include "param.h"
+#include "systm.h"
#include "mbuf.h"
#include "domain.h"
#include "protosw.h"
@@ -142,6 +143,7 @@ register struct clnp_fragl *cfh; /* fragment header to delete */
*
* NOTES:
*/
+void
clnp_slowtimo()
{
register struct clnp_fragl *cfh = clnp_frags;
@@ -170,6 +172,7 @@ clnp_slowtimo()
* NOTES:
* TODO: should send back ER
*/
+void
clnp_drain()
{
register struct clnp_fragl *cfh = clnp_frags;
diff --git a/sys/netiso/cltp_usrreq.c b/sys/netiso/cltp_usrreq.c
index e2d722f05d3a..665547a9bc8d 100644
--- a/sys/netiso/cltp_usrreq.c
+++ b/sys/netiso/cltp_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)cltp_usrreq.c 7.6 (Berkeley) 6/27/91
- * $Id: cltp_usrreq.c,v 1.3 1993/10/16 21:04:59 rgrimes Exp $
+ * $Id: cltp_usrreq.c,v 1.5 1993/11/25 01:35:50 wollman Exp $
*/
#ifndef CLTPOVAL_SRC /* XXX -- till files gets changed */
@@ -56,10 +56,15 @@
#include "cltp_var.h"
#endif
+struct isopcb cltb;
+struct cltpstat cltpstat;
+
+
/*
* CLTP protocol implementation.
* Per ISO 8602, December, 1987.
*/
+void
cltp_init()
{
@@ -70,6 +75,7 @@ int cltp_cksum = 1;
/* ARGUSED */
+int
cltp_input(m0, srcsa, dstsa, cons_channel, output)
struct mbuf *m0;
struct sockaddr *srcsa, *dstsa;
@@ -82,7 +88,7 @@ cltp_input(m0, srcsa, dstsa, cons_channel, output)
register struct sockaddr_iso *src = (struct sockaddr_iso *)srcsa;
int len, hdrlen = *up + 1, dlen = 0;
u_char *uplim = up + hdrlen;
- caddr_t dtsap;
+ caddr_t dtsap = 0;
for (len = 0; m; m = m->m_next)
len += m->m_len;
@@ -156,6 +162,7 @@ bad:
* Notify a cltp user of an asynchronous error;
* just wake up so that he can collect error status.
*/
+void
cltp_notify(isop)
register struct isopcb *isop;
{
@@ -164,6 +171,7 @@ cltp_notify(isop)
sowwakeup(isop->isop_socket);
}
+void
cltp_ctlinput(cmd, sa)
int cmd;
struct sockaddr *sa;
@@ -198,6 +206,7 @@ cltp_ctlinput(cmd, sa)
}
}
+int
cltp_output(isop, m)
register struct isopcb *isop;
register struct mbuf *m;
@@ -263,13 +272,14 @@ u_long cltp_recvspace = 40 * (1024 + sizeof(struct sockaddr_iso));
/*ARGSUSED*/
+int
cltp_usrreq(so, req, m, nam, control)
struct socket *so;
int req;
struct mbuf *m, *nam, *control;
{
struct isopcb *isop = sotoisopcb(so);
- int s, error = 0;
+ int s = 0, error = 0;
if (req == PRU_CONTROL)
return (iso_control(so, (int)m, (caddr_t)nam,
diff --git a/sys/netiso/cltp_var.h b/sys/netiso/cltp_var.h
index 5ed32d66e7c8..6cbfa9b34287 100644
--- a/sys/netiso/cltp_var.h
+++ b/sys/netiso/cltp_var.h
@@ -31,9 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)cltp_var.h 7.3 (Berkeley) 6/28/90
- * $Id: cltp_var.h,v 1.2 1993/10/16 21:05:00 rgrimes Exp $
+ * $Id: cltp_var.h,v 1.3 1993/11/07 17:49:28 wollman Exp $
*/
+#ifndef _NETISO_CLTP_VAR_H_
+#define _NETISO_CLTP_VAR_H_ 1
+
#define UD_TPDU_type 0x40 /* packet type */
#define CLTPOVAL_SRC 0xc1 /* Source TSAP -- required */
@@ -50,6 +53,7 @@ struct cltpstat {
};
#ifdef KERNEL
-struct isopcb cltb;
-struct cltpstat cltpstat;
+extern struct isopcb cltb;
+extern struct cltpstat cltpstat;
#endif
+#endif /* _NETISO_CLTP_VAR_H_ */
diff --git a/sys/netiso/cons.h b/sys/netiso/cons.h
index 489704bbf329..9ffe3692ff67 100644
--- a/sys/netiso/cons.h
+++ b/sys/netiso/cons.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons.h 7.3 (Berkeley) 5/6/91
- * $Id: cons.h,v 1.2 1993/10/16 21:05:02 rgrimes Exp $
+ * $Id: cons.h,v 1.3 1993/11/07 17:49:29 wollman Exp $
*/
/***********************************************************
@@ -61,6 +61,9 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
+#ifndef _NETISO_CONS_H_
+#define _NETISO_CONS_H_ 1
+
/*
* interface between TP and CONS
*/
@@ -88,4 +91,5 @@ struct dte_addr {
#define PRC_CONS_SEND_DONE 2 /* something unused in protosw.h */
-#endif KERNEL
+#endif /* KERNEL */
+#endif /* _NETISO_CONS_H_ */
diff --git a/sys/netiso/cons_pcb.h b/sys/netiso/cons_pcb.h
index e9a9f444f978..f982773c82c7 100644
--- a/sys/netiso/cons_pcb.h
+++ b/sys/netiso/cons_pcb.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)cons_pcb.h 7.4 (Berkeley) 5/6/91
- * $Id: cons_pcb.h,v 1.2 1993/10/16 21:05:03 rgrimes Exp $
+ * $Id: cons_pcb.h,v 1.3 1993/11/07 17:49:31 wollman Exp $
*/
/***********************************************************
@@ -61,6 +61,9 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
+#ifndef _NETISO_CONS_PCB_H_
+#define _NETISO_CONS_PCB_H_ 1
+
/*
* protocol control block for the connection oriented network service
*/
@@ -175,11 +178,13 @@ struct cons_stat {
u_int co_parse_facil_err;
u_int co_addr_proto_consist_err;
u_int co_no_copcb;
-} cons_stat;
+};
+
+extern struct cons_stat cons_stat;
-u_char x25_error_stats[CONL_ERROR_MAX + 1];
+extern u_char x25_error_stats[CONL_ERROR_MAX + 1];
-struct ifqueue consintrq;
+extern struct ifqueue consintrq;
/* reasons for clear are in a data mbuf chained to a clear ecn_request */
struct e_clear_data {
@@ -190,3 +195,4 @@ struct e_clear_data {
#ifdef KERNEL
#define IncStat(XYZ) cons_stat.XYZ++
#endif KERNEL
+#endif /* _NETISO_CONS_PCB_H_ */
diff --git a/sys/netiso/eonvar.h b/sys/netiso/eonvar.h
index e199a79f9cfd..90e2dcf55ca4 100644
--- a/sys/netiso/eonvar.h
+++ b/sys/netiso/eonvar.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)eonvar.h 7.5 (Berkeley) 5/6/91
- * $Id: eonvar.h,v 1.2 1993/10/16 21:05:04 rgrimes Exp $
+ * $Id: eonvar.h,v 1.3 1993/11/07 17:49:32 wollman Exp $
*/
/***********************************************************
@@ -61,6 +61,9 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
+#ifndef _NETISO_EONVAR_H_
+#define _NETISO_EONVAR_H_ 1
+
#define EON_986_VERSION 0x3
#define EON_VERSION 0x1
@@ -149,7 +152,11 @@ struct eon_stat {
/* errors */
int es_badcsum;
int es_badhdr;
-} eonstat;
+};
+
+#ifdef KERNEL
+extern struct eon_stat eon_stat;
+#endif
#undef IncStat
#define IncStat(xxx) eonstat.xxx++
@@ -169,3 +176,4 @@ struct eon_llinfo {
};
#define el_iphdr el_ei.ei_ip
#define el_eonhdr el_ei.ei_eh
+#endif /* _NETISO_EONVAR_H_ */
diff --git a/sys/netiso/esis.c b/sys/netiso/esis.c
index 5d63388bd6fc..1cc68ce2dfc5 100644
--- a/sys/netiso/esis.c
+++ b/sys/netiso/esis.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)esis.c 7.19 (Berkeley) 6/27/91
- * $Id: esis.c,v 1.2 1993/10/16 21:05:06 rgrimes Exp $
+ * $Id: esis.c,v 1.6 1993/12/19 00:53:18 wollman Exp $
*/
/***********************************************************
@@ -99,12 +99,17 @@ SOFTWARE.
*
*/
struct rawcb esis_pcb;
-int esis_config(), snpac_age();
-int esis_sendspace = 2048;
-int esis_recvspace = 2048;
-short esis_holding_time = ESIS_HT;
-short esis_config_time = ESIS_CONFIG;
-short esis_esconfig_time = ESIS_CONFIG;
+struct esis_stat esis_stat;
+
+static void esis_eshinput(struct mbuf *, struct snpa_hdr *);
+static void esis_ishinput(struct mbuf *, struct snpa_hdr *);
+static void esis_rdinput(struct mbuf *, struct snpa_hdr *);
+
+int esis_sendspace = 2048;
+int esis_recvspace = 2048;
+short esis_holding_time = ESIS_HT;
+short esis_config_time = ESIS_CONFIG;
+short esis_esconfig_time = ESIS_CONFIG;
extern int iso_systype;
struct sockaddr_dl esis_dl = { sizeof(esis_dl), AF_LINK };
extern char all_es_snpa[], all_is_snpa[];
@@ -118,6 +123,11 @@ extern char all_es_snpa[], all_is_snpa[];
(m) = (m)->m_next;\
(cp) = mtod((m), caddr_t);\
}
+
+#ifdef ISO_X25ESIS
+void x25esis_input();
+#endif ISO_X25ESIS
+
/*
* FUNCTION: esis_init
*
@@ -129,13 +139,10 @@ extern char all_es_snpa[], all_is_snpa[];
*
* NOTES:
*/
+void
esis_init()
{
extern struct clnl_protosw clnl_protox[256];
- int esis_input(), isis_input();
-#ifdef ISO_X25ESIS
- int x25esis_input();
-#endif ISO_X25ESIS
esis_pcb.rcb_next = esis_pcb.rcb_prev = &esis_pcb;
llinfo_llc.lc_next = llinfo_llc.lc_prev = &llinfo_llc;
@@ -161,6 +168,7 @@ esis_init()
*
*/
/*ARGSUSED*/
+int
esis_usrreq(so, req, m, nam, control)
struct socket *so; /* socket: used only to get to this code */
int req; /* request */
@@ -243,6 +251,7 @@ release:
*
* NOTES:
*/
+void
esis_input(m0, shp)
struct mbuf *m0; /* ptr to first mbuf of pkt */
struct snpa_hdr *shp; /* subnetwork header */
@@ -300,6 +309,7 @@ bad:
* NOTES: Assumes there is enough space for fixed part of header,
* DA, BSNPA and NET in first mbuf.
*/
+void
esis_rdoutput(inbound_shp, inbound_m, inbound_oidx, rd_dstnsap, rt)
struct snpa_hdr *inbound_shp; /* snpa hdr from incoming packet */
struct mbuf *inbound_m; /* incoming pkt itself */
@@ -444,7 +454,7 @@ struct rtentry *rt; /* snpa cache info regarding next hop of
siso.siso_nlen = 6 + 1; /* should be taken from snpa_hdr */
/* +1 is for AFI */
bcopy(inbound_shp->snh_shost, siso.siso_data + 1, 6);
- (ifp->if_output)(ifp, m0, &siso, 0);
+ (ifp->if_output)(ifp, m0, (struct sockaddr *)&siso, 0);
}
/*
@@ -458,6 +468,7 @@ struct rtentry *rt; /* snpa cache info regarding next hop of
*
* NOTES: Plus 1 here is for length byte
*/
+int
esis_insert_addr(buf, len, isoa, m, nsellen)
register caddr_t *buf; /* ptr to buffer to put address into */
int *len; /* ptr to length of buffer so far */
@@ -485,7 +496,6 @@ int nsellen;
#define ESIS_NEXT_OPTION(b) { b += (2 + b[1]); \
if (b > buflim) {esis_stat.es_toosmall++; goto bad;}}
int ESHonly = 0;
-/*
/*
* FUNCTION: esis_eshinput
@@ -498,13 +508,14 @@ int ESHonly = 0;
*
* NOTES:
*/
+void
esis_eshinput(m, shp)
struct mbuf *m; /* esh pdu */
struct snpa_hdr *shp; /* subnetwork header */
{
struct esis_fixed *pdu = mtod(m, struct esis_fixed *);
u_short ht; /* holding time */
- struct iso_addr *nsap;
+ struct iso_addr *nsap = 0;
int naddr;
u_char *buf = (u_char *)(pdu + 1);
u_char *buflim = pdu->esis_hdr_len + (u_char *)pdu;
@@ -582,6 +593,7 @@ bad:
*
* NOTES:
*/
+void
esis_ishinput(m, shp)
struct mbuf *m; /* esh pdu */
struct snpa_hdr *shp; /* subnetwork header */
@@ -612,10 +624,10 @@ struct snpa_hdr *shp; /* subnetwork header */
if (buf[1] != 2)
goto bad;
CTOH(buf[2], buf[3], newct);
- if (esis_config_time != newct) {
+ if ((u_long)esis_config_time != (u_long)newct) {
untimeout(esis_config,0);
esis_config_time = newct;
- esis_config();
+ esis_config(0, 0);
}
break;
@@ -649,6 +661,7 @@ bad:
*
* NOTES:
*/
+void
esis_rdinput(m0, shp)
struct mbuf *m0; /* esh pdu */
struct snpa_hdr *shp; /* subnetwork header */
@@ -744,7 +757,8 @@ bad: ; /* Needed by ESIS_NEXT_OPTION */
*
* NOTES: Called every esis_config_time seconds
*/
-esis_config()
+void
+esis_config(caddr_t dummy1, int dummy2)
{
register struct ifnet *ifp;
@@ -793,13 +807,14 @@ esis_config()
*
* NOTES:
*/
+void
esis_shoutput(ifp, type, ht, sn_addr, sn_len, isoa)
-struct ifnet *ifp;
-int type;
-short ht;
-caddr_t sn_addr;
-int sn_len;
-struct iso_addr *isoa;
+ struct ifnet *ifp;
+ int type;
+ short ht;
+ caddr_t sn_addr;
+ int sn_len;
+ struct iso_addr *isoa;
{
struct mbuf *m, *m0;
caddr_t cp, naddrp;
@@ -921,7 +936,7 @@ struct iso_addr *isoa;
siso.siso_data[0] = AFI_SNA;
siso.siso_nlen = sn_len + 1;
bcopy(sn_addr, siso.siso_data + 1, (unsigned)sn_len);
- (ifp->if_output)(ifp, m0, &siso, 0);
+ (ifp->if_output)(ifp, m0, (struct sockaddr *)&siso, 0);
}
/*
@@ -935,6 +950,7 @@ struct iso_addr *isoa;
*
* NOTES:
*/
+void
isis_input(m0, shp)
struct mbuf *m0; /* ptr to first mbuf of pkt */
struct snpa_hdr *shp; /* subnetwork header */
@@ -967,24 +983,27 @@ struct snpa_hdr *shp; /* subnetwork header */
}
if (mm = m_copy(m0, 0, M_COPYALL)) { /*can't block at interrupt level */
if (sbappendaddr(&rp->rcb_socket->so_rcv,
- &esis_dl, mm, (struct mbuf *)0) != 0)
+ (struct sockaddr *)&esis_dl,
+ mm, (struct mbuf *)0) != 0)
sorwakeup(rp->rcb_socket);
else {
IFDEBUG(D_ISISINPUT)
- printf("Error in sbappenaddr, mm = 0x%x\n", mm);
+ printf("Error in sbappenaddr, mm = 0x%x\n", mm);
ENDDEBUG
m_freem(mm);
}
}
}
if (first_rp && sbappendaddr(&first_rp->rcb_socket->so_rcv,
- &esis_dl, m0, (struct mbuf *)0) != 0) {
+ (struct sockaddr *)&esis_dl,
+ m0, (struct mbuf *)0) != 0) {
sorwakeup(first_rp->rcb_socket);
return;
}
m_freem(m0);
}
+int
isis_output(sdl, m)
register struct sockaddr_dl *sdl;
struct mbuf *m;
@@ -1048,6 +1067,7 @@ release:
* The loop through iso_ifaddr is stupid because
* back in if_down, we knew the ifp...
*/
+void
esis_ctlinput(req, siso)
int req; /* request: we handle only PRC_IFDOWN */
struct sockaddr_iso *siso; /* address of ifp */
@@ -1061,4 +1081,4 @@ struct sockaddr_iso *siso; /* address of ifp */
}
}
-#endif ISO
+#endif /* ISO */
diff --git a/sys/netiso/esis.h b/sys/netiso/esis.h
index a952d9d77284..b455eb2f926e 100644
--- a/sys/netiso/esis.h
+++ b/sys/netiso/esis.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)esis.h 7.4 (Berkeley) 5/6/91
- * $Id: esis.h,v 1.2 1993/10/16 21:05:08 rgrimes Exp $
+ * $Id: esis.h,v 1.4 1993/12/19 00:53:19 wollman Exp $
*/
/***********************************************************
@@ -57,25 +57,14 @@ SOFTWARE.
******************************************************************/
-/*
- * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
- */
+#ifndef _NETISO_ESIS_H_
+#define _NETISO_ESIS_H_ 1
-#ifndef BYTE_ORDER
/*
- * Definitions for byte order,
- * according to byte significance from low address to high.
+ * ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
-#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax) */
-#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
-#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */
-#ifdef vax
-#define BYTE_ORDER LITTLE_ENDIAN
-#else
-#define BYTE_ORDER BIG_ENDIAN /* mc68000, tahoe, most others */
-#endif
-#endif BYTE_ORDER
+#include <machine/endian.h>
#define SNPAC_AGE 60 /* seconds */
#define ESIS_CONFIG 60 /* seconds */
@@ -127,6 +116,12 @@ struct esis_stat {
u_short es_rdrcvd; /* RD rcvd */
};
-#ifdef KERNEL
-struct esis_stat esis_stat;
-#endif KERNEL
+#ifdef KERNEL
+extern struct esis_stat esis_stat;
+void esis_config(caddr_t, int);
+void esis_input(struct mbuf *, struct snpa_hdr *);
+void esis_shoutput(struct ifnet *, int, int /*short*/, caddr_t, int, struct iso_addr *);
+void isis_input(struct mbuf *, struct snpa_hdr *);
+
+#endif /* KERNEL */
+#endif /* _NETISO_ESIS_H_ */
diff --git a/sys/netiso/if_cons.c b/sys/netiso/if_cons.c
index b826e97c33b7..362a82cec3c7 100644
--- a/sys/netiso/if_cons.c
+++ b/sys/netiso/if_cons.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)if_cons.c 7.10 (Berkeley) 5/29/91
- * $Id: if_cons.c,v 1.2 1993/10/16 21:05:10 rgrimes Exp $
+ * $Id: if_cons.c,v 1.4 1993/12/19 22:45:41 wollman Exp $
*/
/***********************************************************
@@ -121,6 +121,9 @@ unsigned LAST_CALL_PCB;
#define DONTCLEAR -1
+static int parse_facil(struct pklcd *, struct isopcb *, caddr_t,
+ int /*u_char*/);
+
/*********************************************************************
* cons.c - CONS interface to the x.25 layer
*
@@ -157,6 +160,10 @@ NOTE:
*********************************************************************/
+/* struct cons_stat cons_stat; */
+u_char x25_error_stats[CONL_ERROR_MAX + 1];
+struct ifqueue consintrq;
+
#define CONS_IFQMAXLEN 5
@@ -298,9 +305,10 @@ nibble_match( src_octet, src_nibble, dst_octet, dst_nibble, len)
* FUNCTION:
* initialize the protocol
*/
+void
cons_init()
{
- int tp_incoming(), clnp_incoming();
+ void tp_incoming(), clnp_incoming();
CLNP_proto = pffindproto(AF_ISO, ISOPROTO_CLNP, SOCK_DGRAM);
@@ -318,13 +326,14 @@ cons_init()
#endif
}
+void
tp_incoming(lcp, m)
-struct pklcd *lcp;
-register struct mbuf *m;
+ struct pklcd *lcp;
+ register struct mbuf *m;
{
register struct isopcb *isop;
extern struct isopcb tp_isopcb;
- int cons_tpinput();
+ void cons_tpinput();
if (iso_pcballoc((struct socket *)0, &tp_incoming_pending)) {
pk_close(lcp);
@@ -339,13 +348,14 @@ register struct mbuf *m;
isop->isop_faddr = &isop->isop_sfaddr;
DTEtoNSAP(isop->isop_laddr, &lcp->lcd_laddr);
DTEtoNSAP(isop->isop_faddr, &lcp->lcd_faddr);
- parse_facil(isop, lcp, &(mtod(m, struct x25_packet *)->packet_data),
+ parse_facil(lcp, isop, &(mtod(m, struct x25_packet *)->packet_data),
m->m_pkthdr.len - PKHEADERLN);
}
+void
cons_tpinput(lcp, m0)
-struct mbuf *m0;
-struct pklcd *lcp;
+ struct mbuf *m0;
+ struct pklcd *lcp;
{
register struct isopcb *isop = (struct isopcb *)lcp->lcd_upnext;
register struct x25_packet *xp;
@@ -401,11 +411,12 @@ struct pklcd *lcp;
* RETURN VALUE:
* returns E*
*/
+int
cons_connect(isop)
register struct isopcb *isop;
{
register struct pklcd *lcp = (struct pklcd *)isop->isop_chan;
- register struct mbuf *m;
+ register struct mbuf *m = 0;
struct ifaddr *ifa;
int error;
@@ -448,6 +459,7 @@ cons_connect(isop)
* NOTE: this takes 3rd arg. because cons uses it to inform itself
* of things (timeouts, etc) but has a pcb instead of an address.
*/
+void
cons_ctlinput(cmd, sa, copcb)
int cmd;
struct sockaddr *sa;
@@ -455,7 +467,7 @@ cons_ctlinput(cmd, sa, copcb)
{
}
-
+int
find_error_reason( xp )
register struct x25_packet *xp;
{
@@ -554,9 +566,9 @@ done:
#ifdef X25_1984
int cons_use_facils = 1;
-#else X25_1984
+#else /* X25_1984 */
int cons_use_facils = 0;
-#endif X25_1984
+#endif /* X25_1984 */
int cons_use_udata = 1; /* KLUDGE FOR DEBUGGING */
@@ -565,15 +577,15 @@ make_partial_x25_packet(isop, lcp)
struct isopcb *isop;
struct pklcd *lcp;
{
- u_int proto;
- int flag;
+ u_int proto = 0;
+ int flag = 0;
caddr_t buf;
register caddr_t ptr;
register int len = 0;
int buflen =0;
caddr_t facil_len;
int oddness = 0;
- struct mbuf *m;
+ struct mbuf *m = 0;
IFDEBUG(D_CCONN)
@@ -728,7 +740,8 @@ NSAPtoDTE(siso, sx25)
dtelen = out - sx25->x25_addr;
*out++ = 0;
} else {
- register struct rtentry *rt = rtalloc1(siso, 1);
+ register struct rtentry *rt = rtalloc1((struct sockaddr *)siso,
+ 1);
/* error = iso_8208snparesolve(addr, x121string, &x121strlen);*/
if (rt) {
@@ -764,7 +777,7 @@ FACILtoNSAP(addr, buf)
register struct sockaddr_iso *addr;
{
int len_in_nibbles, param_len = *buf++;
- u_char buf_len; /* in bytes */
+ u_char buf_len = 0; /* in bytes */
IFDEBUG(D_CADDR)
printf("FACILtoNSAP( 0x%x, 0x%x, 0x%x )\n",
@@ -797,9 +810,9 @@ FACILtoNSAP(addr, buf)
return param_len;
}
-static
+static void
init_siso(siso)
-register struct sockaddr_iso *siso;
+ register struct sockaddr_iso *siso;
{
siso->siso_len = sizeof (*siso);
siso->siso_family = AF_ISO;
diff --git a/sys/netiso/if_eon.c b/sys/netiso/if_eon.c
index e79a030de765..e23a9e48152d 100644
--- a/sys/netiso/if_eon.c
+++ b/sys/netiso/if_eon.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)if_eon.c 7.16 (Berkeley) 6/27/91
- * $Id: if_eon.c,v 1.2 1993/10/16 21:05:13 rgrimes Exp $
+ * $Id: if_eon.c,v 1.5 1993/12/19 00:53:20 wollman Exp $
*/
/***********************************************************
@@ -108,17 +108,20 @@ SOFTWARE.
extern struct timeval time;
extern struct ifnet loif;
+struct eon_stat eonstat;
+
#define EOK 0
-int eoninput();
-int eonoutput();
-int eonioctl();
-int eonattach();
-int eoninit();
-int eonrtrequest();
+void eoninput(struct mbuf *, int);
+static int eonoutput(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *);
+static int eonioctl(struct ifnet *, int, caddr_t);
+static void eonattach(void);
+static void eoninit(int);
+static void eonrtrequest(int, struct rtentry *, struct sockaddr *);
extern int ip_output();
struct ifnet eonif[1];
+void
eonprotoinit() {
(void) eonattach();
}
@@ -135,6 +138,7 @@ struct eon_llinfo eon_llinfo;
* RETURNS: void
*/
+void
eonattach()
{
register struct ifnet *ifp = eonif;
@@ -176,6 +180,7 @@ eonattach()
*
* RETURNS: nothing
*/
+int
eonioctl(ifp, cmd, data)
register struct ifnet *ifp;
int cmd;
@@ -204,11 +209,13 @@ eonioctl(ifp, cmd, data)
return(error);
}
-
+void
eoniphdr(hdr, loc, ro, class, zero)
-struct route *ro;
-register struct eon_iphdr *hdr;
-caddr_t loc;
+ struct route *ro;
+ register struct eon_iphdr *hdr;
+ caddr_t loc;
+ int class;
+ int zero;
{
struct mbuf mhead;
register struct sockaddr_in *sin = (struct sockaddr_in *)&ro->ro_dst;
@@ -261,9 +268,11 @@ caddr_t loc;
*
* RETURNS: nothing
*/
+void
eonrtrequest(cmd, rt, gate)
-register struct rtentry *rt;
-register struct sockaddr *gate;
+ int cmd;
+ register struct rtentry *rt;
+ register struct sockaddr *gate;
{
unsigned long zerodst = 0;
caddr_t ipaddrloc = (caddr_t) &zerodst;
@@ -325,6 +334,7 @@ register struct sockaddr *gate;
* RETURNS: nothing
*/
+void
eoninit(unit)
int unit;
{
@@ -346,19 +356,21 @@ eoninit(unit)
* NOTES:
*
*/
-eonoutput(ifp, m, dst, rt)
+int
+eonoutput(ifp, m, xdst, rt)
struct ifnet *ifp;
register struct mbuf *m; /* packet */
- struct sockaddr_iso *dst; /* destination addr */
+ struct sockaddr *xdst;
struct rtentry *rt;
{
+ struct sockaddr_iso *dst = (struct sockaddr_iso *)xdst;
register struct eon_llinfo *el;
register struct eon_iphdr *ei;
struct route *ro;
int datalen;
struct mbuf *mh;
int error = 0, class = 0, alen = 0;
- caddr_t ipaddrloc;
+ caddr_t ipaddrloc = 0;
static struct eon_iphdr eon_iphdr;
static struct route route;
@@ -444,6 +456,7 @@ flush:
return error;
}
+void
eoninput(m, iphlen)
register struct mbuf *m;
int iphlen;
@@ -566,7 +579,7 @@ eonctlinput(cmd, sin)
IFDEBUG(D_EON)
printf("eonctlinput: cmd 0x%x addr: ", cmd);
- dump_isoaddr(sin);
+ dump_isoaddr((struct sockaddr_iso *)sin);
printf("\n");
ENDDEBUG
diff --git a/sys/netiso/iso.c b/sys/netiso/iso.c
index 02799140a3fc..de288450d41e 100644
--- a/sys/netiso/iso.c
+++ b/sys/netiso/iso.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)iso.c 7.14 (Berkeley) 6/27/91
- * $Id: iso.c,v 1.3 1993/10/16 21:05:15 rgrimes Exp $
+ * $Id: iso.c,v 1.6 1993/12/19 00:53:22 wollman Exp $
*/
/***********************************************************
@@ -65,7 +65,6 @@ SOFTWARE.
* iso.c: miscellaneous routines to support the iso address family
*/
-#include "types.h"
#include "param.h"
#include "systm.h"
#include "ioctl.h"
@@ -78,7 +77,6 @@ SOFTWARE.
#include "../net/if.h"
#include "../net/route.h"
-#include "../net/af.h"
#include "iso.h"
#include "iso_var.h"
@@ -89,9 +87,14 @@ SOFTWARE.
#ifdef ISO
+static void iso_ifscrub(struct ifnet *, struct iso_ifaddr *);
+
+struct iso_ifaddr *iso_ifaddr;
+struct ifqueue clnlintrq;
+
int iso_interfaces = 0; /* number of external interfaces */
-extern struct ifnet loif; /* loopback interface */
-int ether_output(), llc_rtrequest();
+int ether_output();
+void llc_rtrequest();
/*
@@ -107,6 +110,8 @@ int ether_output(), llc_rtrequest();
* NOTES:
*/
struct radix_node_head *iso_rnhead;
+
+void
iso_init()
{
static iso_init_done;
@@ -128,6 +133,7 @@ iso_init()
*
* NOTES:
*/
+int
iso_addrmatch1(isoaa, isoab)
register struct iso_addr *isoaa, *isoab; /* addresses to check */
{
@@ -191,6 +197,7 @@ register struct iso_addr *isoaa, *isoab; /* addresses to check */
*
* NOTES:
*/
+int
iso_addrmatch(sisoa, sisob)
struct sockaddr_iso *sisoa, *sisob; /* addresses to check */
{
@@ -229,7 +236,7 @@ struct sockaddr_iso *sisoa, *sisob;
return ((lena == lenb) && (!bcmp(bufa, bufb, lena)));
}
-#endif notdef
+#endif /* notdef */
/*
* FUNCTION: iso_hashchar
@@ -246,8 +253,8 @@ struct sockaddr_iso *sisoa, *sisob;
*/
u_long
iso_hashchar(buf, len)
-register caddr_t buf; /* buffer to pack from */
-register int len; /* length of buffer */
+ register caddr_t buf; /* buffer to pack from */
+ register int len; /* length of buffer */
{
register u_long h = 0;
register int i;
@@ -426,12 +433,14 @@ caddr_t buf; /* RESULT: network portion of address here */
ENDDEBUG
return len;
}
-#endif notdef
+#endif /* notdef */
+
/*
* Generic iso control operations (ioctl's).
* Ifp is 0 if not an interface-specific ioctl.
*/
/* ARGSUSED */
+int
iso_control(so, cmd, data, ifp)
struct socket *so;
int cmd;
@@ -591,6 +600,7 @@ iso_control(so, cmd, data, ifp)
/*
* Delete any existing route for an interface.
*/
+static void
iso_ifscrub(ifp, ia)
register struct ifnet *ifp;
register struct iso_ifaddr *ia;
@@ -614,10 +624,12 @@ iso_ifscrub(ifp, ia)
* Initialize an interface's internet address
* and routing table entry.
*/
+int
iso_ifinit(ifp, ia, siso, scrub)
register struct ifnet *ifp;
register struct iso_ifaddr *ia;
struct sockaddr_iso *siso;
+ int scrub;
{
struct sockaddr_iso oldaddr;
int s = splimp(), error, nsellength;
@@ -629,7 +641,8 @@ iso_ifinit(ifp, ia, siso, scrub)
* if this is its first address,
* and to validate the address if necessary.
*/
- if (ifp->if_ioctl && (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, ia))) {
+ if (ifp->if_ioctl && (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR,
+ (caddr_t)ia))) {
splx(s);
ia->ia_addr = oldaddr;
return (error);
@@ -723,7 +736,7 @@ iso_ifwithidi(addr)
return ((struct ifaddr *)0);
}
-#endif notdef
+#endif /* notdef */
/*
* FUNCTION: iso_ck_addr
*
@@ -735,8 +748,9 @@ iso_ifwithidi(addr)
* SIDE EFFECTS:
*
*/
+int
iso_ck_addr(isoa)
-struct iso_addr *isoa; /* address to check */
+ struct iso_addr *isoa; /* address to check */
{
return (isoa->isoa_len <= 20);
@@ -772,7 +786,8 @@ struct iso_addr *isoab; /* other addr to check */
}
return(0);
}
-#endif notdef
+#endif /* notdef */
+
/*
* FUNCTION: iso_localifa()
*
@@ -828,7 +843,7 @@ iso_localifa(siso)
#ifdef TPCONS
#include "cons.h"
-#endif TPCONS
+#endif /* TPCONS */
/*
* FUNCTION: iso_nlctloutput
*
@@ -841,11 +856,12 @@ iso_localifa(siso)
* NOTES: This could embody some of the functions of
* rclnp_ctloutput and cons_ctloutput.
*/
+int
iso_nlctloutput(cmd, optname, pcb, m)
-int cmd; /* command:set or get */
-int optname; /* option of interest */
-caddr_t pcb; /* nl pcb */
-struct mbuf *m; /* data for set, buffer for get */
+ int cmd; /* command:set or get */
+ int optname; /* option of interest */
+ caddr_t pcb; /* nl pcb */
+ struct mbuf *m; /* data for set, buffer for get */
{
struct isopcb *isop = (struct isopcb *)pcb;
int error = 0; /* return value */
@@ -889,7 +905,7 @@ struct mbuf *m; /* data for set, buffer for get */
bcopy(data, (caddr_t)isop->isop_x25crud, (unsigned)data_len);
isop->isop_x25crud_len = data_len;
break;
-#endif TPCONS
+#endif /* TPCONS */
default:
error = EOPNOTSUPP;
@@ -897,7 +913,7 @@ struct mbuf *m; /* data for set, buffer for get */
return error;
}
-#endif ISO
+#endif /* ISO */
#ifdef ARGO_DEBUG
@@ -909,6 +925,7 @@ struct mbuf *m; /* data for set, buffer for get */
* RETURNS: nada
*
*/
+void
dump_isoaddr(s)
struct sockaddr_iso *s;
{
@@ -931,4 +948,4 @@ dump_isoaddr(s)
}
}
-#endif ARGO_DEBUG
+#endif /* ARGO_DEBUG */
diff --git a/sys/netiso/iso_chksum.c b/sys/netiso/iso_chksum.c
index f470f86f521b..b5b75a892c7a 100644
--- a/sys/netiso/iso_chksum.c
+++ b/sys/netiso/iso_chksum.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)iso_chksum.c 7.5 (Berkeley) 5/6/91
- * $Id: iso_chksum.c,v 1.3 1993/10/16 21:05:18 rgrimes Exp $
+ * $Id: iso_chksum.c,v 1.5 1993/12/19 00:53:24 wollman Exp $
*/
/***********************************************************
@@ -86,11 +86,11 @@ SOFTWARE.
#include "param.h"
#include "systm.h"
#include "mbuf.h"
-#endif ISO
+#endif /* ISO */
#ifndef MNULL
#define MNULL (struct mbuf *)0
-#endif MNULL
+#endif /* MNULL */
/*
* FUNCTION: iso_check_csum
@@ -188,8 +188,8 @@ iso_gen_csum(m,n,l)
register int c0=0, c1=0;
register int i=0;
int loc = n++, len=0; /* n is position, loc is offset */
- u_char *xloc;
- u_char *yloc;
+ u_char *xloc = 0;
+ u_char *yloc = 0;
int cum=0; /* cum == cumulative length */
IFDEBUG(D_CHKSUM)
@@ -253,133 +253,3 @@ iso_gen_csum(m,n,l)
ENDDEBUG
}
-struct mbuf *
-m_append(head, m)
- struct mbuf *head, *m;
-{
- register struct mbuf *n;
-
- if (m == 0)
- return head;
- if (head == 0)
- return m;
- n = head;
- while (n->m_next)
- n = n->m_next;
- n->m_next = m;
- return head;
-}
-/*
- * FUNCTION: m_datalen
- *
- * PURPOSE: returns length of the mbuf chain.
- * used all over the iso code.
- *
- * RETURNS: integer
- *
- * SIDE EFFECTS: none
- *
- * NOTES:
- */
-
-int
-m_datalen (morig)
- struct mbuf *morig;
-{
- int s = splimp();
- register struct mbuf *n=morig;
- register int datalen = 0;
-
- if( morig == (struct mbuf *)0)
- return 0;
- for(;;) {
- datalen += n->m_len;
- if (n->m_next == (struct mbuf *)0 ) {
- break;
- }
- n = n->m_next;
- }
- splx(s);
- return datalen;
-}
-
-int
-m_compress(in, out)
- register struct mbuf *in, **out;
-{
- register int datalen = 0;
- int s = splimp();
-
- if( in->m_next == MNULL ) {
- *out = in;
- IFDEBUG(D_REQUEST)
- printf("m_compress returning 0x%x: A\n", in->m_len);
- ENDDEBUG
- splx(s);
- return in->m_len;
- }
- MGET((*out), M_DONTWAIT, MT_DATA);
- if((*out) == MNULL) {
- *out = in;
- IFDEBUG(D_REQUEST)
- printf("m_compress returning -1: B\n");
- ENDDEBUG
- splx(s);
- return -1;
- }
- (*out)->m_len = 0;
- (*out)->m_act = MNULL;
-
- while (in) {
- IFDEBUG(D_REQUEST)
- printf("m_compress in 0x%x *out 0x%x\n", in, *out);
- printf("m_compress in: len 0x%x, off 0x%x\n", in->m_len, in->m_data);
- printf("m_compress *out: len 0x%x, off 0x%x\n", (*out)->m_len,
- (*out)->m_data);
- ENDDEBUG
- if (in->m_flags & M_EXT) {
- ASSERT(in->m_len == 0);
- }
- if ( in->m_len == 0) {
- in = in->m_next;
- continue;
- }
- if (((*out)->m_flags & M_EXT) == 0) {
- int len;
-
- len = M_TRAILINGSPACE(*out);
- len = MIN(len, in->m_len);
- datalen += len;
-
- IFDEBUG(D_REQUEST)
- printf("m_compress copying len %d\n", len);
- ENDDEBUG
- bcopy(mtod(in, caddr_t), mtod((*out), caddr_t) + (*out)->m_len,
- (unsigned)len);
-
- (*out)->m_len += len;
- in->m_len -= len;
- continue;
- } else {
- /* (*out) is full */
- if(( (*out)->m_next = m_get(M_DONTWAIT, MT_DATA) ) == MNULL) {
- m_freem(*out);
- *out = in;
- IFDEBUG(D_REQUEST)
- printf("m_compress returning -1: B\n");
- ENDDEBUG
- splx(s);
- return -1;
- }
- (*out)->m_len = 0;
- (*out)->m_act = MNULL;
- *out = (*out)->m_next;
- }
- }
- m_freem(in);
- IFDEBUG(D_REQUEST)
- printf("m_compress returning 0x%x: A\n", datalen);
- ENDDEBUG
- splx(s);
- return datalen;
-}
diff --git a/sys/netiso/iso_errno.h b/sys/netiso/iso_errno.h
index 8f5532008c88..94c0d4f380ae 100644
--- a/sys/netiso/iso_errno.h
+++ b/sys/netiso/iso_errno.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)iso_errno.h 7.5 (Berkeley) 5/6/91
- * $Id: iso_errno.h,v 1.2 1993/10/16 21:05:19 rgrimes Exp $
+ * $Id: iso_errno.h,v 1.3 1993/11/07 17:49:41 wollman Exp $
*/
/***********************************************************
@@ -272,4 +272,4 @@ SOFTWARE.
#define CONL_ERROR_MAX 0x1c3
-#endif __ISO_ERRNO__
+#endif /* __ISO_ERRNO__*/
diff --git a/sys/netiso/iso_map.h b/sys/netiso/iso_map.h
index 30b9d3df143f..ba72c3c5bb9a 100644
--- a/sys/netiso/iso_map.h
+++ b/sys/netiso/iso_map.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)iso_map.h 7.3 (Berkeley) 5/6/91
- * $Id: iso_map.h,v 1.2 1993/10/16 21:05:21 rgrimes Exp $
+ * $Id: iso_map.h,v 1.3 1993/11/07 17:49:43 wollman Exp $
*/
/***********************************************************
@@ -60,8 +60,12 @@ SOFTWARE.
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
+#ifndef _NETISO_ISO_MAP_H_
+#define _NETISO_ISO_MAP_H_ 1
+
struct maptab {
struct iso_addr map_isoa; /* iso address */
u_char map_enaddr[6]; /* ethernet address */
u_char map_valid; /* true if entry is valid */
};
+#endif /* _NETISO_ISO_MAP_H_ */
diff --git a/sys/netiso/iso_pcb.h b/sys/netiso/iso_pcb.h
index 1dd64684426e..65fbe0fa8104 100644
--- a/sys/netiso/iso_pcb.h
+++ b/sys/netiso/iso_pcb.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)iso_pcb.h 7.5 (Berkeley) 5/6/91
- * $Id: iso_pcb.h,v 1.2 1993/10/16 21:05:24 rgrimes Exp $
+ * $Id: iso_pcb.h,v 1.3 1993/11/07 17:49:44 wollman Exp $
*/
/***********************************************************
@@ -61,6 +61,9 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
+#ifndef _NETISO_ISO_PCB_H_
+#define _NETISO_ISO_PCB_H_ 1
+
#define MAXX25CRUDLEN 16 /* 16 bytes of call request user data */
/*
@@ -109,3 +112,4 @@ struct rawisopcb {
#ifdef KERNEL
struct isopcb *iso_pcblookup();
#endif
+#endif /* _NETISO_ISO_PCB_H_ */
diff --git a/sys/netiso/iso_proto.c b/sys/netiso/iso_proto.c
index 2d74770a47f0..0d7aee4f1e56 100644
--- a/sys/netiso/iso_proto.c
+++ b/sys/netiso/iso_proto.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)iso_proto.c 7.8 (Berkeley) 5/6/91
- * $Id: iso_proto.c,v 1.2 1993/10/16 21:05:25 rgrimes Exp $
+ * $Id: iso_proto.c,v 1.3 1993/12/19 00:53:25 wollman Exp $
*/
/***********************************************************
@@ -69,8 +69,8 @@ SOFTWARE.
*/
#ifdef ISO
-#include "types.h"
#include "param.h"
+#include "systm.h"
#include "socket.h"
#include "protosw.h"
#include "domain.h"
@@ -78,19 +78,25 @@ SOFTWARE.
#include "iso.h"
-int clnp_output(), clnp_init(),clnp_slowtimo(),clnp_drain();
+int clnp_output();
+void clnp_init(),clnp_slowtimo(),clnp_drain();
int rclnp_input(), rclnp_output(), rclnp_ctloutput(), raw_usrreq();
int clnp_usrreq();
int tp_ctloutput();
-int tpclnp_ctlinput();
+void tpclnp_ctlinput();
int tpclnp_input();
int tp_usrreq();
-int tp_init(), tp_slowtimo(), tp_drain();
-int cons_init(), tpcons_input();
-
-int esis_input(), esis_ctlinput(), esis_init(), esis_usrreq();
-int cltp_input(), cltp_ctlinput(), cltp_init(), cltp_usrreq(), cltp_output();
+void tp_init(), tp_slowtimo(), tp_drain();
+void cons_init();
+int tpcons_input();
+
+int esis_input();
+void esis_ctlinput(), esis_init();
+int esis_usrreq();
+int cltp_input();
+void cltp_ctlinput(), cltp_init();
+int cltp_usrreq(), cltp_output();
int isis_input();
struct protosw isosw[] = {
@@ -102,10 +108,10 @@ struct protosw isosw[] = {
* pffindtype, which gets the first entry that matches the type.
* sigh.
*/
-{ SOCK_DGRAM, &isodomain, ISOPROTO_CLTP, PR_ATOMIC|PR_ADDR,
- 0, cltp_output, 0, 0,
- cltp_usrreq,
- cltp_init, 0, 0, 0
+{ SOCK_DGRAM, &isodomain, ISOPROTO_CLTP, PR_ATOMIC|PR_ADDR,
+ 0, cltp_output, 0, 0,
+ cltp_usrreq, cltp_init, 0, 0,
+ 0
},
/*
@@ -172,4 +178,4 @@ struct domain isodomain = {
isosw, /* protosw */
&isosw[sizeof(isosw)/sizeof(isosw[0])] /* NPROTOSW */
};
-#endif ISO
+#endif /* ISO */
diff --git a/sys/netiso/iso_snpac.c b/sys/netiso/iso_snpac.c
index 2c9967ae9158..8abac7b0f2af 100644
--- a/sys/netiso/iso_snpac.c
+++ b/sys/netiso/iso_snpac.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)iso_snpac.c 7.14 (Berkeley) 6/27/91
- * $Id: iso_snpac.c,v 1.2 1993/10/16 21:05:26 rgrimes Exp $
+ * $Id: iso_snpac.c,v 1.5 1993/12/19 00:53:26 wollman Exp $
*/
/***********************************************************
@@ -66,6 +66,7 @@ SOFTWARE.
#include "types.h"
#include "param.h"
#include "systm.h"
+#include "kernel.h"
#include "mbuf.h"
#include "domain.h"
#include "protosw.h"
@@ -87,10 +88,12 @@ SOFTWARE.
#include "esis.h"
#include "argo_debug.h"
-int iso_systype = SNPA_ES; /* default to be an ES */
+static void snpac_logdefis(struct rtentry *);
+
+struct llinfo_llc llinfo_llc;
+
+int iso_systype = SNPA_ES; /* default to be an ES */
extern short esis_holding_time, esis_config_time, esis_esconfig_time;
-extern struct timeval time;
-extern int esis_config(), hz;
static void snpac_fixdstandmask();
struct sockaddr_iso blank_siso = {sizeof(blank_siso), AF_ISO};
@@ -152,10 +155,11 @@ union sockunion {
*
* NOTES: This does a lot of obscure magic;
*/
+void
llc_rtrequest(req, rt, sa)
-int req;
-register struct rtentry *rt;
-struct sockaddr *sa;
+ int req;
+ register struct rtentry *rt;
+ struct sockaddr *sa;
{
register union sockunion *gate = (union sockunion *)rt->rt_gateway;
register struct llinfo_llc *lc = (struct llinfo_llc *)rt->rt_llinfo, *lc2;
@@ -201,7 +205,7 @@ struct sockaddr *sa;
if (rt->rt_flags & RTF_CLONING) {
register struct ifaddr *ifa;
register struct sockaddr *sa;
- for (ifa = ifp->if_addrlist; ifa; ifa->ifa_next)
+ for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next)
if ((sa = ifa->ifa_addr)->sa_family == AF_LINK) {
if (sa->sa_len > gate->sa.sa_len)
log(LOG_DEBUG, "llc_rtrequest: cloning address too small\n");
@@ -278,6 +282,7 @@ struct sockaddr *sa;
* A mechanism is needed to prevent this function from
* being invoked if the system is an IS.
*/
+int
iso_snparesolve(ifp, dest, snpa, snpa_len)
struct ifnet *ifp; /* outgoing interface */
struct sockaddr_iso *dest; /* destination */
@@ -343,8 +348,9 @@ int *snpa_len; /* RESULT: length of snpa */
* NOTES: If there is a route entry associated with cache
* entry, then delete that as well
*/
+void
snpac_free(lc)
-register struct llinfo_llc *lc; /* entry to free */
+ register struct llinfo_llc *lc; /* entry to free */
{
register struct rtentry *rt = lc->lc_rt;
register struct iso_addr *r;
@@ -371,13 +377,14 @@ register struct llinfo_llc *lc; /* entry to free */
*
* NOTES: If entry already exists, then update holding time.
*/
+int
snpac_add(ifp, nsap, snpa, type, ht, nsellength)
-struct ifnet *ifp; /* interface info is related to */
-struct iso_addr *nsap; /* nsap to add */
-caddr_t snpa; /* translation */
-char type; /* SNPA_IS or SNPA_ES */
-u_short ht; /* holding time (in seconds) */
-int nsellength; /* nsaps may differ only in trailing bytes */
+ struct ifnet *ifp; /* interface info is related to */
+ struct iso_addr *nsap; /* nsap to add */
+ caddr_t snpa; /* translation */
+ char type; /* SNPA_IS or SNPA_ES */
+ u_short ht; /* holding time (in seconds) */
+ int nsellength; /* nsaps may differ only in trailing bytes */
{
register struct llinfo_llc *lc;
register struct rtentry *rt;
@@ -419,8 +426,10 @@ int nsellength; /* nsaps may differ only in trailing bytes */
goto add;
if (nsellength && (rt->rt_flags & RTF_HOST)) {
if (rt->rt_refcnt == 0) {
- rtrequest(RTM_DELETE, S(dst), (struct sockaddr *)0,
- (struct sockaddr *)0, 0, (struct rtentry *)0);
+ rtrequest(RTM_DELETE, S(dst),
+ (struct sockaddr *)0,
+ (struct sockaddr *)0,
+ 0, (struct rtentry **)0);
rt = 0;
goto add;
} else {
@@ -454,6 +463,7 @@ int nsellength; /* nsaps may differ only in trailing bytes */
static void
snpac_fixdstandmask(nsellength)
+ int nsellength;
{
register char *cp = msk.siso_data, *cplim;
@@ -479,10 +489,11 @@ snpac_fixdstandmask(nsellength)
*
* NOTES:
*/
+int
snpac_ioctl (so, cmd, data)
-struct socket *so;
-int cmd; /* ioctl to process */
-caddr_t data; /* data for the cmd */
+ struct socket *so;
+ int cmd; /* ioctl to process */
+ caddr_t data; /* data for the cmd */
{
register struct systype_req *rq = (struct systype_req *)data;
@@ -511,7 +522,7 @@ caddr_t data; /* data for the cmd */
if (esis_esconfig_time != rq->sr_esconfigt) {
untimeout(esis_config, (caddr_t)0);
esis_esconfig_time = rq->sr_esconfigt;
- esis_config();
+ esis_config(0, 0);
}
} else if (cmd == SIOCGSTYPE) {
rq->sr_type = iso_systype;
@@ -535,8 +546,9 @@ caddr_t data; /* data for the cmd */
*
* NOTES:
*/
+static void
snpac_logdefis(sc)
-register struct rtentry *sc;
+ register struct rtentry *sc;
{
register struct iso_addr *r;
register struct sockaddr_dl *sdl = (struct sockaddr_dl *)sc->rt_gateway;
@@ -581,7 +593,8 @@ register struct rtentry *sc;
* would time out entries where expiry date is older
* than the current time.
*/
-snpac_age()
+void
+snpac_age(caddr_t dummy1, int dummy2)
{
register struct llinfo_llc *lc, *nlc;
register struct rtentry *rt;
@@ -614,9 +627,10 @@ snpac_age()
* as interm kludge until
* real multicast addresses can be configured
*/
+int
snpac_ownmulti(snpa, len)
-caddr_t snpa;
-u_int len;
+ caddr_t snpa;
+ u_int len;
{
return (((iso_systype & SNPA_ES) &&
(!bcmp(snpa, (caddr_t)all_es_snpa, len))) ||
@@ -635,6 +649,7 @@ u_int len;
*
* NOTES:
*/
+void
snpac_flushifp(ifp)
struct ifnet *ifp;
{
@@ -658,13 +673,14 @@ struct ifnet *ifp;
* NOTES: In the future, this should make a request of a user
* level routing daemon.
*/
+void
snpac_rtrequest(req, host, gateway, netmask, flags, ret_nrt)
-int req;
-struct iso_addr *host;
-struct iso_addr *gateway;
-struct iso_addr *netmask;
-short flags;
-struct rtentry **ret_nrt;
+ int req;
+ struct iso_addr *host;
+ struct iso_addr *gateway;
+ struct iso_addr *netmask;
+ short flags;
+ struct rtentry **ret_nrt;
{
register struct iso_addr *r;
@@ -712,9 +728,10 @@ struct rtentry **ret_nrt;
* This could be made more efficient by checking
* the existing route before adding a new one.
*/
+void
snpac_addrt(ifp, host, gateway, netmask)
-struct ifnet *ifp;
-struct iso_addr *host, *gateway, *netmask;
+ struct ifnet *ifp;
+ struct iso_addr *host, *gateway, *netmask;
{
register struct iso_addr *r;
@@ -729,4 +746,4 @@ struct iso_addr *host, *gateway, *netmask;
rtredirect(S(dst), S(gte), (struct sockaddr *)0,
RTF_DONE | RTF_HOST, S(gte), 0);
}
-#endif ISO
+#endif /* ISO */
diff --git a/sys/netiso/iso_snpac.h b/sys/netiso/iso_snpac.h
index 29267c8620ba..773369582d18 100644
--- a/sys/netiso/iso_snpac.h
+++ b/sys/netiso/iso_snpac.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)iso_snpac.h 7.8 (Berkeley) 5/6/91
- * $Id: iso_snpac.h,v 1.2 1993/10/16 21:05:28 rgrimes Exp $
+ * $Id: iso_snpac.h,v 1.4 1993/12/19 00:53:27 wollman Exp $
*/
/***********************************************************
@@ -61,6 +61,9 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
+#ifndef _NETISO_ISO_SNPAC_H_
+#define _NETISO_ISO_SNPAC_H_ 1
+
#define MAX_SNPALEN 8 /* curiously equal to sizeof x.121 (
plus 1 for nibble len) addr */
struct snpa_req {
@@ -108,6 +111,23 @@ struct llinfo_llc {
#define SIOCSSTYPE _IOW('a', 39, struct systype_req) /* set system type */
#define SIOCGSTYPE _IOR('a', 40, struct systype_req) /* get system type */
-#ifdef KERNEL
-struct llinfo_llc llinfo_llc; /* head for linked lists */
-#endif KERNEL
+#ifdef KERNEL
+extern struct llinfo_llc llinfo_llc; /* head for linked lists */
+extern void llc_rtrequest(int, struct rtentry *, struct sockaddr *);
+extern int iso_snparesolve(struct ifnet *, struct sockaddr_iso *, caddr_t,
+ int *);
+extern void snpac_free(struct llinfo_llc *);
+extern int snpac_add(struct ifnet *, struct iso_addr *, caddr_t, int /*char*/,
+ int /*u_short*/, int);
+extern int snpac_ioctl(struct socket *, int, caddr_t);
+extern void snpac_age(caddr_t, int);
+extern int snpac_ownmulti(caddr_t, u_int);
+extern void snpac_flushifp(struct ifnet *);
+extern void snpac_rtrequest(int, struct iso_addr *, struct iso_addr *,
+ struct iso_addr *, int /*short*/,
+ struct rtentry **);
+extern void snpac_addrt(struct ifnet *, struct iso_addr *, struct iso_addr *,
+ struct iso_addr *);
+
+#endif /* KERNEL */
+#endif /* _NETISO_ISO_SNPAC_H_ */
diff --git a/sys/netiso/iso_var.h b/sys/netiso/iso_var.h
index a7eaac94cf74..725b475eccd8 100644
--- a/sys/netiso/iso_var.h
+++ b/sys/netiso/iso_var.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)iso_var.h 7.5 (Berkeley) 5/6/91
- * $Id: iso_var.h,v 1.2 1993/10/16 21:05:30 rgrimes Exp $
+ * $Id: iso_var.h,v 1.4 1993/12/19 00:53:28 wollman Exp $
*/
/***********************************************************
@@ -61,6 +61,9 @@ SOFTWARE.
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
+#ifndef _NETISO_ISO_VAR_H_
+#define _NETISO_ISO_VAR_H_ 1
+
/*
* Interface address, iso version. One of these structures is
* allocated for each interface with an osi address. The ifaddr
@@ -129,7 +132,24 @@ struct snpa_hdr {
short snh_flags;
};
#ifdef KERNEL
-struct iso_ifaddr *iso_ifaddr; /* linked list of iso address ifaces */
-struct iso_ifaddr *iso_localifa(); /* linked list of iso address ifaces */
-struct ifqueue clnlintrq; /* clnl packet input queue */
-#endif KERNEL
+extern struct iso_ifaddr *iso_ifaddr; /* linked list of iso address ifaces */
+struct iso_ifaddr *iso_localifa(); /* linked list of iso address ifaces */
+extern struct ifqueue clnlintrq; /* clnl packet input queue */
+
+extern int iso_check_csum(struct mbuf *, int);
+extern void iso_gen_csum(struct mbuf *, int, int);
+extern void iso_init(void);
+extern int iso_addrmatch1(struct iso_addr *, struct iso_addr *);
+extern int iso_addrmatch(struct sockaddr_iso *, struct sockaddr_iso *);
+extern u_long iso_hashchar(caddr_t, int);
+extern int iso_control(struct socket *, int, caddr_t, struct ifnet *);
+extern int iso_ifinit(struct ifnet *, struct iso_ifaddr *,
+ struct sockaddr_iso *, int);
+extern int iso_ck_addr(struct iso_addr *);
+extern struct iso_ifaddr *iso_localifa(struct sockaddr_iso *);
+extern int iso_nlctloutput(int, int, caddr_t, struct mbuf *);
+extern void dump_isoaddr(struct sockaddr_iso *);
+extern void dump_addr(struct sockaddr *);
+
+#endif /* KERNEL */
+#endif /* _NETISO_ISO_VAR_H_ */
diff --git a/sys/netiso/tp_astring.c b/sys/netiso/tp_astring.c
index 6b27d86edee2..d00b08cb5814 100644
--- a/sys/netiso/tp_astring.c
+++ b/sys/netiso/tp_astring.c
@@ -31,12 +31,12 @@
* SUCH DAMAGE.
*
* from: @(#)tp_astring.c 7.4 (Berkeley) 5/6/91
- * $Id: tp_astring.c,v 1.2 1993/10/16 21:05:33 rgrimes Exp $
+ * $Id: tp_astring.c,v 1.3 1993/12/19 00:53:29 wollman Exp $
*/
#ifndef _NFILE
#include <stdio.h>
-#endif _NFILE
+#endif /* _NFILE */
char *tp_sstring[] = {
"ST_ERROR(0x0)",
"TP_CLOSED(0x1)",
diff --git a/sys/netiso/tp_clnp.h b/sys/netiso/tp_clnp.h
index 38ab12e3a748..66a7f1512b5e 100644
--- a/sys/netiso/tp_clnp.h
+++ b/sys/netiso/tp_clnp.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_clnp.h 7.3 (Berkeley) 5/6/91
- * $Id: tp_clnp.h,v 1.2 1993/10/16 21:05:34 rgrimes Exp $
+ * $Id: tp_clnp.h,v 1.3 1993/11/07 17:49:50 wollman Exp $
*/
/***********************************************************
@@ -87,7 +87,7 @@ SOFTWARE.
#endif
#include "../netiso/iso_var.h"
-struct isopcb tp_isopcb;
+extern struct isopcb tp_isopcb;
/* queue of active inpcbs for tp ; for tp with dod ip */
#endif __TP_CLNP__
diff --git a/sys/netiso/tp_cons.c b/sys/netiso/tp_cons.c
index a4fab09b1ecb..01e9d17a8778 100644
--- a/sys/netiso/tp_cons.c
+++ b/sys/netiso/tp_cons.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_cons.c 7.8 (Berkeley) 5/9/91
- * $Id: tp_cons.c,v 1.2 1993/10/16 21:05:36 rgrimes Exp $
+ * $Id: tp_cons.c,v 1.4 1993/12/19 22:45:43 wollman Exp $
*/
/***********************************************************
@@ -79,6 +79,7 @@ SOFTWARE.
#ifdef TPCONS
#include "param.h"
+#include "systm.h"
#include "socket.h"
#include "domain.h"
#include "mbuf.h"
@@ -117,9 +118,10 @@ int tpcons_output();
* version of the previous procedure for X.25
*/
+int
tpcons_pcbconnect(isop, nam)
-struct isopcb *isop;
-register struct mbuf *nam;
+ struct isopcb *isop;
+ register struct mbuf *nam;
{
int error;
if (error = iso_pcbconnect(isop, nam))
@@ -221,7 +223,8 @@ tpcons_input(m, faddr, laddr, channel)
printf("tpcons_input before tp_input(m 0x%x)\n", m);
dump_buf( m, 12+ m->m_len);
ENDDEBUG
- tp_input(m, faddr, laddr, channel, tpcons_output, 0);
+ tp_input(m, (struct sockaddr *)faddr, (struct sockaddr *)laddr,
+ (u_long)channel, tpcons_output, 0);
return 0;
}
@@ -262,7 +265,7 @@ tpcons_output(isop, m0, datalen, nochksum)
m->m_next = m0;
}
m->m_pkthdr.len = datalen;
- error = pk_send(isop->isop_chan, m);
+ error = pk_send((void *)isop->isop_chan, m);
IncStat(ts_tpdu_sent);
return error;
@@ -286,5 +289,5 @@ tpcons_dg_output(chan, m0, datalen)
{
return tpcons_output(((struct pklcd *)chan)->lcd_upnext, m0, datalen, 0);
}
-#endif TPCONS
-#endif ISO
+#endif /* TPCONS */
+#endif /* ISO */
diff --git a/sys/netiso/tp_driver.c b/sys/netiso/tp_driver.c
index 32f3370b45ad..0c027b8c80c9 100644
--- a/sys/netiso/tp_driver.c
+++ b/sys/netiso/tp_driver.c
@@ -1,6 +1,6 @@
/*
* from: unknown
- * $Id: tp_driver.c,v 1.3 1993/10/16 21:05:37 rgrimes Exp $
+ * $Id: tp_driver.c,v 1.5 1993/12/19 00:53:31 wollman Exp $
*/
#define _XEBEC_PG static
@@ -51,7 +51,7 @@ void tp_indicate(), tp_getoptions(),
tp_cuntimeout(), tp_ctimeout_MIN(),
tp_freeref(), tp_detach(),
tp0_stash(), tp0_send(),
- tp_netcmd(), tp_send()
+ tp_netcmd();
;
typedef struct tp_pcb tpcb_struct;
@@ -1044,6 +1044,8 @@ static int inx[26][9] = { {0,0,0,0,0,0,0,0,0,},
{0x0,0x49,-1,0x45,-1,0x44,0x48,-1,0x0, },
{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,-1, },
};
+
+int
tp_driver(p, e)
register tp_PCB_ *p;
register struct tp_event *e;
diff --git a/sys/netiso/tp_emit.c b/sys/netiso/tp_emit.c
index c87e310dd729..d998f5240638 100644
--- a/sys/netiso/tp_emit.c
+++ b/sys/netiso/tp_emit.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_emit.c 7.9 (Berkeley) 5/9/91
- * $Id: tp_emit.c,v 1.3 1993/10/16 21:05:39 rgrimes Exp $
+ * $Id: tp_emit.c,v 1.5 1993/12/19 00:53:33 wollman Exp $
*/
/***********************************************************
@@ -87,7 +87,10 @@ SOFTWARE.
#include "errno.h"
#include "types.h"
#include "time.h"
+
+#include "net/if.h"
#include "iso.h"
+#include "iso_var.h"
#include "iso_pcb.h"
#include "argo_debug.h"
#include "tp_timer.h"
@@ -100,7 +103,6 @@ SOFTWARE.
#include "tp_seq.h"
#include "iso_errno.h"
-#include "../net/if.h"
#ifdef TRUE
#undef FALSE
#undef TRUE
@@ -109,9 +111,6 @@ SOFTWARE.
#include "../netccitt/pk.h"
#include "../netccitt/pk_var.h"
-void iso_gen_csum();
-
-
/* Here is a mighty kludge. The token ring misorders packets if you
* fire them at it too fast, and TP sans checksum is "too fast", so
* we have introduced a delay when checksumming isn't used.
@@ -968,4 +967,5 @@ tp_error_emit(error, sref, faddr, laddr, erdata, erlen, tpcb, cons_channel,
#endif notdef
}
}
+ return 0;
}
diff --git a/sys/netiso/tp_events.h b/sys/netiso/tp_events.h
index dc51d5961fc6..ba0cd2b231d6 100644
--- a/sys/netiso/tp_events.h
+++ b/sys/netiso/tp_events.h
@@ -1,74 +1,87 @@
/*
* from: unknown
- * $Id: tp_events.h,v 1.2 1993/10/16 21:05:41 rgrimes Exp $
+ * $Id: tp_events.h,v 1.3 1993/11/07 17:49:51 wollman Exp $
*/
+#ifndef _NETISO_TP_EVENTS_H_
+#define _NETISO_TP_EVENTS_H_ 1
+
struct tp_event {
- int ev_number;
- struct timeval e_time;
+ int ev_number;
+ struct timeval e_time;
#define TM_inact 0x0
#define TM_retrans 0x1
#define TM_sendack 0x2
#define TM_notused 0x3
- union{
-struct { SeqNum e_low; SeqNum e_high; int e_retrans; } EV_TM_reference;
+ union{
+ struct { SeqNum e_low; SeqNum e_high; int e_retrans; } EV_TM_reference;
#define TM_reference 0x4
-struct { SeqNum e_low; SeqNum e_high; int e_retrans; } EV_TM_data_retrans;
+ struct { SeqNum e_low; SeqNum e_high; int e_retrans; } EV_TM_data_retrans;
#define TM_data_retrans 0x5
-struct {
- u_char e_reason;
- } EV_ER_TPDU;
+ struct {
+ u_char e_reason;
+ } EV_ER_TPDU;
#define ER_TPDU 0x6
-struct { struct mbuf *e_data; /* first field */
- int e_datalen; /* 2nd field */
- u_int e_cdt;
- } EV_CR_TPDU;
+ struct {
+ struct mbuf *e_data; /* first field */
+ int e_datalen; /* 2nd field */
+ u_int e_cdt;
+ } EV_CR_TPDU;
#define CR_TPDU 0x7
-struct { struct mbuf *e_data; /* first field */
- int e_datalen; /* 2nd field */
- u_short e_sref;
- u_char e_reason;
- } EV_DR_TPDU;
+ struct {
+ struct mbuf *e_data; /* first field */
+ int e_datalen; /* 2nd field */
+ u_short e_sref;
+ u_char e_reason;
+ } EV_DR_TPDU;
#define DR_TPDU 0x8
#define DC_TPDU 0x9
-struct { struct mbuf *e_data; /* first field */
- int e_datalen; /* 2nd field */
- u_short e_sref;
- u_int e_cdt;
- } EV_CC_TPDU;
+ struct {
+ struct mbuf *e_data; /* first field */
+ int e_datalen; /* 2nd field */
+ u_short e_sref;
+ u_int e_cdt;
+ } EV_CC_TPDU;
#define CC_TPDU 0xa
-struct { u_int e_cdt;
- SeqNum e_seq;
- SeqNum e_subseq;
- u_char e_fcc_present;
- } EV_AK_TPDU;
+ struct {
+ u_int e_cdt;
+ SeqNum e_seq;
+ SeqNum e_subseq;
+ u_char e_fcc_present;
+ } EV_AK_TPDU;
#define AK_TPDU 0xb
-struct { struct mbuf *e_data; /* first field */
- int e_datalen; /* 2nd field */
- u_int e_eot;
- SeqNum e_seq;
- } EV_DT_TPDU;
+ struct {
+ struct mbuf *e_data; /* first field */
+ int e_datalen; /* 2nd field */
+ u_int e_eot;
+ SeqNum e_seq;
+ } EV_DT_TPDU;
#define DT_TPDU 0xc
-struct { struct mbuf *e_data; /* first field */
- int e_datalen; /* 2nd field */
- SeqNum e_seq;
- } EV_XPD_TPDU;
+ struct {
+ struct mbuf *e_data; /* first field */
+ int e_datalen; /* 2nd field */
+ SeqNum e_seq;
+ } EV_XPD_TPDU;
#define XPD_TPDU 0xd
-struct { SeqNum e_seq; } EV_XAK_TPDU;
+ struct {
+ SeqNum e_seq;
+ } EV_XAK_TPDU;
#define XAK_TPDU 0xe
#define T_CONN_req 0xf
-struct { u_char e_reason; } EV_T_DISC_req;
+ struct {
+ u_char e_reason;
+ } EV_T_DISC_req;
#define T_DISC_req 0x10
#define T_LISTEN_req 0x11
@@ -79,9 +92,10 @@ struct { u_char e_reason; } EV_T_DISC_req;
#define T_DETACH 0x16
#define T_NETRESET 0x17
#define T_ACPT_req 0x18
- }ev_union;
+ } ev_union;
};/* end struct event */
#define tp_NEVENTS 0x19
#define ATTR(X)ev_union.EV_/**/X/**/
+#endif /* _NETISO_TP_EVENTS_H_ */
diff --git a/sys/netiso/tp_inet.c b/sys/netiso/tp_inet.c
index 4964255c28a4..ec9cacacc003 100644
--- a/sys/netiso/tp_inet.c
+++ b/sys/netiso/tp_inet.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_inet.c 7.8 (Berkeley) 5/6/91
- * $Id: tp_inet.c,v 1.2 1993/10/16 21:05:42 rgrimes Exp $
+ * $Id: tp_inet.c,v 1.4 1993/12/19 00:53:34 wollman Exp $
*/
/***********************************************************
@@ -85,6 +85,7 @@ SOFTWARE.
#ifdef INET
#include "param.h"
+#include "systm.h"
#include "socket.h"
#include "socketvar.h"
#include "mbuf.h"
@@ -105,6 +106,8 @@ SOFTWARE.
#include "iso_chksum.c"
#endif
+static void tpin_abort(struct inpcb *, int);
+
/*
* NAME: in_getsufx()
@@ -122,6 +125,7 @@ SOFTWARE.
*
* NOTES:
*/
+void
in_getsufx(inp, lenp, data_out, which)
struct inpcb *inp;
u_short *lenp;
@@ -161,6 +165,7 @@ void
in_putsufx(inp, sufxloc, sufxlen, which)
struct inpcb *inp;
caddr_t sufxloc;
+ int sufxlen;
int which;
{
if (which == TP_FOREIGN) {
@@ -250,6 +255,7 @@ in_putnetaddr(inp, name, which)
*
* NOTES:
*/
+int
in_cmpnetaddr(inp, name, which)
register struct inpcb *inp;
register struct sockaddr_in *name;
@@ -667,8 +673,6 @@ tpip_ctlinput(cmd, sin)
struct sockaddr_in *sin;
{
extern u_char inetctlerrmap[];
- extern ProtoHook tpin_abort();
- extern ProtoHook in_rtchange();
extern struct in_addr zeroin_addr;
if (sin->sin_family != AF_INET && sin->sin_family != AF_IMPLINK)
@@ -680,8 +684,8 @@ tpip_ctlinput(cmd, sin)
switch (cmd) {
case PRC_QUENCH:
- in_pcbnotify(&tp_inpcb, sin, 0,
- zeroin_addr, 0, cmd, (int (*)())tp_quench);
+ in_pcbnotify(&tp_inpcb, (struct sockaddr *)sin, 0,
+ zeroin_addr, 0, cmd, (void (*)())tp_quench);
break;
case PRC_ROUTEDEAD:
@@ -689,7 +693,7 @@ tpip_ctlinput(cmd, sin)
case PRC_UNREACH_NET:
case PRC_IFDOWN:
case PRC_HOSTDEAD:
- in_pcbnotify(&tp_inpcb, sin, 0,
+ in_pcbnotify(&tp_inpcb, (struct sockaddr *)sin, 0,
zeroin_addr, 0, cmd, in_rtchange);
break;
@@ -709,7 +713,7 @@ tpip_ctlinput(cmd, sin)
case PRC_TIMXCEED_REASS:
case PRC_PARAMPROB:
*/
- in_pcbnotify(&tp_inpcb, sin, 0, zeroin_addr, 0,
+ in_pcbnotify(&tp_inpcb, (struct sockaddr *)sin, 0, zeroin_addr, 0,
cmd, tpin_abort);
}
return 0;
@@ -734,25 +738,26 @@ tpip_ctlinput(cmd, sin)
* NOTES:
*/
-ProtoHook
-tpin_abort(inp)
+static void
+tpin_abort(inp, errno)
struct inpcb *inp;
+ int errno;
{
struct tp_event e;
e.ev_number = ER_TPDU;
e.ATTR(ER_TPDU).e_reason = ENETRESET;
(void) tp_driver((struct tp_pcb *)inp->inp_ppcb, &e);
- return 0;
}
#ifdef ARGO_DEBUG
+void
dump_inaddr(addr)
register struct sockaddr_in *addr;
{
printf("INET: port 0x%x; addr 0x%x\n", addr->sin_port, addr->sin_addr);
}
-#endif ARGO_DEBUG
+#endif /* ARGO_DEBUG */
/*
* NAME: tpip_route()
@@ -814,4 +819,4 @@ tpip_route(dst)
return ifp;
}
-#endif INET
+#endif /* INET */
diff --git a/sys/netiso/tp_input.c b/sys/netiso/tp_input.c
index b11e649d225c..cd865d4473f4 100644
--- a/sys/netiso/tp_input.c
+++ b/sys/netiso/tp_input.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tp_input.c 7.19 (Berkeley) 6/27/91
- * $Id: tp_input.c,v 1.2 1993/10/16 21:05:44 rgrimes Exp $
+ * $Id: tp_input.c,v 1.4 1993/12/19 00:53:35 wollman Exp $
*/
/***********************************************************
@@ -209,7 +209,7 @@ static u_char tpdu_info[][4] =
if (Phrase) {error = (Erval); errlen = (int)(Loc); IncStat(Stat); tpibrk();\
goto Whattodo; }
-tpibrk() {}
+void tpibrk() {}
/*
* WHENEVER YOU USE THE FOLLOWING MACRO,
@@ -348,7 +348,7 @@ tp_newsocket(so, fname, cons_channel, class_to_use, netservice)
* the passive open case
*/
tpcb->tp_dont_change_params = 0;
- err = tp_route_to( m, tpcb, cons_channel);
+ err = tp_route_to( m, tpcb, (caddr_t)cons_channel);
m_free(m);
if (!err)
@@ -370,11 +370,12 @@ ok:
}
#ifndef TPCONS
+int
tpcons_output()
{
return(0);
}
-#endif !CONS
+#endif /* !CONS */
/*
* NAME: tp_input()
@@ -412,18 +413,18 @@ tp_input(m, faddr, laddr, cons_channel, dgout_routine, ce_bit)
{
register struct tp_pcb *tpcb = (struct tp_pcb *)0;
- register struct tpdu *hdr;
- struct socket *so;
- struct tp_event e;
- int error = 0;
- unsigned dutype;
- u_short dref, sref = 0, acktime = 2, subseq = 0; /*VAX*/
- u_char preferred_class = 0, class_to_use = 0;
- u_char opt, dusize = TP_DFL_TPDUSIZE, addlopt = 0, version;
+ register struct tpdu *hdr;
+ struct socket *so;
+ struct tp_event e;
+ int error = 0;
+ unsigned dutype;
+ u_short dref, sref = 0, acktime = 2, subseq = 0; /*VAX*/
+ u_char preferred_class = 0, class_to_use = 0;
+ u_char opt, dusize = TP_DFL_TPDUSIZE, addlopt = 0, version = 0;
#ifdef TP_PERF_MEAS
- u_char perf_meas;
+ u_char perf_meas;
#endif TP_PERF_MEAS
- u_char fsufxlen = 0, lsufxlen = 0, intercepted = 0;
+ u_char fsufxlen = 0, lsufxlen = 0, intercepted = 0;
caddr_t fsufxloc = 0, lsufxloc = 0;
int tpdu_len = 0;
u_int takes_data = FALSE;
@@ -916,7 +917,7 @@ again:
/* we've now made the error reporting thing check for
multiple channels and not close out if more than
one in use */
-#endif old_history
+#endif /* old_history */
{
CHECK( ((int)dref <= 0 || dref >= N_TPREF) ,
@@ -1233,7 +1234,7 @@ again:
#else
e.ATTR(AK_TPDU).e_cdt = hdr->tpdu_AKcdtX;
e.ATTR(AK_TPDU).e_seq = hdr->tpdu_AKseqX;
-#endif BYTE_ORDER
+#endif /* BYTE_ORDER */
} else {
e.ATTR(AK_TPDU).e_cdt = hdr->tpdu_AKcdt;
e.ATTR(AK_TPDU).e_seq = hdr->tpdu_AKseq;
@@ -1258,7 +1259,7 @@ again:
e.ATTR(XAK_TPDU).e_seq = seqeotX.s_seq;
#else
e.ATTR(XAK_TPDU).e_seq = hdr->tpdu_XAKseqX;
-#endif BYTE_ORDER
+#endif /* BYTE_ORDER */
} else {
e.ATTR(XAK_TPDU).e_seq = hdr->tpdu_XAKseq;
}
@@ -1276,7 +1277,7 @@ again:
e.ATTR(XPD_TPDU).e_seq = seqeotX.s_seq;
#else
e.ATTR(XPD_TPDU).e_seq = hdr->tpdu_XPDseqX;
-#endif BYTE_ORDER
+#endif /* BYTE_ORDER */
} else {
e.ATTR(XPD_TPDU).e_seq = hdr->tpdu_XPDseq;
}
@@ -1311,7 +1312,7 @@ again:
#else
e.ATTR(DT_TPDU).e_seq = hdr->tpdu_DTseqX;
e.ATTR(DT_TPDU).e_eot = hdr->tpdu_DTeotX;
-#endif BYTE_ORDER
+#endif /* BYTE_ORDER */
} else {
e.ATTR(DT_TPDU).e_seq = hdr->tpdu_DTseq;
e.ATTR(DT_TPDU).e_eot = hdr->tpdu_DTeot;
diff --git a/sys/netiso/tp_ip.h b/sys/netiso/tp_ip.h
index 9cbaf22014d2..8d5ffe2bcde8 100644
--- a/sys/netiso/tp_ip.h
+++ b/sys/netiso/tp_ip.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_ip.h 7.3 (Berkeley) 5/6/91
- * $Id: tp_ip.h,v 1.2 1993/10/16 21:05:46 rgrimes Exp $
+ * $Id: tp_ip.h,v 1.3 1993/11/07 17:49:52 wollman Exp $
*/
/***********************************************************
@@ -84,7 +84,7 @@ SOFTWARE.
#include "../netinet/ip_var.h"
-struct inpcb tp_inpcb;
+extern struct inpcb tp_inpcb;
/* queue of active inpcbs for tp ; for tp with dod ip */
#endif __TP_IP__
diff --git a/sys/netiso/tp_iso.c b/sys/netiso/tp_iso.c
index 8ea9e449c997..24e05522a8db 100644
--- a/sys/netiso/tp_iso.c
+++ b/sys/netiso/tp_iso.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_iso.c 7.11 (Berkeley) 5/6/91
- * $Id: tp_iso.c,v 1.3 1993/10/16 21:05:47 rgrimes Exp $
+ * $Id: tp_iso.c,v 1.5 1993/12/19 00:53:37 wollman Exp $
*/
/***********************************************************
@@ -110,13 +110,17 @@ SOFTWARE.
#include "tp_clnp.h"
#include "cltp_var.h"
+int clnp_output(); /* XXX */
+void tpclnp_ctlinput(); /* XXX */
+int tp_driver(); /* XXX */
+
/*
* CALLED FROM:
* pr_usrreq() on PRU_BIND, PRU_CONNECT, PRU_ACCEPT, and PRU_PEERADDR
* FUNCTION, ARGUMENTS:
* The argument (which) takes the value TP_LOCAL or TP_FOREIGN.
*/
-
+void
iso_getsufx(isop, lenp, data_out, which)
struct isopcb *isop;
u_short *lenp;
@@ -260,6 +264,7 @@ iso_putnetaddr(isop, name, which)
* with that implicitly stored in an isopcb (isop).
* The argument (which) takes values TP_LOCAL or TP_FOREIGN.
*/
+int
iso_cmpnetaddr(isop, name, which)
register struct isopcb *isop;
register struct sockaddr_iso *name;
@@ -629,7 +634,7 @@ tpiso_quench(isop)
* (cmd) is the type of ICMP error.
* (siso) is the address of the guy who sent the ER CLNPDU
*/
-ProtoHook
+void
tpclnp_ctlinput(cmd, siso)
int cmd;
struct sockaddr_iso *siso;
@@ -646,9 +651,9 @@ tpclnp_ctlinput(cmd, siso)
ENDDEBUG
if (cmd < 0 || cmd > PRC_NCMDS)
- return 0;
+ return;
if (siso->siso_family != AF_ISO)
- return 0;
+ return;
switch (cmd) {
case PRC_QUENCH2:
@@ -690,7 +695,7 @@ tpclnp_ctlinput(cmd, siso)
iso_pcbnotify(&tp_isopcb, siso, (int)inetctlerrmap[cmd], tpiso_abort);
break;
}
- return 0;
+ return;
}
/*
* XXX - Variant which is called by clnp_er.c with an isoaddr rather
@@ -698,6 +703,8 @@ tpclnp_ctlinput(cmd, siso)
*/
static struct sockaddr_iso siso = {sizeof(siso), AF_ISO};
+
+void
tpclnp_ctlinput1(cmd, isoa)
int cmd;
struct iso_addr *isoa;
diff --git a/sys/netiso/tp_meas.c b/sys/netiso/tp_meas.c
index 4777c4ea85d9..35ccb7bfe249 100644
--- a/sys/netiso/tp_meas.c
+++ b/sys/netiso/tp_meas.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_meas.c 7.4 (Berkeley) 5/6/91
- * $Id: tp_meas.c,v 1.2 1993/10/16 21:05:49 rgrimes Exp $
+ * $Id: tp_meas.c,v 1.3 1993/12/19 00:53:38 wollman Exp $
*/
/***********************************************************
@@ -67,12 +67,12 @@ SOFTWARE.
*/
#include "types.h"
+#include "systm.h"
+#include "kernel.h"
#include "time.h"
#include "argo_debug.h"
#include "tp_meas.h"
-extern struct timeval time;
-
#ifdef TP_PERF_MEAS
int tp_Measn = 0;
struct tp_Meas tp_Meas[TPMEASN];
diff --git a/sys/netiso/tp_meas.h b/sys/netiso/tp_meas.h
index e8e1e7a6d684..ab769df95b31 100644
--- a/sys/netiso/tp_meas.h
+++ b/sys/netiso/tp_meas.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_meas.h 7.5 (Berkeley) 5/6/91
- * $Id: tp_meas.h,v 1.2 1993/10/16 21:05:50 rgrimes Exp $
+ * $Id: tp_meas.h,v 1.3 1993/11/07 17:49:54 wollman Exp $
*/
/***********************************************************
@@ -57,6 +57,9 @@ SOFTWARE.
******************************************************************/
+#ifndef _NETISO_TP_MEAS_H_
+#define _NETISO_TP_MEAS_H_ 1
+
/*
* ARGO Project, Computer Sciences Dept., University of Wisconsin - Madison
*/
@@ -92,4 +95,5 @@ extern struct tp_Meas tp_Meas[];
#define TPtime_open_X 0x28 /* xtd format */
#define TPtime_close 0x09
-#endif TP_PERF_MEAS
+#endif /* TP_PERF_MEAS */
+#endif /* _NETISO_TP_MEAS_H_ */
diff --git a/sys/netiso/tp_output.c b/sys/netiso/tp_output.c
index 96184609234f..fe5d0f5efb07 100644
--- a/sys/netiso/tp_output.c
+++ b/sys/netiso/tp_output.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)tp_output.c 7.10 (Berkeley) 6/27/91
- * $Id: tp_output.c,v 1.3 1993/10/16 21:05:51 rgrimes Exp $
+ * $Id: tp_output.c,v 1.4 1993/12/19 00:53:39 wollman Exp $
*/
/***********************************************************
@@ -117,9 +117,9 @@ SOFTWARE.
int
tp_consistency( tpcb, cmd, param )
+ struct tp_pcb *tpcb;
u_int cmd;
struct tp_conn_param *param;
- struct tp_pcb *tpcb;
{
register int error = EOK;
int class_to_use = tp_mask_to_num(param->p_class);
diff --git a/sys/netiso/tp_param.h b/sys/netiso/tp_param.h
index 1412f95e489e..23e7c7dd2f80 100644
--- a/sys/netiso/tp_param.h
+++ b/sys/netiso/tp_param.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_param.h 7.8 (Berkeley) 6/27/91
- * $Id: tp_param.h,v 1.2 1993/10/16 21:05:53 rgrimes Exp $
+ * $Id: tp_param.h,v 1.4 1993/12/19 00:53:40 wollman Exp $
*/
/***********************************************************
@@ -153,8 +153,8 @@ extern int N_TPREF;
#define TP_MAX_CR_DATA TP_MAX_CC_DATA
#define TP_MAX_DR_DATA 0x40 /* 64 octets */
-#define TP_XTD_FMT_BIT 0x80000000
-#define TP_XTD_FMT_MASK 0x7fffffff
+#define TP_XTD_FMT_BIT 0x80000000ul
+#define TP_XTD_FMT_MASK 0x7ffffffful
#define TP_NML_FMT_BIT 0x80
#define TP_NML_FMT_MASK 0x7f
@@ -236,7 +236,7 @@ extern int N_TPREF;
#define MT_XPD 0x44
#define MT_EOT 0x40
-#define TP_ENOREF 0x80000000
+#define TP_ENOREF 0x80000000ul
typedef unsigned int SeqNum;
typedef unsigned short RefNum;
@@ -348,7 +348,7 @@ bcopy((caddr_t)&(((struct tp_vbp *)(src))->tpv_val),(caddr_t)&(dst),sizeof(type)
(tpcb)->tp_lcredit = xxi; \
} \
}
-#endif ARGO_DEBUG
+#endif /* ARGO_DEBUG */
#ifdef KERNEL
@@ -361,7 +361,7 @@ bcopy((caddr_t)&(((struct tp_vbp *)(src))->tpv_val),(caddr_t)&(dst),sizeof(type)
#define ATTR(X) ev_union.EV_ ## X
#endif /* defined(__STDC__) || defined(__cplusplus) */
-#endif tp_NSTATES
-#endif KERNEL
+#endif /* tp_NSTATES */
+#endif /* KERNEL */
-#endif __TP_PARAM__
+#endif /* __TP_PARAM__ */
diff --git a/sys/netiso/tp_pcb.c b/sys/netiso/tp_pcb.c
index 1f1c66040dd3..1c36e2a541e5 100644
--- a/sys/netiso/tp_pcb.c
+++ b/sys/netiso/tp_pcb.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_pcb.c 7.11 (Berkeley) 5/6/91
- * $Id: tp_pcb.c,v 1.2 1993/10/16 21:05:55 rgrimes Exp $
+ * $Id: tp_pcb.c,v 1.4 1993/12/19 00:53:41 wollman Exp $
*/
/***********************************************************
@@ -76,8 +76,8 @@ SOFTWARE.
*
*/
-#include "types.h"
#include "param.h"
+#include "systm.h"
#include "mbuf.h"
#include "socket.h"
#include "socketvar.h"
@@ -252,56 +252,51 @@ struct tp_conn_param tp_conn_param[] = {
};
#ifdef INET
-int in_putnetaddr();
-int in_getnetaddr();
-int in_cmpnetaddr();
+int in_putnetaddr();
+int in_getnetaddr();
+int in_cmpnetaddr();
int in_putsufx();
int in_getsufx();
int in_recycle_tsuffix();
int tpip_mtu();
-int in_pcbbind();
-int in_pcbconnect();
-int in_pcbdisconnect();
-int in_pcbdetach();
-int in_pcballoc();
int tpip_output();
int tpip_output_dg();
struct inpcb tp_inpcb;
-#endif INET
+#endif /* INET */
#ifdef ISO
-int iso_putnetaddr();
-int iso_getnetaddr();
-int iso_cmpnetaddr();
+int iso_putnetaddr();
+int iso_getnetaddr();
+int iso_cmpnetaddr();
int iso_putsufx();
int iso_getsufx();
int iso_recycle_tsuffix();
-int tpclnp_mtu();
-int iso_pcbbind();
-int iso_pcbconnect();
-int iso_pcbdisconnect();
-int iso_pcbdetach();
+int tpclnp_mtu();
+int iso_pcbbind();
+int iso_pcbconnect();
+void iso_pcbdisconnect();
+void iso_pcbdetach();
int iso_pcballoc();
int tpclnp_output();
int tpclnp_output_dg();
-int iso_nlctloutput();
+int iso_nlctloutput();
struct isopcb tp_isopcb;
-#endif ISO
+#endif /* ISO */
#ifdef TPCONS
-int iso_putnetaddr();
-int iso_getnetaddr();
-int iso_cmpnetaddr();
+int iso_putnetaddr();
+int iso_getnetaddr();
+int iso_cmpnetaddr();
int iso_putsufx();
int iso_getsufx();
int iso_recycle_tsuffix();
-int iso_pcbbind();
-int tpcons_pcbconnect();
-int tpclnp_mtu();
-int iso_pcbdisconnect();
-int iso_pcbdetach();
+int iso_pcbbind();
+int tpcons_pcbconnect();
+int tpclnp_mtu();
+void iso_pcbdisconnect();
+void iso_pcbdetach();
int iso_pcballoc();
int tpcons_output();
struct isopcb tp_isopcb;
-#endif TPCONS
+#endif /* TPCONS */
struct nl_protosw nl_protosw[] = {
@@ -591,6 +586,7 @@ tp_getref(tpcb)
*
* NOTES:
*/
+int
tp_attach(so, dom)
struct socket *so;
int dom;
diff --git a/sys/netiso/tp_pcb.h b/sys/netiso/tp_pcb.h
index 073be329fbb6..605808ee59c1 100644
--- a/sys/netiso/tp_pcb.h
+++ b/sys/netiso/tp_pcb.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_pcb.h 7.9 (Berkeley) 5/6/91
- * $Id: tp_pcb.h,v 1.2 1993/10/16 21:05:56 rgrimes Exp $
+ * $Id: tp_pcb.h,v 1.6 1993/12/19 00:53:42 wollman Exp $
*/
/***********************************************************
@@ -76,7 +76,7 @@ SOFTWARE.
#include "../netiso/tp_user.h"
#ifndef sblock
#include "socketvar.h"
-#endif sblock
+#endif /* sblock */
/* NOTE: the code depends on REF_CLOSED > REF_OPEN > the rest, and
* on REF_FREE being zero
@@ -135,23 +135,23 @@ struct tp_rtc {
};
struct nl_protosw {
- int nlp_afamily; /* address family */
- int (*nlp_putnetaddr)(); /* puts addresses in nl pcb */
- int (*nlp_getnetaddr)(); /* gets addresses from nl pcb */
- int (*nlp_cmpnetaddr)(); /* compares address in pcb with sockaddr */
- int (*nlp_putsufx)(); /* puts transport suffixes in nl pcb */
- int (*nlp_getsufx)(); /* gets transport suffixes from nl pcb */
- int (*nlp_recycle_suffix)();/* clears suffix from nl pcb */
- int (*nlp_mtu)(); /* figures out mtu based on nl used */
- int (*nlp_pcbbind)(); /* bind to pcb for net level */
- int (*nlp_pcbconn)(); /* connect for net level */
- int (*nlp_pcbdisc)(); /* disconnect net level */
- int (*nlp_pcbdetach)(); /* detach net level pcb */
- int (*nlp_pcballoc)(); /* allocate a net level pcb */
- int (*nlp_output)(); /* prepare a packet to give to nl */
- int (*nlp_dgoutput)(); /* prepare a packet to give to nl */
- int (*nlp_ctloutput)(); /* hook for network set/get options */
- caddr_t nlp_pcblist; /* list of xx_pcb's for connections */
+ int nlp_afamily; /* address family */
+ int (*nlp_putnetaddr)(); /* puts addresses in nl pcb */
+ int (*nlp_getnetaddr)(); /* gets addresses from nl pcb */
+ int (*nlp_cmpnetaddr)(); /* compares address in pcb with sockaddr */
+ int (*nlp_putsufx)(); /* puts transport suffixes in nl pcb */
+ int (*nlp_getsufx)(); /* gets transport suffixes from nl pcb */
+ int (*nlp_recycle_suffix)(); /* clears suffix from nl pcb */
+ int (*nlp_mtu)(); /* figures out mtu based on nl used */
+ int (*nlp_pcbbind)(); /* bind to pcb for net level */
+ int (*nlp_pcbconn)(); /* connect for net level */
+ void (*nlp_pcbdisc)(); /* disconnect net level */
+ void (*nlp_pcbdetach)(); /* detach net level pcb */
+ int (*nlp_pcballoc)(); /* allocate a net level pcb */
+ int (*nlp_output)(); /* prepare a packet to give to nl */
+ int (*nlp_dgoutput)(); /* prepare a packet to give to nl */
+ int (*nlp_ctloutput)(); /* hook for network set/get options */
+ caddr_t nlp_pcblist; /* list of xx_pcb's for connections */
};
@@ -285,7 +285,7 @@ struct tp_pcb {
/* performance stats - see tp_stat.h */
struct tp_pmeas *tp_p_meas;
struct mbuf *tp_p_mbuf;
-#endif TP_PERF_MEAS
+#endif /* TP_PERF_MEAS */
/* addressing */
u_short tp_domain; /* domain (INET, ISO) */
/* for compatibility with the *old* way and with INET, be sure that
@@ -303,7 +303,7 @@ struct tp_pcb {
u_char tp_peer_acktime; /* used to compute DT retrans time */
struct sockbuf tp_Xsnd; /* for expedited data */
-/* struct sockbuf tp_Xrcv; /* for expedited data */
+/* struct sockbuf tp_Xrcv;*/ /* for expedited data */
#define tp_Xrcv tp_sock->so_rcv
SeqNum tp_Xsndnxt; /* next XPD seq # to send */
SeqNum tp_Xuna; /* seq # of unacked XPD */
@@ -315,7 +315,10 @@ struct tp_pcb {
};
-u_int tp_start_win;
+#ifdef KERNEL
+extern u_int tp_start_win;
+#endif
+
#define ROUND(scaled_int) (((scaled_int) >> 8) + (((scaled_int) & 0x80) ? 1:0))
@@ -362,6 +365,35 @@ extern struct tp_param tp_param;
extern struct nl_protosw nl_protosw[];
extern struct tp_pcb *tp_listeners;
extern struct tp_pcb *tp_intercepts;
+
+extern int tp_goodXack(struct tp_pcb *, SeqNum);
+extern void tp_rtt_rtv(struct timeval *, struct timeval *, struct timeval *);
+extern int tp_goodack(struct tp_pcb *, u_int, SeqNum, SeqNum);
+extern int tp_send(struct tp_pcb *);
+struct tp_event;
+extern int tp_stash(struct tp_pcb *, struct tp_event *);
+
+extern void tp_local_credit(struct tp_pcb *);
+extern int tp_protocol_error(struct tp_event *, struct tp_pcb *);
+extern void tp_drain(void);
+extern void tp_indicate(int, struct tp_pcb *, int /*u_short*/);
+extern void tp_getoptions(struct tp_pcb *);
+extern void tp_recycle_tsuffix(struct tp_pcb *);
+extern void tp_quench(struct tp_pcb *, int);
+extern void tp_netcmd(struct tp_pcb *, int);
+extern int tp_mask_to_num(int /*u_char*/);
+extern int tp_route_to(struct mbuf *, struct tp_pcb *, caddr_t);
+extern void tp0_stash(struct tp_pcb *, struct tp_event *);
+extern void ytp0_openflow(struct tp_pcb *);
+extern int tp_setup_perf(struct tp_pcb *);
+
+extern int tp_consistency(struct tp_pcb *, u_int, struct tp_conn_param *);
+extern int tp_ctloutput(int, struct socket *, int, int, struct mbuf **);
+extern struct mbuf *tp_inputprep(struct mbuf *);
+extern int tp_input(struct mbuf *, struct sockaddr *, struct sockaddr *,
+ u_int, int (*)(), int);
+extern int tp_headersize(int, struct tp_pcb *);
+
#endif
#define sototpcb(so) ((struct tp_pcb *)(so->so_tpcb))
@@ -369,4 +401,4 @@ extern struct tp_pcb *tp_intercepts;
#define tpcbtoso(tp) ((struct socket *)((tp)->tp_sock))
#define tpcbtoref(tp) ((struct tp_ref *)((tp)->tp_ref))
-#endif __TP_PCB__
+#endif /* __TP_PCB__ */
diff --git a/sys/netiso/tp_seq.h b/sys/netiso/tp_seq.h
index 36bee739cfa9..26e88eb3b015 100644
--- a/sys/netiso/tp_seq.h
+++ b/sys/netiso/tp_seq.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_seq.h 7.5 (Berkeley) 5/6/91
- * $Id: tp_seq.h,v 1.2 1993/10/16 21:05:58 rgrimes Exp $
+ * $Id: tp_seq.h,v 1.3 1993/11/07 17:49:58 wollman Exp $
*/
/***********************************************************
@@ -120,4 +120,4 @@ SOFTWARE.
#define IN_SWINDOW(tpcb, seq, lwe, uwe)\
( SEQ_GT(tpcb, seq, lwe) && SEQ_LEQ(tpcb, seq, uwe) )
-#endif __TP_SEQ__
+#endif /* __TP_SEQ__ */
diff --git a/sys/netiso/tp_stat.h b/sys/netiso/tp_stat.h
index fd24cff34a35..33300e6fe469 100644
--- a/sys/netiso/tp_stat.h
+++ b/sys/netiso/tp_stat.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_stat.h 7.5 (Berkeley) 6/27/91
- * $Id: tp_stat.h,v 1.2 1993/10/16 21:05:59 rgrimes Exp $
+ * $Id: tp_stat.h,v 1.4 1993/11/25 01:36:11 wollman Exp $
*/
/***********************************************************
@@ -184,7 +184,12 @@ struct tp_stat {
* ACK_USRRCV **
* ACK_FCC **
*/
-} tp_stat ;
+} ;
+
+#ifdef KERNEL
+struct tp_stat tp_stat;
+#endif
+
#define TP_PM_MAX 0xa /* 10 decimal */
#define IncStat(x) tp_stat./**/x/**/++
@@ -265,16 +270,16 @@ struct tp_pmeas {
#define IFPERF(tpcb) if (tpcb->tp_perf_on && tpcb->tp_p_meas) {
#define ENDPERF }
-#else
+#else /* not TP_PERF_MEAS */
-int PStat_Junk;
+extern int PStat_Junk;
#define PStat(tpcb, x) PStat_Junk
#define IncPStat(tpcb, x) /* no-op */
-#define tpmeas(a,b,c,d,e,f) 0
+#define tpmeas(a,b,c,d,e,f)
#define IFPERF(x) if (0) {
#define ENDPERF }
-#endif TP_PERF_MEAS
+#endif /* TP_PERF_MEAS */
-#endif __TP_STAT__
+#endif /* __TP_STAT__ */
diff --git a/sys/netiso/tp_states.h b/sys/netiso/tp_states.h
index 6f01eda6cfa3..d9abb462ce26 100644
--- a/sys/netiso/tp_states.h
+++ b/sys/netiso/tp_states.h
@@ -1,8 +1,11 @@
/*
* from: unknown
- * $Id: tp_states.h,v 1.2 1993/10/16 21:06:01 rgrimes Exp $
+ * $Id: tp_states.h,v 1.3 1993/11/07 17:50:01 wollman Exp $
*/
+#ifndef _NETISO_TP_STATES_H_
+#define _NETISO_TP_STATES_H_ 1
+
#define ST_ERROR 0x0
#define TP_CLOSED 0x1
#define TP_CRSENT 0x2
@@ -14,3 +17,4 @@
#define TP_CONFIRMING 0x8
#define tp_NSTATES 0x9
+#endif /* _NETISO_TP_STATES_H_ */
diff --git a/sys/netiso/tp_subr.c b/sys/netiso/tp_subr.c
index 12317c24d6b7..975bde35b0b5 100644
--- a/sys/netiso/tp_subr.c
+++ b/sys/netiso/tp_subr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_subr.c 7.9 (Berkeley) 6/27/91
- * $Id: tp_subr.c,v 1.3 1993/10/16 21:06:03 rgrimes Exp $
+ * $Id: tp_subr.c,v 1.5 1993/11/25 01:36:12 wollman Exp $
*/
/***********************************************************
@@ -94,6 +94,20 @@ SOFTWARE.
#include "tp_trace.h"
#include "tp_meas.h"
#include "tp_seq.h"
+#include "tp_clnp.h"
+
+struct isopcb tp_isopcb;
+struct inpcb tp_inpcb;
+u_int tp_start_win;
+struct tp_stat tp_stat;
+#ifndef TP_PERF_MEAS
+int PStat_Junk;
+#endif
+#ifdef TPPT
+int tp_Tracen = 0;
+#endif
+
+
int tp_emit();
static void tp_sbdrop();
@@ -424,6 +438,7 @@ tp_sbdrop(tpcb, seq)
* RETURN VALUE:
* the highest seq # sent successfully.
*/
+int
tp_send(tpcb)
register struct tp_pcb *tpcb;
{
@@ -474,8 +489,10 @@ tp_send(tpcb)
ENDTRACE
- if ( SEQ_GT(tpcb, lowseq, highseq) )
- return ; /* don't send, don't change hiwat, don't set timers */
+ if( SEQ_GT(tpcb, lowseq, highseq) ) {
+ /* don't send, don't change hiwat, don't set timers */
+ return 0;
+ }
ASSERT( SEQ_LEQ(tpcb, lowseq, highseq) );
SEQ_DEC(tpcb, lowseq);
@@ -639,6 +656,8 @@ done:
tpcb->tp_sndhiwat, lowseq, eotsdu_reached, tpcb->tp_sock->so_error);
ENDTRACE
+ ;
+ return 0;
}
/*
diff --git a/sys/netiso/tp_subr2.c b/sys/netiso/tp_subr2.c
index 08fc744ddfe0..fdcdae8cdc1c 100644
--- a/sys/netiso/tp_subr2.c
+++ b/sys/netiso/tp_subr2.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_subr2.c 7.10 (Berkeley) 6/27/91
- * $Id: tp_subr2.c,v 1.3 1993/10/16 21:06:04 rgrimes Exp $
+ * $Id: tp_subr2.c,v 1.5 1993/12/19 00:53:44 wollman Exp $
*/
/***********************************************************
@@ -187,10 +187,10 @@ tp_protocol_error(e,tpcb)
/* Not used at the moment */
-ProtoHook
-tp_drain()
+void
+tp_drain(void)
{
- return 0;
+ return;
}
@@ -391,6 +391,7 @@ tp_quench( tpcb, cmd )
*
* NOTES:
*/
+void
tp_netcmd( tpcb, cmd )
struct tp_pcb *tpcb;
int cmd;
@@ -417,7 +418,7 @@ tp_netcmd( tpcb, cmd )
printf("tp_netcmd(0x%x, 0x%x) NOT IMPLEMENTED\n", tpcb, cmd);
break;
}
-#else TPCONS
+#else /* TPCONS */
printf("tp_netcmd(): X25 NOT CONFIGURED!!\n");
#endif
}
@@ -452,7 +453,7 @@ tp_mask_to_num(x)
return j;
}
-static
+static void
copyQOSparms(src, dst)
struct tp_conn_param *src, *dst;
{
@@ -635,8 +636,8 @@ done:
return error;
}
-#ifndef TPCONS
-static
+#ifndef CCITT
+static void
pk_flowcontrol() {}
#endif
@@ -747,6 +748,7 @@ tp_setup_perf(tpcb)
#endif TP_PERF_MEAS
#ifdef ARGO_DEBUG
+void
dump_addr (addr)
register struct sockaddr *addr;
{
@@ -758,7 +760,7 @@ dump_addr (addr)
case AF_ISO:
dump_isoaddr((struct sockaddr_iso *)addr);
break;
-#endif ISO
+#endif /* ISO */
default:
printf("BAD AF: 0x%x\n", addr->sa_family);
break;
@@ -773,9 +775,10 @@ dump_addr (addr)
* columns of hex/dec numbers will be printed, followed by the
* character representations (if printable).
*/
+void
Dump_buf(buf, len)
-caddr_t buf;
-int len;
+ char *buf;
+ int len;
{
int i,j;
#define Buf ((u_char *)buf)
@@ -803,5 +806,5 @@ int len;
}
-#endif ARGO_DEBUG
+#endif /* ARGO_DEBUG */
diff --git a/sys/netiso/tp_timer.c b/sys/netiso/tp_timer.c
index 80cbcb78d710..fbb84a0099fd 100644
--- a/sys/netiso/tp_timer.c
+++ b/sys/netiso/tp_timer.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_timer.c 7.5 (Berkeley) 5/6/91
- * $Id: tp_timer.c,v 1.3 1993/10/16 21:06:06 rgrimes Exp $
+ * $Id: tp_timer.c,v 1.4 1993/12/19 00:53:45 wollman Exp $
*/
/***********************************************************
@@ -102,6 +102,7 @@ struct Ecallout *TP_callout;
struct tp_ref *tp_ref;
int N_TPREF = 100;
+int tp_driver(); /* XXX */
extern int tp_maxrefopen; /* highest ref # of an open tp connection */
/*
diff --git a/sys/netiso/tp_timer.h b/sys/netiso/tp_timer.h
index 72318014b334..a60e0c42d94c 100644
--- a/sys/netiso/tp_timer.h
+++ b/sys/netiso/tp_timer.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_timer.h 7.4 (Berkeley) 5/6/91
- * $Id: tp_timer.h,v 1.2 1993/10/16 21:06:08 rgrimes Exp $
+ * $Id: tp_timer.h,v 1.3 1993/11/07 17:50:03 wollman Exp $
*/
/***********************************************************
@@ -88,4 +88,4 @@ struct Ecallout {
struct Ecallout *c_next;
};
-#endif __TP_CALLOUT__
+#endif /* __TP_CALLOUT__ */
diff --git a/sys/netiso/tp_tpdu.h b/sys/netiso/tp_tpdu.h
index 463c4e2d0ba5..b3eb3eedaf20 100644
--- a/sys/netiso/tp_tpdu.h
+++ b/sys/netiso/tp_tpdu.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_tpdu.h 7.4 (Berkeley) 5/6/91
- * $Id: tp_tpdu.h,v 1.2 1993/10/16 21:06:09 rgrimes Exp $
+ * $Id: tp_tpdu.h,v 1.3 1993/11/07 17:50:05 wollman Exp $
*/
/***********************************************************
@@ -71,21 +71,7 @@ SOFTWARE.
#ifndef __TP_TPDU__
#define __TP_TPDU__
-#ifndef BYTE_ORDER
-/*
- * Definitions for byte order,
- * according to byte significance from low address to high.
- */
-#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax) */
-#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
-#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */
-
-#ifdef vax
-#define BYTE_ORDER LITTLE_ENDIAN
-#else
-#define BYTE_ORDER BIG_ENDIAN /* mc68000, tahoe, most others */
-#endif
-#endif BYTE_ORDER
+#include <machine/endian.h>
/* This much of a tpdu is the same for all types of tpdus (except
* DT tpdus in class 0; their exceptions are handled by the data
@@ -130,12 +116,12 @@ struct tp0du {
* This is used when the extended format seqence numbers are
* being sent and received.
*/
- /*
- * the seqeot field is an int that overlays the seq
- * and eot fields, this allows the htonl operation
- * to be applied to the entire 32 bit quantity, and
- * simplifies the structure definitions.
- */
+ /*
+ * the seqeot field is an int that overlays the seq
+ * and eot fields, this allows the htonl operation
+ * to be applied to the entire 32 bit quantity, and
+ * simplifies the structure definitions.
+ */
union seq_type {
struct {
#if BYTE_ORDER == BIG_ENDIAN
@@ -160,14 +146,14 @@ union tpdu_fixed_rest {
struct {
u_short _tpdufr_sref, /* source reference */
#if BYTE_ORDER == BIG_ENDIAN
- _tpdufr_class: 4, /* class [ ISO 8073 13.3.3.e ] */
- _tpdufr_opt: 4, /* options [ ISO 8073 13.3.3.e ] */
+ _tpdufr_class: 4, /* class [ ISO 8073 13.3.3.e ] */
+ _tpdufr_opt: 4, /* options [ ISO 8073 13.3.3.e ] */
#endif
#if BYTE_ORDER == LITTLE_ENDIAN
- _tpdufr_opt: 4, /* options [ ISO 8073 13.3.3.e ] */
- _tpdufr_class: 4, /* class [ ISO 8073 13.3.3.e ] */
+ _tpdufr_opt: 4, /* options [ ISO 8073 13.3.3.e ] */
+ _tpdufr_class: 4, /* class [ ISO 8073 13.3.3.e ] */
#endif
- _tpdufr_xx: 8; /* unused */
+ _tpdufr_xx: 8; /* unused */
} CRCC;
#define tpdu_CRli _tpduf._tpduf_li
@@ -215,21 +201,21 @@ union tpdu_fixed_rest {
struct {
#if BYTE_ORDER == BIG_ENDIAN
unsigned char _tpdufr_eot:1, /* end-of-tsdu */
- _tpdufr_seq:7; /* 7 bit sequence number */
+ _tpdufr_seq:7; /* 7 bit sequence number */
#endif
#if BYTE_ORDER == LITTLE_ENDIAN
unsigned char _tpdufr_seq:7, /* 7 bit sequence number */
- _tpdufr_eot:1; /* end-of-tsdu */
+ _tpdufr_eot:1; /* end-of-tsdu */
#endif
}SEQEOT;
struct {
#if BYTE_ORDER == BIG_ENDIAN
unsigned int _tpdufr_Xeot:1, /* end-of-tsdu */
- _tpdufr_Xseq:31; /* 31 bit sequence number */
+ _tpdufr_Xseq:31; /* 31 bit sequence number */
#endif
#if BYTE_ORDER == LITTLE_ENDIAN
unsigned int _tpdufr_Xseq:31, /* 31 bit sequence number */
- _tpdufr_Xeot:1; /* end-of-tsdu */
+ _tpdufr_Xeot:1; /* end-of-tsdu */
#endif
}SEQEOT31;
unsigned int _tpdufr_Xseqeot;
@@ -254,11 +240,11 @@ union tpdu_fixed_rest {
struct {
#if BYTE_ORDER == BIG_ENDIAN
unsigned _tpdufr_yrseq0:1, /* always zero */
- _tpdufr_yrseq:31; /* [ ISO 8073 13.9.3.d ] */
+ _tpdufr_yrseq:31; /* [ ISO 8073 13.9.3.d ] */
#endif
#if BYTE_ORDER == LITTLE_ENDIAN
unsigned _tpdufr_yrseq:31, /* [ ISO 8073 13.9.3.d ] */
- _tpdufr_yrseq0:1; /* always zero */
+ _tpdufr_yrseq0:1; /* always zero */
#endif
unsigned short _tpdufr_cdt; /* [ ISO 8073 13.9.3.b ] */
} AK31;
@@ -292,4 +278,4 @@ struct tpdu {
union tpdu_fixed_rest _tpdufr;
};
-#endif __TP_TPDU__
+#endif /* __TP_TPDU__ */
diff --git a/sys/netiso/tp_trace.h b/sys/netiso/tp_trace.h
index 43d4447172df..dcaef32e4dd4 100644
--- a/sys/netiso/tp_trace.h
+++ b/sys/netiso/tp_trace.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_trace.h 7.5 (Berkeley) 6/27/91
- * $Id: tp_trace.h,v 1.2 1993/10/16 21:06:12 rgrimes Exp $
+ * $Id: tp_trace.h,v 1.4 1993/11/25 01:36:14 wollman Exp $
*/
/***********************************************************
@@ -147,7 +147,7 @@ struct tp_Trace {
#define tpt_window tpt_stuff.tpt_Time.tptv_window
#define tpt_size tpt_stuff.tpt_Time.tptv_size
-#endif defined(TP_TRACEFILE)||!defined(KERNEL)
+#endif /* defined(TP_TRACEFILE)||!defined(KERNEL) */
#ifdef TPPT
@@ -165,7 +165,7 @@ struct tp_Trace {
extern void tpTrace();
extern struct tp_Trace tp_Trace[];
extern u_char tp_traceflags[];
-int tp_Tracen = 0;
+extern int tp_Tracen;
#define IFTRACE(ascii)\
if(tp_traceflags[ascii]) {
@@ -176,21 +176,18 @@ int tp_Tracen = 0;
#define ENDTRACE }
-#else TPPT
+#else /* TPPT */
/***********************************************
* NO TPPT TRACE STUFF
**********************************************/
#define TPTRACEN 1
-#define tptrace(A,B,C,D,E,F) 0
-#define tptraceTPCB(A,B,C,D,E,F) 0
+#define tptrace(A,B,C,D,E,F)
+#define tptraceTPCB(A,B,C,D,E,F)
#define IFTRACE(ascii) if (0) {
#define ENDTRACE }
-#endif TPPT
-
-
-
-#endif __TP_TRACE__
+#endif /* TPPT */
+#endif /* __TP_TRACE__ */
diff --git a/sys/netiso/tp_user.h b/sys/netiso/tp_user.h
index 3f8ca795b487..cfe44ba780e4 100644
--- a/sys/netiso/tp_user.h
+++ b/sys/netiso/tp_user.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_user.h 7.10 (Berkeley) 5/6/91
- * $Id: tp_user.h,v 1.2 1993/10/16 21:06:13 rgrimes Exp $
+ * $Id: tp_user.h,v 1.3 1993/11/07 17:50:07 wollman Exp $
*/
/***********************************************************
@@ -67,17 +67,11 @@ SOFTWARE.
* These are the values a real-live user ;-) needs.
*/
-#ifndef _TYPES_
-#ifdef KERNEL
-#include "../sys/types.h"
-#else KERNEL
-#include <sys/types.h>
-#endif KERNEL
-#endif
-
#ifndef __TP_USER__
#define __TP_USER__
+#include <sys/types.h>
+
struct tp_conn_param {
/* PER CONNECTION parameters */
short p_Nretrans;
@@ -168,4 +162,4 @@ struct tp_disc_reason {
*/
-#endif __TP_USER__
+#endif /* __TP_USER__ */
diff --git a/sys/netiso/tp_usrreq.c b/sys/netiso/tp_usrreq.c
index df87899e27aa..7661ef0d1d08 100644
--- a/sys/netiso/tp_usrreq.c
+++ b/sys/netiso/tp_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)tp_usrreq.c 7.17 (Berkeley) 6/27/91
- * $Id: tp_usrreq.c,v 1.2 1993/10/16 21:06:14 rgrimes Exp $
+ * $Id: tp_usrreq.c,v 1.4 1993/12/19 00:53:46 wollman Exp $
*/
/***********************************************************
@@ -93,6 +93,8 @@ SOFTWARE.
#include "iso.h"
#include "iso_errno.h"
+int tp_confirm(struct tp_pcb *);
+
int tp_attach(), tp_driver();
int TNew;
int TPNagle1, TPNagle2;
@@ -167,6 +169,7 @@ dump_mbuf(n, str)
* xpd data in the buffer
* E* whatever is returned from the fsm.
*/
+int
tp_rcvoob(tpcb, so, m, outflags, inflags)
struct tp_pcb *tpcb;
register struct socket *so;
@@ -273,6 +276,7 @@ release:
* EMSGSIZE if trying to send > max-xpd bytes (16)
* ENOBUFS if ran out of mbufs
*/
+int
tp_sendoob(tpcb, so, xdata, outflags)
struct tp_pcb *tpcb;
register struct socket *so;
@@ -788,6 +792,8 @@ tp_usrreq(so, req, m, nam, controlp)
splx(s);
return error;
}
+
+void
tp_ltrace(so, uio)
struct socket *so;
struct uio *uio;
@@ -801,8 +807,9 @@ struct uio *uio;
ENDTRACE
}
+int
tp_confirm(tpcb)
-register struct tp_pcb *tpcb;
+ register struct tp_pcb *tpcb;
{
struct tp_event E;
if (tpcb->tp_state == TP_CONFIRMING)
@@ -815,6 +822,7 @@ register struct tp_pcb *tpcb;
/*
* Process control data sent with sendmsg()
*/
+int
tp_snd_control(m, so, data)
struct mbuf *m;
struct socket *so;