More work on CAPWAP VM
FossilOrigin-Name: 9d9a86d2bafe31253a6f505e874f188792539485bb4462f4d778e6c53ac3000b
This commit is contained in:
		@ -98,7 +98,13 @@ int readelem_cisco_rad_name(struct conn *conn,struct cw_action * a,uint8_t *data
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
int avlprint(void *priv, void *data)
 | 
			
		||||
{
 | 
			
		||||
	struct cw_str * d = (struct cw_str*) data;
 | 
			
		||||
	printf("String: %d - %s\n",d->id,d->str);
 | 
			
		||||
}
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
int main (int argc, const char * argv[]) 
 | 
			
		||||
{
 | 
			
		||||
@ -117,7 +123,19 @@ int main (int argc, const char * argv[])
 | 
			
		||||
 | 
			
		||||
	cw_dbg_opt_detail=DBG_DETAIL_ASC_DMP;
 | 
			
		||||
 | 
			
		||||
	cw_register_actions_capwap_ac(&capwap_actions);
 | 
			
		||||
	cw_register_actions_cipwap_ac(&capwap_actions);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	struct avltree *avlt = capwap_actions.strelem;
 | 
			
		||||
 | 
			
		||||
	avltree_foreach_asc(avlt,avlprint,0);
 | 
			
		||||
 | 
			
		||||
	exit(0);
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	ac_global_init();
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
@ -353,6 +353,7 @@ static struct cwrmsg * wtpman_wait_for_message(struct wtpman * wtpman, time_t ti
 | 
			
		||||
	return cwrmsg;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
	int conn_msg_processor(struct conn *conn);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void wtpman_run_discovery(void *arg)
 | 
			
		||||
@ -361,7 +362,6 @@ static void wtpman_run_discovery(void *arg)
 | 
			
		||||
	struct wtpman * wtpman = (struct wtpman *)arg;
 | 
			
		||||
	struct cwrmsg * cwrmsg;
 | 
			
		||||
	
 | 
			
		||||
	void conn_msg_processor(struct conn *conn);
 | 
			
		||||
 | 
			
		||||
	time_t timer = cw_timer_start(10);
 | 
			
		||||
 | 
			
		||||
@ -370,7 +370,6 @@ extern cw_actionlist_in_t the_tree;
 | 
			
		||||
	wtpman->conn->capwap_state=CW_STATE_DISCOVERY;
 | 
			
		||||
	wtpman->conn->actions = &capwap_actions;
 | 
			
		||||
 | 
			
		||||
	wtpman->conn->itemstore = cw_itemstore_create();
 | 
			
		||||
 | 
			
		||||
	wtpman->conn->local = ac_config;
 | 
			
		||||
	wtpman->conn->remote = cw_itemstore_create();
 | 
			
		||||
@ -379,6 +378,12 @@ extern cw_actionlist_in_t the_tree;
 | 
			
		||||
		conn_msg_processor(wtpman->conn);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	struct cw_item * wn = cw_itemstore_get(wtpman->conn->remote,CW_ITEM_WTP_NAME);
 | 
			
		||||
 | 
			
		||||
	if (wn ) {
 | 
			
		||||
		printf("WTP Name: %s\n",wn->data);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	wtpman_remove(wtpman);
 | 
			
		||||
	return;
 | 
			
		||||
	
 | 
			
		||||
@ -594,16 +599,20 @@ wtpman->conn->capwap_state=CW_STATE_JOIN;
 | 
			
		||||
	wtpman->conn->capwap_state=CW_STATE_JOIN;
 | 
			
		||||
	wtpman->conn->actions = &capwap_actions;
 | 
			
		||||
 | 
			
		||||
	wtpman->conn->itemstore = cw_itemstore_create();
 | 
			
		||||
//	wtpman->conn->itemstore = cw_itemstore_create();
 | 
			
		||||
 | 
			
		||||
	wtpman->conn->local = ac_config;
 | 
			
		||||
	wtpman->conn->remote = cw_itemstore_create();
 | 
			
		||||
 | 
			
		||||
	while ( !cw_timer_timeout(timer) && wtpman->conn->capwap_state==CW_STATE_JOIN){
 | 
			
		||||
		conn_msg_processor(wtpman->conn);
 | 
			
		||||
		int rc = conn_msg_processor(wtpman->conn);
 | 
			
		||||
		if (rc <0 ) {
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	printf("Breaked\n");
 | 
			
		||||
	exit(0);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user