Colored debugging, some code cleaning.
FossilOrigin-Name: 23a60b9297d5719fa502b2163680fa1af8bc0201cb777771dc30de045f84b341
This commit is contained in:
		@ -7,7 +7,6 @@
 | 
			
		||||
#include "capwap/sock.h"
 | 
			
		||||
 | 
			
		||||
#include "socklist.h"
 | 
			
		||||
#include "capwap/acinfo.h"
 | 
			
		||||
#include "conf.h"
 | 
			
		||||
 | 
			
		||||
#include "capwap/capwap.h"
 | 
			
		||||
@ -25,6 +24,7 @@ struct radioinfo * get_radioinfo()
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
struct ac_info * get_acinfo()
 | 
			
		||||
{
 | 
			
		||||
	
 | 
			
		||||
@ -40,7 +40,7 @@ struct ac_info * get_acinfo()
 | 
			
		||||
	acinfo->limit=10000;
 | 
			
		||||
	acinfo->active_wtps=10;
 | 
			
		||||
	acinfo->max_wtps=conf_max_wtps;
 | 
			
		||||
	acinfo->rmac=1; 	/* radio mac supported */
 | 
			
		||||
	acinfo->rmac=1; 	
 | 
			
		||||
 | 
			
		||||
	acinfo->vendor_id=conf_vendor_id;
 | 
			
		||||
 | 
			
		||||
@ -68,9 +68,11 @@ struct ac_info * get_acinfo()
 | 
			
		||||
 | 
			
		||||
	//acinfo->aciplist=get_aciplist();
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
	aciplist_foreach(acinfo->aciplist,pr,NULL);
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	int i;
 | 
			
		||||
	for (i=1; i<=4; i++){
 | 
			
		||||
		acinfo->radioinfos[i].type= 
 | 
			
		||||
@ -87,7 +89,7 @@ struct ac_info * get_acinfo()
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
get_join_result()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -106,6 +106,8 @@ int readelem_cisco_rad_name(struct conn *conn,struct cw_action * a,uint8_t *data
 | 
			
		||||
 | 
			
		||||
int main (int argc, const char * argv[]) 
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	intavltree_t t = intavltree_create();
 | 
			
		||||
	int i;
 | 
			
		||||
@ -171,6 +173,7 @@ int main (int argc, const char * argv[])
 | 
			
		||||
		goto errX;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
printf("Debug oprtions: %08X\n",cw_dbg_opt_level);
 | 
			
		||||
	rc = ac_run();
 | 
			
		||||
errX:
 | 
			
		||||
	wtplist_destroy();
 | 
			
		||||
@ -328,6 +331,7 @@ void process_cw_ctrl_packet(int index,struct sockaddr * addr, uint8_t * buffer,
 | 
			
		||||
 | 
			
		||||
		wtpman = wtpman_create(index,addr);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		if (!wtpman ){
 | 
			
		||||
			cw_log(LOG_ERR,"Error creating wtpman: %s",strerror(errno));
 | 
			
		||||
			wtplist_unlock();
 | 
			
		||||
 | 
			
		||||
@ -557,7 +557,9 @@ static int conf_read_dbg_level(cfg_t *cfg)
 | 
			
		||||
	for (i=0; i<n; i++) {
 | 
			
		||||
		char * str = cfg_getnstr(cfg,name,i);
 | 
			
		||||
//int u = cw_log_str2dbglevel(str);
 | 
			
		||||
		cw_dbg_opt_level|= cw_strlist_get_id(cw_dbg_strings,str); //cw_log_str2dbglevel(str);
 | 
			
		||||
		int b = cw_strlist_get_id(cw_dbg_strings,str); //cw_log_str2dbglevel(str);
 | 
			
		||||
 | 
			
		||||
		cw_dbg_set_level(b,1);
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
	return 1;
 | 
			
		||||
 | 
			
		||||
@ -51,6 +51,7 @@ void conn_handle_change_state_event_request(struct conn *conn)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
struct rh_param {
 | 
			
		||||
	struct conn *conn;
 | 
			
		||||
	int *msglist;
 | 
			
		||||
@ -72,14 +73,15 @@ static int conn_rh(void *param)
 | 
			
		||||
			return 0;
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
	/* unexpected response here */
 | 
			
		||||
	cw_log(LOG_ERR, "Unexpected message from %s", sock_addr2str(&p->conn->addr));
 | 
			
		||||
	cwsend_unknown_response(p->conn, p->conn->cwrmsg.seqnum, p->conn->cwrmsg.type);
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
struct ac_info *get_acinfo();
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
static void wtpman_remove(struct wtpman *wtpman)
 | 
			
		||||
{
 | 
			
		||||
@ -120,7 +122,8 @@ static void wtpman_run_discovery(void *arg)
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	wtpman->conn->outgoing = ac_config;
 | 
			
		||||
	wtpman->conn->local = ac_config;
 | 
			
		||||
	wtpman->conn->outgoing = cw_itemstore_create();
 | 
			
		||||
	wtpman->conn->incomming = cw_itemstore_create();
 | 
			
		||||
 | 
			
		||||
	while (!cw_timer_timeout(timer)
 | 
			
		||||
@ -131,7 +134,7 @@ static void wtpman_run_discovery(void *arg)
 | 
			
		||||
	struct cw_item *wn = cw_itemstore_get(wtpman->conn->incomming, CW_ITEM_WTP_NAME);
 | 
			
		||||
 | 
			
		||||
	if (wn) {
 | 
			
		||||
		printf("WTP Name: %s\n", wn->data);
 | 
			
		||||
		//printf("WTP Name: %s\n", wn->data);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	wtpman_remove(wtpman);
 | 
			
		||||
@ -284,9 +287,10 @@ static int wtpman_join(void *arg, time_t timer)
 | 
			
		||||
 | 
			
		||||
//      wtpman->conn->itemstore = cw_itemstore_create();
 | 
			
		||||
 | 
			
		||||
	wtpman->conn->outgoing = ac_config;
 | 
			
		||||
	wtpman->conn->outgoing = cw_itemstore_create();
 | 
			
		||||
	wtpman->conn->incomming = cw_itemstore_create();
 | 
			
		||||
	wtpman->conn->local = cw_itemstore_create();
 | 
			
		||||
	wtpman->conn->local = ac_config;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	struct conn * conn = wtpman->conn;
 | 
			
		||||
 | 
			
		||||
@ -439,7 +443,7 @@ static void wtpman_run(void *arg)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		if (rc) {
 | 
			
		||||
			cw_log(LOG_ERR,"Image download RC: %s",cw_strrc(rc));
 | 
			
		||||
			cw_log(LOG_ERR,"Error sending image to %s: %s",sock_addr2str(&conn->addr),cw_strrc(rc));
 | 
			
		||||
		}
 | 
			
		||||
		else {
 | 
			
		||||
			cw_dbg(DBG_INFO,"Image '%s' sucessful sent to %s in %0.1f seconds.",
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user