Add teardown SOAP request and fix param name
This commit is contained in:
@ -45,7 +45,7 @@ static int ac_backend_soap_join(int forcereset) {
|
||||
if (!g_ac_backend.endthread) {
|
||||
request = ac_soapclient_create_request("joinBackend", SOAP_NAMESPACE_URI);
|
||||
if (request) {
|
||||
ac_soapclient_add_param(request, "xs:string", "acid", g_ac.backendacid);
|
||||
ac_soapclient_add_param(request, "xs:string", "idac", g_ac.backendacid);
|
||||
ac_soapclient_add_param(request, "xs:string", "version", g_ac.backendversion);
|
||||
ac_soapclient_add_param(request, "xs:boolean", "forcereset", (forcereset ? "true" : "false"));
|
||||
g_ac_backend.soaprequest = ac_soapclient_prepare_request(request, server);
|
||||
@ -114,7 +114,7 @@ static int ac_backend_soap_waitevent(void) {
|
||||
if (!g_ac_backend.endthread) {
|
||||
request = ac_soapclient_create_request("waitBackendEvent", SOAP_NAMESPACE_URI);
|
||||
if (request) {
|
||||
ac_soapclient_add_param(request, "xs:string", "sessionid", g_ac.backendsessionid);
|
||||
ac_soapclient_add_param(request, "xs:string", "idsession", g_ac.backendsessionid);
|
||||
g_ac_backend.soaprequest = ac_soapclient_prepare_request(request, server);
|
||||
|
||||
/* Change result timeout */
|
||||
@ -181,7 +181,7 @@ static void ac_backend_soap_leave(void) {
|
||||
/* Build Soap Request */
|
||||
request = ac_soapclient_create_request("leaveBackend", SOAP_NAMESPACE_URI);
|
||||
if (request) {
|
||||
ac_soapclient_add_param(request, "xs:string", "sessionid", g_ac.backendsessionid);
|
||||
ac_soapclient_add_param(request, "xs:string", "idsession", g_ac.backendsessionid);
|
||||
g_ac_backend.soaprequest = ac_soapclient_prepare_request(request, server);
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,19 @@
|
||||
|
||||
/* */
|
||||
static int ac_dfa_state_join_check_authorizejoin(struct ac_session_t* session, struct ac_soap_response* response) {
|
||||
if (response->responsecode != HTTP_RESULT_OK) {
|
||||
xmlChar* xmlResult;
|
||||
|
||||
if ((response->responsecode != HTTP_RESULT_OK) || !response->xmlResponseReturn) {
|
||||
/* TODO: check return failed code */
|
||||
return CAPWAP_RESULTCODE_JOIN_FAILURE_UNKNOWN_SOURCE;
|
||||
}
|
||||
|
||||
// Check return value
|
||||
xmlResult = xmlNodeGetContent(response->xmlResponseReturn);
|
||||
if (xmlStrcmp(xmlResult, (const xmlChar *)"true")) {
|
||||
return CAPWAP_RESULTCODE_JOIN_FAILURE_UNKNOWN_SOURCE;
|
||||
}
|
||||
|
||||
return CAPWAP_RESULTCODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,14 @@ int ac_dfa_state_teardown(struct ac_session_t* session, struct capwap_parsed_pac
|
||||
ASSERT(session != NULL);
|
||||
ASSERT(packet == NULL);
|
||||
|
||||
// Notify teardown session
|
||||
if (session->wtpid) {
|
||||
struct ac_soap_response* response = ac_soap_teardownevent(session, session->wtpid);
|
||||
if (response) {
|
||||
ac_soapclient_free_response(response);
|
||||
}
|
||||
}
|
||||
|
||||
/* Defered free resource */
|
||||
ac_dfa_change_state(session, CAPWAP_DEAD_STATE);
|
||||
return AC_DFA_DROP_PACKET;
|
||||
|
@ -806,7 +806,7 @@ struct ac_soap_response* ac_session_send_soap_request(struct ac_session_t* sessi
|
||||
/* Build Soap Request */
|
||||
request = ac_soapclient_create_request(method, SOAP_NAMESPACE_URI);
|
||||
if (request) {
|
||||
ac_soapclient_add_param(request, "xs:string", "sessionid", g_ac.backendsessionid);
|
||||
ac_soapclient_add_param(request, "xs:string", "idsession", g_ac.backendsessionid);
|
||||
session->soaprequest = ac_soapclient_prepare_request(request, server);
|
||||
}
|
||||
|
||||
|
@ -137,10 +137,11 @@ 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", "wtpid", wtpid)
|
||||
#define ac_soap_joinevent(s, wtpid, joinparam) ac_session_send_soap_request((s), "joinEvent", 2, "xs:string", "wtpid", wtpid, "xs:base64Binary", "join", joinparam)
|
||||
#define ac_soap_configurestatusevent(s, wtpid, confstatusparam) ac_session_send_soap_request((s), "configureStatusEvent", 2, "xs:string", "wtpid", wtpid, "xs:base64Binary", "confstatus", confstatusparam)
|
||||
#define ac_soap_changestateevent(s, wtpid, changestateparam) ac_session_send_soap_request((s), "changeStateEvent", 2, "xs:string", "wtpid", wtpid, "xs:base64Binary", "changestate", changestateparam)
|
||||
#define ac_soap_runningevent(s, wtpid) ac_session_send_soap_request((s), "runningEvent", 1, "xs:string", "wtpid", wtpid)
|
||||
#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)
|
||||
|
||||
#endif /* __AC_SESSION_HEADER__ */
|
||||
|
Reference in New Issue
Block a user