Home | History | Annotate | Download | only in objmng
      1 /*
      2  * Copyright (C) 2007 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef __DRM_INNER_H__
     18 #define __DRM_INNER_H__
     19 
     20 #ifdef __cplusplus
     21 extern "C" {
     22 #endif
     23 
     24 #include <drm_common_types.h>
     25 
     26 #define INT_2_YMD_HMS(year, mon, day, date, hour, min, sec, time) do{\
     27     year = date / 10000;\
     28     mon = date % 10000 / 100;\
     29     day = date %100;\
     30     hour = time / 10000;\
     31     min = time % 10000 / 100;\
     32     sec = time % 100;\
     33 }while(0)
     34 
     35 /**
     36  * Define the max malloc length for a DRM.
     37  */
     38 #define DRM_MAX_MALLOC_LEN          (50 * 1024) /* 50K */
     39 
     40 #define DRM_ONE_AES_BLOCK_LEN       16
     41 #define DRM_TWO_AES_BLOCK_LEN       32
     42 
     43 typedef struct _T_DRM_DM_Binary_Node {
     44     uint8_t boundary[256];
     45 } T_DRM_DM_Binary_Node;
     46 
     47 typedef struct _T_DRM_DM_Base64_Node {
     48     uint8_t boundary[256];
     49     uint8_t b64DecodeData[4];
     50     int32_t b64DecodeDataLen;
     51 } T_DRM_DM_Base64_Node;
     52 
     53 typedef struct _T_DRM_Dcf_Node {
     54     uint8_t rightsIssuer[256];
     55     int32_t encContentLength;
     56     uint8_t aesDecData[16];
     57     int32_t aesDecDataLen;
     58     int32_t aesDecDataOff;
     59     uint8_t aesBackupBuf[16];
     60     int32_t bAesBackupBuf;
     61 } T_DRM_Dcf_Node;
     62 
     63 typedef struct _T_DRM_Session_Node {
     64     int32_t sessionId;
     65     int32_t inputHandle;
     66     int32_t mimeType;
     67     int32_t (*getInputDataLengthFunc)(int32_t inputHandle);
     68     int32_t (*readInputDataFunc)(int32_t inputHandle, uint8_t* buf, int32_t bufLen);
     69     int32_t (*seekInputDataFunc)(int32_t inputHandle, int32_t offset);
     70     int32_t deliveryMethod;
     71     int32_t transferEncoding;
     72     uint8_t contentType[64];
     73     int32_t contentLength;
     74     int32_t contentOffset;
     75     uint8_t contentID[256];
     76     uint8_t* rawContent;
     77     int32_t rawContentLen;
     78     int32_t bEndData;
     79     uint8_t* readBuf;
     80     int32_t readBufLen;
     81     int32_t readBufOff;
     82     void* infoStruct;
     83     struct _T_DRM_Session_Node* next;
     84 } T_DRM_Session_Node;
     85 
     86 #ifdef __cplusplus
     87 }
     88 #endif
     89 
     90 #endif /* __DRM_INNER_H__ */
     91