Create prototype for IPC_CREATE macro on linux,
and change return type to pointer.
This commit is contained in:
		| @@ -34,7 +34,8 @@ int firstReadAfterWrite = 0; | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| #ifdef SSCS_LINUX_PLAT_F | #ifdef SSCS_LINUX_PLAT_F | ||||||
| int ipc_unx_create() | void* ipc_unx_create() | ||||||
|  |  | ||||||
| { | { | ||||||
|     int retVal = 0; |     int retVal = 0; | ||||||
|     struct sockaddr_un servAddr; |     struct sockaddr_un servAddr; | ||||||
| @@ -63,7 +64,7 @@ int ipc_unx_create() | |||||||
|         else |         else | ||||||
|             retVal = sockFd; |             retVal = sockFd; | ||||||
|     }while(0); |     }while(0); | ||||||
|     return retVal; |     return (void*)retVal; | ||||||
| } | } | ||||||
|  |  | ||||||
| #else | #else | ||||||
|   | |||||||
| @@ -20,158 +20,163 @@ | |||||||
|  *  |  *  | ||||||
|  ***********************************************************************/ |  ***********************************************************************/ | ||||||
|  |  | ||||||
| #ifndef _SSCS_IPC_H | #ifndef _SSCS_IPC_H | ||||||
| #define _SSCS_IPC_H | #define _SSCS_IPC_H | ||||||
| #include <micasa_types.h> | #include <micasa_types.h> | ||||||
|  |  | ||||||
| typedef uint8_t Byte; | typedef uint8_t Byte; | ||||||
| #define MAX_SOCKET_PATH_LEN 256 | #define MAX_SOCKET_PATH_LEN 256 | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
| #define DMSG(x) printf x | #define DMSG(x) printf x | ||||||
| #else | #else | ||||||
| #define DMSG(x) | #define DMSG(x) | ||||||
| #endif | #endif | ||||||
| // Used for global buffers. | // Used for global buffers. | ||||||
| #define	MIN_REQUEST_BUF_LEN		1024 | #define	MIN_REQUEST_BUF_LEN		1024 | ||||||
| #define	MIN_REPLY_BUF_LEN		4096 | #define	MIN_REPLY_BUF_LEN		4096 | ||||||
|  |  | ||||||
| #ifdef SSCS_LINUX_PLAT_F | #ifdef SSCS_LINUX_PLAT_F | ||||||
| #include "sscs_unx_ipc_client.h" | #include "sscs_unx_ipc_client.h" | ||||||
| #include "sscs_unx_cache_defines.h" | #include "sscs_unx_cache_defines.h" | ||||||
| #include <sscs_lldefs.h> | #include <sscs_lldefs.h> | ||||||
| #include <errno.h> | #include <errno.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
|  |  | ||||||
| #define IPC_CREATE(...) ipc_unx_create(__VA_ARGS__); | void* ipc_unx_create(void); | ||||||
| #define IPC_READ(...)   ipc_unx_read(__VA_ARGS__); | int ipc_unx_write(int fd, Byte *pData, int bytes); | ||||||
| #define IPC_WRITE(...)  ipc_unx_write(__VA_ARGS__); | int ipc_unx_read(int fd, Byte *pData, int bytes); | ||||||
| #define IPC_CLOSE(...)  ipc_unx_close(__VA_ARGS__); | int ipc_unx_close(int fd); | ||||||
|  |  | ||||||
| #else | #define IPC_CREATE(...) ipc_unx_create(__VA_ARGS__); | ||||||
|  | #define IPC_READ(...)   ipc_unx_read(__VA_ARGS__); | ||||||
| //#ifdef SSCS_WIN32_PLAT_F | #define IPC_WRITE(...)  ipc_unx_write(__VA_ARGS__); | ||||||
|  | #define IPC_CLOSE(...)  ipc_unx_close(__VA_ARGS__); | ||||||
| #include <windows.h> |  | ||||||
| #include "sscs_unx_ipc_client.h" | #else | ||||||
| #include "sscs_unx_cache_defines.h" |  | ||||||
| #include <sscs_lldefs.h> | //#ifdef SSCS_WIN32_PLAT_F | ||||||
| #include <errno.h> |  | ||||||
|  | #include <windows.h> | ||||||
| void * ipc_win_create(void); | #include "sscs_unx_ipc_client.h" | ||||||
| int ipc_win_write(HANDLE hPipe, LPCVOID lpBuffer, DWORD bytesToWrite); | #include "sscs_unx_cache_defines.h" | ||||||
| int ipc_win_read(HANDLE hPipe, LPVOID lpBuffer, DWORD numOfBytesToRead); | #include <sscs_lldefs.h> | ||||||
| int ipc_win_close(HANDLE hPipe); | #include <errno.h> | ||||||
|  |  | ||||||
| #define IPC_CREATE()		 ipc_win_create(); | void * ipc_win_create(void); | ||||||
| #define IPC_READ(s1,s2,s3)   ipc_win_read(s1,s2,s3); | int ipc_win_write(HANDLE hPipe, LPCVOID lpBuffer, DWORD bytesToWrite); | ||||||
| #define IPC_WRITE(s1,s2,s3)  ipc_win_write(s1,s2,s3); | int ipc_win_read(HANDLE hPipe, LPVOID lpBuffer, DWORD numOfBytesToRead); | ||||||
| #define IPC_CLOSE(s1)		 ipc_win_close(s1); | int ipc_win_close(HANDLE hPipe); | ||||||
|  |  | ||||||
| //#endif | #define IPC_CREATE()		 ipc_win_create(); | ||||||
|  | #define IPC_READ(s1,s2,s3)   ipc_win_read(s1,s2,s3); | ||||||
| // function prototypes | #define IPC_WRITE(s1,s2,s3)  ipc_win_write(s1,s2,s3); | ||||||
| int ipc_OpenSecretStore | #define IPC_CLOSE(s1)		 ipc_win_close(s1); | ||||||
| ( |  | ||||||
|     void *secretStoreID, | //#endif | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle |  | ||||||
| ); | // function prototypes | ||||||
|  | int ipc_OpenSecretStore | ||||||
| int ipc_CloseSecretStore | ( | ||||||
| ( |     void *secretStoreID, | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_SECRETSTORE_HANDLE_T *ssHandle | ||||||
| 	uint32_t	ssFlags | ); | ||||||
| ); |  | ||||||
|  | int ipc_CloseSecretStore | ||||||
| int ipc_RemoveSecretStore | ( | ||||||
| ( |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle | 	uint32_t	ssFlags | ||||||
| ); | ); | ||||||
|  |  | ||||||
| int ipc_EnumerateKeychainIDs | int ipc_RemoveSecretStore | ||||||
| ( | ( | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_SECRETSTORE_HANDLE_T *ssHandle | ||||||
|     SSCS_KEYCHAIN_ID_LIST_T *kcIDList | ); | ||||||
| ); |  | ||||||
|  | int ipc_EnumerateKeychainIDs | ||||||
| int ipc_AddKeychain | ( | ||||||
| ( |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_KEYCHAIN_ID_LIST_T *kcIDList | ||||||
|     unsigned int ssFlags, | ); | ||||||
|     SSCS_KEYCHAIN_ID_T *keychainID |  | ||||||
| ); | int ipc_AddKeychain | ||||||
|  | ( | ||||||
| int ipc_RemoveKeychain |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
| ( |     unsigned int ssFlags, | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_KEYCHAIN_ID_T *keychainID | ||||||
|     SSCS_KEYCHAIN_ID_T *keychainID | ); | ||||||
| ); |  | ||||||
|  | int ipc_RemoveKeychain | ||||||
| int ipc_EnumerateSecretIDs | ( | ||||||
| ( |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_KEYCHAIN_ID_T *keychainID | ||||||
|     SSCS_KEYCHAIN_ID_T        *keychainID, | ); | ||||||
|     SSCS_SECRET_ID_LIST_T     *secretIDList |  | ||||||
| ); | int ipc_EnumerateSecretIDs | ||||||
|  | ( | ||||||
| int ipc_ReadSecret |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
| ( |     SSCS_KEYCHAIN_ID_T        *keychainID, | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_SECRET_ID_LIST_T     *secretIDList | ||||||
|     SSCS_KEYCHAIN_ID_T        *keychainID, | ); | ||||||
|     SSCS_SECRET_ID_T          *secretID, |  | ||||||
|     SSCS_SECRET_T             *secretData, | int ipc_ReadSecret | ||||||
|     SSCS_PASSWORD_T           *epPassword, | ( | ||||||
|     unsigned int              *bytesRequired |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
| ); |     SSCS_KEYCHAIN_ID_T        *keychainID, | ||||||
|  |     SSCS_SECRET_ID_T          *secretID, | ||||||
| int ipc_WriteSecret |     SSCS_SECRET_T             *secretData, | ||||||
| ( |     SSCS_PASSWORD_T           *epPassword, | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     unsigned int              *bytesRequired | ||||||
|     unsigned int              ssFlags, | ); | ||||||
|     SSCS_KEYCHAIN_ID_T        *keychainID, |  | ||||||
|     SSCS_SECRET_ID_T          *secretID, | int ipc_WriteSecret | ||||||
|     SSCS_SECRET_T             *secretData, | ( | ||||||
|     SSCS_PASSWORD_T           *epPassword, |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
| 	SSCS_EXT_T				  *ext |     unsigned int              ssFlags, | ||||||
| ); |     SSCS_KEYCHAIN_ID_T        *keychainID, | ||||||
|  |     SSCS_SECRET_ID_T          *secretID, | ||||||
| int ipc_RemoveSecret |     SSCS_SECRET_T             *secretData, | ||||||
| ( |     SSCS_PASSWORD_T           *epPassword, | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | 	SSCS_EXT_T				  *ext | ||||||
|     SSCS_KEYCHAIN_ID_T        *keychainID, | ); | ||||||
|     SSCS_SECRET_ID_T          *secretID, |  | ||||||
|     SSCS_PASSWORD_T           *epPassword | int ipc_RemoveSecret | ||||||
| ); | ( | ||||||
|  |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
| int  ipc_GetSecretStoreInfo |     SSCS_KEYCHAIN_ID_T        *keychainID, | ||||||
| ( |     SSCS_SECRET_ID_T          *secretID, | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_PASSWORD_T           *epPassword | ||||||
|     SSCS_SECRETSTORE_INFO_T *ssInfo | ); | ||||||
| ); |  | ||||||
|  | int  ipc_GetSecretStoreInfo | ||||||
| int  ipc_GetKeychainInfo | ( | ||||||
| ( |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_SECRETSTORE_INFO_T *ssInfo | ||||||
|     SSCS_KEYCHAIN_ID_T        *keychainID, | ); | ||||||
|     SSCS_KEYCHAIN_INFO_T      *kcInfo |  | ||||||
| ); | int  ipc_GetKeychainInfo | ||||||
|  | ( | ||||||
| int  ipc_LockCache |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
| ( |     SSCS_KEYCHAIN_ID_T        *keychainID, | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle |     SSCS_KEYCHAIN_INFO_T      *kcInfo | ||||||
| ); | ); | ||||||
|  |  | ||||||
| int ipc_UnlockCache | int  ipc_LockCache | ||||||
| ( | ( | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_SECRETSTORE_HANDLE_T *ssHandle | ||||||
|     SSCS_PASSCODE_T *passcode | ); | ||||||
| ); |  | ||||||
|  | int ipc_UnlockCache | ||||||
| int ipc_SetMasterPasscode | ( | ||||||
| ( |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_PASSCODE_T *passcode | ||||||
|     SSCS_PASSCODE_T *passcode | ); | ||||||
| ); |  | ||||||
|  | int ipc_SetMasterPasscode | ||||||
|  | ( | ||||||
|  |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
|  |     SSCS_PASSCODE_T *passcode | ||||||
|  | ); | ||||||
|  |  | ||||||
| int ipc_ReadKey | int ipc_ReadKey | ||||||
| ( | ( | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
| @@ -183,36 +188,9 @@ int ipc_ReadKey | |||||||
|     uint32_t                   *valLen, |     uint32_t                   *valLen, | ||||||
|     SSCS_PASSWORD_T           *epPassword, |     SSCS_PASSWORD_T           *epPassword, | ||||||
|     uint32_t                  *bytesRequired |     uint32_t                  *bytesRequired | ||||||
| ); | ); | ||||||
|  |  | ||||||
| int ipc_WriteKey | int ipc_WriteKey | ||||||
| ( |  | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |  | ||||||
|     uint32_t                  ssFlags, |  | ||||||
|     SSCS_KEYCHAIN_ID_T        *keychainID, |  | ||||||
|     SSCS_SECRET_ID_T          *secretID, |  | ||||||
|     SS_UTF8_T                 *key, |  | ||||||
|     uint32_t                   keyLen, |  | ||||||
|     uint8_t                    *val, |  | ||||||
|     uint32_t                   valLen, |  | ||||||
|     SSCS_PASSWORD_T           *epPassword, |  | ||||||
|     SSCS_EXT_T				  *ext |  | ||||||
| ); |  | ||||||
|  |  | ||||||
| int ipc_ReadBinaryKey |  | ||||||
| ( |  | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |  | ||||||
|     SSCS_KEYCHAIN_ID_T        *keychainID, |  | ||||||
|     SSCS_SECRET_ID_T          *secretID, |  | ||||||
|     SS_UTF8_T                 *key, |  | ||||||
|     uint32_t                   keyLen, |  | ||||||
|     uint8_t                    *val, |  | ||||||
|     uint32_t                   *valLen, |  | ||||||
|     SSCS_PASSWORD_T           *epPassword, |  | ||||||
|     uint32_t                  *bytesRequired |  | ||||||
| ); |  | ||||||
|  |  | ||||||
| int ipc_WriteBinaryKey |  | ||||||
| ( | ( | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
|     uint32_t                  ssFlags, |     uint32_t                  ssFlags, | ||||||
| @@ -224,15 +202,42 @@ int ipc_WriteBinaryKey | |||||||
|     uint32_t                   valLen, |     uint32_t                   valLen, | ||||||
|     SSCS_PASSWORD_T           *epPassword, |     SSCS_PASSWORD_T           *epPassword, | ||||||
|     SSCS_EXT_T				  *ext |     SSCS_EXT_T				  *ext | ||||||
| ); | ); | ||||||
|  |  | ||||||
|  | int ipc_ReadBinaryKey | ||||||
|  | ( | ||||||
|  |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
|  |     SSCS_KEYCHAIN_ID_T        *keychainID, | ||||||
|  |     SSCS_SECRET_ID_T          *secretID, | ||||||
|  |     SS_UTF8_T                 *key, | ||||||
|  |     uint32_t                   keyLen, | ||||||
|  |     uint8_t                    *val, | ||||||
|  |     uint32_t                   *valLen, | ||||||
|  |     SSCS_PASSWORD_T           *epPassword, | ||||||
|  |     uint32_t                  *bytesRequired | ||||||
|  | ); | ||||||
|  |  | ||||||
|  | int ipc_WriteBinaryKey | ||||||
|  | ( | ||||||
|  |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
|  |     uint32_t                  ssFlags, | ||||||
|  |     SSCS_KEYCHAIN_ID_T        *keychainID, | ||||||
|  |     SSCS_SECRET_ID_T          *secretID, | ||||||
|  |     SS_UTF8_T                 *key, | ||||||
|  |     uint32_t                   keyLen, | ||||||
|  |     uint8_t                    *val, | ||||||
|  |     uint32_t                   valLen, | ||||||
|  |     SSCS_PASSWORD_T           *epPassword, | ||||||
|  |     SSCS_EXT_T				  *ext | ||||||
|  | ); | ||||||
|  |  | ||||||
| int32_t ipc_SetMasterPassword | int32_t ipc_SetMasterPassword | ||||||
| ( | ( | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
|     SSCS_PASSWORD_T *passwd, |     SSCS_PASSWORD_T *passwd, | ||||||
|     SSCS_HINT_T *hint |     SSCS_HINT_T *hint | ||||||
| ); | ); | ||||||
|  |  | ||||||
| int ipc_IsSecretPersistent | int ipc_IsSecretPersistent | ||||||
| ( | ( | ||||||
|     SSCS_SECRETSTORE_HANDLE_T *ssHandle, |     SSCS_SECRETSTORE_HANDLE_T *ssHandle, | ||||||
| @@ -240,8 +245,8 @@ int ipc_IsSecretPersistent | |||||||
|     SSCS_KEYCHAIN_ID_T        *keychainID, |     SSCS_KEYCHAIN_ID_T        *keychainID, | ||||||
|     SSCS_SECRET_ID_T          *secretID, |     SSCS_SECRET_ID_T          *secretID, | ||||||
|     SSCS_EXT_T				  *ext |     SSCS_EXT_T				  *ext | ||||||
| ); | ); | ||||||
|  |  | ||||||
| #endif | #endif | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user