int udp_output2(struct socket *so, struct mbuf *m,

                struct sockaddr_in *saddr, struct sockaddr_in *daddr,

                int iptos)

{

	register struct udpiphdr *ui;

	int error = 0;



	DEBUG_CALL("udp_output");

	DEBUG_ARG("so = %p", so);

	DEBUG_ARG("m = %p", m);

	DEBUG_ARG("saddr = %lx", (long)saddr->sin_addr.s_addr);

	DEBUG_ARG("daddr = %lx", (long)daddr->sin_addr.s_addr);



	/*

	 * Adjust for header

	 */

	m->m_data -= sizeof(struct udpiphdr);

	m->m_len += sizeof(struct udpiphdr);



	/*

	 * Fill in mbuf with extended UDP header

	 * and addresses and length put into network format.

	 */

	ui = mtod(m, struct udpiphdr *);

    memset(&ui->ui_i.ih_mbuf, 0 , sizeof(struct mbuf_ptr));

	ui->ui_x1 = 0;

	ui->ui_pr = IPPROTO_UDP;

	ui->ui_len = htons(m->m_len - sizeof(struct ip));

	/* XXXXX Check for from-one-location sockets, or from-any-location sockets */

        ui->ui_src = saddr->sin_addr;

	ui->ui_dst = daddr->sin_addr;

	ui->ui_sport = saddr->sin_port;

	ui->ui_dport = daddr->sin_port;

	ui->ui_ulen = ui->ui_len;



	/*

	 * Stuff checksum and output datagram.

	 */

	ui->ui_sum = 0;

	if ((ui->ui_sum = cksum(m, m->m_len)) == 0)

		ui->ui_sum = 0xffff;

	((struct ip *)ui)->ip_len = m->m_len;



	((struct ip *)ui)->ip_ttl = IPDEFTTL;

	((struct ip *)ui)->ip_tos = iptos;



	error = ip_output(so, m);



	return (error);

}

int udp_output2(struct socket *so, struct mbuf *m,

                struct sockaddr_in *saddr, struct sockaddr_in *daddr,

                int iptos)

{

	register struct udpiphdr *ui;

	int error = 0;



	DEBUG_CALL("udp_output");

	DEBUG_ARG("so = %p", so);

	DEBUG_ARG("m = %p", m);

	DEBUG_ARG("saddr = %lx", (long)saddr->sin_addr.s_addr);

	DEBUG_ARG("daddr = %lx", (long)daddr->sin_addr.s_addr);



	





	m->m_data -= sizeof(struct udpiphdr);

	m->m_len += sizeof(struct udpiphdr);



	







	ui = mtod(m, struct udpiphdr *);

    memset(&ui->ui_i.ih_mbuf, 0 , sizeof(struct mbuf_ptr));

	ui->ui_x1 = 0;

	ui->ui_pr = IPPROTO_UDP;

	ui->ui_len = htons(m->m_len - sizeof(struct ip));

	

        ui->ui_src = saddr->sin_addr;

	ui->ui_dst = daddr->sin_addr;

	ui->ui_sport = saddr->sin_port;

	ui->ui_dport = daddr->sin_port;

	ui->ui_ulen = ui->ui_len;



	





	ui->ui_sum = 0;

	if ((ui->ui_sum = cksum(m, m->m_len)) == 0)

		ui->ui_sum = 0xffff;

	((struct ip *)ui)->ip_len = m->m_len;



	((struct ip *)ui)->ip_ttl = IPDEFTTL;

	((struct ip *)ui)->ip_tos = iptos;



	error = ip_output(so, m);



	return (error);

}

int FUNC_0(struct socket *VAR_0, struct mbuf *VAR_1,

                struct sockaddr_in *VAR_2, struct sockaddr_in *VAR_3,

                int VAR_4)

{

	register struct udpiphdr *VAR_5;

	int VAR_6 = 0;



	DEBUG_CALL("udp_output");

	DEBUG_ARG("VAR_0 = %p", VAR_0);

	DEBUG_ARG("VAR_1 = %p", VAR_1);

	DEBUG_ARG("VAR_2 = %lx", (long)VAR_2->sin_addr.s_addr);

	DEBUG_ARG("VAR_3 = %lx", (long)VAR_3->sin_addr.s_addr);



	





	VAR_1->m_data -= sizeof(struct udpiphdr);

	VAR_1->m_len += sizeof(struct udpiphdr);



	







	VAR_5 = mtod(VAR_1, struct udpiphdr *);

    memset(&VAR_5->ui_i.ih_mbuf, 0 , sizeof(struct mbuf_ptr));

	VAR_5->ui_x1 = 0;

	VAR_5->ui_pr = IPPROTO_UDP;

	VAR_5->ui_len = htons(VAR_1->m_len - sizeof(struct ip));

	

        VAR_5->ui_src = VAR_2->sin_addr;

	VAR_5->ui_dst = VAR_3->sin_addr;

	VAR_5->ui_sport = VAR_2->sin_port;

	VAR_5->ui_dport = VAR_3->sin_port;

	VAR_5->ui_ulen = VAR_5->ui_len;



	





	VAR_5->ui_sum = 0;

	if ((VAR_5->ui_sum = cksum(VAR_1, VAR_1->m_len)) == 0)

		VAR_5->ui_sum = 0xffff;

	((struct ip *)VAR_5)->ip_len = VAR_1->m_len;



	((struct ip *)VAR_5)->ip_ttl = IPDEFTTL;

	((struct ip *)VAR_5)->ip_tos = VAR_4;



	VAR_6 = ip_output(VAR_0, VAR_1);



	return (VAR_6);

}

int FUNC_0(struct socket *VAR_0, struct mbuf *VAR_1,
struct sockaddr_in *VAR_2, struct sockaddr_in *VAR_3,
int VAR_4)
{ register struct udpiphdr *VAR_5; int VAR_6 = 0; DEBUG_CALL("udp_output"); DEBUG_ARG("VAR_0 = %p", VAR_0); DEBUG_ARG("VAR_1 = %p", VAR_1); DEBUG_ARG("VAR_2 = %lx", (long)VAR_2->sin_addr.s_addr); DEBUG_ARG("VAR_3 = %lx", (long)VAR_3->sin_addr.s_addr); VAR_1->m_data -= sizeof(struct udpiphdr); VAR_1->m_len += sizeof(struct udpiphdr); VAR_5 = mtod(VAR_1, struct udpiphdr *); memset(&VAR_5->ui_i.ih_mbuf, 0 , sizeof(struct mbuf_ptr)); VAR_5->ui_x1 = 0; VAR_5->ui_pr = IPPROTO_UDP; VAR_5->ui_len = htons(VAR_1->m_len - sizeof(struct ip)); VAR_5->ui_src = VAR_2->sin_addr; VAR_5->ui_dst = VAR_3->sin_addr; VAR_5->ui_sport = VAR_2->sin_port; VAR_5->ui_dport = VAR_3->sin_port; VAR_5->ui_ulen = VAR_5->ui_len; VAR_5->ui_sum = 0; if ((VAR_5->ui_sum = cksum(VAR_1, VAR_1->m_len)) == 0)
VAR_5->ui_sum = 0xffff; ((struct ip *)VAR_5)->ip_len = VAR_1->m_len; ((struct ip *)VAR_5)->ip_ttl = IPDEFTTL; ((struct ip *)VAR_5)->ip_tos = VAR_4; VAR_6 = ip_output(VAR_0, VAR_1); return (VAR_6); }