Fix SOAP request functions name.
Add check WTP session into capwap echo request
This commit is contained in:
@ -133,7 +133,7 @@ static struct ac_soap_response* ac_dfa_state_configure_parsing_request(struct ac
|
||||
ac_base64_string_encode(jsonmessage, base64confstatus);
|
||||
|
||||
/* Send message */
|
||||
response = ac_soap_configurestatusevent(session, session->wtpid, base64confstatus);
|
||||
response = ac_soap_configurestatuswtpsession(session, session->wtpid, base64confstatus);
|
||||
|
||||
/* Free JSON */
|
||||
json_object_put(jsonparam);
|
||||
|
@ -73,7 +73,7 @@ static struct ac_soap_response* ac_dfa_state_datacheck_parsing_request(struct ac
|
||||
ac_base64_string_encode(jsonmessage, base64confstatus);
|
||||
|
||||
/* Send message */
|
||||
response = ac_soap_changestateevent(session, session->wtpid, base64confstatus);
|
||||
response = ac_soap_changestatewtpsession(session, session->wtpid, base64confstatus);
|
||||
|
||||
/* Free JSON */
|
||||
json_object_put(jsonparam);
|
||||
@ -245,7 +245,7 @@ int ac_dfa_state_datacheck_to_run(struct ac_session_t* session, struct capwap_pa
|
||||
/* Capwap handshake complete, notify event to backend */
|
||||
if (result) {
|
||||
result = 0;
|
||||
response = ac_soap_runningevent(session, session->wtpid);
|
||||
response = ac_soap_runningwtpsession(session, session->wtpid);
|
||||
if (response) {
|
||||
if (response->responsecode == HTTP_RESULT_OK) {
|
||||
result = 1;
|
||||
|
@ -295,7 +295,7 @@ static struct ac_soap_response* ac_dfa_state_join_parsing_request(struct ac_sess
|
||||
ac_base64_string_encode(jsonmessage, base64confstatus);
|
||||
|
||||
/* Send message */
|
||||
response = ac_soap_joinevent(session, session->wtpid, base64confstatus);
|
||||
response = ac_soap_joinwtpsession(session, session->wtpid, base64confstatus);
|
||||
|
||||
/* Free JSON */
|
||||
json_object_put(jsonparam);
|
||||
@ -632,7 +632,7 @@ int ac_dfa_state_join(struct ac_session_t* session, struct capwap_parsed_packet*
|
||||
wtpid = ac_get_printable_wtpid(wtpboarddata);
|
||||
if (wtpid && !ac_has_wtpid(wtpid)) {
|
||||
/* Request authorization of Backend for complete join */
|
||||
response = ac_soap_authorizejoin(session, wtpid);
|
||||
response = ac_soap_authorizewtpsession(session, wtpid);
|
||||
if (response) {
|
||||
resultcode.code = ac_dfa_state_join_check_authorizejoin(session, response);
|
||||
ac_soapclient_free_response(response);
|
||||
|
@ -5,12 +5,31 @@
|
||||
|
||||
/* */
|
||||
static int receive_echo_request(struct ac_session_t* session, struct capwap_parsed_packet* packet) {
|
||||
int validsession = 0;
|
||||
struct ac_soap_response* response;
|
||||
struct capwap_header_data capwapheader;
|
||||
struct capwap_packet_txmng* txmngpacket;
|
||||
|
||||
ASSERT(session != NULL);
|
||||
ASSERT(packet != NULL);
|
||||
|
||||
/* Check session */
|
||||
response = ac_soap_checkwtpsession(session, session->wtpid);
|
||||
if (response) {
|
||||
if ((response->responsecode == HTTP_RESULT_OK) && response->xmlResponseReturn) {
|
||||
xmlChar* xmlResult = xmlNodeGetContent(response->xmlResponseReturn);
|
||||
if (!xmlStrcmp(xmlResult, (const xmlChar *)"true")) {
|
||||
validsession = 1;
|
||||
}
|
||||
}
|
||||
|
||||
ac_soapclient_free_response(response);
|
||||
}
|
||||
|
||||
if (!validsession) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Create response */
|
||||
capwap_header_init(&capwapheader, CAPWAP_RADIOID_NONE, GET_WBID_HEADER(packet->rxmngpacket->header));
|
||||
txmngpacket = capwap_packet_txmng_create_ctrl_message(&capwapheader, CAPWAP_ECHO_RESPONSE, packet->rxmngpacket->ctrlmsg.seq, session->mtu);
|
||||
|
@ -10,7 +10,7 @@ int ac_dfa_state_teardown(struct ac_session_t* session, struct capwap_parsed_pac
|
||||
|
||||
// Notify teardown session
|
||||
if (session->wtpid) {
|
||||
struct ac_soap_response* response = ac_soap_teardownevent(session, session->wtpid);
|
||||
struct ac_soap_response* response = ac_soap_teardownwtpsession(session, session->wtpid);
|
||||
if (response) {
|
||||
ac_soapclient_free_response(response);
|
||||
}
|
||||
|
@ -138,11 +138,12 @@ int ac_dfa_state_dead(struct ac_session_t* session, struct capwap_parsed_packet*
|
||||
|
||||
/* Soap function */
|
||||
struct ac_soap_response* ac_session_send_soap_request(struct ac_session_t* session, char* method, int numparam, ...);
|
||||
#define ac_soap_authorizejoin(s, wtpid) ac_session_send_soap_request((s), "authorizeJoin", 1, "xs:string", "idwtp", wtpid)
|
||||
#define ac_soap_joinevent(s, wtpid, joinparam) ac_session_send_soap_request((s), "joinEvent", 2, "xs:string", "idwtp", wtpid, "xs:base64Binary", "join", joinparam)
|
||||
#define ac_soap_configurestatusevent(s, wtpid, confstatusparam) ac_session_send_soap_request((s), "configureStatusEvent", 2, "xs:string", "idwtp", wtpid, "xs:base64Binary", "confstatus", confstatusparam)
|
||||
#define ac_soap_changestateevent(s, wtpid, changestateparam) ac_session_send_soap_request((s), "changeStateEvent", 2, "xs:string", "idwtp", wtpid, "xs:base64Binary", "changestate", changestateparam)
|
||||
#define ac_soap_runningevent(s, wtpid) ac_session_send_soap_request((s), "runningEvent", 1, "xs:string", "idwtp", wtpid)
|
||||
#define ac_soap_teardownevent(s, wtpid) ac_session_send_soap_request((s), "teardownEvent", 1, "xs:string", "idwtp", wtpid)
|
||||
#define ac_soap_authorizewtpsession(s, wtpid) ac_session_send_soap_request((s), "authorizeWTPSession", 1, "xs:string", "idwtp", wtpid)
|
||||
#define ac_soap_joinwtpsession(s, wtpid, joinparam) ac_session_send_soap_request((s), "joinWTPSession", 2, "xs:string", "idwtp", wtpid, "xs:base64Binary", "join", joinparam)
|
||||
#define ac_soap_configurestatuswtpsession(s, wtpid, confstatusparam) ac_session_send_soap_request((s), "configureStatusWTPSession", 2, "xs:string", "idwtp", wtpid, "xs:base64Binary", "confstatus", confstatusparam)
|
||||
#define ac_soap_changestatewtpsession(s, wtpid, changestateparam) ac_session_send_soap_request((s), "changeStateWTPSession", 2, "xs:string", "idwtp", wtpid, "xs:base64Binary", "changestate", changestateparam)
|
||||
#define ac_soap_runningwtpsession(s, wtpid) ac_session_send_soap_request((s), "runningWTPSession", 1, "xs:string", "idwtp", wtpid)
|
||||
#define ac_soap_teardownwtpsession(s, wtpid) ac_session_send_soap_request((s), "teardownWTPSession", 1, "xs:string", "idwtp", wtpid)
|
||||
#define ac_soap_checkwtpsession(s, wtpid) ac_session_send_soap_request((s), "checkWTPSession", 1, "xs:string", "idwtp", wtpid)
|
||||
|
||||
#endif /* __AC_SESSION_HEADER__ */
|
||||
|
Reference in New Issue
Block a user