More strict capwap actube and wtp.
FossilOrigin-Name: 73d6e8e84bdf334760945de51e4f4f4b14e15a34fed5477700e3bb388aa4b727
This commit is contained in:
parent
434305390b
commit
e9b94947a9
@ -239,9 +239,8 @@ static int wtpman_join(void *arg, time_t timer)
|
||||
|
||||
struct conn * conn = wtpman->conn;
|
||||
|
||||
conn->capwap_mode=CW_MODE_CIPWAP;
|
||||
|
||||
|
||||
conn->strict_capwap=1;
|
||||
|
||||
cw_dbg(DBG_INFO,"Join State - %s",sock_addr2str(&conn->addr));
|
||||
|
||||
|
@ -13,6 +13,16 @@ int cw_in_check_join_resp(struct conn *conn, struct cw_action_in *a, uint8_t * d
|
||||
|
||||
cw_action_in_t * mlist[60];
|
||||
|
||||
mbag_item_t * jresult = mbag_get(conn->incomming,CW_ITEM_RESULT_CODE);
|
||||
if (jresult ) {
|
||||
if (!cw_rcok(jresult->dword)){
|
||||
return jresult->dword;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Check for mandatory elements */
|
||||
int n = cw_check_missing_mand(mlist,conn,a);
|
||||
if (n && conn->strict_capwap) {
|
||||
@ -27,7 +37,6 @@ int cw_in_check_join_resp(struct conn *conn, struct cw_action_in *a, uint8_t * d
|
||||
|
||||
|
||||
|
||||
mbag_item_t * jresult = mbag_get(conn->incomming, CW_ITEM_RESULT_CODE);
|
||||
|
||||
if ( jresult ) {
|
||||
return jresult->dword;
|
||||
|
@ -5,10 +5,12 @@
|
||||
#include "capwap_items.h"
|
||||
#include "capwap.h"
|
||||
|
||||
static int cw_put_encryption_subelems(uint8_t *dst)
|
||||
static int cw_put_encryption_subelems(uint8_t *dst,int capwap_mode)
|
||||
{
|
||||
if (capwap_mode==CW_MODE_CISCO){
|
||||
cw_put_word(dst,0x01);
|
||||
return 2;
|
||||
}
|
||||
|
||||
int n=2;
|
||||
|
||||
@ -34,9 +36,10 @@ int cw_out_wtp_descriptor(struct conn *conn, struct cw_action_out *a, uint8_t *
|
||||
// XXX Dummy WTP Descriptor Header
|
||||
uint8_t *d = dst+4;
|
||||
|
||||
d+=cw_put_byte(d,2); //max radios
|
||||
d+=cw_put_byte(d,conn->radios->count); //max radios
|
||||
d+=cw_put_byte(d,2); //radios in use
|
||||
d+=cw_put_encryption_subelems(d);
|
||||
|
||||
d+=cw_put_encryption_subelems(d,conn->capwap_mode);
|
||||
|
||||
mbag_item_t * i;
|
||||
i = mbag_get(mbag,CW_ITEM_WTP_HARDWARE_VERSION);
|
||||
|
@ -168,12 +168,19 @@ int run_join(struct conn * conn)
|
||||
int rc = cw_send_request(conn,CW_MSG_JOIN_REQUEST);
|
||||
|
||||
if (!cw_rcok(rc) ) {
|
||||
cw_log(LOG_ERR,"Can't Join AC at %s: %d - %s.",
|
||||
if (rc>0 ){
|
||||
cw_log(LOG_ERR,"Can't Join AC at %s, AC said: %d - %s.",
|
||||
sock_addr2str(&conn->addr),rc,cw_strerror(rc));
|
||||
|
||||
}
|
||||
else{
|
||||
cw_log(LOG_ERR,"Can't Join AC at %s: %d - %s.",
|
||||
sock_addr2str(&conn->addr),errno,cw_strerror(rc));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
cw_dbg(DBG_ELEM,"Join Result: %d - %s",rc,cw_strresult(rc));
|
||||
cw_dbg(DBG_ELEM,"Joined AC at %s, Join Result: %d - %s",sock_addr2str(&conn->addr),rc,cw_strresult(rc));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -183,7 +190,6 @@ int run_join(struct conn * conn)
|
||||
int join()
|
||||
{
|
||||
struct conn * conn = get_conn();
|
||||
conn->capwap_mode=CW_MODE_CISCO;
|
||||
|
||||
cw_aciplist_t iplist = mbag_get_avltree(conn->local,CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST);
|
||||
if (!iplist){
|
||||
|
@ -111,7 +111,7 @@ mavl_destroy(b);
|
||||
|
||||
|
||||
|
||||
cw_register_actions_cipwap_wtp(&capwap_actions);
|
||||
cw_register_actions_capwap_wtp(&capwap_actions);
|
||||
cw_register_actions_capwap_80211_wtp(&capwap_actions);
|
||||
|
||||
|
||||
@ -130,7 +130,10 @@ mavl_destroy(b);
|
||||
conn->incomming = mbag_create();
|
||||
conn->local = mbag_create();
|
||||
conn->base_rmac=get_base_rmac();
|
||||
conn->capwap_mode = CW_MODE_CISCO;
|
||||
|
||||
conn->capwap_mode = CW_MODE_STD;
|
||||
the_conn->strict_capwap=1;
|
||||
|
||||
|
||||
conn->config=mbag_create();
|
||||
|
||||
@ -168,7 +171,6 @@ cw_set_msg_end_callback(conn,CW_STATE_CONFIGURE,CW_MSG_CONFIGURATION_STATUS_RESP
|
||||
|
||||
|
||||
|
||||
the_conn->strict_capwap=1;
|
||||
if (!discovery())
|
||||
return -1;
|
||||
if (!join())
|
||||
|
Loading…
Reference in New Issue
Block a user