1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030 |
- /* soapcwmpService.cpp
- Generated by gSOAP 2.8.83 for trapi.h
- gSOAP XML Web services tools
- Copyright (C) 2000-2018, Robert van Engelen, Genivia Inc. All Rights Reserved.
- The soapcpp2 tool and its generated software are released under the GPL.
- This program is released under the GPL with the additional exemption that
- compiling, linking, and/or using OpenSSL is allowed.
- --------------------------------------------------------------------------------
- A commercial use license is available from Genivia Inc., contact@genivia.com
- --------------------------------------------------------------------------------
- */
- #include "soapcwmpService.h"
- cwmpService::cwmpService() {
- this->soap = soap_new();
- this->soap_own = true;
- cwmpService_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
- }
- cwmpService::cwmpService(const cwmpService &rhs) {
- this->soap = rhs.soap;
- this->soap_own = false;
- }
- cwmpService::cwmpService(struct soap *_soap) {
- this->soap = _soap;
- this->soap_own = false;
- cwmpService_init(_soap->imode, _soap->omode);
- }
- cwmpService::cwmpService(soap_mode iomode) {
- this->soap = soap_new();
- this->soap_own = true;
- cwmpService_init(iomode, iomode);
- }
- cwmpService::cwmpService(soap_mode imode, soap_mode omode) {
- this->soap = soap_new();
- this->soap_own = true;
- cwmpService_init(imode, omode);
- }
- cwmpService::~cwmpService() {
- if (this->soap_own) {
- this->destroy();
- soap_free(this->soap);
- }
- }
- void cwmpService::cwmpService_init(soap_mode imode, soap_mode omode) {
- soap_imode(this->soap, imode);
- soap_omode(this->soap, omode);
- static const struct Namespace namespaces[] = {
- {"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://www.w3.org/*/soap-envelope", NULL},
- {"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://www.w3.org/*/soap-encoding", NULL},
- {"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL},
- {"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL},
- {"cwmp", "urn:dslforum-org:cwmp-1-2", NULL, NULL},
- {NULL, NULL, NULL, NULL}
- };
- soap_set_namespaces(this->soap, namespaces);
- }
- void cwmpService::destroy() {
- soap_destroy(this->soap);
- soap_end(this->soap);
- }
- void cwmpService::reset() {
- this->destroy();
- soap_done(this->soap);
- soap_initialize(this->soap);
- cwmpService_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
- }
- #ifndef WITH_PURE_VIRTUAL
- cwmpService *cwmpService::copy() {
- cwmpService *dup = SOAP_NEW_UNMANAGED(cwmpService);
- if (dup) {
- soap_done(dup->soap);
- soap_copy_context(dup->soap, this->soap);
- }
- return dup;
- }
- #endif
- cwmpService &cwmpService::operator=(const cwmpService &rhs) {
- if (this->soap != rhs.soap) {
- if (this->soap_own)
- soap_free(this->soap);
- this->soap = rhs.soap;
- this->soap_own = false;
- }
- return *this;
- }
- int cwmpService::soap_close_socket() {
- return soap_closesock(this->soap);
- }
- int cwmpService::soap_force_close_socket() {
- return soap_force_closesock(this->soap);
- }
- int cwmpService::soap_senderfault(const char *string, const char *detailXML) {
- return ::soap_sender_fault(this->soap, string, detailXML);
- }
- int cwmpService::soap_senderfault(const char *subcodeQName, const char *string, const char *detailXML) {
- return ::soap_sender_fault_subcode(this->soap, subcodeQName, string, detailXML);
- }
- int cwmpService::soap_receiverfault(const char *string, const char *detailXML) {
- return ::soap_receiver_fault(this->soap, string, detailXML);
- }
- int cwmpService::soap_receiverfault(const char *subcodeQName, const char *string, const char *detailXML) {
- return ::soap_receiver_fault_subcode(this->soap, subcodeQName, string, detailXML);
- }
- void cwmpService::soap_print_fault(FILE *fd) {
- ::soap_print_fault(this->soap, fd);
- }
- #ifndef WITH_LEAN
- #ifndef WITH_COMPAT
- void cwmpService::soap_stream_fault(std::ostream &os) {
- ::soap_stream_fault(this->soap, os);
- }
- #endif
- char *cwmpService::soap_sprint_fault(char *buf, size_t len) {
- return ::soap_sprint_fault(this->soap, buf, len);
- }
- #endif
- void cwmpService::soap_noheader() {
- this->soap->header = NULL;
- }
- void cwmpService::soap_header(struct _cwmp__SupportedCWMPVersions *cwmp__SupportedCWMPVersions,
- struct _cwmp__UseCWMPVersion *cwmp__UseCWMPVersion,
- struct _cwmp__SessionTimeout *cwmp__SessionTimeout, struct _cwmp__ID *cwmp__ID,
- struct _cwmp__HoldRequests *cwmp__HoldRequests) {
- ::soap_header(this->soap);
- this->soap->header->cwmp__SupportedCWMPVersions = cwmp__SupportedCWMPVersions;
- this->soap->header->cwmp__UseCWMPVersion = cwmp__UseCWMPVersion;
- this->soap->header->cwmp__SessionTimeout = cwmp__SessionTimeout;
- this->soap->header->cwmp__ID = cwmp__ID;
- this->soap->header->cwmp__HoldRequests = cwmp__HoldRequests;
- }
- ::SOAP_ENV__Header *cwmpService::soap_header() {
- return this->soap->header;
- }
- #ifndef WITH_NOIO
- int cwmpService::run(int port, int backlog) {
- if (!soap_valid_socket(this->soap->master) && !soap_valid_socket(this->bind(NULL, port, backlog)))
- return this->soap->error;
- for (;;) {
- if (!soap_valid_socket(this->accept())) {
- if (this->soap->errnum == 0) // timeout?
- this->soap->error = SOAP_OK;
- break;
- }
- if (this->serve())
- break;
- this->destroy();
- }
- return this->soap->error;
- }
- #if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
- int cwmpService::ssl_run(int port, int backlog)
- { if (!soap_valid_socket(this->soap->master) && !soap_valid_socket(this->bind(NULL, port, backlog)))
- return this->soap->error;
- for (;;)
- { if (!soap_valid_socket(this->accept()))
- { if (this->soap->errnum == 0) // timeout?
- this->soap->error = SOAP_OK;
- break;
- }
- if (this->ssl_accept() || this->serve())
- break;
- this->destroy();
- }
- return this->soap->error;
- }
- #endif
- SOAP_SOCKET cwmpService::bind(const char *host, int port, int backlog) {
- return soap_bind(this->soap, host, port, backlog);
- }
- SOAP_SOCKET cwmpService::accept() {
- return soap_accept(this->soap);
- }
- #if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
- int cwmpService::ssl_accept()
- { return soap_ssl_accept(this->soap);
- }
- #endif
- #endif
- int cwmpService::serve() {
- #ifndef WITH_FASTCGI
- this->soap->keep_alive = this->soap->max_keep_alive + 1;
- #endif
- do {
- #ifndef WITH_FASTCGI
- if (this->soap->keep_alive > 0 && this->soap->max_keep_alive > 0)
- this->soap->keep_alive--;
- #endif
- auto result1 = soap_begin_serve(this->soap);
- // std::cerr<<"Serv result1: "<<result1<<std::endl;
- if (result1 != 0 && result1 == 20000) {
- if (this->soap->error >= SOAP_STOP)
- continue;
- return this->soap->error;
- }
- if ((dispatch() || (this->soap->fserveloop && this->soap->fserveloop(this->soap))) && this->soap->error &&
- this->soap->error < SOAP_STOP) {
- #ifdef WITH_FASTCGI
- soap_send_fault(this->soap);
- #else
- return soap_send_fault(this->soap);
- #endif
- }
- #ifdef WITH_FASTCGI
- soap_destroy(this->soap);
- soap_end(this->soap);
- } while (1);
- #else
- } while (this->soap->keep_alive);
- #endif
- return SOAP_OK;
- }
- static int serve___cwmp__GetParameterNames(struct soap *, cwmpService *);
- static int serve___cwmp__GetParameterValues(struct soap *, cwmpService *);
- static int serve___cwmp__GetParameterValuesResponse(struct soap *, cwmpService *);
- static int serve___cwmp__SetParameterValues(struct soap *, cwmpService *);
- static int serve___cwmp__GetParameterAttributes(struct soap *, cwmpService *);
- static int serve___cwmp__SetParameterAttributes(struct soap *, cwmpService *);
- static int serve___cwmp__Download(struct soap *, cwmpService *);
- static int serve___cwmp__Upload(struct soap *, cwmpService *);
- static int serve___cwmp__AddObject(struct soap *, cwmpService *);
- static int serve___cwmp__DeleteObject(struct soap *, cwmpService *);
- static int serve___cwmp__GetRPCMethods(struct soap *, cwmpService *);
- static int serve___cwmp__Inform(struct soap *, cwmpService *);
- static int serve___cwmp__Reboot(struct soap *, cwmpService *);
- static int serve___cwmp__FactoryReset(struct soap *, cwmpService *);
- int cwmpService::dispatch() {
- return dispatch(this->soap);
- }
- int cwmpService::dispatch(struct soap *soap) {
- int _check = 0;
- cwmpService_init(soap->imode, soap->omode);
- if (soap->error == 20400) {
- _check = 1;
- soap->error = 0;
- }
- if (_check == 1) {
- _check = 0;
- soap->error = 0;
- return CheckQueue(soap, this);
- }
- soap_peek_element(soap);
- std::cerr << "Method : " << soap->tag << std::endl;
- if (!soap_match_tag(soap, soap->tag, "cwmp:GetParameterNames"))
- return serve___cwmp__GetParameterNames(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:GetParameterValues"))
- return serve___cwmp__GetParameterValues(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:GetParameterValuesResponse"))
- return serve___cwmp__GetParameterValuesResponse(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:SetParameterValues"))
- return serve___cwmp__SetParameterValues(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:GetParameterAttributes"))
- return serve___cwmp__GetParameterAttributes(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:SetParameterAttributes"))
- return serve___cwmp__SetParameterAttributes(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:Download"))
- return serve___cwmp__Download(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:Upload"))
- return serve___cwmp__Upload(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:AddObject"))
- return serve___cwmp__AddObject(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:DeleteObject"))
- return serve___cwmp__DeleteObject(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:GetRPCMethods"))
- return serve___cwmp__GetRPCMethods(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:Inform"))
- return serve___cwmp__Inform(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:RebootResponse"))
- return CustomeRebootResonse(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:Reboot"))
- return serve___cwmp__Reboot(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:FactoryReset"))
- return serve___cwmp__FactoryReset(soap, this);
- if (!soap_match_tag(soap, soap->tag, "cwmp:DownloadResponse"))
- return cwmpService::CustomeDownloadResponse(soap, this);
- std::cerr << "Method Not Implemented: " << soap->tag << std::endl;
- return soap->error = SOAP_NO_METHOD;
- }
- static int serve___cwmp__GetParameterNames(struct soap *soap, cwmpService *service) {
- struct __cwmp__GetParameterNames soap_tmp___cwmp__GetParameterNames;
- struct _cwmp__GetParameterNamesResponse cwmp__GetParameterNamesResponse;
- soap_default__cwmp__GetParameterNamesResponse(soap, &cwmp__GetParameterNamesResponse);
- soap_default___cwmp__GetParameterNames(soap, &soap_tmp___cwmp__GetParameterNames);
- if (!soap_get___cwmp__GetParameterNames(soap, &soap_tmp___cwmp__GetParameterNames, "-cwmp:GetParameterNames", NULL))
- return soap->error;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->GetParameterNames(soap_tmp___cwmp__GetParameterNames.cwmp__GetParameterNames,
- &cwmp__GetParameterNamesResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__GetParameterNamesResponse(soap, &cwmp__GetParameterNamesResponse);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__GetParameterNamesResponse(soap, &cwmp__GetParameterNamesResponse,
- "cwmp:GetParameterNamesResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__GetParameterNamesResponse(soap, &cwmp__GetParameterNamesResponse,
- "cwmp:GetParameterNamesResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- static int serve___cwmp__GetParameterValues(struct soap *soap, cwmpService *service) {
- struct __cwmp__GetParameterValues soap_tmp___cwmp__GetParameterValues;
- struct _cwmp__GetParameterValuesResponse cwmp__GetParameterValuesResponse;
- soap_default__cwmp__GetParameterValuesResponse(soap, &cwmp__GetParameterValuesResponse);
- soap_default___cwmp__GetParameterValues(soap, &soap_tmp___cwmp__GetParameterValues);
- if (!soap_get___cwmp__GetParameterValues(soap, &soap_tmp___cwmp__GetParameterValues, "-cwmp:GetParameterValues",
- NULL))
- return soap->error;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->GetParameterValues(soap_tmp___cwmp__GetParameterValues.cwmp__GetParameterValues,
- &cwmp__GetParameterValuesResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__GetParameterValuesResponse(soap, &cwmp__GetParameterValuesResponse);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__GetParameterValuesResponse(soap, &cwmp__GetParameterValuesResponse,
- "cwmp:GetParameterValuesResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__GetParameterValuesResponse(soap, &cwmp__GetParameterValuesResponse,
- "cwmp:GetParameterValuesResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- static int serve___cwmp__GetParameterValuesResponse(struct soap *soap, cwmpService *service) {
- struct __cwmp__GetParameterValuesResponse soap_tmp___cwmp__GetParameterValuesResponse;
- soap_default___cwmp__GetParameterValuesResponse(soap, &soap_tmp___cwmp__GetParameterValuesResponse);
- if (!soap_get___cwmp__GetParameterValuesResponse(soap, &soap_tmp___cwmp__GetParameterValuesResponse,
- "-cwmp:GetParameterValuesResponse", NULL))
- return soap->error;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->GetParameterValuesResponse(
- soap_tmp___cwmp__GetParameterValuesResponse.cwmp__GetParameterValuesResponse);
- if (soap->error)
- return soap->error;
- return soap_closesock(soap);
- }
- static int serve___cwmp__SetParameterValues(struct soap *soap, cwmpService *service) {
- struct __cwmp__SetParameterValues soap_tmp___cwmp__SetParameterValues;
- struct _cwmp__SetParameterValuesResponse cwmp__SetParameterValuesResponse;
- soap_default__cwmp__SetParameterValuesResponse(soap, &cwmp__SetParameterValuesResponse);
- soap_default___cwmp__SetParameterValues(soap, &soap_tmp___cwmp__SetParameterValues);
- if (!soap_get___cwmp__SetParameterValues(soap, &soap_tmp___cwmp__SetParameterValues, "-cwmp:SetParameterValues",
- NULL))
- return soap->error;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->SetParameterValues(soap_tmp___cwmp__SetParameterValues.cwmp__SetParameterValues,
- &cwmp__SetParameterValuesResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__SetParameterValuesResponse(soap, &cwmp__SetParameterValuesResponse);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__SetParameterValuesResponse(soap, &cwmp__SetParameterValuesResponse,
- "cwmp:SetParameterValuesResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__SetParameterValuesResponse(soap, &cwmp__SetParameterValuesResponse,
- "cwmp:SetParameterValuesResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- static int serve___cwmp__GetParameterAttributes(struct soap *soap, cwmpService *service) {
- struct __cwmp__GetParameterAttributes soap_tmp___cwmp__GetParameterAttributes;
- struct _cwmp__GetParameterAttributesResponse cwmp__GetParameterAttributesResponse;
- soap_default__cwmp__GetParameterAttributesResponse(soap, &cwmp__GetParameterAttributesResponse);
- soap_default___cwmp__GetParameterAttributes(soap, &soap_tmp___cwmp__GetParameterAttributes);
- if (!soap_get___cwmp__GetParameterAttributes(soap, &soap_tmp___cwmp__GetParameterAttributes,
- "-cwmp:GetParameterAttributes", NULL))
- return soap->error;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->GetParameterAttributes(soap_tmp___cwmp__GetParameterAttributes.cwmp__GetParameterAttributes,
- &cwmp__GetParameterAttributesResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__GetParameterAttributesResponse(soap, &cwmp__GetParameterAttributesResponse);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__GetParameterAttributesResponse(soap, &cwmp__GetParameterAttributesResponse,
- "cwmp:GetParameterAttributesResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__GetParameterAttributesResponse(soap, &cwmp__GetParameterAttributesResponse,
- "cwmp:GetParameterAttributesResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- static int serve___cwmp__SetParameterAttributes(struct soap *soap, cwmpService *service) {
- struct __cwmp__SetParameterAttributes soap_tmp___cwmp__SetParameterAttributes;
- struct _cwmp__SetParameterAttributesResponse cwmp__SetParameterAttributesResponse;
- soap_default__cwmp__SetParameterAttributesResponse(soap, &cwmp__SetParameterAttributesResponse);
- soap_default___cwmp__SetParameterAttributes(soap, &soap_tmp___cwmp__SetParameterAttributes);
- if (!soap_get___cwmp__SetParameterAttributes(soap, &soap_tmp___cwmp__SetParameterAttributes,
- "-cwmp:SetParameterAttributes", NULL))
- return soap->error;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->SetParameterAttributes(soap_tmp___cwmp__SetParameterAttributes.cwmp__SetParameterAttributes,
- &cwmp__SetParameterAttributesResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__SetParameterAttributesResponse(soap, &cwmp__SetParameterAttributesResponse);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__SetParameterAttributesResponse(soap, &cwmp__SetParameterAttributesResponse,
- "cwmp:SetParameterAttributesResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__SetParameterAttributesResponse(soap, &cwmp__SetParameterAttributesResponse,
- "cwmp:SetParameterAttributesResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- static int serve___cwmp__Download(struct soap *soap, cwmpService *service) {
- struct __cwmp__Download soap_tmp___cwmp__Download;
- struct _cwmp__DownloadResponse cwmp__DownloadResponse;
- soap_default__cwmp__DownloadResponse(soap, &cwmp__DownloadResponse);
- soap_default___cwmp__Download(soap, &soap_tmp___cwmp__Download);
- if (!soap_get___cwmp__Download(soap, &soap_tmp___cwmp__Download, "-cwmp:Download", NULL))
- return soap->error;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->Download(soap_tmp___cwmp__Download.cwmp__Download, &cwmp__DownloadResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__DownloadResponse(soap, &cwmp__DownloadResponse);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__DownloadResponse(soap, &cwmp__DownloadResponse, "cwmp:DownloadResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__DownloadResponse(soap, &cwmp__DownloadResponse, "cwmp:DownloadResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- static int serve___cwmp__Upload(struct soap *soap, cwmpService *service) {
- struct __cwmp__Upload soap_tmp___cwmp__Upload;
- struct _cwmp__UploadResponse cwmp__UploadResponse;
- soap_default__cwmp__UploadResponse(soap, &cwmp__UploadResponse);
- soap_default___cwmp__Upload(soap, &soap_tmp___cwmp__Upload);
- if (!soap_get___cwmp__Upload(soap, &soap_tmp___cwmp__Upload, "-cwmp:Upload", NULL))
- return soap->error;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->Upload(soap_tmp___cwmp__Upload.cwmp__Upload, &cwmp__UploadResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__UploadResponse(soap, &cwmp__UploadResponse);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__UploadResponse(soap, &cwmp__UploadResponse, "cwmp:UploadResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__UploadResponse(soap, &cwmp__UploadResponse, "cwmp:UploadResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- static int serve___cwmp__AddObject(struct soap *soap, cwmpService *service) {
- struct __cwmp__AddObject soap_tmp___cwmp__AddObject;
- struct _cwmp__AddObjectResponse cwmp__AddObjectResponse;
- soap_default__cwmp__AddObjectResponse(soap, &cwmp__AddObjectResponse);
- soap_default___cwmp__AddObject(soap, &soap_tmp___cwmp__AddObject);
- if (!soap_get___cwmp__AddObject(soap, &soap_tmp___cwmp__AddObject, "-cwmp:AddObject", NULL))
- return soap->error;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->AddObject(soap_tmp___cwmp__AddObject.cwmp__AddObject, &cwmp__AddObjectResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__AddObjectResponse(soap, &cwmp__AddObjectResponse);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__AddObjectResponse(soap, &cwmp__AddObjectResponse, "cwmp:AddObjectResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__AddObjectResponse(soap, &cwmp__AddObjectResponse, "cwmp:AddObjectResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- static int serve___cwmp__DeleteObject(struct soap *soap, cwmpService *service) {
- struct __cwmp__DeleteObject soap_tmp___cwmp__DeleteObject;
- struct _cwmp__DeleteObjectResponse cwmp__DeleteObjectResponse;
- soap_default__cwmp__DeleteObjectResponse(soap, &cwmp__DeleteObjectResponse);
- soap_default___cwmp__DeleteObject(soap, &soap_tmp___cwmp__DeleteObject);
- if (!soap_get___cwmp__DeleteObject(soap, &soap_tmp___cwmp__DeleteObject, "-cwmp:DeleteObject", NULL))
- return soap->error;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->DeleteObject(soap_tmp___cwmp__DeleteObject.cwmp__DeleteObject, &cwmp__DeleteObjectResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__DeleteObjectResponse(soap, &cwmp__DeleteObjectResponse);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__DeleteObjectResponse(soap, &cwmp__DeleteObjectResponse, "cwmp:DeleteObjectResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__DeleteObjectResponse(soap, &cwmp__DeleteObjectResponse, "cwmp:DeleteObjectResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- static int serve___cwmp__GetRPCMethods(struct soap *soap, cwmpService *service) {
- struct __cwmp__GetRPCMethods soap_tmp___cwmp__GetRPCMethods;
- struct _cwmp__GetRPCMethodsResponse cwmp__GetRPCMethodsResponse;
- soap_default__cwmp__GetRPCMethodsResponse(soap, &cwmp__GetRPCMethodsResponse);
- soap_default___cwmp__GetRPCMethods(soap, &soap_tmp___cwmp__GetRPCMethods);
- if (!soap_get___cwmp__GetRPCMethods(soap, &soap_tmp___cwmp__GetRPCMethods, "-cwmp:GetRPCMethods", NULL))
- return soap->error;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->GetRPCMethods(soap_tmp___cwmp__GetRPCMethods.cwmp__GetRPCMethods,
- &cwmp__GetRPCMethodsResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__GetRPCMethodsResponse(soap, &cwmp__GetRPCMethodsResponse);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- ||
- soap_put__cwmp__GetRPCMethodsResponse(soap, &cwmp__GetRPCMethodsResponse, "cwmp:GetRPCMethodsResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__GetRPCMethodsResponse(soap, &cwmp__GetRPCMethodsResponse, "cwmp:GetRPCMethodsResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- static int serve___cwmp__Inform(struct soap *soap, cwmpService *service) {
- struct __cwmp__Inform soap_tmp___cwmp__Inform;
- struct _cwmp__InformResponse cwmp__InformResponse;
- soap_default__cwmp__InformResponse(soap, &cwmp__InformResponse);
- soap_default___cwmp__Inform(soap, &soap_tmp___cwmp__Inform);
- if (!soap_get___cwmp__Inform(soap, &soap_tmp___cwmp__Inform, "-cwmp:Inform", NULL))
- return soap->error;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->Inform(soap_tmp___cwmp__Inform.cwmp__Inform, &cwmp__InformResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__InformResponse(soap, &cwmp__InformResponse);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__InformResponse(soap, &cwmp__InformResponse, "cwmp:InformResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__InformResponse(soap, &cwmp__InformResponse, "cwmp:InformResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- static int serve___cwmp__Reboot(struct soap *soap, cwmpService *service) {
- struct __cwmp__Reboot soap_tmp___cwmp__Reboot;
- struct _cwmp__RebootResponse cwmp__RebootResponse;
- struct __cwmp__Reboot cwmp__reboot;
- soap_default__cwmp__RebootResponse(soap, &cwmp__RebootResponse);
- soap_default___cwmp__Reboot(soap, &soap_tmp___cwmp__Reboot);
- soap_default___cwmp__Reboot(soap, &cwmp__reboot);
- soap->error = service->Reboot(soap_tmp___cwmp__Reboot.cwmp__Reboot, &cwmp__RebootResponse);
- if (!soap_get___cwmp__Reboot(soap, &soap_tmp___cwmp__Reboot, "-cwmp:Reboot", NULL))
- return soap->error;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->Reboot(soap_tmp___cwmp__Reboot.cwmp__Reboot, &cwmp__RebootResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__RebootResponse(soap, &cwmp__RebootResponse);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__RebootResponse(soap, &cwmp__RebootResponse, "cwmp:RebootResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__RebootResponse(soap, &cwmp__RebootResponse, "cwmp:RebootResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- static int serve___cwmp__FactoryReset(struct soap *soap, cwmpService *service) {
- struct __cwmp__FactoryReset soap_tmp___cwmp__FactoryReset;
- struct _cwmp__FactoryResetResponse cwmp__FactoryResetResponse;
- soap_default__cwmp__FactoryResetResponse(soap, &cwmp__FactoryResetResponse);
- soap_default___cwmp__FactoryReset(soap, &soap_tmp___cwmp__FactoryReset);
- if (!soap_get___cwmp__FactoryReset(soap, &soap_tmp___cwmp__FactoryReset, "-cwmp:FactoryReset", NULL))
- return soap->error;
- // std::cerr<<"Factory Reset Called in serve___cwmp__FactoryReset."<<std::endl;
- if (soap_body_end_in(soap)
- || soap_envelope_end_in(soap)
- || soap_end_recv(soap))
- return soap->error;
- soap->error = service->FactoryReset(soap_tmp___cwmp__FactoryReset.cwmp__FactoryReset, &cwmp__FactoryResetResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__FactoryResetResponse(soap, &cwmp__FactoryResetResponse);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__FactoryResetResponse(soap, &cwmp__FactoryResetResponse, "cwmp:FactoryResetResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__FactoryResetResponse(soap, &cwmp__FactoryResetResponse, "cwmp:FactoryResetResponse", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- /* End of server object code */
- int cwmpService::CustomeFactoryReset(struct soap *pSoap, cwmpService *pService) {
- struct _cwmp__FactoryReset cwmp__FactoryReset;
- struct __cwmp__FactoryReset soap_tmp___cwmp__FactoryReset;
- struct _cwmp__FactoryResetResponse cwmp__FactoryResetResponse;
- soap_default__cwmp__FactoryResetResponse(soap, &cwmp__FactoryResetResponse);
- soap_default___cwmp__FactoryReset(soap, &soap_tmp___cwmp__FactoryReset);
- // if (soap_body_end_in(soap)
- // || soap_envelope_end_in(soap)
- // || soap_end_recv(soap))
- // return soap->error;
- soap->error = pService->FactoryReset(soap_tmp___cwmp__FactoryReset.cwmp__FactoryReset, &cwmp__FactoryResetResponse);
- if (soap->error)
- return soap->error;
- soap->encodingStyle = ""; /* use SOAP encoding style */
- soap_serializeheader(soap);
- soap_serialize__cwmp__FactoryReset(soap, &cwmp__FactoryReset);
- if (soap_begin_count(soap))
- return soap->error;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__FactoryReset(soap, &cwmp__FactoryReset, "cwmp:FactoryReset", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__FactoryReset(soap, &cwmp__FactoryReset, "cwmp:FactoryReset", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- int cwmpService::CustomeReboot(struct soap *pSoap, cwmpService *pService) {
- soap->error = 0;
- struct _cwmp__Reboot cwmp__reboot;
- cwmp__reboot.CommandKey = "reboot";
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__Reboot(soap, &cwmp__reboot, "cwmp:Reboot", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__Reboot(soap, &cwmp__reboot, "cwmp:Reboot", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
- int cwmpService::CustomeRebootResonse(struct soap *pSoap, cwmpService *pService) {
- std::cerr << "Recieve Reboot Response in Service.cpp" << std::endl;
- return soap_closesock(soap);
- }
- int cwmpService::CustomeDownload(struct soap *pSoap, cwmpService *pService, int DelaySeconds,
- char *FileType,
- char *URL, char *Username, char *Password, int FileSize,
- char *TargetFileName, char *SuccessURL, char *FailureURL) {
- soap->error = 0;
- std::cerr << "Upgrade Request recieved with parameters: " << std::endl;
- struct _cwmp__Download cwmp__download;
- cwmp__download.CommandKey = "";
- cwmp__download.DelaySeconds = DelaySeconds;
- cwmp__download.FileType = FileType;
- cwmp__download.URL = URL;
- cwmp__download.Username = Username;
- cwmp__download.Password = Password;
- cwmp__download.FileSize = FileSize;
- cwmp__download.TargetFileName = NULL;
- cwmp__download.SuccessURL = SuccessURL;
- cwmp__download.FailureURL = FailureURL;
- if ((soap->mode & SOAP_IO_LENGTH)) {
- if (soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__Download(soap, &cwmp__download, "cwmp:Download", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap))
- return soap->error;
- };
- if (soap_end_count(soap)
- || soap_response(soap, SOAP_OK)
- || soap_envelope_begin_out(soap)
- || soap_putheader(soap)
- || soap_body_begin_out(soap)
- || soap_put__cwmp__Download(soap, &cwmp__download, "cwmp:Download", "")
- || soap_body_end_out(soap)
- || soap_envelope_end_out(soap)
- || soap_end_send(soap))
- return soap->error;
- return soap_closesock(soap);
- }
|