1*6833Ssam 
2*6833Ssam #include "../h/param.h"
3*6833Ssam #include "../h/systm.h"
4*6833Ssam #include "../h/clock.h"
5*6833Ssam #include "../h/mbuf.h"
6*6833Ssam #include "../h/protosw.h"
7*6833Ssam #include "../h/socket.h"
8*6833Ssam #include "../net/in.h"
9*6833Ssam #include "../net/in_systm.h"
10*6833Ssam #include "../net/if.h"
11*6833Ssam #include "../net/tp.h"
12*6833Ssam #include "../net/tp_var.h"
13*6833Ssam 
14*6833Ssam 
15*6833Ssam /*
16*6833Ssam  * Transport output routine.  Fill in the
17*6833Ssam  * transport header and pass it off to the
18*6833Ssam  * interface.
19*6833Ssam  */
20*6833Ssam tp_output(m, dstnode)
21*6833Ssam 	register struct mbuf *m;
22*6833Ssam 	u_short dstnode;
23*6833Ssam {
24*6833Ssam 	register struct tprh *t;
25*6833Ssam 
26*6833Ssam 	if (tpstate != TPS_RUN)
27*6833Ssam 		return (1);
28*6833Ssam 	if (dstnode > tprp.tprp_nn)		/* node number out of range? */
29*6833Ssam 		return (1);
30*6833Ssam 	m->m_off -= sizeof (struct tprh);
31*6833Ssam 	m->m_len += sizeof (struct tprh);
32*6833Ssam 	t = mtod(m, struct tprh *);
33*6833Ssam 	t->tprh_rtflg = TP_RH;
34*6833Ssam 	AD_SHORT(t->tprh_srcnode, tp_host);
35*6833Ssam 	AD_SHORT(t->tprh_dstnode, dstnode);
36*6833Ssam 	t->tprh_forward = 0;
37*6833Ssam 	return ((*tpifp->if_output)(tpifp, m, PF_DECNET));
38*6833Ssam }
39