replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / include / pmtypes.h
index 08f21c3..6a46dd6 100644 (file)
@@ -29,6 +29,35 @@ extern "C" {
 #endif
 
 /**
+ * Node to construct list of UUID pair list.
+ */
+typedef struct OCPairList OCPairList_t;
+struct OCPairList
+{
+    OicUuid_t dev;
+    OicUuid_t dev2;
+    OCPairList_t *next;
+};
+
+/**
+ * Node to construct UUID linked list.
+ */
+typedef struct OCUuidList  OCUuidList_t;
+struct OCUuidList
+{
+    OicUuid_t dev;
+    OCUuidList_t *next;
+};
+
+/*
+ * Device's power on/off state.
+ */
+typedef enum {
+    DEV_STATUS_ON = (1 << 0),
+    DEV_STATUS_OFF = (1 << 1)
+}DeviceStatus;
+
+/**
  * Device Information of discoverd unowned/owned device(s) for provisioning.
  */
 typedef struct OCProvisionDev
@@ -38,10 +67,32 @@ typedef struct OCProvisionDev
     OicSecDoxm_t    *doxm;           /**< Pointer to target's doxm resource. **/
     OCConnectivityType connType;     /**< Connectivity type of endpoint */
     uint16_t        securePort;      /**< secure port **/
-    struct OCProvisionDev  *next;           /**< Next pointer. **/
+#ifdef WITH_TCP
+    uint16_t        tcpPort;         /**< tcp port **/
+#endif
+    char             secVer[OIC_SEC_MAX_VER_LEN];         /**< security version **/
+    DeviceStatus    devStatus;       /**< status of device **/
+    OCDoHandle    handle;
+    struct OCProvisionDev  *next;    /**< Next pointer. **/
 }OCProvisionDev_t;
 
 /**
+ * Device Information of discoverd direct pairing device(s).
+ */
+typedef struct OCDirectPairingDev
+{
+    OCDevAddr               endpoint;
+    OCConnectivityType   connType;
+    uint16_t                     securePort;
+    bool              edp;
+    OicSecPrm_t  *prm;
+    size_t            prmLen;
+    OicUuid_t       deviceID;
+    OicUuid_t       rowner;
+    struct OCDirectPairingDev *next;
+} OCDirectPairingDev_t;
+
+/**
  * Result information for each target device.
  */
 typedef struct OCPMResult{
@@ -50,6 +101,31 @@ typedef struct OCPMResult{
 }OCProvisionResult_t;
 
 /**
+ * Owner device type
+ */
+typedef enum OwnerType{
+    SUPER_OWNER = 0,
+    SUB_OWNER = 1
+}OwnerType_t;
+
+/**
+ * Index value to access OxM allow table
+ */
+typedef enum OxmAllowTableIdx {
+    OXM_IDX_JUST_WORKS = 0,
+    OXM_IDX_MV_JUST_WORKS,
+#ifdef MULTIPLE_OWNER
+    OXM_IDX_PRECONFIG_PIN,
+#endif
+    OXM_IDX_RANDOM_DEVICE_PIN,
+    OXM_IDX_MANUFACTURER_CERTIFICATE,
+    OXM_IDX_CON_MFG_CERT,
+    OXM_IDX_DECENTRALIZED_PUBLIC_KEY,
+    OXM_IDX_COUNT,
+    OXM_IDX_UNKNOWN
+}OxmAllowTableIdx_t;
+
+/**
  * Callback function definition of provisioning API
  *
  * @param[OUT] ctx - If user set his/her context, it will be returned here.
@@ -60,8 +136,20 @@ typedef struct OCPMResult{
  */
 typedef void (*OCProvisionResultCB)(void* ctx, int nOfRes, OCProvisionResult_t *arr, bool hasError);
 
+
+/**
+ * Callback function definition of direct-pairing
+ *
+ * @param[OUT] ctx - User context which will be returned wth callback
+ * @param[OUT] peer - pairing device info.
+ * @param[OUT} result - It's returned with 'OC_STACK_XXX'. It will return 'OC_STACK_OK'
+ *                                   if D2D pairing is success without error
+ */
+typedef void (*OCDirectPairingResultCB)(void *ctx, OCDirectPairingDev_t *peer, OCStackResult result);
+
+
 #ifdef __cplusplus
 }
 #endif
 
-#endif //OC_PROVISIONING_TYPES_H
\ No newline at end of file
+#endif //OC_PROVISIONING_TYPES_H