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

volumesvcs_prv.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 ********************************************************************/
00035 #ifndef VOLUMESVCS_PRV_H
00036 #define VOLUMESVCS_PRV_H
00037 
00038 #include <hiker/volumesvcs.h>
00039 
00040 #define ALP_VOLUMESVCS_SERVER_CHANNEL "alp_volumesvcs_server" // user requests come in here
00041 #define ALP_VOLUMESVCS_UDEV_CHANNEL "alp_volumesvcs_udev" // udev evnents come in here
00042 #define ALP_VOLUMESVCS_APPID "com.access.servers.volumesvcsd"
00043 
00044 /*
00045  * environemtn vars and codes for passing udev events
00046  */
00047 #define ALP_VOLUMESVCS_DEVNAME_CODE 0
00048 #define ALP_VOLUMESVCS_DEVPATH_CODE 1
00049 #define ALP_VOLUMESVCS_PHYSBUS_CODE 2
00050 #define ALP_VOLUMESVCS_MAJOR_CODE 3
00051 #define ALP_VOLUMESVCS_MINOR_CODE 4
00052 #define ALP_VOLUMESVCS_ID_FS_LABEL_CODE 5
00053 #define ALP_VOLUMESVCS_ID_FS_TYPE_CODE 6
00054 #define ALP_VOLUMESVCS_ID_FS_UUID_CODE 7
00055 #define ALP_VOLUMESVCS_UDEV_CODES 8
00056 
00057 typedef struct {
00058         short   code;   // from above list
00059         char    *envvar;
00060 } prv_alpudevmap_t;
00061 
00062 static const prv_alpudevmap_t sudevmap[]={
00063         {ALP_VOLUMESVCS_DEVNAME_CODE,"DEVNAME"},
00064         {ALP_VOLUMESVCS_DEVPATH_CODE,"DEVPATH"},
00065         {ALP_VOLUMESVCS_PHYSBUS_CODE,"PHYSDEVBUS"},
00066         {ALP_VOLUMESVCS_MAJOR_CODE,"MAJOR"},
00067         {ALP_VOLUMESVCS_MINOR_CODE,"MINOR"},
00068         {ALP_VOLUMESVCS_ID_FS_LABEL_CODE,"ID_FS_LABEL"},
00069         {ALP_VOLUMESVCS_ID_FS_TYPE_CODE,"ID_FS_TYPE"},
00070         {ALP_VOLUMESVCS_ID_FS_UUID_CODE,"ID_FS_UUID"}
00071 };
00072 
00073 
00074 /*
00075  * commands for rpc requests, each packet starts with a cmd code.  typedefs
00076  * are not used for the packets to allow for char pointers insted
00077  * of fixed size arrays,  the resposne packet uses the msgID for the
00078  * returned status.
00079  * comments following each code are the (intneral only) args
00080  */
00081 #define ALP_VOLUMESVCS_CMD_MOUNT ALP_CLASS_VOLUMESVCS + 1
00082 // udi to mount
00083 // response ID: status
00084 #define ALP_VOLUMESVCS_USER_CMD_MIN ALP_VOLUMESVCS_CMD_MOUNT
00085 
00086 #define ALP_VOLUMESVCS_CMD_UMOUNT ALP_CLASS_VOLUMESVCS + 2
00087 // udi to unmount
00088 // response ID: status
00089 
00090 #define ALP_VOLUMESVCS_CMD_FSINFO ALP_CLASS_VOLUMESVCS + 3
00091 // none
00092 // response ID: status
00093 // response msg data:
00094 //               N = number of following elements
00095 //           if N>0, then N AlpVolumeSvcsFSinfo elemnets packed as strings
00096 //               and a byte array for the fstat and flags
00097 
00098 #define ALP_VOLUMESVCS_CMD_MAKEFS ALP_CLASS_VOLUMESVCS + 4
00099 // udi of device to format
00100 // name to use as mount point
00101 // fstype to format
00102 // response ID: status
00103 
00104 #define ALP_VOLUMESVCS_CMD_BIND ALP_CLASS_VOLUMESVCS + 5
00105 // name
00106 // dirpath to mount --bind on /media/<name>
00107 // response ID status
00108 
00109 #define ALP_VOLUMESVCS_CMD_FSTYPES ALP_CLASS_VOLUMESVCS + 6
00110 // none
00111 // response ID: status
00112 // response msg data:
00113 //               N = number of following elements
00114 //           if N>0, then N char pointers follow for the fstypes supported
00115 
00116 #define ALP_VOLUMESVCS_CMD_RENAME ALP_CLASS_VOLUMESVCS + 7
00117 // udi of entry to rename
00118 // new name
00119 // response ID: status
00120 
00121 #define ALP_VOLUMESVCS_USER_CMD_MAX ALP_VOLUMESVCS_CMD_RENAME
00122 
00123 #define ALP_VOLUMESVCS_UDEV_ADD ALP_CLASS_VOLUMESVCS + 20
00124 // UDEV_MAX_CODE pairs of env var key num from above
00125 //                        matching string for that key
00126 #define ALP_VOLUMESVCS_UDEV_CMD_MIN ALP_VOLUMESVCS_UDEV_ADD
00127 // UDEV_MAX_CODE pairs of env var key num from above
00128 //                        matching string for that key
00129 
00130 #define ALP_VOLUMESVCS_UDEV_REMOVE ALP_CLASS_VOLUMESVCS + 21
00131 #define ALP_VOLUMESVCS_CTRL_EXIT ALP_CLASS_VOLUMESVCS + 22
00132 #define ALP_VOLUMESVCS_UDEV_CMD_MAX ALP_VOLUMESVCS_CTRL_EXIT
00133 
00134 /* flags that are internal only
00135  */
00136 #define ALP_VOLUMESVCS_FLAGS_NOTIFY_PENDING 0x80000000
00137 #define ALP_VOLUMESVCS_FLAGS_NONOTIFY       0x40000000
00138 #define ALP_VOLUMESVCS_FLAGS_HIDE           0x20000000
00139 #define ALP_VOLUMESVCS_FLAGS_QUIET_KIDS     0x10000000
00140 #define ALP_VOLUMESVCS_FLAGS_PRIVATE_MASK   0xFFFF0000
00141 
00142 #define PACKSTART(as,msg,cmd,error) {if ((as=alp_ipc_message_pack_start(msg,cmd)) != ALP_STATUS_OK) goto error;}
00143 #define PACKRSPSTART(as,msg,cmd,rqst_msg,error) {if ((as=alp_ipc_message_response_pack_start(msg,cmd,rqst_msg)) != ALP_STATUS_OK) goto error;}
00144 #define PACKEND(as,msg,error) {if ((as=alp_ipc_message_pack_end(msg)) != ALP_STATUS_OK) goto error;}
00145 #define UNPACKSTART(as,msg,error) {if ((as=alp_ipc_message_unpack_start(msg)) != ALP_STATUS_OK) goto error;}
00146 #define UNPACKEND(as,msg,error) {if ((as=alp_ipc_message_unpack_end(msg)) != ALP_STATUS_OK) goto error;}
00147 #define PACKU32(as,msg,val,error) {if ((as=alp_ipc_message_pack_uint32(msg, val)) != ALP_STATUS_OK) goto error;}
00148 #define UNPACKU32(as,msg,val,error) {if ((as=alp_ipc_message_unpack_uint32(msg, val)) != ALP_STATUS_OK) goto error;}
00149 #define PACKSTR(as,msg,val,error) {if ((as=alp_ipc_message_pack_string(msg, val)) != ALP_STATUS_OK) goto error;}
00150 #define UNPACKSTR(as,msg,val,error) {if ((as=alp_ipc_message_unpack_string(msg, val)) != ALP_STATUS_OK) goto error;}
00151 #define PACKBYTES(as,msg,val,len,error) {if ((as=alp_ipc_message_pack_byte_array(msg, val, len)) != ALP_STATUS_OK) goto error;}
00152 #define UNPACKBYTES(as,msg,val,len,error) {if ((as=alp_ipc_message_unpack_byte_array(msg, val, len)) != ALP_STATUS_OK) goto error;}
00153 
00154 #endif

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