2015-04-10 17:16:33 +02:00
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
#include "capwap.h"
|
|
|
|
#include "intavltree.h"
|
|
|
|
#include "dbg.h"
|
2015-04-10 17:52:01 +02:00
|
|
|
#include "log.h"
|
2018-03-17 17:29:09 +01:00
|
|
|
|
2015-04-10 17:16:33 +02:00
|
|
|
|
|
|
|
int cw_in_check_join_resp(struct conn *conn, struct cw_action_in *a, uint8_t * data,
|
2015-04-12 23:28:55 +02:00
|
|
|
int len,struct sockaddr *from)
|
2015-04-10 17:16:33 +02:00
|
|
|
{
|
2018-03-12 11:22:06 +01:00
|
|
|
/*
|
2015-04-10 17:16:33 +02:00
|
|
|
cw_action_in_t * mlist[60];
|
|
|
|
|
2015-04-26 15:48:40 +02:00
|
|
|
mbag_item_t * jresult = mbag_get(conn->incomming,CW_ITEM_RESULT_CODE);
|
|
|
|
if (jresult ) {
|
2018-03-09 15:38:21 +01:00
|
|
|
if (!cw_result_is_ok(jresult->u2.dword)){
|
2018-03-03 17:42:28 +01:00
|
|
|
return jresult->u2.dword;
|
2015-04-26 15:48:40 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
// Check for mandatory elements
|
2015-04-10 17:16:33 +02:00
|
|
|
int n = cw_check_missing_mand(mlist,conn,a);
|
2015-04-26 08:41:12 +02:00
|
|
|
if (n && conn->strict_capwap) {
|
|
|
|
cw_dbg_missing_mand(DBG_MSG_ERR,conn,mlist,n,a);
|
2018-02-28 07:38:02 +01:00
|
|
|
conn->capwap_state=CAPWAP_STATE_JOIN;
|
2015-04-10 17:16:33 +02:00
|
|
|
errno=EAGAIN;
|
|
|
|
return -1; //CW_RESULT_MISSING_MAND_ELEM;
|
|
|
|
}
|
2015-04-26 08:41:12 +02:00
|
|
|
if (n){
|
|
|
|
cw_dbg_missing_mand(DBG_RFC,conn,mlist,n,a);
|
|
|
|
}
|
2015-04-10 17:16:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( jresult ) {
|
2018-03-03 17:42:28 +01:00
|
|
|
return jresult->u2.dword;
|
2015-04-10 17:16:33 +02:00
|
|
|
}
|
|
|
|
|
2018-03-12 11:22:06 +01:00
|
|
|
// set result code to ok and change to configure state
|
2015-04-19 23:27:44 +02:00
|
|
|
// mbag_set_dword(conn->outgoing,CW_ITEM_RESULT_CODE,0);
|
2018-03-12 11:22:06 +01:00
|
|
|
*/
|
2015-04-10 17:16:33 +02:00
|
|
|
return 0;
|
|
|
|
}
|