1 /* 2 * Copyright (c) 2010 Red Hat, Inc. 3 * 4 * All rights reserved. 5 * 6 * Author: Angus Salkeld <asalkeld@redhat.com> 7 * 8 * This file is part of libqb. 9 * 10 * libqb is free software: you can redistribute it and/or modify 11 * it under the terms of the GNU Lesser General Public License as published by 12 * the Free Software Foundation, either version 2.1 of the License, or 13 * (at your option) any later version. 14 * 15 * libqb is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License for more details. 19 * 20 * You should have received a copy of the GNU Lesser General Public License 21 * along with libqb. If not, see <http://www.gnu.org/licenses/>. 22 */ 23 #ifndef QB_IPC_COMMON_H_DEFINED 24 #define QB_IPC_COMMON_H_DEFINED 25 26 #include <stdint.h> 27 28 /* *INDENT-OFF* */ 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 /* *INDENT-ON* */ 33 34 /** 35 * @file qbipc_common.h 36 * common types and definitions 37 */ 38 39 struct qb_ipc_request_header { 40 int32_t id __attribute__ ((aligned(8))); 41 int32_t size __attribute__ ((aligned(8))); 42 } __attribute__ ((aligned(8))); 43 44 struct qb_ipc_response_header { 45 int32_t id __attribute__ ((aligned(8))); 46 int32_t size __attribute__ ((aligned(8))); 47 int32_t error __attribute__ ((aligned(8))); 48 } __attribute__ ((aligned(8))); 49 50 enum qb_ipc_type { 51 QB_IPC_SOCKET, 52 QB_IPC_SHM, 53 QB_IPC_POSIX_MQ, 54 QB_IPC_SYSV_MQ, 55 QB_IPC_NATIVE, 56 }; 57 58 59 #define QB_IPC_MSG_NEW_MESSAGE 0 60 #define QB_IPC_MSG_USER_START QB_IPC_MSG_NEW_MESSAGE 61 #define QB_IPC_MSG_AUTHENTICATE -1 62 #define QB_IPC_MSG_NEW_EVENT_SOCK -2 63 #define QB_IPC_MSG_DISCONNECT -3 64 65 /* *INDENT-OFF* */ 66 #ifdef __cplusplus 67 } 68 #endif 69 /* *INDENT-ON* */ 70 71 #endif /* QB_IPC_COMMON_H_DEFINED */ 72