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