-
- return(ip_send(p)); /* pass datagram to local net level */
-}
-
-ip_send(p) /* format header and send message to 1822 level */
-struct ip *p;
-{
- register struct mbuf *m;
- register struct imp *l;
- int s;
-COUNT(IP_SEND);
-
- m = dtom(p); /* ->header mbuf */
-
- /* set up 1822 leader fields for transmit */
-
- l = (struct imp *)((int)m + m->m_off - L1822);
-/*
- l->i_hst = p->ip_dst.s_host;
- l->i_impno = p->ip_dst.s_imp;
- l->i_mlen = p->ip_len + L1822;
- l->i_link = IPLINK;
- l->i_type = 0;
- l->i_htype = 0;
- l->i_stype = 0;
-*/
- if ((l->i_shost = p->ip_src.s_host) == 0)
- l->i_shost = 253;
- if ((l->i_dhost = p->ip_dst.s_host) == 0)
- l->i_dhost = 253;
- l->i_type = IPTYPE;
-
- /* finish ip leader by calculating checksum and doing
- necessary byte-swapping */
-
- p->ip_sum = 0;
- ip_bswap(p);
- p->ip_sum = cksum(m, sizeof(struct ip));
-
- m->m_off -= L1822; /* -> 1822 leader */
- m->m_len += L1822;
-
- m->m_act = NULL;
-
-#ifndef IMPLOOP
-
- /* put output message on queue */
-
- s = spl_imp();
- if (imp_stat.outq_head != NULL)
- imp_stat.outq_tail->m_act = m;
- else
- imp_stat.outq_head = m;
- imp_stat.outq_tail = m;
- splx(s);
-
- /* if no outstanding output, start some */
-
- if (!imp_stat.outactive)
- imp_output(0);
-
-#else
- /* software looping: put msg chain on input queue */
-
- if (imp_stat.inq_head != NULL)
- imp_stat.inq_tail->m_act = m;
- else
- imp_stat.inq_head = m;
- imp_stat.inq_tail = m;
-
-#endif IMPLOOP