soapcwmpService.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* soapcwmpService.h
  2. Generated by gSOAP 2.8.83 for trapi.h
  3. gSOAP XML Web services tools
  4. Copyright (C) 2000-2018, Robert van Engelen, Genivia Inc. All Rights Reserved.
  5. The soapcpp2 tool and its generated software are released under the GPL.
  6. This program is released under the GPL with the additional exemption that
  7. compiling, linking, and/or using OpenSSL is allowed.
  8. --------------------------------------------------------------------------------
  9. A commercial use license is available from Genivia Inc., contact@genivia.com
  10. --------------------------------------------------------------------------------
  11. */
  12. #ifndef soapcwmpService_H
  13. #define soapcwmpService_H
  14. #include "soapH.h"
  15. class SOAP_CMAC cwmpService {
  16. public:
  17. /// Context to manage service IO and data
  18. struct soap *soap;
  19. /// flag indicating that this context is owned by this service and should be deleted by the destructor
  20. bool soap_own;
  21. /// Variables globally declared in trapi.h, if any
  22. /// Construct a service with new managing context
  23. cwmpService();
  24. /// Copy constructor
  25. cwmpService(const cwmpService&);
  26. /// Construct service given a shared managing context
  27. cwmpService(struct soap*);
  28. /// Constructor taking input+output mode flags for the new managing context
  29. cwmpService(soap_mode iomode);
  30. /// Constructor taking input and output mode flags for the new managing context
  31. cwmpService(soap_mode imode, soap_mode omode);
  32. /// Destructor deletes deserialized data and its managing context, when the context was allocated by the contructor
  33. virtual ~cwmpService();
  34. /// Delete all deserialized data (with soap_destroy() and soap_end())
  35. virtual void destroy();
  36. /// Delete all deserialized data and reset to defaults
  37. virtual void reset();
  38. /// Initializer used by constructors
  39. virtual void cwmpService_init(soap_mode imode, soap_mode omode);
  40. /// Return a copy that has a new managing context with the same engine state
  41. virtual cwmpService *copy() SOAP_PURE_VIRTUAL_COPY;
  42. /// Copy assignment
  43. cwmpService& operator=(const cwmpService&);
  44. /// Close connection (normally automatic)
  45. virtual int soap_close_socket();
  46. /// Force close connection (can kill a thread blocked on IO)
  47. virtual int soap_force_close_socket();
  48. /// Return sender-related fault to sender
  49. virtual int soap_senderfault(const char *string, const char *detailXML);
  50. /// Return sender-related fault with SOAP 1.2 subcode to sender
  51. virtual int soap_senderfault(const char *subcodeQName, const char *string, const char *detailXML);
  52. /// Return receiver-related fault to sender
  53. virtual int soap_receiverfault(const char *string, const char *detailXML);
  54. /// Return receiver-related fault with SOAP 1.2 subcode to sender
  55. virtual int soap_receiverfault(const char *subcodeQName, const char *string, const char *detailXML);
  56. /// Print fault
  57. virtual void soap_print_fault(FILE*);
  58. #ifndef WITH_LEAN
  59. #ifndef WITH_COMPAT
  60. /// Print fault to stream
  61. virtual void soap_stream_fault(std::ostream&);
  62. #endif
  63. /// Write fault to buffer
  64. virtual char *soap_sprint_fault(char *buf, size_t len);
  65. #endif
  66. /// Disables and removes SOAP Header from message by setting soap->header = NULL
  67. virtual void soap_noheader();
  68. /// Add SOAP Header to message
  69. virtual void 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);
  70. /// Get SOAP Header structure (i.e. soap->header, which is NULL when absent)
  71. virtual ::SOAP_ENV__Header *soap_header();
  72. #ifndef WITH_NOIO
  73. /// Run simple single-thread (iterative, non-SSL) service on port until a connection error occurs (returns SOAP_OK or error code), use this->bind_flag = SO_REUSEADDR to rebind for immediate rerun
  74. virtual int run(int port, int backlog = 1);
  75. #if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
  76. /// Run simple single-thread SSL service on port until a connection error occurs (returns SOAP_OK or error code), use this->bind_flag = SO_REUSEADDR to rebind for immediate rerun
  77. virtual int ssl_run(int port, int backlog = 1);
  78. #endif
  79. /// Bind service to port (returns master socket or SOAP_INVALID_SOCKET upon error)
  80. virtual SOAP_SOCKET bind(const char *host, int port, int backlog);
  81. /// Accept next request (returns socket or SOAP_INVALID_SOCKET upon error)
  82. virtual SOAP_SOCKET accept();
  83. #if defined(WITH_OPENSSL) || defined(WITH_GNUTLS)
  84. /// When SSL is used, after accept() should perform and accept SSL handshake
  85. virtual int ssl_accept();
  86. #endif
  87. #endif
  88. /// After accept() serve the pending request (returns SOAP_OK or error code)
  89. virtual int serve();
  90. /// Used by serve() to dispatch a pending request (returns SOAP_OK or error code)
  91. virtual int dispatch();
  92. virtual int dispatch(struct soap *soap);
  93. //
  94. // Service operations are listed below: you should define these
  95. // Note: compile with -DWITH_PURE_VIRTUAL to declare pure virtual methods
  96. //
  97. /// Web service operation 'GetParameterNames' implementation, should return SOAP_OK or error code
  98. virtual int GetParameterNames(struct _cwmp__GetParameterNames *cwmp__GetParameterNames, struct _cwmp__GetParameterNamesResponse *cwmp__GetParameterNamesResponse) SOAP_PURE_VIRTUAL;
  99. //
  100. /// Web service operation 'GetParameterValues' implementation, should return SOAP_OK or error code
  101. virtual int GetParameterValues(struct _cwmp__GetParameterValues *cwmp__GetParameterValues, struct _cwmp__GetParameterValuesResponse *cwmp__GetParameterValuesResponse) SOAP_PURE_VIRTUAL;
  102. //
  103. /// Web service one-way operation 'GetParameterValuesResponse' implementation, should return value of send_GetParameterValuesResponse_empty_response() to send HTTP Accept acknowledgment, or return an error code, or return SOAP_OK to immediately return without sending an HTTP response message
  104. virtual int GetParameterValuesResponse(struct _cwmp__GetParameterValuesResponse *cwmp__GetParameterValuesResponse) SOAP_PURE_VIRTUAL;
  105. /// Web service asynchronous send of HTTP Accept acknowledgment to be called in 'GetParameterValuesResponse', returns SOAP_OK or error code
  106. virtual int send_GetParameterValuesResponse_empty_response(int soap_http_status = 202) { return soap_send_empty_response(this->soap, soap_http_status); }
  107. //
  108. /// Web service operation 'SetParameterValues' implementation, should return SOAP_OK or error code
  109. virtual int SetParameterValues(struct _cwmp__SetParameterValues *cwmp__SetParameterValues, struct _cwmp__SetParameterValuesResponse *cwmp__SetParameterValuesResponse) SOAP_PURE_VIRTUAL;
  110. //
  111. /// Web service operation 'GetParameterAttributes' implementation, should return SOAP_OK or error code
  112. virtual int GetParameterAttributes(struct _cwmp__GetParameterAttributes *cwmp__GetParameterAttributes, struct _cwmp__GetParameterAttributesResponse *cwmp__GetParameterAttributesResponse) SOAP_PURE_VIRTUAL;
  113. //
  114. /// Web service operation 'SetParameterAttributes' implementation, should return SOAP_OK or error code
  115. virtual int SetParameterAttributes(struct _cwmp__SetParameterAttributes *cwmp__SetParameterAttributes, struct _cwmp__SetParameterAttributesResponse *cwmp__SetParameterAttributesResponse) SOAP_PURE_VIRTUAL;
  116. //
  117. /// Web service operation 'Download' implementation, should return SOAP_OK or error code
  118. virtual int Download(struct _cwmp__Download *cwmp__Download, struct _cwmp__DownloadResponse *cwmp__DownloadResponse) SOAP_PURE_VIRTUAL;
  119. //
  120. /// Web service operation 'Upload' implementation, should return SOAP_OK or error code
  121. virtual int Upload(struct _cwmp__Upload *cwmp__Upload, struct _cwmp__UploadResponse *cwmp__UploadResponse) SOAP_PURE_VIRTUAL;
  122. //
  123. /// Web service operation 'AddObject' implementation, should return SOAP_OK or error code
  124. virtual int AddObject(struct _cwmp__AddObject *cwmp__AddObject, struct _cwmp__AddObjectResponse *cwmp__AddObjectResponse) SOAP_PURE_VIRTUAL;
  125. //
  126. /// Web service operation 'DeleteObject' implementation, should return SOAP_OK or error code
  127. virtual int DeleteObject(struct _cwmp__DeleteObject *cwmp__DeleteObject, struct _cwmp__DeleteObjectResponse *cwmp__DeleteObjectResponse) SOAP_PURE_VIRTUAL;
  128. //
  129. /// Web service operation 'GetRPCMethods' implementation, should return SOAP_OK or error code
  130. virtual int GetRPCMethods(struct _cwmp__GetRPCMethods *cwmp__GetRPCMethods, struct _cwmp__GetRPCMethodsResponse *cwmp__GetRPCMethodsResponse) SOAP_PURE_VIRTUAL;
  131. //
  132. /// Web service operation 'Inform' implementation, should return SOAP_OK or error code
  133. virtual int Inform(struct _cwmp__Inform *cwmp__Inform, struct _cwmp__InformResponse *cwmp__InformResponse) SOAP_PURE_VIRTUAL;
  134. //
  135. /// Web service operation 'Reboot' implementation, should return SOAP_OK or error code
  136. virtual int Reboot(struct _cwmp__Reboot *cwmp__Reboot, struct _cwmp__RebootResponse *cwmp__RebootResponse) SOAP_PURE_VIRTUAL;
  137. //
  138. /// Web service operation 'FactoryReset' implementation, should return SOAP_OK or error code
  139. virtual int FactoryReset(struct _cwmp__FactoryReset *cwmp__FactoryReset, struct _cwmp__FactoryResetResponse *cwmp__FactoryResetResponse) SOAP_PURE_VIRTUAL;
  140. virtual int CheckQueue(struct soap *soap, cwmpService *cwmpService1) SOAP_PURE_VIRTUAL;
  141. virtual int CustomeFactoryReset(struct soap *soap , cwmpService *cwmpService1) SOAP_PURE_VIRTUAL;
  142. virtual int CustomeReboot(struct soap *soap , cwmpService *cwmpService1) SOAP_PURE_VIRTUAL;
  143. virtual int CustomeRebootResonse(struct soap *soap , cwmpService *cwmpService1) SOAP_PURE_VIRTUAL;
  144. };
  145. #endif