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