Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

attnmgr_ipc.h

Go to the documentation of this file.
00001 /********************************************************************
00002 
00003 Copyright 2006, ACCESS Systems Americas, Inc. All rights reserved.
00004 
00005 The contents of this file are subject to the Mozilla Public License Version
00006 1.1 (the "License"); you may not use this file except in compliance with
00007 the License. You may obtain a copy of the License at
00008 http://www.mozilla.org/MPL/
00009 
00010 Software distributed under the License is distributed on an "AS IS" basis,
00011 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012 for the specific language governing rights and limitations under the
00013 License.
00014 
00015 The Original Code is the entire contents of this file.
00016 
00017 The Initial Developer of the Original Code is ACCESS Systems Americas, Inc.
00018 
00019 Portions created by ACCESS Systems Americas, Inc. are Copyright © 2006. All
00020 Rights Reserved.
00021 
00022 Contributor(s): none.
00023 
00024 ********************************************************************/
00032 #ifndef __ALP_ATTN_IPC_H__
00033 #define __ALP_ATTN_IPC_H__
00034 
00035 #include <hiker/types.h>
00036 #include <hiker/ipc.h>
00037 #include <hiker/attnmgr_common.h>
00038 
00051 typedef enum
00052 {
00053     ALP_ATTN_MSG_ID_STATUS = 1,   
00054     ALP_ATTN_MSG_ID_STATUS_REPLY, 
00055     ALP_ATTN_MSG_ID_POST,         
00056     ALP_ATTN_MSG_ID_POST_REPLY,   
00057     ALP_ATTN_MSG_ID_UPDATE,       
00058     ALP_ATTN_MSG_ID_UPDATE_REPLY, 
00059     ALP_ATTN_MSG_ID_DELETE,       
00060     ALP_ATTN_MSG_ID_DELETE_REPLY, 
00061     ALP_ATTN_MSG_ID_LOOKUP,       
00062     ALP_ATTN_MSG_ID_LOOKUP_REPLY  
00063 } AlpAttnMsgID;
00064 
00068 typedef enum
00069 {
00070     ALP_ATTN_MGR_MSG_ID_QUERY = 1
00071 } AlpAttnMgrMsgID;
00072     
00077 #define ALP_STATUS_ATTN_IPC_BAD_PARAM       (ALP_STATUS_ATTN_IPC | 0x00000100) //<! An invalid parameter was passed to the function call
00078 #define ALP_STATUS_ATTN_IPC_NO_MEMORY       (ALP_STATUS_ATTN_IPC | 0x00000200) //<! Unable to allocate enough memory to complete the function call
00079 #define ALP_STATUS_ATTN_IPC_INTERNAL        (ALP_STATUS_ATTN_IPC | 0x00000300) //<! An unexpected internal error occurred during the function call
00080 #define ALP_STATUS_ATTN_IPC_TIMEOUT         (ALP_STATUS_ATTN_IPC | 0x00000400) //<! The IPC request timed out during the function call
00081 
00087 #define ALP_ATTN_CALLBACK_CHANNEL_FORMAT   "alp-alert-callback-%d"
00088 #define ALP_ATTN_CALLBACK_CHANNEL_PROPERTY "callback-channel"
00089 
00091 #ifdef __cplusplus
00092 extern "C" {
00093 #endif
00094 
00095     alp_status_t    alp_attn_ipc_init       (const char *channel);
00096 
00097     const char     *alp_attn_ipc_get_channel (void);
00098 
00099     alp_status_t    alp_attn_ipc_setup      (void);
00100 
00101     alp_status_t    alp_attn_ipc_teardown   (void);
00102 
00103     alp_status_t    alp_attn_ipc_send       (AlpMessage  *msg);
00104         
00105     alp_status_t
00106     alp_attn_ipc_send_with_response         (AlpMessage  *msg,
00107                                              AlpMessage **response);
00108         
00109     /*** unpacking routines ***/
00110     alp_status_t
00111     alp_attn_ipc_unpack_alert_post_msg      (AlpMessage    *message,
00112                                              AlpDmlItemH   *itemH);
00113 
00114     alp_status_t
00115     alp_attn_ipc_unpack_alert_post_reply    (AlpMessage    *response,
00116                                              alp_status_t  *status,
00117                                              AlpAttnId     *alertId);
00118 
00119     alp_status_t
00120     alp_attn_ipc_unpack_alert_update_msg    (AlpMessage    *message,
00121                                              AlpDmlItemH   *itemH);
00122 
00123     alp_status_t
00124     alp_attn_ipc_unpack_alert_update_reply  (AlpMessage    *response,
00125                                              alp_status_t  *status);
00126 
00127     alp_status_t
00128     alp_attn_ipc_unpack_alert_delete_msg    (AlpMessage    *message,
00129                                              AlpDmlItemH   *itemH);
00130 
00131     alp_status_t
00132     alp_attn_ipc_unpack_alert_delete_reply  (AlpMessage    *response,
00133                                              alp_status_t  *status);
00134 
00135 #if 0
00136     alp_status_t
00137     alp_attn_ipc_unpack_lookup_id_msg       (AlpMessage    *message,
00138                                              AlpAttnAlertH *alertH);
00139 
00140     alp_status_t
00141     alp_attn_ipc_unpack_lookup_id_reply     (AlpMessage    *response,
00142                                              alp_status_t  *status,
00143                                              AlpAttnId     *alertId);
00144 #endif
00145 
00146     alp_status_t
00147     alp_attn_ipc_unpack_status_reply_msg    (AlpMessage    *response,
00148                                              alp_status_t  *status,
00149                                              gchar        **srv_status);
00150 
00151     /*** packing routines ***/
00152     AlpMessage *
00153     alp_attn_ipc_pack_alert_post_msg        (const char     *source,
00154                                              const char     *name,
00155                                              const char     *handle,
00156                                              const char     *interface,
00157                                              gint32          priority,
00158                                              gint32          duration,
00159                                              guint32         nprops,
00160                                              AlpAttnProp    *props[],
00161                                              const char     *channel);
00162     AlpMessage *
00163     alp_attn_ipc_pack_alert_post_reply      (AlpMessage     *replyTo,
00164                                              guint32         status,
00165                                              guint32         id);
00166     AlpMessage *
00167     alp_attn_ipc_pack_alert_update_msg      (const char     *source,
00168                                              const char     *name,
00169                                              const char     *handle,
00170                                              guint32         nprops,
00171                                              AlpAttnProp    *props[]);
00172     AlpMessage *
00173     alp_attn_ipc_pack_alert_update_reply    (AlpMessage     *replyTo,
00174                                              guint32         status);
00175 
00176 
00177     AlpMessage *
00178     alp_attn_ipc_pack_alert_delete_msg      (const char     *source,
00179                                              const char     *name,
00180                                              const char     *handle);
00181 
00182     AlpMessage *
00183     alp_attn_ipc_pack_alert_delete_reply    (AlpMessage     *replyTo,
00184                                              guint32         status);
00185 
00186 #if 0
00187     AlpMessage *
00188     alp_attn_ipc_pack_lookup_id_msg         (const char     *source,
00189                                              const char     *name,
00190                                              const char     *handle);
00191                                              
00192     AlpMessage *
00193     alp_attn_ipc_pack_lookup_id_reply       (AlpMessage     *replyTo,
00194                                              guint32         status,
00195                                              guint32         id);
00196 #endif
00197     AlpMessage *
00198     alp_attn_ipc_pack_status_reply          (AlpMessage     *replyTo,
00199                                              guint32         status,
00200                                              gchar          *srv_status);
00201 
00202     alp_status_t
00203     alp_attn_ipc_send_callback (const char *channel,
00204                                 const char *source,
00205                                 const char *name,
00206                                 const char *handle,
00207                                 uint32_t    argc,
00208                                 char       *argv[]);
00211 #ifdef __cplusplus
00212 } // extern "C"
00213 #endif
00214 
00215 #endif /* __ALP_ATTN_IPC_H__ */

Generated on Sat Dec 16 20:29:47 2006 for hiker-0.9 by  doxygen 1.4.4