Wasabi ExpressPlay SDK for iOS  1.23.0
ShiEngine.h
Go to the documentation of this file.
1 /*****************************************************************
2 |
3 | Sushi - DRM Engine
4 |
5 | $Id: ShiEngine.h 8161 2016-12-27 13:28:41Z jayakeerthis $
6 | Original author: Gilles Boccon-Gibod
7 |
8 | This software is provided to you pursuant to your agreement
9 | with Intertrust Technologies Corporation ("Intertrust").
10 | This software may be used only in accordance with the terms
11 | of the agreement.
12 |
13 | Copyright (c) 2005-2014 by Intertrust. All rights reserved.
14 |
15 ****************************************************************/
21 #ifndef _SHI_ENGINE_H_
22 #define _SHI_ENGINE_H_
23 
24 /*----------------------------------------------------------------------
25 | includes
26 +---------------------------------------------------------------------*/
27 #include "ShiResults.h"
28 #include "ShiTypes.h"
29 #include "ShiInterfaces.h"
30 #include "ShiList.h"
31 #include "ShiLicense.h"
32 #include "ShiService.h"
33 #include "ShiProperties.h"
34 
35 /*----------------------------------------------------------------------
36 | error codes
37 +---------------------------------------------------------------------*/
38 #define SHI_ERROR_ENGINE_NOT_PERSONALIZED (SHI_ERROR_BASE_API_ENGINE - 0)
39 #define SHI_ERROR_ENGINE_INVALID_TEMPLATE (SHI_ERROR_BASE_API_ENGINE - 1)
40 #define SHI_ERROR_ENGINE_POST_VACUUM (SHI_ERROR_BASE_API_ENGINE - 2)
41 #define SHI_ERROR_ENGINE_NO_CONFIG_TOKEN (SHI_ERROR_BASE_API_ENGINE - 3)
42 #define SHI_ERROR_ENGINE_ALREADY_PERSONALIZED (SHI_ERROR_BASE_API_ENGINE - 4)
43 
44 /*----------------------------------------------------------------------
45 | constants
46 +---------------------------------------------------------------------*/
53 #define SHI_ENGINE_PROP_VERSION "Version"
54 #define SHI_ENGINE_PROP_BUILD_DATE "BuildDate"
55 #define SHI_ENGINE_PROP_IS_PERSONALIZED "IsPersonalized"
56 #define SHI_ENGINE_PROP_PERSONALITY "Personality"
57 #define SHI_ENGINE_PROP_HTTP_PROXY_HOST_NAME "HttpProxyHostname"
58 #define SHI_ENGINE_PROP_HTTP_PROXY_PORT "HttpProxyPort"
59 #define SHI_ENGINE_PROP_HTTP_PROXY_ENABLED "HttpProxyEnabled"
60 #define SHI_ENGINE_PROP_HTTPS_PROXY_HOST_NAME "HttpsProxyHostname"
61 #define SHI_ENGINE_PROP_HTTPS_PROXY_PORT "HttpsProxyPort"
62 #define SHI_ENGINE_PROP_HTTP_CONNECTION_TIMEOUT "HttpConnectionTimeout"
63 #define SHI_ENGINE_PROP_HTTP_IO_TIMEOUT "HttpIOTimeout"
64 #define SHI_ENGINE_PROP_PREFERRED_LANGUAGES "PreferredLanguages"
65 #define SHI_ENGINE_PROP_CACHE_POLICY "CachePolicy"
66 #define SHI_ENGINE_PROP_NEMO "Nemo"
71 typedef enum {
75 
79 #define SHI_ENGINE_VACUUM_FLAG_NODES (1)
80 #define SHI_ENGINE_VACUUM_FLAG_LINKS (2)
81 #define SHI_ENGINE_VACUUM_FLAG_SEASHELL (4)
82 #define SHI_ENGINE_VACUUM_FLAG_DONT_SAVE_RECENT_LINK (8)
83 #define SHI_ENGINE_VACUUM_FLAG_WIPE (16)
88 typedef enum {
89 
94 
95 /*----------------------------------------------------------------------
96 | types
97 +---------------------------------------------------------------------*/
101 typedef enum {
113 
117 typedef struct {
118  const char* name;
122 
126 typedef struct {
130 
135 typedef struct {
141  const void* cookie;
142 
153 
161 typedef struct {
163  const void* data;
166 
169 
173 typedef struct {
177 
195  void (*OnEvent)(SHI_EngineListener self,
196  SHI_EngineEventType type,
197  const SHI_EngineEvent* event);
198 };
199 
257 typedef struct {
261 
273  SHI_Result (*GetPersonality) (SHI_Data** perso_data);
280  SHI_Result (*GetNode) (const char* node_id,
281  SHI_Data** node_data);
292  SHI_Result (*SaveNode) (const char* node_id,
293  const char* node_type,
294  const char* node_name,
295  const char* service_id,
296  const char* data,
297  SHI_UInt32 data_size);
306  SHI_Result (*SaveLink) (const char* link_id,
307  const char* context,
308  const char* data,
309  SHI_UInt32 data_size);
312 
313 /*----------------------------------------------------------------------
314 | interfaces
315 +---------------------------------------------------------------------*/
316 #if defined(__cplusplus)
317 extern "C" {
318 #endif
319 
331 typedef struct SHI_Engine SHI_Engine;
332 
344 void*
346 
358 
369 
406  const char* token,
407  SHI_Size token_size,
408  const void* cookie);
409 
441  const char* token,
442  SHI_Size token_size,
443  const void* cookie);
444 
456 
482 SHI_Result
484  const char* token,
485  SHI_Size token_size,
486  const void* cookie);
487 
519 SHI_Result
521  const char* token,
522  SHI_Size token_size,
523  const void* cookie,
524  SHI_RegistrationDataManager* registration_data_manager);
525 
537 SHI_Result
539 
555  const char* service_id,
556  SHI_List** users);
557 
576  const char* service_id,
577  const char* user_id,
578  SHI_List** subscriptions);
579 
592 SHI_Result
593 SHI_Engine_CreateLicense(SHI_Engine* self, SHI_License** license);
594 
619 SHI_Result
621  const char* service_id,
622  SHI_UInt32 last_update,
623  const void* cookie);
624 
637 SHI_Result
639  SHI_Flags vacuum_options);
640 
657  const char* object_id,
658  SHI_Attribute** details);
659 
671  const char* object_id);
672 
685  SHI_Data** id_array);
686 
699  SHI_Data** id_array);
700 
715  const char* uri_template,
716  SHI_Data** uri);
717 
738  SHI_EngineCertChain cert_chain,
739  SHI_Data** cert_array);
740 
754 SHI_Result
755 SHI_Engine_Create(const SHI_EngineConfig* config, SHI_Engine** engine);
756 
758 #if defined(__cplusplus)
759 }
760 #endif
761 
762 #endif /* _SHI_ENGINE_H_ */
#define SHI_PUBLIC_API
Definition: ShiTypes.h:52
Event data for all SHI_ENGINE_EVENT_LICENSE_DATA_RECEIVED events.
Definition: ShiEngine.h:161
struct SHI_EngineListenerInstance SHI_EngineListenerInstance
Definition: ShiEngine.h:167
unsigned int SHI_UInt32
32-bit (or more) unsigned integer
Definition: ShiTypes.h:27
SHI_Size size
Size of the license data.
Definition: ShiEngine.h:164
Definition: ShiEngine.h:110
Broadband Services.
SHI_EngineEventInfoItems * info
Pointer to a list of information items containing details about the event.
Definition: ShiEngine.h:151
SHI_EngineEvent base
Base class.
Definition: ShiEngine.h:162
Result codes.
Recipient of event callbacks.
Definition: ShiEngine.h:173
SHI_PUBLIC_API SHI_Result SHI_Engine_ProcessServiceToken(SHI_Engine *self, const char *token, SHI_Size token_size, const void *cookie)
Requests that this engine process a service token, such as a Broadband Action Token.
struct SHI_RegistrationDataManager SHI_RegistrationDataManager
Interface implemented and passed to SHI_Engine_ProcessServiceTokenEx to modify where the SDK should g...
struct SHI_Engine SHI_Engine
A SHI_Engine object is the initial point of interaction between an application and a DRM Engine...
Definition: ShiEngine.h:331
SHI_PUBLIC_API SHI_Result SHI_Engine_VacuumData(SHI_Engine *self, SHI_Flags vacuum_options)
Removes expired data stored in Sushi's database.
const SHI_EngineEventInfoItem * items
Pointer to the list items.
Definition: ShiEngine.h:128
SHI_PUBLIC_API SHI_Result SHI_Engine_DeleteObject(SHI_Engine *self, const char *object_id)
Removes the given Octopus object from the Sushi database.
const void * cookie
Application-provided cookie that can be used to correlate method calls and related events...
Definition: ShiEngine.h:141
SHI_UInt32 SHI_Size
An unsigned integer used to represent a measurable quantity (e.g., the size of a file).
Definition: ShiTypes.h:95
Interfaces.
SHI_PUBLIC_API SHI_Result SHI_Engine_GetTrustedTime(SHI_Engine *self, SHI_DateTime *now)
Returns the current value of the trusted time.
SHI_UInt32 reference_count
Definition: ShiEngine.h:310
SHI_DataValue value
Item data value.
Definition: ShiEngine.h:120
SHI_PUBLIC_API SHI_Boolean SHI_Engine_IsPersonalized(SHI_Engine *self)
Indicates whether or not this engine has been personalized.
struct SHI_Attribute SHI_Attribute
SHI_Attribute objects represent named values that can be arranged in a tree structure.
Definition: ShiAttributes.h:110
SHI_PUBLIC_API SHI_Result SHI_Engine_EnumerateServices(SHI_Engine *self, SHI_List **services)
Gets the list of the services that are currently configured for this engine.
Information about an event received by a SHI_EngineListener.
Definition: ShiEngine.h:135
SHI_DataType type
Type of item data value.
Definition: ShiEngine.h:119
SHI_PUBLIC_API SHI_Result SHI_Engine_TransformURITemplate(SHI_Engine *self, const char *uri_template, SHI_Data **uri)
Transforms a URI template according to the "URI Templates for Marlin" specification.
Definition: ShiEngine.h:105
SHI_PUBLIC_API SHI_Result SHI_Engine_GetNodeIds(SHI_Engine *self, SHI_Data **id_array)
Gets list of all Octopus nodes known to this Sushi instance.
SHI_PUBLIC_API SHI_Result SHI_Engine_Destroy(SHI_Engine *self)
Destroys this engine object.
List of event information items.
Definition: ShiEngine.h:126
SHI_Cardinal item_count
Number of list items.
Definition: ShiEngine.h:127
Definition: ShiEngine.h:103
Definition: ShiEngine.h:107
Union of different possible types of values encapsulated by a SHI_Data object.
Definition: ShiData.h:90
SHI_PUBLIC_API SHI_Result SHI_Engine_UpdatePersonality(SHI_Engine *self, const char *token, SHI_Size token_size, const void *cookie)
Requests that this engine engage in the personality update process to renew its public credentials...
nemo signing cert and chain including trust anchor
Definition: ShiEngine.h:90
SHI_EngineCertChain
certificate chain types
Definition: ShiEngine.h:88
SHI_EngineListener listener
Recipient of event callbacks.
Definition: ShiEngine.h:259
SHI_PUBLIC_API SHI_Result SHI_Engine_ProcessServiceTokenEx(SHI_Engine *self, const char *token, SHI_Size token_size, const void *cookie, SHI_RegistrationDataManager *registration_data_manager)
Use this API instead of SHI_Engine_ProcessServiceToken if you want to overwrite the default behavior ...
SHI_DataType
Possible types of data in the value encapsulated by a SHI_Data object.
Definition: ShiData.h:37
SHI_PUBLIC_API SHI_Result SHI_Engine_EnumerateServiceUsers(SHI_Engine *self, const char *service_id, SHI_List **users)
Gets a list of service users of one or more of this engine's configured services. ...
Property Lists.
SHI_PUBLIC_API SHI_Result SHI_Engine_GetObjectDetails(SHI_Engine *self, const char *object_id, SHI_Attribute **details)
Gets the details of this Octopus object.
SHI_PUBLIC_API SHI_Result SHI_Engine_Personalize(SHI_Engine *self, const char *token, SHI_Size token_size, const void *cookie)
Requests that this engine engage in the personalization process.
SHI_PUBLIC_API SHI_Result SHI_Engine_UpdateSecurityData(SHI_Engine *self, const char *service_id, SHI_UInt32 last_update, const void *cookie)
Updates security data for a specified service configured for this engine object.
SHI_EngineListenerInstance * instance
Definition: ShiEngine.h:175
Definition: ShiEngine.h:111
const char * name
Item name.
Definition: ShiEngine.h:118
A single event information item.
Definition: ShiEngine.h:117
SHI_UInt32 SHI_Cardinal
An unsigned integer used to represent a quantity that can be counted (such as a number of elements in...
Definition: ShiTypes.h:112
Definition: ShiEngine.h:73
SHI_PUBLIC_API SHI_Result SHI_Engine_GetCertificateChain(SHI_Engine *self, SHI_EngineCertChain cert_chain, SHI_Data **cert_array)
Get the certificates of the specified certificate chain.
Definition: ShiEngine.h:102
Definition: ShiEngine.h:106
SHI_PUBLIC_API SHI_Result SHI_Engine_CreateLicense(SHI_Engine *self, SHI_License **license)
Creates a new SHI_License object managed by this engine.
SHI_PUBLIC_API SHI_Result SHI_Engine_GetLinkIds(SHI_Engine *self, SHI_Data **id_array)
Gets list of all Octopus links known to this Sushi instance.
SHI_UInt32 SHI_InterfaceId
Definition: ShiInterfaces.h:33
SHI_EngineEventType
Types of events that a SHI_EngineEventListener may receive.
Definition: ShiEngine.h:101
Definition: ShiEngine.h:72
Interface implemented and passed to SHI_Engine_ProcessServiceTokenEx to modify where the SDK should g...
Definition: ShiEngine.h:267
Definition: ShiEngine.h:104
SHI_Boolean
Boolean type used for variables that can be true (SHI_TRUE) or false (SHI_FALSE). ...
Definition: ShiTypes.h:62
Configuration passed as an argument to the SHI_Engine_Create factory function.
Definition: ShiEngine.h:257
SHI_Flags flags
Configuration flags.
Definition: ShiEngine.h:258
A date and time.
Definition: ShiTypes.h:128
SHI_PUBLIC_API SHI_Result SHI_Engine_EnumerateServiceSubscriptions(SHI_Engine *self, const char *service_id, const char *user_id, SHI_List **subscriptions)
Gets a list of subscriptions associated with one or more of the engine's configured services...
Definition: ShiEngine.h:109
Definition: ShiEngine.h:108
const SHI_EngineListenerInterface * iface
Definition: ShiEngine.h:174
const void * data
Pointer to the license data.
Definition: ShiEngine.h:163
struct SHI_List SHI_List
Definition: ShiList.h:80
struct SHI_Data SHI_Data
A SHI_Data object represents a typed data object.
Definition: ShiData.h:116
Generic Lists.
Common data types.
Definition: ShiEngine.h:92
SHI_UInt32 SHI_Flags
Type used to represent a bit pattern signifying a combination of flags that can be on or off...
Definition: ShiTypes.h:84
int SHI_Result
Signed integer value representing a function or method result (return value).
Definition: ShiTypes.h:74
SHI_PUBLIC_API SHI_Result SHI_Engine_Create(const SHI_EngineConfig *config, SHI_Engine **engine)
Creates a SHI_Engine object.
SHI_EngineCachePolicy
Caching policies.
Definition: ShiEngine.h:71
Interface implemented by an application in order to receive event notifications from a SHI_Engine...
Definition: ShiEngine.h:183
SHI_PUBLIC_API void * SHI_Engine_GetInterface(SHI_Engine *self, SHI_InterfaceId iface_id)
Obtains a pointer to a SHI_Engine object with a different interface.