#include "../util/myprintf.h"
#include "../evb/channel.h"


CHANNELHANDLER ChannelHandler[MAX_SOCK_NUM];

u_char sock_flag = 0x00;

u_char bchannel_start[MAX_SOCK_NUM] = { 0, 0, 0, 0};

void init_channel_handler(void)
{
	u_int i;
	for(i = 0; i < MAX_SOCK_NUM; i++)
	{
		ChannelHandler[i].Handler = 0;
		bchannel_start[i] = 0;
	}
}

void register_channel_handler(u_char ch, void (*handler))
{
	ChannelHandler[ch].Handler = handler;
	DPRINTLN1("Register %d channel handler",ch);
}

void unregister_channel_handler(u_char ch)
{
	ChannelHandler[ch].Handler = 0;
	bchannel_start[ch] = 0;
	DPRINTLN1("Unregister %d channel handler",ch);
}

