replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / security / include / internal / pstatresource.h
index 90e5657..c021cb0 100644 (file)
@@ -50,7 +50,7 @@ OCStackResult DeInitPstatResource();
  * @return ::OC_STACK_OK for Success, otherwise some error value.
  */
  OCStackResult PstatToCBORPayload(const OicSecPstat_t *pstat, uint8_t **cborPayload,
-                                  size_t *cborSize);
+                                  size_t *cborSize, bool writableOnly);
 
 /**
  * This method converts cbor into PSTAT data.
@@ -64,6 +64,19 @@ OCStackResult DeInitPstatResource();
  OCStackResult CBORPayloadToPstat(const uint8_t *cborPayload, const size_t cborSize,
                                   OicSecPstat_t **pstat);
 
+#ifdef MULTIPLE_OWNER
+/**
+ * Function to check the pstat access of SubOwner
+ *
+ * @param[in] cborPayload CBOR payload of pstat
+ * @param[in] size Byte length of cborPayload
+ *
+ * @return ::true for valid access, otherwise invalid access
+ */
+bool IsValidPstatAccessForSubOwner(const uint8_t *cborPayload, size_t size);
+#endif
+
+
 /** This function deallocates the memory for OicSecPstat_t.
  *
  * @param pstat is the pointer to @ref OicSecPstat_t.
@@ -85,6 +98,30 @@ void RestorePstatToInitState();
  */
 OCStackResult SetPstatRownerId(const OicUuid_t* newROwner);
 
+/**
+ * Gets the OicUuid_t value for the rownerid of the pstat resource.
+ *
+ * @param rowneruuid a pointer to be assigned to the rowneruuid property
+ * @return ::OC_STACK_OK if rowneruuid is assigned correctly, else ::OC_STACK_ERROR.
+ */
+OCStackResult GetPstatRownerId(OicUuid_t *rowneruuid);
+
+/**
+ * This function returns the "isop" status of the device.
+ *
+ * @return true iff pstat.isop == 1, else false
+ */
+bool GetPstatIsop();
+
+/**
+ * Internal function to change pastat resource to Ready for Normal Operation.
+ *
+ * @param newROwner new owner
+ *
+ * @retval ::OC_STACK_OK for Success, otherwise some error value
+ */
+OCStackResult SetPstatSelfOwnership(const OicUuid_t* newROwner);
+
 #ifdef __cplusplus
 }
 #endif