1*3e639e67Swnj /*	tp_output.c	1.3	82/10/09	*/
2077752a8Ssam 
3077752a8Ssam #include "../h/param.h"
4077752a8Ssam #include "../h/systm.h"
5077752a8Ssam #include "../h/mbuf.h"
6077752a8Ssam #include "../h/protosw.h"
7077752a8Ssam #include "../h/socket.h"
8077752a8Ssam #include "../net/if.h"
9*3e639e67Swnj #include "../netdecnet/tp.h"
10*3e639e67Swnj #include "../netdecnet/tp_var.h"
11077752a8Ssam 
12077752a8Ssam /*
13077752a8Ssam  * Transport output routine.  Fill in the
14077752a8Ssam  * transport header and pass it off to the
15077752a8Ssam  * interface.
16077752a8Ssam  */
tp_output(m,dstnode)17077752a8Ssam tp_output(m, dstnode)
18077752a8Ssam 	register struct mbuf *m;
19077752a8Ssam 	u_short dstnode;
20077752a8Ssam {
21077752a8Ssam 	register struct tprh *t;
22077752a8Ssam 
23077752a8Ssam 	if (tpstate != TPS_RUN)
24077752a8Ssam 		return (1);
25077752a8Ssam 	if (dstnode > tprp.tprp_nn)		/* node number out of range? */
26077752a8Ssam 		return (1);
27077752a8Ssam 	m->m_off -= sizeof (struct tprh);
28077752a8Ssam 	m->m_len += sizeof (struct tprh);
29077752a8Ssam 	t = mtod(m, struct tprh *);
30077752a8Ssam 	t->tprh_rtflg = TP_RH;
31077752a8Ssam 	AD_SHORT(t->tprh_srcnode, tp_host);
32077752a8Ssam 	AD_SHORT(t->tprh_dstnode, dstnode);
33077752a8Ssam 	t->tprh_forward = 0;
34077752a8Ssam 	return ((*tpifp->if_output)(tpifp, m, PF_DECNET));
35077752a8Ssam }
36