CloudPlugin.h
3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef __CLOUD_PLUG_IN_H__
#define __CLOUD_PLUG_IN_H__
#include "vmsys.h"
#define SRV_CLOUD_NAME_LEN (64)
#define SRV_CLOUD_URL_LEN (256)
#define CLOUD_PLUGIN_FEATURE_TOTAL (8)
#define CLOUD_PLUGIN_NAME_SIZE (64)
/* feature */
#define CLOUD_PLUGIN_FEATURE_TYPE_CONTACT_BACKUP_RESTORE 0x0001 //
#define CLOUD_PLUGIN_FEATURE_TYPE_SMS_BACKUP_RESTORE 0x0002 //
#define CLOUD_PLUGIN_FEATURE_TYPE_EMAIL_REFRESH 0x0004 //
/* protocol */
#define CLOUD_PLUGIN_PROTOCOL_TYPE_HTTP 0x00010000
#define CLOUD_PLUGIN_PROTOCOL_TYPE_HTTPS 0x00020000
#define CLOUD_PLUGIN_PROTOCOL_IMAP 0x00040000
#define CLOUD_PLUGIN_PROTOCOL_CARDDAV 0x00080000
#define CLOUD_PLUGIN_PROTOCOL_SMTP 0x00100000 //
#define CLOUD_PLUGIN_PATH "%c:\\mre_cloud\\"
#define CLOUD_PLUGIN_TARGET_EXT L"*.vpp"
#define CLOUD_PLUGIN_MODIS_EXT L"*.dll"
typedef enum
{
CLOUD_PLUGIN_SEC_NONE = 0,
CLOUD_PLUGIN_SEC_SSL_TLS,
CLOUD_PLUGIN_SEC_STARTTLS,
CLOUD_PLUGIN_SEC_TOTAL
} cloud_plugin_sec_mode_enum;
typedef struct
{
VMUINT32 features; //format: FEATURE | PROTOCOL
VMUINT8 d_name_space[SRV_CLOUD_NAME_LEN]; // the normal namespace of the server.
VMUINT8 c_name_space[SRV_CLOUD_NAME_LEN]; // the collect namespace of the server.
VMUINT8 user_agent[SRV_CLOUD_NAME_LEN]; // the user agent.
VMUINT8 server[SRV_CLOUD_URL_LEN]; // the server address.
VMUINT8 url[SRV_CLOUD_URL_LEN]; // the contact url on the server.
VMUINT16 port_num; // the port number
cloud_plugin_sec_mode_enum sec_mode; // the security mode
}cloud_plugin_server_info_struct;
typedef struct
{
VMUINT32 id;
cloud_plugin_server_info_struct server[CLOUD_PLUGIN_FEATURE_TOTAL]; //format: FEATURE | PROTOCOL
}cloud_plugin_provider_struct;
/******************************************************************************
* FUNCTION
* cloud_plugin_get_data_account
* DESCRIPTION
* get data account.
* PARAMETERS
* provider: [IN] the provider id of service vendor,
* account_id: [OUT] data account used to access network
* RETURNS
* return 0 if success, otherwise < 0.
******************************************************************************/
typedef VMINT ( * cloud_plugin_get_data_account_func)(VMUINT32 provider, VMUINT32 * account_id );
VMINT cloud_plugin_get_data_account(VMUINT32 provider, VMUINT32 * account_id );
/********************************************************************************
* FUNCTION
* cloud_plugin_get_provider_features
* DESCRIPTION
* get service type which provider can support.
* PARAMETERS
* info: [OUT] information of provider
* RETURNS
*
*********************************************************************************/
typedef void (*cloud_plugin_manifest_func)(cloud_plugin_provider_struct * );
void cloud_plugin_manifest(
cloud_plugin_provider_struct *info
);
#endif //__CLOUD_PLUG_IN_H__