ipc_cmap.h
Go to the documentation of this file.
/*
* Copyright (c) 2011-2017 Red Hat, Inc.
*
* All rights reserved.
*
* Author: Jan Friesse (jfriesse@redhat.com)
*
* This software licensed under BSD license, the text of which follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of the Red Hat, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef IPC_CMAP_H_DEFINED
#define IPC_CMAP_H_DEFINED
#include <netinet/in.h>
#include <corosync/corotypes.h>
#include <corosync/mar_gen.h>
enum req_cmap_types {
MESSAGE_REQ_CMAP_SET = 0,
MESSAGE_REQ_CMAP_DELETE = 1,
MESSAGE_REQ_CMAP_GET = 2,
MESSAGE_REQ_CMAP_ADJUST_INT = 3,
MESSAGE_REQ_CMAP_ITER_INIT = 4,
MESSAGE_REQ_CMAP_ITER_NEXT = 5,
MESSAGE_REQ_CMAP_ITER_FINALIZE = 6,
MESSAGE_REQ_CMAP_TRACK_ADD = 7,
MESSAGE_REQ_CMAP_TRACK_DELETE = 8,
MESSAGE_REQ_CMAP_SET_CURRENT_MAP = 9,
};
enum res_cmap_types {
MESSAGE_RES_CMAP_SET = 0,
MESSAGE_RES_CMAP_DELETE = 1,
MESSAGE_RES_CMAP_GET = 2,
MESSAGE_RES_CMAP_ADJUST_INT = 3,
MESSAGE_RES_CMAP_ITER_INIT = 4,
MESSAGE_RES_CMAP_ITER_NEXT = 5,
MESSAGE_RES_CMAP_ITER_FINALIZE = 6,
MESSAGE_RES_CMAP_TRACK_ADD = 7,
MESSAGE_RES_CMAP_TRACK_DELETE = 8,
MESSAGE_RES_CMAP_NOTIFY_CALLBACK = 9,
MESSAGE_RES_CMAP_SET_CURRENT_MAP = 10,
};
enum {
CMAP_SETMAP_DEFAULT = 0,
CMAP_SETMAP_STATS = 1,
};
struct req_lib_cmap_set {
struct qb_ipc_request_header header __attribute__((aligned(8)));
mar_name_t key_name __attribute__((aligned(8)));
mar_size_t value_len __attribute__((aligned(8)));
mar_uint8_t type __attribute__((aligned(8)));
mar_uint8_t value[] __attribute__((aligned(8)));
};
struct res_lib_cmap_set {
struct qb_ipc_response_header header __attribute__((aligned(8)));
};
struct req_lib_cmap_delete {
struct qb_ipc_request_header header __attribute__((aligned(8)));
mar_name_t key_name __attribute__((aligned(8)));
};
struct res_lib_cmap_delete {
struct qb_ipc_response_header header __attribute__((aligned(8)));
};
struct req_lib_cmap_get {
struct qb_ipc_request_header header __attribute__((aligned(8)));
mar_name_t key_name __attribute__((aligned(8)));
mar_size_t value_len __attribute__((aligned(8)));
};
struct res_lib_cmap_get {
struct qb_ipc_response_header header __attribute__((aligned(8)));
mar_size_t value_len __attribute__((aligned(8)));
mar_uint8_t type __attribute__((aligned(8)));
mar_uint8_t value[] __attribute__((aligned(8)));
};
struct req_lib_cmap_adjust_int {
struct qb_ipc_request_header header __attribute__((aligned(8)));
mar_name_t key_name __attribute__((aligned(8)));
mar_int32_t step __attribute__((aligned(8)));
};
struct res_lib_cmap_adjust_int {
struct qb_ipc_response_header header __attribute__((aligned(8)));
};
struct req_lib_cmap_iter_init {
struct qb_ipc_request_header header __attribute__((aligned(8)));
mar_name_t prefix __attribute__((aligned(8)));
};
struct res_lib_cmap_iter_init {
struct qb_ipc_response_header header __attribute__((aligned(8)));
mar_uint64_t iter_handle __attribute__((aligned(8)));
};
struct req_lib_cmap_iter_next {
struct qb_ipc_request_header header __attribute__((aligned(8)));
mar_uint64_t iter_handle __attribute__((aligned(8)));
};
struct res_lib_cmap_iter_next {
struct qb_ipc_response_header header __attribute__((aligned(8)));
mar_name_t key_name __attribute__((aligned(8)));
mar_size_t value_len __attribute__((aligned(8)));
mar_uint8_t type __attribute__((aligned(8)));
};
struct req_lib_cmap_iter_finalize {
struct qb_ipc_request_header header __attribute__((aligned(8)));
mar_uint64_t iter_handle __attribute__((aligned(8)));
};
struct res_lib_cmap_iter_finalize {
struct qb_ipc_response_header header __attribute__((aligned(8)));
};
struct req_lib_cmap_track_add {
struct qb_ipc_request_header header __attribute__((aligned(8)));
mar_name_t key_name __attribute__((aligned(8)));
mar_int32_t track_type __attribute__((aligned(8)));
mar_uint64_t track_inst_handle __attribute__((aligned(8)));
};
struct res_lib_cmap_track_add {
struct qb_ipc_response_header header __attribute__((aligned(8)));
mar_uint64_t track_handle __attribute__((aligned(8)));
};
struct req_lib_cmap_track_delete {
struct qb_ipc_request_header header __attribute__((aligned(8)));
mar_uint64_t track_handle __attribute__((aligned(8)));
};
struct res_lib_cmap_track_delete {
struct qb_ipc_response_header header __attribute__((aligned(8)));
mar_uint64_t track_inst_handle __attribute__((aligned(8)));
};
struct res_lib_cmap_notify_callback {
struct qb_ipc_response_header header __attribute__((aligned(8)));
mar_uint64_t track_inst_handle __attribute__((aligned(8)));
mar_name_t key_name __attribute__((aligned(8)));
mar_int32_t event __attribute__((aligned(8)));
mar_uint8_t new_value_type __attribute__((aligned(8)));
mar_uint8_t old_value_type __attribute__((aligned(8)));
mar_size_t new_value_len __attribute__((aligned(8)));
mar_size_t old_value_len __attribute__((aligned(8)));
/*
* After old_vale_len, there are two items with length of new_value_len
* and old_value_len, only first (as a pointer) is defined
*
* mar_uint8_t *new_value;
* mar_uint8_t *old_value;
*/
mar_uint8_t new_value[];
};
struct req_lib_cmap_set_current_map {
struct qb_ipc_request_header header __attribute__((aligned(8)));
mar_int32_t map __attribute__((aligned(8)));
};
#endif /* IPC_CMAP_H_DEFINED */
corotypes.h
value
uint32_t value
Definition exec/votequorum.c:2
req_cmap_types
req_cmap_types
The req_cmap_types enum.
Definition ipc_cmap.h:45
MESSAGE_REQ_CMAP_ITER_NEXT
@ MESSAGE_REQ_CMAP_ITER_NEXT
Definition ipc_cmap.h:51
MESSAGE_REQ_CMAP_SET
@ MESSAGE_REQ_CMAP_SET
Definition ipc_cmap.h:46
MESSAGE_REQ_CMAP_ITER_INIT
@ MESSAGE_REQ_CMAP_ITER_INIT
Definition ipc_cmap.h:50
MESSAGE_REQ_CMAP_TRACK_DELETE
@ MESSAGE_REQ_CMAP_TRACK_DELETE
Definition ipc_cmap.h:54
MESSAGE_REQ_CMAP_ADJUST_INT
@ MESSAGE_REQ_CMAP_ADJUST_INT
Definition ipc_cmap.h:49
MESSAGE_REQ_CMAP_GET
@ MESSAGE_REQ_CMAP_GET
Definition ipc_cmap.h:48
MESSAGE_REQ_CMAP_SET_CURRENT_MAP
@ MESSAGE_REQ_CMAP_SET_CURRENT_MAP
Definition ipc_cmap.h:55
MESSAGE_REQ_CMAP_ITER_FINALIZE
@ MESSAGE_REQ_CMAP_ITER_FINALIZE
Definition ipc_cmap.h:52
MESSAGE_REQ_CMAP_TRACK_ADD
@ MESSAGE_REQ_CMAP_TRACK_ADD
Definition ipc_cmap.h:53
MESSAGE_REQ_CMAP_DELETE
@ MESSAGE_REQ_CMAP_DELETE
Definition ipc_cmap.h:47
CMAP_SETMAP_STATS
@ CMAP_SETMAP_STATS
Definition ipc_cmap.h:77
CMAP_SETMAP_DEFAULT
@ CMAP_SETMAP_DEFAULT
Definition ipc_cmap.h:76
res_cmap_types
res_cmap_types
The res_cmap_types enum.
Definition ipc_cmap.h:61
MESSAGE_RES_CMAP_ITER_FINALIZE
@ MESSAGE_RES_CMAP_ITER_FINALIZE
Definition ipc_cmap.h:68
MESSAGE_RES_CMAP_SET_CURRENT_MAP
@ MESSAGE_RES_CMAP_SET_CURRENT_MAP
Definition ipc_cmap.h:72
MESSAGE_RES_CMAP_SET
@ MESSAGE_RES_CMAP_SET
Definition ipc_cmap.h:62
MESSAGE_RES_CMAP_ITER_INIT
@ MESSAGE_RES_CMAP_ITER_INIT
Definition ipc_cmap.h:66
MESSAGE_RES_CMAP_ITER_NEXT
@ MESSAGE_RES_CMAP_ITER_NEXT
Definition ipc_cmap.h:67
MESSAGE_RES_CMAP_GET
@ MESSAGE_RES_CMAP_GET
Definition ipc_cmap.h:64
MESSAGE_RES_CMAP_DELETE
@ MESSAGE_RES_CMAP_DELETE
Definition ipc_cmap.h:63
MESSAGE_RES_CMAP_NOTIFY_CALLBACK
@ MESSAGE_RES_CMAP_NOTIFY_CALLBACK
Definition ipc_cmap.h:71
MESSAGE_RES_CMAP_TRACK_ADD
@ MESSAGE_RES_CMAP_TRACK_ADD
Definition ipc_cmap.h:69
MESSAGE_RES_CMAP_TRACK_DELETE
@ MESSAGE_RES_CMAP_TRACK_DELETE
Definition ipc_cmap.h:70
MESSAGE_RES_CMAP_ADJUST_INT
@ MESSAGE_RES_CMAP_ADJUST_INT
Definition ipc_cmap.h:65
mar_gen.h
mar_int32_t
int32_t mar_int32_t
Definition mar_gen.h:48
mar_size_t
mar_uint64_t mar_size_t
mar_size_t
Definition mar_gen.h:286
mar_uint8_t
uint8_t mar_uint8_t
Definition mar_gen.h:51
mar_uint64_t
uint64_t mar_uint64_t
Definition mar_gen.h:54
mar_name_t
mar_name_t struct
Definition mar_gen.h:166
req_lib_cmap_adjust_int
The req_lib_cmap_adjust_int struct.
Definition ipc_cmap.h:135
req_lib_cmap_adjust_int::__attribute__
mar_name_t key_name __attribute__((aligned(8)))
req_lib_cmap_adjust_int::__attribute__
mar_int32_t step __attribute__((aligned(8)))
req_lib_cmap_adjust_int::__attribute__
struct qb_ipc_request_header header __attribute__((aligned(8)))
req_lib_cmap_delete
The req_lib_cmap_delete struct.
Definition ipc_cmap.h:101
req_lib_cmap_delete::__attribute__
struct qb_ipc_request_header header __attribute__((aligned(8)))
req_lib_cmap_delete::__attribute__
mar_name_t key_name __attribute__((aligned(8)))
req_lib_cmap_get
The req_lib_cmap_get struct.
Definition ipc_cmap.h:116
req_lib_cmap_get::__attribute__
mar_size_t value_len __attribute__((aligned(8)))
req_lib_cmap_get::__attribute__
struct qb_ipc_request_header header __attribute__((aligned(8)))
req_lib_cmap_get::__attribute__
mar_name_t key_name __attribute__((aligned(8)))
req_lib_cmap_iter_finalize
The req_lib_cmap_iter_finalize struct.
Definition ipc_cmap.h:185
req_lib_cmap_iter_finalize::__attribute__
mar_uint64_t iter_handle __attribute__((aligned(8)))
req_lib_cmap_iter_finalize::__attribute__
struct qb_ipc_request_header header __attribute__((aligned(8)))
req_lib_cmap_iter_init
The req_lib_cmap_iter_init struct.
Definition ipc_cmap.h:151
req_lib_cmap_iter_init::__attribute__
struct qb_ipc_request_header header __attribute__((aligned(8)))
req_lib_cmap_iter_init::__attribute__
mar_name_t prefix __attribute__((aligned(8)))
req_lib_cmap_iter_next
The req_lib_cmap_iter_next struct.
Definition ipc_cmap.h:167
req_lib_cmap_iter_next::__attribute__
mar_uint64_t iter_handle __attribute__((aligned(8)))
req_lib_cmap_iter_next::__attribute__
struct qb_ipc_request_header header __attribute__((aligned(8)))
req_lib_cmap_set_current_map
The req_lib_cmap_set_current_map struct used by cmap_initialize_map().
Definition ipc_cmap.h:257
req_lib_cmap_set_current_map::__attribute__
mar_int32_t map __attribute__((aligned(8)))
req_lib_cmap_set_current_map::__attribute__
struct qb_ipc_request_header header __attribute__((aligned(8)))
req_lib_cmap_set
The req_lib_cmap_set struct.
Definition ipc_cmap.h:83
req_lib_cmap_set::__attribute__
mar_size_t value_len __attribute__((aligned(8)))
req_lib_cmap_set::__attribute__
mar_uint8_t type __attribute__((aligned(8)))
req_lib_cmap_set::__attribute__
mar_uint8_t value[] __attribute__((aligned(8)))
req_lib_cmap_set::__attribute__
mar_name_t key_name __attribute__((aligned(8)))
req_lib_cmap_set::__attribute__
struct qb_ipc_request_header header __attribute__((aligned(8)))
req_lib_cmap_track_add
The req_lib_cmap_track_add struct.
Definition ipc_cmap.h:200
req_lib_cmap_track_add::__attribute__
mar_int32_t track_type __attribute__((aligned(8)))
req_lib_cmap_track_add::__attribute__
mar_name_t key_name __attribute__((aligned(8)))
req_lib_cmap_track_add::__attribute__
mar_uint64_t track_inst_handle __attribute__((aligned(8)))
req_lib_cmap_track_add::__attribute__
struct qb_ipc_request_header header __attribute__((aligned(8)))
req_lib_cmap_track_delete
The req_lib_cmap_track_delete struct.
Definition ipc_cmap.h:218
req_lib_cmap_track_delete::__attribute__
struct qb_ipc_request_header header __attribute__((aligned(8)))
req_lib_cmap_track_delete::__attribute__
mar_uint64_t track_handle __attribute__((aligned(8)))
res_lib_cmap_adjust_int
The res_lib_cmap_adjust_int struct.
Definition ipc_cmap.h:144
res_lib_cmap_adjust_int::__attribute__
struct qb_ipc_response_header header __attribute__((aligned(8)))
res_lib_cmap_delete
The res_lib_cmap_delete struct.
Definition ipc_cmap.h:109
res_lib_cmap_delete::__attribute__
struct qb_ipc_response_header header __attribute__((aligned(8)))
res_lib_cmap_get
The res_lib_cmap_get struct.
Definition ipc_cmap.h:125
res_lib_cmap_get::__attribute__
mar_uint8_t value[] __attribute__((aligned(8)))
res_lib_cmap_get::__attribute__
struct qb_ipc_response_header header __attribute__((aligned(8)))
res_lib_cmap_get::__attribute__
mar_uint8_t type __attribute__((aligned(8)))
res_lib_cmap_get::__attribute__
mar_size_t value_len __attribute__((aligned(8)))
res_lib_cmap_iter_finalize
The res_lib_cmap_iter_finalize struct.
Definition ipc_cmap.h:193
res_lib_cmap_iter_finalize::__attribute__
struct qb_ipc_response_header header __attribute__((aligned(8)))
res_lib_cmap_iter_init
The res_lib_cmap_iter_init struct.
Definition ipc_cmap.h:159
res_lib_cmap_iter_init::__attribute__
mar_uint64_t iter_handle __attribute__((aligned(8)))
res_lib_cmap_iter_init::__attribute__
struct qb_ipc_response_header header __attribute__((aligned(8)))
res_lib_cmap_iter_next
The res_lib_cmap_iter_next struct.
Definition ipc_cmap.h:175
res_lib_cmap_iter_next::__attribute__
mar_uint8_t type __attribute__((aligned(8)))
res_lib_cmap_iter_next::__attribute__
struct qb_ipc_response_header header __attribute__((aligned(8)))
res_lib_cmap_iter_next::__attribute__
mar_size_t value_len __attribute__((aligned(8)))
res_lib_cmap_iter_next::__attribute__
mar_name_t key_name __attribute__((aligned(8)))
res_lib_cmap_notify_callback
The res_lib_cmap_notify_callback struct.
Definition ipc_cmap.h:234
res_lib_cmap_notify_callback::__attribute__
mar_uint8_t old_value_type __attribute__((aligned(8)))
res_lib_cmap_notify_callback::__attribute__
mar_size_t old_value_len __attribute__((aligned(8)))
res_lib_cmap_notify_callback::__attribute__
mar_size_t new_value_len __attribute__((aligned(8)))
res_lib_cmap_notify_callback::__attribute__
mar_uint8_t new_value_type __attribute__((aligned(8)))
res_lib_cmap_notify_callback::__attribute__
mar_name_t key_name __attribute__((aligned(8)))
res_lib_cmap_notify_callback::__attribute__
struct qb_ipc_response_header header __attribute__((aligned(8)))
res_lib_cmap_notify_callback::__attribute__
mar_int32_t event __attribute__((aligned(8)))
res_lib_cmap_notify_callback::new_value
mar_uint8_t new_value[]
Definition ipc_cmap.h:250
res_lib_cmap_notify_callback::__attribute__
mar_uint64_t track_inst_handle __attribute__((aligned(8)))
res_lib_cmap_set
The res_lib_cmap_set struct.
Definition ipc_cmap.h:94
res_lib_cmap_set::__attribute__
struct qb_ipc_response_header header __attribute__((aligned(8)))
res_lib_cmap_track_add
The res_lib_cmap_track_add struct.
Definition ipc_cmap.h:210
res_lib_cmap_track_add::__attribute__
struct qb_ipc_response_header header __attribute__((aligned(8)))
res_lib_cmap_track_add::__attribute__
mar_uint64_t track_handle __attribute__((aligned(8)))
res_lib_cmap_track_delete
The res_lib_cmap_track_delete struct.
Definition ipc_cmap.h:226
res_lib_cmap_track_delete::__attribute__
struct qb_ipc_response_header header __attribute__((aligned(8)))
res_lib_cmap_track_delete::__attribute__
mar_uint64_t track_inst_handle __attribute__((aligned(8)))
type
char type
Definition totem.h:2
header
struct totem_message_header header
Definition totemsrp.c:0