#define CA_OPTION_OBSERVE 6
/**
+ @brief Max length of ID
+ */
+#define DTLS_PSK_ID_LEN 16
+
+/**
+ @brief Max length of PSK
+ */
+#define DTLS_PSK_PSK_LEN 16
+
+/**
+ @brief version
+ */
+#define DtlsPskCredsBlobVer_1 1
+
+/**
+ @brief current version
+ */
+#define DtlsPskCredsBlobVer_CurrentVersion DtlsPskCredsBlobVer_1
+
+
+/**
@brief Payload information from resource model
*/
-typedef char* CAPayload_t;
+typedef char *CAPayload_t;
/**
@brief URI for the OIC base.CA considers relative URI as the URI.
*/
-typedef char* CAURI_t;
+typedef char *CAURI_t;
/**
@brief Token information for mapping the request and responses by resource model
*/
-typedef char* CAToken_t;
+typedef char *CAToken_t;
/**
@brief Boolean value used for specifying the success or failure
CAAddress_t addressInfo;
/** Connectivity of the endpoint**/
CAConnectivityType_t connectivityType;
+ /** Secure connection**/
+ CABool_t isSecured;
} CARemoteEndpoint_t;
CAAddress_t addressInfo;
/** Connectivity type that localconnectivity avaialble **/
CAConnectivityType_t type;
+ /** Secure connection**/
+ CABool_t isSecured;
} CALocalConnectivity_t;
/**
CA_DESTINATION_DISCONNECTED,
CA_STATUS_FAILED,
CA_NOT_SUPPORTED
-/* Result code - END HERE */
+ /* Result code - END HERE */
} CAResult_t;
/**
CA_BAD_REQ = 400,
CA_BAD_OPT = 402,
CA_NOT_FOUND = 404
-/* Response status code - END HERE */
+ /* Response status code - END HERE */
} CAResponseResult_t;
/**
{
/**Qos for the request **/
CAMessageType_t type;
+ /** Message id.
+ * if message id is zero, it will generated by CA inside.
+ * otherwise, you can use it.**/
+ uint16_t messageId;
/** Token for CA**/
CAToken_t token;
/** Header Options for the request **/
- CAHeaderOption_t * options;
+ CAHeaderOption_t *options;
/** Number of Header options**/
uint8_t numOptions;
/** payload of the request **/
CAInfo_t info;
} CAResponseInfo_t;
+/**
+ * Credentials for a device. Includes identity and the associated PSK.
+ */
+typedef struct
+{
+ unsigned char clientIdentity[DTLS_PSK_ID_LEN];
+ unsigned char rsClientPsk[DTLS_PSK_PSK_LEN];
+} CADtlsPskCreds_t;
+
+/**
+ * Binary blob containing device identity and the credentials for all devices
+ * trusted by this device.
+ */
+typedef struct
+{
+ uint16_t blobVer; /**< version of the blob */
+ uint16_t reserved; /**< reserved for future use */
+ unsigned char rsIdentity[DTLS_PSK_ID_LEN]; /**< identity of self */
+ uint32_t num; /**< number of credentials in this blob */
+ CADtlsPskCreds_t *creds; /**< list of credentials. Size of this
+ array is determined by 'num' variable. */
+} CADtlsPskCredsBlob_t;
+
#ifdef __cplusplus
} /* extern "C" */
#endif