#include "shared.h"
#include "funcdef.h"

extern struct real_data shared;

/*
 *	mbinit()
 */
void
mbinit()
{
	int	i;
	struct mbuf *mp;
	struct ebuf *ep;

	shared.mbfree = 0;
	shared.mbprocess = 0;
	shared.mbnext = &shared.mbprocess;
	mp = shared.mb;
	for (i = 0; i < NMBUFS; i++) {
		mp->next = shared.mbfree;
		shared.mbfree = mp++;
	}
	ep = shared.eb;
	ep->start_addr = shared.etherbuff;
	ep->count = RAWETHER;
	for (i = 0; i < NEBUFS; i++) {
		ep++;
		ep->start_addr = 0;
		ep->count = 0;
	}
}
