00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00034 #ifndef EXGMGR_PRV_H_
00035 #define EXGMGR_PRV_H_
00036
00037 #include <unistd.h>
00038 #include <hiker/exgmgr.h>
00039
00040 #ifdef __cplusplus
00041 extern "C"
00042 {
00043 #endif
00044
00045
00046 #define ALP_EXG_DAEMON_SOCKET_NAME "/tmp/alp_exg_mgr_daemon_socket"
00047
00048
00049 #define ALP_EXG_DAEMON_MSG_OPCODE_REGISTER_HANDLER 1
00050 #define ALP_EXG_DAEMON_MSG_OPCODE_UNREGISTER_HANDLER 2
00051 #define ALP_EXG_DAEMON_MSG_OPCODE_RECEIVE_REQUEST 3
00052 #define ALP_EXG_DAEMON_MSG_OPCODE_IS_ALIVE 4
00053 #define ALP_EXG_DAEMON_MSG_OPCODE_REGISTER_HANDLER_NOTIFICATION 5
00054 #define ALP_EXG_DAEMON_MSG_OPCODE_UNREGISTER_HANDLER_NOTIFICATION 6
00055 #define ALP_EXG_DAEMON_MSG_OPCODE_QUERY_GENERIC_VERBS 7
00056 #define ALP_EXG_DAEMON_MSG_OPCODE_CHECK_HANDLER_REGISTRATION 8
00057 #define ALP_EXG_DAEMON_MSG_OPCODE_CANCEL_REQUEST 9
00058 #define ALP_EXG_DAEMON_MSG_OPCODE_GET_GUID 10
00059
00060
00061 typedef struct _AlpExgMgrdMessageType AlpExgMgrdMessageType;
00062 struct _AlpExgMgrdMessageType {
00063 int itsOpcode;
00064 union
00065 {
00066 struct _register_handler_bundle
00067 {
00068 char itsVerb[ALP_EXGMGR_VERB_MAXLEN + 1];
00069 char itsLocalizedVerb[ALP_EXGMGR_LOCALIZED_VERB_MAXLEN + 1];
00070 char itsMIMEType[ALP_EXGMGR_MIMETYPE_MAXLEN + 1];
00071 char itsHandlerBundleName[ALP_EXGMGR_PACKAGENAME_MAXLEN + 1];
00072 int itsLocalOnly;
00073 int itsSerializeMe;
00074 int itsMustBeUnique;
00075 int itsAcceptGenericInvocation;
00076 } register_handler_bundle;
00077
00078 struct _register_handler_notification
00079 {
00080 char itsVerb[ALP_EXGMGR_VERB_MAXLEN + 1];
00081 char itsLocalizedVerb[ALP_EXGMGR_LOCALIZED_VERB_MAXLEN + 1];
00082 char itsMIMEType[ALP_EXGMGR_MIMETYPE_MAXLEN + 1];
00083 char itsHandlerNotificationType[ALP_EXGMGR_NOTIFICATIONTYPE_MAXLEN + 1];
00084 int itsLocalOnly;
00085 int itsSerializeMe;
00086 int itsMustBeUnique;
00087 int itsAcceptGenericInvocation;
00088 } register_handler_notification;
00089
00090 struct _unregister_handler
00091 {
00092 char itsVerb[ALP_EXGMGR_VERB_MAXLEN + 1];
00093 char itsMIMEType[ALP_EXGMGR_MIMETYPE_MAXLEN + 1];
00094 char itsHandlerBundleName[ALP_EXGMGR_PACKAGENAME_MAXLEN + 1];
00095 } unregister_handler;
00096
00097 struct _unregister_handler_notification
00098 {
00099 char itsVerb[ALP_EXGMGR_VERB_MAXLEN + 1];
00100 char itsMIMEType[ALP_EXGMGR_MIMETYPE_MAXLEN + 1];
00101 char itsHandlerNotificationType[ALP_EXGMGR_NOTIFICATIONTYPE_MAXLEN + 1];
00102 } unregister_handler_notification;
00103
00104 struct _check_handler_registration
00105 {
00106 char itsVerb[ALP_EXGMGR_VERB_MAXLEN + 1];
00107 char itsMIMEType[ALP_EXGMGR_MIMETYPE_MAXLEN + 1];
00108 } check_handler_registration;
00109
00110 struct _query_generic_verbs
00111 {
00112 char itsMIMEType[ALP_EXGMGR_MIMETYPE_MAXLEN + 1];
00113 } query_generic_verbs;
00114
00115 struct _receive_request
00116 {
00117 AlpExgRequest itsRequestId;
00118 } receive_request;
00119
00120 struct _cancel_request
00121 {
00122 int itsGuid;
00123 } cancel_request;
00124 } params;
00125 };
00126
00127
00128 typedef struct _AlpExgMgrdMessageReplyType AlpExgMgrdMessageReplyType;
00129 struct _AlpExgMgrdMessageReplyType {
00130 alp_status_t itsReplyStatus;
00131 union
00132 {
00133 struct _get_request_guid
00134 {
00135 int itsRequestGuid;
00136 } get_request_guid;
00137 } params;
00138 };
00139
00140
00141 typedef struct _AlpExgMgrdMessageOrReplyType AlpExgMgrdMessageOrReplyType;
00142 struct _AlpExgMgrdMessageOrReplyType {
00143 union
00144 {
00145 AlpExgMgrdMessageType itsMsg;
00146 AlpExgMgrdMessageReplyType itsReply;
00147 } params;
00148 };
00149
00150
00151
00152
00153
00154 #define ALP_EXGMGR_OBEX_OBJECT_COUNT "obex_legacy_count"
00155
00156 #define ALP_EXGMGR_OBEX_OBJECT_FILE_BASE "obex_legacy_file0"
00157 #define ALP_EXGMGR_OBEX_OBJECT_FILE_2ND "obex_legacy_file1"
00158
00159 #define ALP_EXGMGR_OBEX_OBJECT_TYPE_BASE "obex_legacy_type0"
00160
00161 #define ALP_EXGMGR_OBEX_OBJECT_DESC_BASE "obex_legacy_desc0"
00162
00163 #define ALP_EXGMGR_OBEX_OBJECT_NAME_BASE "obex_legacy_name0"
00164
00165
00166 #define ALP_EXGMGR_PROGRESS_NOTIF_PARAM_NAME "priv_progress_param"
00167 #define ALP_EXGMGR_DEFAULT_PROGRESS_NOTIF "AlpProgressNotifType"
00168
00169
00170 #define ALP_EXGMGR_REQUEST_GLOBAL_UID_PARAM_NAME "AlpPrivGlobalUid"
00171 #define EXG_MGR_BT_INCOMING_UID 1 // special UID used to cancel an incoming BT object.
00172 #define EXG_MGR_IR_INCOMING_UID 2
00173 #define EXG_MGR_FIRST_GUID 20
00174
00175
00176 #define ALP_EXGMGR_REQUEST_PROGRESS_ACTIVE_PARAM_NAME "AlpPrivProgressActive"
00177
00178
00179 int alp_exg_prv_daemon_is_alive ();
00180 alp_status_t alp_exg_prv_extract_transport_params_item_value (char *iTransportParams, char *iItemName, char *oValue, size_t iValueLen);
00181 void alp_exg_request_prv_get_version (AlpExgRequest iRequest, int *oVersion);
00182 void alp_ext_request_prv_get_info (AlpExgRequest iRequest, char **oInfo, size_t *oInfoLen);
00183 void alp_exg_request_prv_set_info (AlpExgRequest iRequest, char *iInfo, size_t iInfoLen);
00184 alp_status_t alp_exg_request_prv_alloc_init_info (AlpExgRequest iRequest, size_t iInfoLen);
00185
00186 alp_status_t alp_exg_prv_sync_full_write (int iSocket, void *iBuf, size_t iBufLen);
00187 alp_status_t alp_exg_prv_sync_full_read (int iSocket, void *iBuf, size_t iBufLen);
00188 ssize_t alp_exg_prv_read_fd(int sockFD, void* payload, size_t maxPL, int* recvFD);
00189 ssize_t alp_exg_prv_write_fd(int sockFD, void* payload, size_t nPL, int sendFD);
00190 char *alp_exg_make_tmpfile (char *iPrefix, int *oFd);
00191 alp_status_t alp_exg_prv_fd_to_file (int iFd, char *iPrefix, char **oFilename);
00192 alp_status_t alp_exg_prv_cancel_incoming (int iGuid);
00193
00195
00196 #ifdef __cplusplus
00197 }
00198 #endif
00199
00200 #endif