#include "includes.h"
#include "device.h"
#include "gateway.h"
#include "net_proc.h"

typedef struct _gb_gateway_info {
	gb_gateway_bind_info_t bind;
	u16 gw_echo_fail_count;
	u16 node_echo_fail_count[GB_SUPPORT_MAX_NODE];
} gb_gateway_info_t;

gb_gateway_info_t gw_mgr;

int gateway_gw_id_flush(u32 gw_device_id)
{
	int ret = 0;
	gw_mgr.bind.gw_device_id = gw_device_id;
	gw_mgr.gw_echo_fail_count = 0;
	
	return ret;
}
	
int gateway_id_cmp(u32 gw_device_id)
{
	int ret = 0;
	
	if(gw_mgr.bind.gw_device_id == gw_device_id) {
		ret = 1;
	}

	return ret;
}

int gateway_gw_id_get(u32 *gw_device_id)
{
	int ret = 0;

	if(gw_device_id) {
		*gw_device_id = gw_mgr.bind.gw_device_id;
	}
	
	if(gw_mgr.bind.gw_device_id) {
		ret = 1;
	}
	
	return ret;
}

