Improved the management of soap request/response.
The director has the opportunity to change the configuration of AC in join connection. The virtual interfaces which encapsulate the wifi stations is managed dynamically by the Director. The AC must request authorization from Director for associate a station.
This commit is contained in:
@ -259,9 +259,7 @@ static struct ac_soap_response* ac_dfa_state_configure_parsing_request(struct ac
|
||||
/* */
|
||||
static uint32_t ac_dfa_state_configure_create_response(struct ac_session_t* session, struct capwap_parsed_packet* packet, struct ac_soap_response* response, struct capwap_packet_txmng* txmngpacket) {
|
||||
int length;
|
||||
char* json;
|
||||
unsigned long i;
|
||||
xmlChar* xmlResult;
|
||||
struct json_object* jsonroot;
|
||||
struct json_object* jsonelement;
|
||||
struct capwap_array* radioadmstate;
|
||||
@ -270,10 +268,6 @@ static uint32_t ac_dfa_state_configure_create_response(struct ac_session_t* sess
|
||||
struct capwap_wtpfallback_element responsewtpfallback;
|
||||
unsigned short binding = GET_WBID_HEADER(packet->rxmngpacket->header);
|
||||
|
||||
if ((response->responsecode != HTTP_RESULT_OK) || !response->xmlResponseReturn) {
|
||||
return CAPWAP_RESULTCODE_FAILURE;
|
||||
}
|
||||
|
||||
/* Receive SOAP response with JSON result
|
||||
{
|
||||
CAPWAPTimers: {
|
||||
@ -399,27 +393,11 @@ static uint32_t ac_dfa_state_configure_create_response(struct ac_session_t* sess
|
||||
}
|
||||
*/
|
||||
|
||||
/* Decode base64 result */
|
||||
xmlResult = xmlNodeGetContent(response->xmlResponseReturn);
|
||||
if (!xmlResult) {
|
||||
return CAPWAP_RESULTCODE_FAILURE;
|
||||
}
|
||||
|
||||
length = xmlStrlen(xmlResult);
|
||||
if (!length) {
|
||||
return CAPWAP_RESULTCODE_FAILURE;
|
||||
}
|
||||
|
||||
json = (char*)capwap_alloc(AC_BASE64_DECODE_LENGTH(length));
|
||||
ac_base64_string_decode((const char*)xmlResult, json);
|
||||
|
||||
xmlFree(xmlResult);
|
||||
|
||||
/* Parsing JSON result */
|
||||
jsonroot = json_tokener_parse(json);
|
||||
capwap_free(json);
|
||||
|
||||
/* Add message elements response, every local value can be overwrite from backend server */
|
||||
jsonroot = ac_soapclient_parse_json_response(response);
|
||||
if (!jsonroot) {
|
||||
return CAPWAP_RESULTCODE_FAILURE;
|
||||
}
|
||||
|
||||
/* CAPWAP Timers */
|
||||
memcpy(&responsetimers, &session->dfa.timers, sizeof(struct capwap_timers_element));
|
||||
|
Reference in New Issue
Block a user