eeddf378a9b209376e882090601520ea0a2f6fd3
[framework/osp/security-service.git] / inc / DrmServiceDl.h
1 /*
2  * DrmServiceDl.h
3  *
4  *  Created on: Mar 25, 2013
5  *      Author: manyfun
6  */
7
8 #ifndef _DRMSERVICE_DL_H_
9 #define _DRMSERVICE_DL_H_
10
11 #define DLOPEN_FAILED   -1
12 #define DLSYM_FAILED    -2
13 #define SADC_SUCCESS    1
14
15 #define DRM_SAPPS_SO_PATH       "/usr/lib/libdrm-service-core-sapps.so"
16
17 /*Samsung Apps DRM*/
18 typedef int (*DRM_OEM_SAPPS_GENERATE_LICENSE_REQUEST) (const char *pRespBuf, unsigned int respBufLen, char *pReqBuf, unsigned int *pReqBufLen, char *pLicenseUrl, unsigned int *pLicenseUrlLen);
19 typedef int (*DRM_OEM_SAPPS_REGISTER_LICENSE) (const char *pRespBuf, unsigned int respBufLen);
20 typedef int (*DRM_OEM_SAPPS_IS_DRM_FILE) (const char *pDcfPath, int dcfPathLen);
21 typedef int (*DRM_OEM_SAPPS_DECRYPT_PACKAGE) (const char *pSADCFilepath, int sadcFileLen, const char *pDecryptedFile, int decryptedFileLen);
22 typedef int (*DRM_OEM_SAPPS_IS_DRM_APP) (const char *pSzCid, int cidLen);
23 typedef int (*DRM_OEM_SAPPS_UNINSTALL_LICENSE) (const char *szCid, int cidLen);
24 typedef int (*DRM_OEM_SAPPS_GET_FILE_HEADER) (const char *pSADCFilepath, char *cid, unsigned int cidLength, char *riurl, unsigned int riurlLength);
25 typedef int (*DRM_OEM_SAPPS_GENERATE_PURCHASE_REQUEST) (const char *pSADCFilepath, char *pReqBuf, unsigned int *pReqBufLen, char *pLicenseUrl, unsigned int *pLicenseUrlLen);
26 typedef int (*DRM_OEM_SAPPS_HAS_VALID_LICENSE) (const char *szCid);
27 typedef int (*DRM_OEM_SAPPS_CONSUME_LICENSE) (const char *szCid);
28
29 /*Samsung Apps function start*/
30 typedef enum {
31         FUNC_DRM_OEM_SAPPS_GENERATE_LICENSE_REQUEST = 0,
32         FUNC_DRM_OEM_SAPPS_REGISTER_LICENSE,
33         FUNC_DRM_OEM_SAPPS_IS_DRM_FILE,
34         FUNC_DRM_OEM_SAPPS_DECRYPT_PACKAGE,
35         FUNC_DRM_OEM_SAPPS_IS_DRM_APP,
36         FUNC_DRM_OEM_SAPPS_UNINSTALL_LICENSE,
37         FUNC_DRM_OEM_SAPPS_GET_FILE_HEADER,
38         FUNC_DRM_OEM_SAPPS_GENERATE_PURCHASE_REQUEST,
39         FUNC_DRM_OEM_SAPPS_HAS_VALID_LICENSE,
40         FUNC_DRM_OEM_SAPPS_CONSUME_LICENSE,
41         FUNC_DRM_SAPPS_MAX
42 } drm_sapps_enum_t;
43
44 typedef struct {
45         DRM_OEM_SAPPS_GENERATE_LICENSE_REQUEST drm_oem_sapps_generate_license_request;
46         DRM_OEM_SAPPS_REGISTER_LICENSE drm_oem_sapps_register_license;
47         DRM_OEM_SAPPS_IS_DRM_FILE drm_oem_sapps_is_drm_file;
48         DRM_OEM_SAPPS_DECRYPT_PACKAGE drm_oem_sapps_decrypt_package;
49         DRM_OEM_SAPPS_IS_DRM_APP drm_oem_sapps_is_drm_app;
50         DRM_OEM_SAPPS_UNINSTALL_LICENSE drm_oem_sapps_uninstall_license;
51         DRM_OEM_SAPPS_GET_FILE_HEADER drm_oem_sapps_get_file_header;
52         DRM_OEM_SAPPS_GENERATE_PURCHASE_REQUEST drm_oem_sapps_generate_purchase_request;
53         DRM_OEM_SAPPS_HAS_VALID_LICENSE drm_oem_sapps_has_valid_license;
54         DRM_OEM_SAPPS_CONSUME_LICENSE drm_oem_sapps_consume_license;
55 } drm_sapps_func_t;
56
57 #endif