/*	Debug module strucutre head file	*/
/*	Written by Liu Wei 2005-05-10	*/
/*	Version 4.0				*/
/*	--------------------------------	*/

#ifndef _DEBUG
#define	_DEBUG
  
#include "debug_struct.h" 
#include "dirent.h"

extern mib_node   *mib_root_node;
extern mib_node			   *mib_curr_node;
extern menu_node   		   *menu_root_node; 
extern menu_node   		   *menu_curr_node;
extern mib_node		     	mib_nodes[MIB_MAX_NODES];

/*for test
  char file_name[128];
  FILE *fp_prt;
  long int timeuse,max_time;
  struct timeval tv_start, tv_end;*/
//for test

extern menu_node               menu_nodes[MENU_MAX_NODES];
extern mib_child_node		    mib_child_nodes[MIB_MAX_CHILD_NODES];

extern debug_snmp_agent        debug_snmp_agent_buf[MAX_PACKET_NUM];



//////////////////////////////interface declaration////////////////////////

void debug_init();

void debug_rt();


WORD find_child_index(mib_node *node_ptr, DWORD oid, char *name, BYTE type);

mib_node *find_node(mib_node *start_node_ptr, char *node_name, int find_type, DWORD *last_node_oid);

mib_node *search_mib_node(mib_node *start_mib_node_ptr, DWORD *oid, BYTE oid_len);

int	 debug_set_response(unsigned char object_id_len,unsigned int *object_id,unsigned char *data,unsigned short data_len);

int	 debug_get_response(unsigned char object_id_len,unsigned int *object_id,unsigned char *data,unsigned char *vartype);

menu_node *search_menu_node(menu_node *start_menu_node_ptr, BYTE *menu_id, BYTE id_len);

void Clear_Access_History();

void debug_set_agent();

void debug_get_agent();  

int get_my_address (struct in_addr *addr);

//////////////////////////////end of interface declaration////////////////////////
#endif
