replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / include / ocprovisioningmanager.h
index 7cf06a1..b76512c 100644 (file)
 \r
 #include "octypes.h"\r
 #include "pmtypes.h"\r
+#include "casecurityinterface.h"\r
 #include "ownershiptransfermanager.h"\r
-#ifdef _ENABLE_MULTIPLE_OWNER_\r
+#ifdef MULTIPLE_OWNER\r
 #include "securevirtualresourcetypes.h"\r
-#endif //_ENABLE_MULTIPLE_OWNER_\r
+#endif //MULTIPLE_OWNER\r
 \r
 #ifdef __cplusplus\r
 extern "C" {\r
@@ -45,6 +46,19 @@ extern "C" {
 OCStackResult OCInitPM(const char* dbPath);\r
 \r
 /**\r
+ * API to termiante the provisioning manager\r
+ */\r
+void OCTerminatePM();\r
+\r
+/**\r
+ * API to cleanup PDM in case of timeout.\r
+ * It will remove the PDM_DEVICE_INIT state devices from PDM.\r
+ *\r
+ * @return OC_STACK_OK in case of success and other value otherwise.\r
+ */\r
+OCStackResult OCPDMCleanupForTimeout();\r
+\r
+/**\r
  * The function is responsible for discovery of owned/unowned device is specified endpoint/deviceID.\r
  * It will return the found device even though timeout is not exceeded.\r
  *\r
@@ -58,6 +72,23 @@ OCStackResult OCDiscoverSingleDevice(unsigned short timeout, const OicUuid_t* de
                              OCProvisionDev_t **ppFoundDevice);\r
 \r
 /**\r
+ * The function is responsible for discovery of owned/unowned device is specified endpoint/MAC\r
+ * address.\r
+ * It will return the found device even though timeout is not exceeded.\r
+ *\r
+ * @param[in] timeout Timeout in seconds, value till which function will listen to responses from\r
+ *                    server before returning the device.\r
+ * @param[in] deviceID         deviceID of target device.\r
+ * @param[in] hostAddress       MAC address of target device.\r
+ * @param[in] connType       ConnectivityType for discovery.\r
+ * @param[out] ppFoundDevice     OCProvisionDev_t of found device.\r
+ * @return OTM_SUCCESS in case of success and other value otherwise.\r
+ */\r
+OCStackResult OCDiscoverSingleDeviceInUnicast(unsigned short timeout, const OicUuid_t* deviceID,\r
+                             const char* hostAddress, OCConnectivityType connType,\r
+                             OCProvisionDev_t **ppFoundDevice);\r
+\r
+/**\r
  * The function is responsible for discovery of device is current subnet. It will list\r
  * all the device in subnet which are not yet owned. Please call OCInit with OC_CLIENT_SERVER as\r
  * OCMode.\r
@@ -91,7 +122,8 @@ OCStackResult OCDoOwnershipTransfer(void* ctx,
  */\r
 OCStackResult OCSetOxmAllowStatus(const OicSecOxm_t oxm, const bool allowStatus);\r
 \r
-#ifdef _ENABLE_MULTIPLE_OWNER_\r
+\r
+#ifdef MULTIPLE_OWNER\r
 /**\r
  * API to perfrom multiple ownership transfer for MOT enabled device.\r
  *\r
@@ -103,7 +135,36 @@ OCStackResult OCSetOxmAllowStatus(const OicSecOxm_t oxm, const bool allowStatus)
 OCStackResult OCDoMultipleOwnershipTransfer(void* ctx,\r
                                       OCProvisionDev_t *targetDevices,\r
                                       OCProvisionResultCB resultCallback);\r
-#endif //_ENABLE_MULTIPLE_OWNER_\r
+\r
+/**\r
+ * API to remove sub-owner from resource server\r
+ *\r
+ * @param[in] ctx Application context would be returned in result callback\r
+ * @param[in] targetDeviceInfo Selected target device.\r
+ * @param[in] subOwner sub-owner UUID to be removed\r
+ * @param[in] resultCallback callback provided by API user, callback will be invoked when\r
+ *            DELETE 'subowneruuid' request recieves a response from resource server.\r
+ * @return OC_STACK_OK in case of success and other value otherwise.\r
+ */\r
+OCStackResult OCRemoveSubOwner(void* ctx,\r
+                                const OCProvisionDev_t *targetDeviceInfo,\r
+                                const OicUuid_t* subOwner,\r
+                                OCProvisionResultCB resultCallback);\r
+\r
+/**\r
+ * API to remove all sub-owner from resource server\r
+ *\r
+ * @param[in] ctx Application context would be returned in result callback\r
+ * @param[in] targetDeviceInfo Selected target device.\r
+ * @param[in] resultCallback callback provided by API user, callback will be invoked when\r
+ *            DELETE 'subowneruuid' request recieves a response from resource server.\r
+ * @return OC_STACK_OK in case of success and other value otherwise.\r
+ */\r
+OCStackResult OCRemoveAllSubOwner(void* ctx,\r
+                                const OCProvisionDev_t *targetDeviceInfo,\r
+                                OCProvisionResultCB resultCallback);\r
+\r
+#endif //MULTIPLE_OWNER\r
 \r
 /**\r
  * API to register for particular OxM.\r
@@ -125,7 +186,7 @@ OCStackResult OCSetOwnerTransferCallbackData(OicSecOxm_t oxm, OTMCallbackData_t*
  */\r
 OCStackResult OCDiscoverOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList);\r
 \r
-#ifdef _ENABLE_MULTIPLE_OWNER_\r
+#ifdef MULTIPLE_OWNER\r
 /**\r
  * The function is responsible for discovery of MOT enabled device is current subnet.\r
  *\r
@@ -145,7 +206,7 @@ OCStackResult OCDiscoverMultipleOwnerEnabledDevices(unsigned short timeout, OCPr
  * @return OC_STACK_OK in case of success and other value otherwise.\r
  */\r
 OCStackResult OCDiscoverMultipleOwnedDevices(unsigned short timeout, OCProvisionDev_t **ppList);\r
-#endif //_ENABLE_MULTIPLE_OWNER_\r
+#endif //MULTIPLE_OWNER\r
 \r
 /**\r
  * API to provision credentials between two devices and ACLs for the devices who act as a server.\r
@@ -239,7 +300,7 @@ OCStackResult OCProvisionCredentials(void *ctx, OicSecCredType_t type, size_t ke
                                       const OCProvisionDev_t *pDev2,\r
                                       OCProvisionResultCB resultCallback);\r
 \r
-#ifdef _ENABLE_MULTIPLE_OWNER_\r
+#ifdef MULTIPLE_OWNER\r
 /**\r
  * API to provision preconfigured PIN to device(NOT LIST).\r
  * If device does not support the Preconfigured PIN OxM,\r
@@ -295,7 +356,7 @@ OCStackResult OCChangeMOTMode(void *ctx, const OCProvisionDev_t *targetDeviceInf
  */\r
 OCStackResult OCSelectMOTMethod(void *ctx, const OCProvisionDev_t *targetDeviceInfo,\r
                                  const OicSecOxm_t oxmSelValue, OCProvisionResultCB resultCallback);\r
-#endif //_ENABLE_MULTIPLE_OWNER_\r
+#endif //MULTIPLE_OWNER\r
 \r
 /**\r
  * Function to unlink devices.\r
@@ -363,6 +424,20 @@ OCStackResult OCResetDevice(void* ctx, unsigned short waitTimeForOwnedDeviceDisc
                             OCProvisionResultCB resultCallback);\r
 \r
 /**\r
+ * This function resets SVR DB to its factory setting.\r
+ *\r
+ *@return OC_STACK_OK in case of successful reset and other value otherwise.\r
+ */\r
+OCStackResult OCResetSVRDB(void);\r
+\r
+/**\r
+ * This function configures SVR DB as self-ownership.\r
+ *\r
+ *@return OC_STACK_OK in case of successful configue and other value otherwise.\r
+ */\r
+OCStackResult OCConfigSelfOwnership(void);\r
+\r
+/**\r
  * API to get status of all the devices in current subnet. The status include endpoint information\r
  * and doxm information which can be extracted duing owned and unowned discovery. Along with this\r
  * information. The API will provide information about devices' status\r
@@ -424,19 +499,6 @@ void OCDeletePdAclList(OicSecPdAcl_t* pPdAcl);
 \r
 #if defined(__WITH_DTLS__) || defined(__WITH_TLS__)\r
 /**\r
- * this function sends CRL information to resource.\r
- *\r
- * @param[in] ctx Application context would be returned in result callback.\r
- * @param[in] selectedDeviceInfo Selected target device.\r
- * @param[in] crl CRL to provision.\r
- * @param[in] resultCallback callback provided by API user, callback will be called when provisioning\r
-              request recieves a response from resource server.\r
- * @return  OC_STACK_OK in case of success and other value otherwise.\r
- */\r
-OCStackResult OCProvisionCRL(void* ctx, const OCProvisionDev_t *selectedDeviceInfo, OicSecCrl_t *crl,\r
-                             OCProvisionResultCB resultCallback);\r
-\r
-/**\r
  * function to provision Trust certificate chain to devices.\r
  *\r
  * @param[in] ctx Application context would be returned in result callback.\r
@@ -485,6 +547,23 @@ void OCRemoveTrustCertChainNotifier(void);
 OCStackResult OCReadTrustCertChain(uint16_t credId, uint8_t **trustCertChain,\r
                                      size_t *chainSize);\r
 \r
+/**\r
+ * Function to select appropriate security provisioning method.\r
+ *\r
+ * @param[in] supportedMethods   Array of supported methods\r
+ * @param[in] numberOfMethods   number of supported methods\r
+ * @param[out]  selectedMethod         Selected methods\r
+ * @param[in] ownerType type of owner device (SUPER_OWNER or SUB_OWNER)\r
+ * @return  OC_STACK_OK on success\r
+ */\r
+OCStackResult OCSelectOwnershipTransferMethod(const OicSecOxm_t *supportedMethods,\r
+        size_t numberOfMethods, OicSecOxm_t *selectedMethod, OwnerType_t ownerType);\r
+\r
+/**\r
+ * This function sets the callback to utilize peer certificate information\r
+ */\r
+OCStackResult OCSetPeerCertCallback(void *ctx, PeerCertCallback peerCertCallback);\r
+\r
 #endif // __WITH_DTLS__ || __WITH_TLS__\r
 \r
 \r