m_get(Slirp *slirp)

{

	register struct mbuf *m;

	int flags = 0;



	DEBUG_CALL("m_get");



	if (slirp->m_freelist.m_next == &slirp->m_freelist) {

		m = (struct mbuf *)malloc(SLIRP_MSIZE);

		if (m == NULL) goto end_error;

		slirp->mbuf_alloced++;

		if (slirp->mbuf_alloced > MBUF_THRESH)

			flags = M_DOFREE;

		m->slirp = slirp;

	} else {

		m = slirp->m_freelist.m_next;

		remque(m);

	}



	/* Insert it in the used list */

	insque(m,&slirp->m_usedlist);

	m->m_flags = (flags | M_USEDLIST);



	/* Initialise it */

	m->m_size = SLIRP_MSIZE - sizeof(struct m_hdr);

	m->m_data = m->m_dat;

	m->m_len = 0;

        m->m_nextpkt = NULL;

        m->m_prevpkt = NULL;

end_error:

	DEBUG_ARG("m = %lx", (long )m);

	return m;

}

m_get(Slirp *slirp)

{

	register struct mbuf *m;

	int flags = 0;



	DEBUG_CALL("m_get");



	if (slirp->m_freelist.m_next == &slirp->m_freelist) {

		m = (struct mbuf *)malloc(SLIRP_MSIZE);

		if (m == NULL) goto end_error;

		slirp->mbuf_alloced++;

		if (slirp->mbuf_alloced > MBUF_THRESH)

			flags = M_DOFREE;

		m->slirp = slirp;

	} else {

		m = slirp->m_freelist.m_next;

		remque(m);

	}



	

	insque(m,&slirp->m_usedlist);

	m->m_flags = (flags | M_USEDLIST);



	

	m->m_size = SLIRP_MSIZE - sizeof(struct m_hdr);

	m->m_data = m->m_dat;

	m->m_len = 0;

        m->m_nextpkt = NULL;

        m->m_prevpkt = NULL;

end_error:

	DEBUG_ARG("m = %lx", (long )m);

	return m;

}

	m->m_size = SLIRP_MSIZE - sizeof(struct m_hdr);
FUNC_0(Slirp *VAR_0)

{

	register struct mbuf *VAR_1;

	int VAR_2 = 0;



	DEBUG_CALL("FUNC_0");



	if (VAR_0->m_freelist.m_next == &VAR_0->m_freelist) {

		VAR_1 = (struct mbuf *)malloc(SLIRP_MSIZE);

		if (VAR_1 == NULL) goto end_error;

		VAR_0->mbuf_alloced++;

		if (VAR_0->mbuf_alloced > MBUF_THRESH)

			VAR_2 = M_DOFREE;

		VAR_1->VAR_0 = VAR_0;

	} else {

		VAR_1 = VAR_0->m_freelist.m_next;

		remque(VAR_1);

	}



	

	insque(VAR_1,&VAR_0->m_usedlist);

	VAR_1->m_flags = (VAR_2 | M_USEDLIST);



	

	VAR_1->m_size = SLIRP_MSIZE - sizeof(struct m_hdr);

	VAR_1->m_data = VAR_1->m_dat;

	VAR_1->m_len = 0;

        VAR_1->m_nextpkt = NULL;

        VAR_1->m_prevpkt = NULL;

end_error:

	DEBUG_ARG("VAR_1 = %lx", (long )VAR_1);

	return VAR_1;

}

FUNC_0(Slirp *VAR_0)
{ register struct mbuf *VAR_1; int VAR_2 = 0; DEBUG_CALL("FUNC_0"); if (VAR_0->m_freelist.m_next == &VAR_0->m_freelist) { VAR_1 = (struct mbuf *)malloc(SLIRP_MSIZE); if (VAR_1 == NULL) goto end_error; VAR_0->mbuf_alloced++; if (VAR_0->mbuf_alloced > MBUF_THRESH)
VAR_2 = M_DOFREE; VAR_1->VAR_0 = VAR_0; } else { VAR_1 = VAR_0->m_freelist.m_next; remque(VAR_1); } insque(VAR_1,&VAR_0->m_usedlist); VAR_1->m_flags = (VAR_2 | M_USEDLIST); VAR_1->m_size = SLIRP_MSIZE - sizeof(struct m_hdr); VAR_1->m_data = VAR_1->m_dat; VAR_1->m_len = 0; VAR_1->m_nextpkt = NULL; VAR_1->m_prevpkt = NULL; end_error:
DEBUG_ARG("VAR_1 = %lx", (long )VAR_1); return VAR_1; }