4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
\r
6 * Contact: Hakjoo Ko <hakjoo.ko@samsung.com>
\r
7 * Mahendra Kumar Prajapat <mahendra.p@samsung.com>
\r
8 * Harsha Shekar <h.shekar@samsung.com>
\r
11 * Licensed under the Apache License, Version 2.0 (the "License");
\r
12 * you may not use this file except in compliance with the License.
\r
13 * You may obtain a copy of the License at
\r
15 * http://www.apache.org/licenses/LICENSE-2.0
\r
17 * Unless required by applicable law or agreed to in writing, software
\r
18 * distributed under the License is distributed on an "AS IS" BASIS,
\r
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
20 * See the License for the specific language governing permissions and
\r
21 * limitations under the License.
\r
26 * @file drm_client_types.h
\r
27 * @brief DRM Client API macros, structures & enum declaration file.
\r
28 * @author Mahendra Kumar Prajapat (mahendra.p@samsung.com)
\r
29 * @author Harsha Shekar (h.shekar@samsung.com)
\r
31 * @history 0.1: First version of DRM Client API macros,
\r
32 * structures & enum declarations.
\r
35 #ifndef __DRM_CLIENT_TYPES_H__
\r
36 #define __DRM_CLIENT_TYPES_H__
\r
40 #endif /*__cplusplus */
\r
44 #include "tizen_error.h"
\r
47 /******************************************************************/
\r
50 * Maximum Length of Author field
\r
52 #define DRM_MAX_LEN_AUTHOR (64)
\r
55 * Maximum Length of Copyright field
\r
57 #define DRM_MAX_LEN_COPYRIGHT (64)
\r
60 * Maximum Length of Description field
\r
62 #define DRM_MAX_LEN_DESCRIPTION (256)
\r
65 * Maximum Length of Icon URI field
\r
67 #define DRM_MAX_LEN_ICON_URI (256)
\r
70 * Maximum Length of Info URL field
\r
72 #define DRM_MAX_LEN_INFO_URL (256)
\r
75 * Maximum Length of Content URL field
\r
77 #define DRM_MAX_LEN_CONTENT_URL (512)
\r
80 * Maximum Length of Rights URL field
\r
82 #define DRM_MAX_LEN_RIGHTS_URL (256)
\r
85 * Maximum Length of Title field
\r
87 #define DRM_MAX_LEN_TITLE (256)
\r
90 * Maximum Length of MIME (Content Type) field
\r
92 #define DRM_MAX_LEN_MIME (64)
\r
95 * Maximum Length of Content ID field
\r
97 #define DRM_MAX_LEN_CID (256)
\r
100 * Maximum Length of Individual Identity field
\r
102 #define DRM_MAX_LEN_INDIVIDUAL_IDENTITY (64)
\r
105 * Maximum Length of System Identity field
\r
107 #define DRM_MAX_LEN_SYSTEM_IDENTITY (64)
\r
110 * Maximum Length of original filename for PlayReady envelope
\r
112 #define DRM_MAX_LEN_FILEPATH (256)
\r
115 * Maximum length of Transaction ID of the DCF
\r
117 #define DRM_MAX_SIZE_TRANSACTION_ID (17)
\r
120 * Maximum length of DivX code (Registration / De-registration code )
\r
122 #define DRM_MAX_SIZE_DIVX_CODE (16)
\r
125 * Maximum length of License Data
\r
127 #define DRM_MAX_LEN_LICENSE_DATA (3000)
\r
130 * Maximum length of Initiator URL
\r
132 #define DRM_MAX_LEN_INITIATOR_URL (512)
\r
135 * Maximum length of IP Address
\r
137 #define DRM_MAX_LEN_IP_ADDR (64)
\r
140 * Max length of APP ID
\r
142 #define DRM_MAX_LEN_APP_ID (15)
\r
145 * Max length of User ID
\r
147 #define DRM_MAX_LEN_USER_GUID (15)
\r
150 * Max length of Device ID
\r
152 #define DRM_MAX_LEN_DEVICE_ID (15)
\r
155 * Max length of Order ID
\r
157 #define DRM_MAX_LEN_ORDER_ID (23)
\r
160 * Max length of Service ID
\r
162 #define DRM_MAX_LEN_SERVICE_ID (31)
\r
165 * Max length of Account ID
\r
167 #define DRM_MAX_LEN_ACCOUNT_ID (31)
\r
169 /****************************************************************/
\r
172 * @enum drm_result_e
\r
173 * @brief DRM Return values.
\r
177 DRM_RETURN_SUCCESS = 0,
\r
178 /**< Invalid Argument */
\r
179 DRM_RETURN_INVALID_ARG = TIZEN_ERROR_INVALID_PARAMETER,
\r
180 /**< Insufficient Memory */
\r
181 DRM_RETURN_INSUFFICIENT_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,
\r
182 /**< Parsing Error */
\r
183 DRM_RETURN_PARSING_ERROR = TIZEN_ERROR_DRM_CLASS | 0x01,
\r
185 DRM_RETURN_DB_ERROR = TIZEN_ERROR_DRM_CLASS | 0x02,
\r
187 DRM_RETURN_FILE_ERROR = TIZEN_ERROR_DRM_CLASS | 0x03,
\r
188 /**< Communication Error */
\r
189 DRM_RETURN_COMMUNICATION_ERROR = TIZEN_ERROR_DRM_CLASS | 0x04,
\r
190 /**< Internal Error */
\r
191 DRM_RETURN_INTERNAL_ERROR = TIZEN_ERROR_UNKNOWN
\r
195 * @enum drm_bool_type_e
\r
196 * @brief DRM Bool values.
\r
199 DRM_FALSE = 0, /**< false */
\r
200 DRM_TRUE = 1, /**< true */
\r
201 DRM_UNKNOWN = 0xFFFFFFFF /**< error */
\r
205 * @enum drm_file_type_e
\r
206 * @brief DRM file types.
\r
209 DRM_TYPE_UNDEFINED, /**< For initialization purpose */
\r
210 DRM_TYPE_OMA_V1, /**< OMA DRM v1 file */
\r
211 DRM_TYPE_OMA_V2, /**< OMA DRM v2 file */
\r
212 DRM_TYPE_PLAYREADY, /**< PlayReady file */
\r
213 DRM_TYPE_PLAYREADY_ENVELOPE, /**< PlayReady Envelope file */
\r
214 DRM_TYPE_DIVX, /**< DivX file */
\r
215 DRM_TYPE_OMA_PD, /**< Progressive Download file */
\r
216 DRM_TYPE_PIFF, /**< PIFF file */
\r
217 DRM_TYPE_SAPPS /**< Samsung Apps */
\r
221 * @enum drm_permission_type_e
\r
222 * @brief DRM Permission types.
\r
225 DRM_PERMISSION_TYPE_NONE, /**< For initialization purpose */
\r
226 DRM_PERMISSION_TYPE_ANY, /**< Any permission */
\r
227 DRM_PERMISSION_TYPE_PLAY, /**< Play Permission */
\r
228 DRM_PERMISSION_TYPE_COLLABORATIVE_PLAY, /**< Collaborative Play
\r
229 (e.g gaming application) */
\r
231 DRM_PERMISSION_TYPE_DISPLAY, /**< Display Permission */
\r
232 DRM_PERMISSION_TYPE_EXECUTE, /**< Execute Permission */
\r
233 DRM_PERMISSION_TYPE_PRINT, /**< Print Permission */
\r
234 DRM_PERMISSION_TYPE_EXPORT_COPY, /**< Export-copy permission */
\r
235 DRM_PERMISSION_TYPE_EXPORT_MOVE /**< Export-move permission */
\r
236 } drm_permission_type_e;
\r
239 * @enum drm_license_status_e
\r
240 * @brief DRM License status.
\r
243 DRM_LICENSE_STATUS_UNDEFINED, /**< For initialization purpose */
\r
244 DRM_LICENSE_STATUS_VALID, /**< Valid License */
\r
245 DRM_LICENSE_STATUS_FUTURE_USE, /**< License for future use */
\r
246 DRM_LICENSE_STATUS_EXPIRED, /**< Expired License */
\r
247 DRM_LICENSE_STATUS_NO_LICENSE, /**< No License */
\r
248 } drm_license_status_e;
\r
251 * @enum drm_action_type_e
\r
252 * @brief DRM Action types.
\r
255 DRM_ACTION_UNDEFINED, /**< for initialization purpose */
\r
256 DRM_IS_FORWARDING_ALLOWED, /**< if a file can be forwarded */
\r
257 DRM_HAS_VALID_SETAS_STATUS, /**< if a file can be SETAS */
\r
258 DRM_IS_DEVICE_ACTIVATED, /**< if a device is DIVX activated */
\r
259 DRM_IS_VALID_SECURE_CLOCK /**< if Secure Clock is set */
\r
260 } drm_action_type_e;
\r
263 * @enum drm_method_type_e
\r
264 * @brief DRM method types.
\r
267 DRM_METHOD_TYPE_UNDEFINED, /**< For initialization purpose */
\r
268 DRM_METHOD_TYPE_FORWARD_LOCK, /**< OMA DRM forward lock */
\r
269 DRM_METHOD_TYPE_COMBINED_DELIVERY, /**< OMA DRM Combined Delivery */
\r
270 DRM_METHOD_TYPE_SEPARATE_DELIVERY /**< OMA DRM Separate Delivery
\r
272 }drm_method_type_e;
\r
275 * @enum drm_rights_version_e
\r
276 * @brief DRM Rights Version.
\r
279 DRM_OMA_DRMV1_RIGHTS, /**< OMA DRM v1 */
\r
280 DRM_OMA_DRMV2_RIGHTS, /**< OMA DRM v2 */
\r
281 DRM_UNDEFINED_RIGHTS = 3 /**< dummy */
\r
282 } drm_rights_version_e;
\r
285 * @enum drm_constraint_identity_type_e
\r
286 * @brief DRM Constraint Identity type.
\r
289 DRM_CONSTRAINT_IDENTITY_TYPE_NONE, /**< For initialization */
\r
290 DRM_CONSTRAINT_IDENTITY_TYPE_IMEI, /**< IMEI */
\r
291 DRM_CONSTRAINT_IDENTITY_TYPE_IMSI, /**< IMSI */
\r
292 DRM_CONSTRAINT_IDENTITY_TYPE_MSISDN, /**< MS-ISDN */
\r
293 DRM_CONSTRAINT_IDENTITY_TYPE_WIM /**< WIM
\r
294 (Wireless/WAP Identity Module ) */
\r
295 } drm_constraint_identity_type_e;
\r
298 * @enum drm_setas_category_e
\r
299 * @brief DRM SETAS type.
\r
302 DRM_SETAS_NONE = -1, /**< No set as operation */
\r
303 DRM_SETAS_WALLPAPER = 0, /**< Set As Wallpaper */
\r
304 DRM_SETAS_RINGTONE = 2, /**< Set As Ringtone */
\r
305 } drm_setas_category_e;
\r
308 * @enum drm_data_type_e
\r
309 * @brief DRM Requested Data types.
\r
312 /* For initialization purpose */
\r
313 DRM_DATA_TYPE_NONE = -1,
\r
315 /* Secure Clock Information */
\r
316 DRM_DATA_TYPE_SECURE_CLOCK = 0,
\r
318 /* Transaction Tracking flag status information */
\r
319 DRM_DATA_TYPE_TRANSACTION_TRACKING_FLAG,
\r
321 /* Transaction Tracking ID information */
\r
322 DRM_DATA_TYPE_TRANSACTION_TRACKING_ID,
\r
324 /* DivX Registration Code information */
\r
325 DRM_DATA_TYPE_DIVX_REGISTRATION_CODE,
\r
327 /* DivX De-registration Code information */
\r
328 DRM_DATA_TYPE_DIVX_DEREGISTRATION_CODE,
\r
332 * @enum drm_request_type_e
\r
333 * @brief DRM Request types.
\r
336 /* For initialization purpose */
\r
337 DRM_REQUEST_TYPE_NONE = -1,
\r
339 /* Request to Register DRM file in DB */
\r
340 DRM_REQUEST_TYPE_REGISTER_FILE = 0,
\r
342 /* Request to Un-register DRM file from DB */
\r
343 DRM_REQUEST_TYPE_UNREGISTER_FILE,
\r
345 /* Request to Un-register All DRM files from DB */
\r
346 DRM_REQUEST_TYPE_UNREGISTER_ALL_FILES,
\r
348 /* Request to Register / install License into DB */
\r
349 DRM_REQUEST_TYPE_REGISTER_LICENSE,
\r
351 /* Request to start Initiator processing for PlayReady */
\r
352 DRM_REQUEST_TYPE_SUBMIT_INITIATOR_URL,
\r
354 /* Submit Roap Message */
\r
355 DRM_REQUEST_TYPE_SUBMIT_ROAP_MESSAGE,
\r
357 /* Submit Roap User Consent */
\r
358 DRM_REQUEST_TYPE_SUBMIT_ROAP_USER_CONSENT,
\r
360 /* HTTP User Cancel */
\r
361 DRM_REQUEST_TYPE_HTTP_USER_CANCEL,
\r
363 /* Register Copy File */
\r
364 DRM_REQUEST_TYPE_REGISTER_COPY_FILE,
\r
366 /* Register Move File */
\r
367 DRM_REQUEST_TYPE_REGISTER_MOVE_FILE,
\r
369 /* Insert External Memory */
\r
370 DRM_REQUEST_TYPE_INSERT_EXT_MEMORY,
\r
372 /* Extract External Memory */
\r
373 DRM_REQUEST_TYPE_EXTRACT_EXT_MEMORY,
\r
375 /* Register SetAs */
\r
376 DRM_REQUEST_TYPE_REGISTER_SETAS,
\r
378 /* Unregister SetAs */
\r
379 DRM_REQUEST_TYPE_UNREGISTER_SETAS
\r
381 } drm_request_type_e;
\r
384 * @enum drm_roap_init_src_e
\r
385 * @brief DRM ROAP initialization source.
\r
389 DRM_ROAP_INIT_FROM_UNKNOWN,
\r
391 /**< roap is initialized from browser*/
\r
392 DRM_ROAP_INIT_FROM_BROWSER,
\r
394 /**< roap is initialized from DRM content */
\r
395 DRM_ROAP_INIT_FROM_CONTENT,
\r
397 /**< roap is initialized from WAPPUSH */
\r
398 DRM_ROAP_INIT_FROM_WAPPUSH
\r
399 } drm_roap_init_src_e;
\r
402 * @enum drm_operation_type_e
\r
403 * @brief DRM operation type.
\r
406 /* License Acquisition Operation */
\r
407 DRM_OPERATION_TYPE_LICENSE_ACQ,
\r
409 /* Join Domain Operation */
\r
410 DRM_OPERATION_TYPE_JOIN_DOMAIN,
\r
412 /* Leave Domain Operation */
\r
413 DRM_OPERATION_TYPE_LEAVE_DOMAIN,
\r
415 /* Metering Operation */
\r
416 DRM_OPERATION_TYPE_METERING_INFO,
\r
418 /* Unknown Operation type */
\r
419 DRM_OPERATION_TYPE_UNKNOWN
\r
420 } drm_operation_type_e;
\r
423 * @enum drm_operation_status_e
\r
424 * @brief DRM operation status.
\r
427 /** DRM operation is started */
\r
428 DRM_OPERATION_STATUS_STARTED,
\r
430 /** DRM operation is in Progress */
\r
431 DRM_OPERATION_STATUS_INPROGRESS,
\r
433 /** DRM operation is Completed */
\r
434 DRM_OPERATION_STATUS_COMPLETED,
\r
436 /** During DRM operation, additional operation is to be performed */
\r
437 DRM_OPERATION_STATUS_ADDITIONAL_INFO,
\r
439 /** An error occurred with respect to DRM operation */
\r
440 DRM_OPERATION_STATUS_ERROR
\r
441 } drm_operation_status_e;
\r
444 * @enum drm_web_server_result_code_e
\r
445 * @brief DRM Return values.
\r
448 /** No server Error */
\r
449 DRM_RESULT_CODE_NONE,
\r
451 /** Device Certificate is revoked.
\r
452 * User shall be informed that their device needs to be updated.
\r
454 DRM_RESULT_CODE_DEVCERT_REVOKED,
\r
456 /** Indicates a server problem.Device shall silently retry 3 times.
\r
457 * If failure persists, user shall be informed about a server failure
\r
458 * and to try again later
\r
460 DRM_RESULT_CODE_INTERNAL_ERROR,
\r
462 /** Means an invalid protocol message.
\r
463 * This shall never happen unless there's been a "man in the middle"
\r
464 * attack. Device shall perform a retry.
\r
466 DRM_RESULT_CODE_INVALID_MESSAGE,
\r
468 /** Means that the device limit has been reached for this domain and
\r
469 * therefore the device cannot join this Domain.
\r
470 * The application on the device shall provide the appropriate
\r
471 * response to the end user.
\r
473 DRM_RESULT_CODE_DEVICE_LIMIT_REACHED,
\r
475 /** Indicates that the device shall join a Domain and then
\r
476 * retry license acquisition.
\r
478 DRM_RESULT_CODE_DOMAIN_REQUIRED,
\r
480 /** Indicates that the device shall renew the Domain Certificate
\r
481 * for this Domain. The device shall join Domain and then retry
\r
482 * license acquisition.
\r
484 DRM_RESULT_CODE_RENEW_DOMAIN,
\r
486 /** Device shall leave Domain */
\r
487 DRM_RESULT_CODE_NOT_A_MEMBER,
\r
489 /** Means that device is not using correct protocol, most likely
\r
490 * because server has been updated since device was manufactured.
\r
491 * The device shall notify user to check for updates or fail gracefully.
\r
493 DRM_RESULT_CODE_PROTOCOL_VERSION_MISMATCH,
\r
495 /** User shall always be authenticated before making license acquisitions.
\r
496 * If this error happens, device shall notify user to contact
\r
497 * customer service.
\r
499 DRM_RESULT_CODE_UNKNOWN_ACCOUNTID,
\r
501 /** Device shall follow redirect. */
\r
502 DRM_RESULT_CODE_PROTOCOL_REDIRECT,
\r
504 /** Service specific Server errors */
\r
505 DRM_RESULT_CODE_SERVICE_SPECIFIC,
\r
506 } drm_web_server_result_code_e;
\r
509 * @enum drm_initiator_type
\r
510 * @brief DRM Initiator type
\r
513 DRM_INITIATOR_TYPE_NONE = -1,
\r
514 DRM_INITIATOR_TYPE_INITIATOR_URL = 0,
\r
515 DRM_INITIATOR_TYPE_LICENSE_ACQ,
\r
516 DRM_INITIATOR_TYPE_JOIN_DOMAIN,
\r
517 DRM_INITIATOR_TYPE_LEAVE_DOMAIN
\r
518 } drm_initiator_type;
\r
521 * @enum drm_const_type_e
\r
522 * @brief DRM constraint types
\r
525 DRM_CONSTRAINT_TYPE_RENTAL = 0,
\r
526 DRM_CONSTRAINT_TYPE_RENTAL_UNLIMITED,
\r
527 DRM_CONSTRAINT_TYPE_PURCHASE,
\r
528 DRM_CONSTRAINT_TYPE_BASE,
\r
529 DRM_CONSTRAINT_TYPE_EXPIRED,
\r
530 DRM_CONSTRAINT_TYPE_NOT_AUTHORIZED,
\r
531 DRM_CONSTRAINT_TYPE_INVALID_DRM_VERSION,
\r
532 DRM_CONSTRAINT_TYPE_UNKNOWN_TYPE,
\r
533 DRM_CONSTRAINT_TYPE_GENERAL_ERROR
\r
534 } drm_const_type_e;
\r
537 * @struct drm_content_info_s
\r
538 * @brief DRM content info structure.
\r
541 /**< Author of original content */
\r
542 char author[DRM_MAX_LEN_AUTHOR];
\r
544 /**< Copyright information */
\r
545 char copyright[DRM_MAX_LEN_COPYRIGHT];
\r
547 /**< Content information */
\r
548 char description[DRM_MAX_LEN_DESCRIPTION];
\r
550 char icon_uri[DRM_MAX_LEN_ICON_URI]; /**< Icon URI */
\r
551 char info_url[DRM_MAX_LEN_INFO_URL]; /**< Information URL */
\r
552 char content_url[DRM_MAX_LEN_CONTENT_URL]; /**< Content URL */
\r
553 char rights_url[DRM_MAX_LEN_RIGHTS_URL]; /**< Rights URL */
\r
554 char title[DRM_MAX_LEN_TITLE]; /**< Content Title */
\r
556 /**< Original MIME type */
\r
557 char mime_type[DRM_MAX_LEN_MIME];
\r
558 char content_id[DRM_MAX_LEN_CID]; /**< Content ID */
\r
560 } drm_content_info_s;
\r
563 * @struct drm_file_oma_info_s
\r
564 * @brief DRM (OMA)file info structure.
\r
567 drm_rights_version_e version; /**< OMA DRM Rights Version */
\r
568 drm_method_type_e method; /**< OMA DRM Method type */
\r
569 }drm_file_oma_info_s;
\r
572 * @struct drm_file_pr_env_info_s
\r
573 * @brief DRM (PlayReady Envelope)file info structure.
\r
576 /**< Original content file name inside Playready - Envelope Contents */
\r
577 char org_file_name[DRM_MAX_LEN_FILEPATH];
\r
579 /**< Original content file size inside Playready - Envelope Contents */
\r
580 unsigned int org_file_size;
\r
581 }drm_file_pr_env_info_s;
\r
584 * @struct drm_file_sapps_info_s
\r
585 * @brief DRM (SAPPS)file info structure.
\r
588 char content_id[DRM_MAX_LEN_CID]; /**< Content ID */
\r
589 char rights_url[DRM_MAX_LEN_RIGHTS_URL]; /**< Rights URL */
\r
590 } drm_file_sapps_info_s;
\r
593 * @struct drm_file_info_s
\r
594 * @brief DRM file info structure.
\r
597 drm_file_oma_info_s oma_info; /**< OMA DRM file info */
\r
598 drm_file_pr_env_info_s pr_env_info; /**< PlayReady
\r
599 Envelope file info */
\r
600 drm_file_sapps_info_s sapps_info; /**< SAPPS file info */
\r
604 * @struct drm_constraint_type_s
\r
605 * @brief DRM Constraint type structure.
\r
608 int is_unlimited; /**< Unlimited constraints */
\r
609 int is_count; /**< Count constraint present/not present */
\r
610 int is_datetime; /**< Datetime constraint present/not present */
\r
611 int is_interval; /**< Interval constraint present/not present */
\r
612 int is_timedcount; /**< TimedCount constraint present/not present */
\r
613 int is_accumulated; /**< Accumulated constraint present/not present */
\r
614 int is_individual; /**< Individual constraint present/not present */
\r
615 int is_system; /**< System constraint present/not present */
\r
616 drm_const_type_e constraint_type; /**< Divx constraint types */
\r
617 } drm_constraint_type_s;
\r
620 * @struct drm_constraint_info_s
\r
621 * @brief DRM Constraint info structure.
\r
625 /**< Constraint type*/
\r
626 drm_constraint_type_s const_type;
\r
628 /**< Original Count */
\r
629 int original_count;
\r
631 /**< Remaining Count */
\r
632 int remaining_count;
\r
636 * As per definition of struct tm:-
\r
637 * int tm_sec seconds [0,61]
\r
638 * int tm_min minutes [0,59]
\r
639 * int tm_hour hour [0,23]
\r
640 * int tm_mday day of month [1,31]
\r
641 * int tm_mon month of year [0,11]
\r
642 * int tm_year years since 1900
\r
643 * int tm_wday day of week [0,6] (Sunday = 0)
\r
644 * int tm_yday day of year [0,365]
\r
645 * int tm_isdst daylight savings flag
\r
649 /* if tm_year = 109 then it means actual year = 109 + 1900 = 2009
\r
650 * if tm_mon = 0 then it means actual month = 0 + 1 = 1 = January
\r
651 * if tm_mon = 1 then it means actual month = 1 + 1 = 2 = Feb
\r
652 * Other parameters doesn't need any manipulation
\r
653 * if tm_mday = 5 then it means day of the month = 5
\r
655 struct tm start_time;
\r
659 * As per definition of struct tm:-
\r
660 * int tm_sec seconds [0,61]
\r
661 * int tm_min minutes [0,59]
\r
662 * int tm_hour hour [0,23]
\r
663 * int tm_mday day of month [1,31]
\r
664 * int tm_mon month of year [0,11]
\r
665 * int tm_year years since 1900
\r
666 * int tm_wday day of week [0,6] (Sunday = 0)
\r
667 * int tm_yday day of year [0,365]
\r
668 * int tm_isdst daylight savings flag
\r
672 /* if tm_year = 109 then it means actual year = 109 + 1900 = 2009
\r
673 * if tm_mon = 0 then it means actual month = 0 + 1 = 1 = January
\r
674 * if tm_mon = 1 then it means actual month = 1 + 1 = 2 = Feb
\r
675 * Other parameters doesn't need any manipulation
\r
676 * if tm_mday = 5 then it means day of the month = 5
\r
678 struct tm end_time;
\r
680 /**< Interval Time */
\r
682 * In interval time calculation, no need to manipulate it.
\r
683 * e.g if tm_year = 109 then it means actual year = 109.
\r
684 * It means license constraint says that content can be consumed in 109 years.
\r
694 * It means content has validity for 1 year, 1 hour, 1 minute & 40 seconds.
\r
696 struct tm interval_time;
\r
698 /**< Timed original count */
\r
699 int timed_original_count;
\r
701 /**< Timed Remaining count */
\r
702 int timed_remaining_count;
\r
704 /**< Timer attribute of Timed-count constraint */
\r
705 int timed_count_timer;
\r
707 /**< Accumulated original time in seconds */
\r
708 int accumulated_original_seconds;
\r
710 /**< Accumulated remaining time in seconds */
\r
711 int accumulated_remaining_seconds;
\r
713 /**< individual identity type */
\r
714 drm_constraint_identity_type_e individual_identity_type;
\r
716 /**< individual identity */
\r
717 char individual_id[DRM_MAX_LEN_INDIVIDUAL_IDENTITY];
\r
719 /**< system identity type */
\r
720 drm_constraint_identity_type_e system_identity_type;
\r
722 /**< system identity */
\r
723 char system_id[DRM_MAX_LEN_SYSTEM_IDENTITY];
\r
724 } drm_constraint_info_s;
\r
727 * @struct drm_action_allowed_data_s
\r
728 * @brief DRM Action Allowed structure.
\r
732 char file_path[DRM_MAX_LEN_FILEPATH];
\r
733 /**< Additional input data */
\r
735 }drm_action_allowed_data_s;
\r
738 * @struct drm_secure_clock_data_s
\r
739 * @brief DRM secure clock data structure.
\r
742 /** Flag to inform whether secure clock is SET or NOT SET
\r
743 * is_secure_clock_set = 0 => Secure clock NOT SET.
\r
744 * is_secure_clock_set = 1 => Secure clock is SET.
\r
746 int is_secure_clock_set;
\r
748 /** Secure clock data */
\r
749 struct tm secure_clock;
\r
750 }drm_secure_clock_data_s;
\r
753 * @struct drm_transaction_id_info_s
\r
754 * @brief DRM Transaction tracking ID structure.
\r
757 /* transaction ID value*/
\r
758 char tr_id[DRM_MAX_SIZE_TRANSACTION_ID];
\r
761 * length of Transaction ID string.
\r
762 * The value zero(0) indicates that transaction id is not available
\r
764 unsigned int tr_id_len;
\r
765 }drm_transaction_id_info_s;
\r
768 * @struct drm_code_info_s
\r
769 * @brief DRM DivX (Registration / De-registration)Code information structure.
\r
773 char code[DRM_MAX_SIZE_DIVX_CODE];
\r
777 * The value zero(0) indicates that Code is not available.
\r
779 unsigned int code_len;
\r
783 * @struct drm_unregister_info_s
\r
784 * @brief DRM Unregister Information structure.
\r
787 /** file path to be unregistered */
\r
788 char file_path[DRM_MAX_LEN_FILEPATH];
\r
791 * Flag to inform whether license also need to be removed
\r
792 * remove_license = 0 => Do not remove License.
\r
793 * remove_license = 1 => Remove License.
\r
795 int remove_license;
\r
796 }drm_unregister_info_s;
\r
799 * @struct drm_user_operation_info_s
\r
800 * @brief DRM operation information structure.
\r
803 /** Type of OPERATION */
\r
804 drm_operation_type_e operation_type;
\r
806 /** Status of OPERATION */
\r
807 drm_operation_status_e operation_status;
\r
808 } drm_user_operation_info_s;
\r
811 * Function pointer to handle DRM operation notifications
\r
813 * @param[out] operation_info operation information .
\r
814 * @param[out] output_data Output data specific to operation.
\r
819 typedef void (*drm_operation_cb)(drm_user_operation_info_s *operation_info,
\r
820 void *output_data);
\r
823 * @struct drm_operation_cb_s
\r
824 * @brief DRM Operation callback structure.
\r
825 * @remark Currently one member but new callback can be added depending on
\r
830 drm_operation_cb callback;
\r
831 }drm_operation_cb_s;
\r
834 * @struct drm_register_lic_info_s
\r
835 * @brief DRM License register Information structure.
\r
838 /** Pointer to license buffer data */
\r
839 unsigned char lic_data[DRM_MAX_LEN_LICENSE_DATA];
\r
841 /** license buffer data length */
\r
842 unsigned int lic_data_len;
\r
844 /** license version (OMA DRM v1 or OMA DRM v2) */
\r
845 drm_rights_version_e lic_version;
\r
847 /** Source of ROAP Initialization */
\r
848 drm_roap_init_src_e roap_init_src;
\r
850 /** Callback for status update */
\r
851 drm_operation_cb_s operation_callback;
\r
852 }drm_register_lic_info_s;
\r
855 * @struct drm_register_lic_resp_s
\r
856 * @brief DRM License register Output parameter.
\r
861 char cid[DRM_MAX_LEN_CID];
\r
863 }drm_register_lic_resp_s;
\r
866 * @struct drm_custom_data_info_s
\r
867 * @brief DRM Custom Data Information.
\r
870 char app_id[DRM_MAX_LEN_APP_ID + 1]; /** App ID */
\r
871 char user_guid[DRM_MAX_LEN_USER_GUID +1]; /** User GID */
\r
872 char device_id[DRM_MAX_LEN_DEVICE_ID + 1]; /** Device ID */
\r
873 char order_id[DRM_MAX_LEN_ORDER_ID + 1]; /** Order ID */
\r
874 char service_id[DRM_MAX_LEN_SERVICE_ID + 1]; /** Service ID */
\r
875 char account_id[DRM_MAX_LEN_ACCOUNT_ID + 1]; /** Account ID */
\r
876 } drm_custom_data_info_s;
\r
879 * @struct drm_initiator_info_s
\r
880 * @brief DRM License Initiator Information structure.
\r
883 /** Pointer to Initiator URL */
\r
884 char initiator_url[DRM_MAX_LEN_INITIATOR_URL];
\r
886 /** Initiator URL length */
\r
887 unsigned int initiator_url_len;
\r
889 /** Callback for status update */
\r
890 drm_operation_cb_s operation_callback;
\r
892 /** Initiator Type */
\r
893 drm_initiator_type init_type;
\r
896 drm_custom_data_info_s custom_data;
\r
897 }drm_initiator_info_s;
\r
900 * @struct drm_web_server_resp_data_s
\r
901 * @brief DRM Web Server Response Data After submitting Initiator URL Information.
\r
904 /** Content URL. Application can download content using this URL if available*/
\r
905 char content_url[DRM_MAX_LEN_CONTENT_URL];
\r
907 /** Server Result Code */
\r
908 drm_web_server_result_code_e result_code;
\r
909 } drm_web_server_resp_data_s;
\r
912 * Function pointer to handle DRM Roap Notifications
\r
914 * @param[out] cbParam Parameter
\r
915 * @param[out] appSessionData Application Session Data
\r
916 * @param[out] agentSessionData DRM Agent Session Data
\r
921 typedef void (*drm_roap_service_cb) (void *cbParam, /**<parameter */
\r
922 void *appSessionData, /**<application session data */
\r
923 void *agentSessionData /**<DRM agent session data */
\r
927 * Type Definition Template
\r
929 typedef drm_roap_service_cb drm_roap_notify_cb;
\r
931 * Type Definition Template
\r
933 typedef drm_roap_service_cb drm_roap_consent_cb;
\r
935 * Type Definition Template
\r
937 typedef drm_roap_service_cb drm_roap_result_cb;
\r
940 * @struct drm_roap_notification_cb_s
\r
941 * @brief DRM Roap Notification callback structure.
\r
944 drm_roap_notify_cb progressNotify; /** Progress Notify */
\r
945 drm_roap_consent_cb userConsent; /** User Consent */
\r
946 drm_roap_result_cb roapResult; /** Roap Result */
\r
947 } drm_roap_notification_cb_s;
\r
950 * Function pointer to handle Start of Content download
\r
952 * @param[out] appSessionData App Session Data.
\r
957 typedef int (*drm_content_start_download_cb) (void *appSessionData);
\r
960 * Function pointer to handle Progress of ODF download
\r
962 * @param[out] pData Data
\r
963 * @param[out] DataLen Data length
\r
964 * @param[out] appSessionData App Session Data.
\r
969 typedef int (*drm_content_progress_download_cb) (const void *pData,
\r
970 unsigned int DataLen,
\r
971 void *appSessionData);
\r
974 * Function pointer to handle Start of ODF download
\r
976 * @param[out] appSessionData App Session Data.
\r
981 typedef int (*drm_content_finish_download_cb) (void *appSessionData);
\r
984 * @struct drm_roap_notification_cb_s
\r
985 * @brief DRM Roap Notification callback structure.
\r
988 drm_content_start_download_cb start_download_cb; /** Start Download */
\r
989 drm_content_progress_download_cb progress_download_cb; /** Progress Download */
\r
990 drm_content_finish_download_cb finish_download_cb; /** Finish Download */
\r
991 } drm_content_download_cb_s;
\r
994 * @struct drm_appsession_datatype_s
\r
995 * @brief DRM Application Session Datatype structure.
\r
998 int profileID; /** Profile ID */
\r
999 int is_progressive_download; /** Is Progressive Download */
\r
1000 char pProxyAddress[DRM_MAX_LEN_IP_ADDR]; /** Proxy Address */
\r
1001 drm_content_download_cb_s content_download_cb; /** Content Download callback */
\r
1002 unsigned int size_pData; /** Size of additional data */
\r
1003 void *pData; /** Additional Data */
\r
1004 } drm_appsession_datatype_s;
\r
1007 * @struct drm_submit_roap_message_info_s
\r
1008 * @brief DRM Submit Roap Message Info
\r
1011 unsigned char* buffer; /** Buffer that contains Trigger of PDU data */
\r
1012 unsigned int buff_size; /** Buffer size */
\r
1013 drm_roap_notification_cb_s roap_notify; /** Roap Notification callback */
\r
1014 drm_roap_init_src_e roap_initiator; /** Roap Initiator */
\r
1015 drm_appsession_datatype_s app_session_data; /** App Session Data */
\r
1016 } drm_submit_roap_message_info_s;
\r
1019 * @struct drm_submit_roap_user_content_info_s
\r
1020 * @brief DRM Submit Roap User Consent Info
\r
1023 drm_bool_type_e bConsent; /** Result of User Consent */
\r
1025 drm_bool_type_e bAddToTrustedWhiteList; /** Result of User Consent */
\r
1027 unsigned int size_agentdata; /** Size of Agent Data */
\r
1029 /** Specifies the pointer points to a ROAP session information that is used by DRM.
\r
1030 * Must deliver agentData received through Callback completely intact
\r
1033 } drm_submit_roap_user_consent_info_s;
\r
1036 * @struct drm_http_user_cancel_info_s
\r
1037 * @brief DRM HTTP User Cancel Info
\r
1040 unsigned int size_app_session_data; /** Size of App Session Data */
\r
1041 void *app_session_data; /** App Session Data */
\r
1042 } drm_http_user_cancel_info_s;
\r
1045 * @struct drm_register_copy_file_info_s
\r
1046 * @brief DRM Register Copy file Info.
\r
1049 char src_file_path[DRM_MAX_LEN_FILEPATH]; /** Source File Path */
\r
1050 char dest_file_path[DRM_MAX_LEN_FILEPATH]; /** Destination File Path */
\r
1051 } drm_register_copy_file_info_s;
\r
1054 * @struct drm_register_move_file_info_s
\r
1055 * @brief DRM Register Move file Info.
\r
1058 char src_file_path[DRM_MAX_LEN_FILEPATH]; /** Source File Path */
\r
1059 char dest_file_path[DRM_MAX_LEN_FILEPATH]; /** Destination File Path */
\r
1060 } drm_register_move_file_info_s;
\r
1063 * @struct drm_register_setas_info_s
\r
1064 * @brief DRM Register SetAs Info.
\r
1067 char file_path[DRM_MAX_LEN_FILEPATH]; /** Source File Path */
\r
1068 drm_setas_category_e setas_cat; /** SetAs Category */
\r
1069 } drm_register_setas_info_s;
\r
1072 * @struct drm_register_setas_resp_data_s
\r
1073 * @brief DRM Stack Response Data containing the GMT expiry
\r
1074 * time corresponding to a given content
\r
1077 struct tm time_expiry; /** Expiry time*/
\r
1078 } drm_register_setas_resp_data_s;
\r
1080 * @struct drm_unregister_setas_info_s
\r
1081 * @brief DRM Unregister SetAs Info.
\r
1084 char file_path[DRM_MAX_LEN_FILEPATH]; /** Source File Path */
\r
1085 drm_setas_category_e setas_cat; /** SetAs Category */
\r
1086 } drm_unregister_setas_info_s;
\r
1088 #ifdef __cplusplus
\r
1090 #endif /* __cplusplus */
\r
1092 #endif /*__DRM_CLIENT_TYPES_H__ */
\r