Inserted a lot of debug printfs, fixed some bugs
This commit is contained in:
		@ -97,21 +97,24 @@ static void do_update(struct conn * conn)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	if (!update)
 | 
			
		||||
		return;
 | 
			
		||||
	update=0;
 | 
			
		||||
//	if (!update)
 | 
			
		||||
//		return;
 | 
			
		||||
//	update=0;
 | 
			
		||||
 | 
			
		||||
/*	mbag_t result = mbag_create();
 | 
			
		||||
	update_radios(conn,result);
 | 
			
		||||
*/	cw_dbg(DBG_INFO, "Saving configuration ...");
 | 
			
		||||
/*	cfg_to_json();*/
 | 
			
		||||
	/* Change State ... */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*	
 | 
			
		||||
	rc = cw_send_request(conn,CAPWAP_MSG_CHANGE_STATE_EVENT_REQUEST);
 | 
			
		||||
	if ( !cw_result_is_ok(rc) ) {
 | 
			
		||||
		cw_strresult(rc);
 | 
			
		||||
		return ;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -162,24 +165,26 @@ int run(struct conn * conn)
 | 
			
		||||
			if (rc < 0 && errno == EAGAIN) {
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
printf("--------------------------------------------------------------------------------------\n");
 | 
			
		||||
			
 | 
			
		||||
			if ( !cw_result_is_ok(rc))
 | 
			
		||||
			if ( !cw_result_is_ok(rc)) {
 | 
			
		||||
printf("---------------------- cwrsult is not ok\n");				
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
printf("lalalala\n");			
 | 
			
		||||
cw_dbg_ktv_dump(conn->remote_cfg,DBG_INFO,"KTV DUMP ----------------","Remote:", "DUMP done -------");
 | 
			
		||||
 | 
			
		||||
			printf("Saving Config\n");
 | 
			
		||||
			mavl_merge(conn->local_cfg,conn->remote_cfg);
 | 
			
		||||
			cw_ktv_save(conn->local_cfg,"cisco.ktv");
 | 
			
		||||
			clean_cfg(conn->remote_cfg);
 | 
			
		||||
			
 | 
			
		||||
 | 
			
		||||
			/*cw_dbg(DBG_X,"We hav a message processed");*/
 | 
			
		||||
			cw_dbg(DBG_X,"We hav a message processed");
 | 
			
		||||
			update=1;
 | 
			
		||||
			do_update(conn);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (rc<0 && errno == EAGAIN){
 | 
			
		||||
			rc = cw_send_request(conn,CAPWAP_MSG_ECHO_REQUEST);
 | 
			
		||||
		
 | 
			
		||||
@ -194,9 +199,6 @@ int run(struct conn * conn)
 | 
			
		||||
			cw_log(LOG_ERR,"Error in run state: %d %s",rc,cw_strrc(rc));
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	} while (conn->capwap_state == CAPWAP_STATE_RUN);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user