cmap.c File Reference
`#include <config.h>`
`#include <sys/types.h>`
`#include <unistd.h>`
`#include <fcntl.h>`
`#include <stdlib.h>`
`#include <errno.h>`
`#include <poll.h>`
`#include <assert.h>`
`#include <qb/qbloop.h>`
`#include <qb/qblist.h>`
`#include <qb/qbipcs.h>`
`#include <qb/qbipc_common.h>`
`#include <corosync/corotypes.h>`
`#include <corosync/corodefs.h>`
`#include <corosync/mar_gen.h>`
`#include <corosync/ipc_cmap.h>`
`#include <corosync/logsys.h>`
`#include <corosync/coroapi.h>`
`#include <corosync/icmap.h>`
`#include "service.h"`
`#include "ipcs_stats.h"`
`#include "stats.h"`
Include dependency graph for exec/cmap.c:

Go to the source code of this file.

## Data Structures

struct | cmap_map
struct | cmap_conn_info
struct | cmap_track_user_data
struct | req_exec_cmap_mcast_item
struct | req_exec_cmap_mcast

## Macros

#define | MAX_REQ_EXEC_CMAP_MCAST_ITEMS 32
#define | ICMAP_VALUETYPE_NOT_EXIST 0

## Enumerations

enum | cmap_message_req_types { MESSAGE_REQ_EXEC_CMAP_MCAST = 0 }
enum | cmap_mcast_reason { CMAP_MCAST_REASON_SYNC = 0 , CMAP_MCAST_REASON_NEW_CONFIG_VERSION = 1 }

## Functions

| LOGSYS_DECLARE_SUBSYS ("CMAP")
struct corosync_service_engine * | cmap_get_service_engine_ver0 (void)

## Variables

struct cmap_map | icmap_map
struct cmap_map | stats_map
struct corosync_service_engine | cmap_service_engine

## Macro Definition Documentation

## ICMAP_VALUETYPE_NOT_EXIST

#define ICMAP_VALUETYPE_NOT_EXIST 0

Definition at line 65 of file exec/cmap.c.

## MAX_REQ_EXEC_CMAP_MCAST_ITEMS

#define MAX_REQ_EXEC_CMAP_MCAST_ITEMS 32

Definition at line 64 of file exec/cmap.c.

## Enumeration Type Documentation

## cmap_mcast_reason

enum cmap_mcast_reason

Enumerator
CMAP_MCAST_REASON_SYNC |
CMAP_MCAST_REASON_NEW_CONFIG_VERSION |

Definition at line 145 of file exec/cmap.c.

## cmap_message_req_types

enum cmap_message_req_types

Enumerator
MESSAGE_REQ_EXEC_CMAP_MCAST |

Definition at line 141 of file exec/cmap.c.

## Function Documentation

## cmap_get_service_engine_ver0()

struct corosync_service_engine * cmap_get_service_engine_ver0 | ( | void |  | ) |

Definition at line 284 of file exec/cmap.c.

References cmap_service_engine.

Referenced by LOGSYS_DECLARE_SUBSYS().

## LOGSYS_DECLARE_SUBSYS()

LOGSYS_DECLARE_SUBSYS | ( | "CMAP" |  | ) |

## Variable Documentation

## cmap_service_engine

struct corosync_service_engine cmap_service_engine

Initial value:
= {
.name = "corosync configuration map access",
.id = CMAP_SERVICE,
.priority = 1,
.private_data_size = sizeof(struct cmap_conn_info),
.flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED,
.allow_inquorate = CS_LIB_ALLOW_INQUORATE,
.lib_init_fn = cmap_lib_init_fn,
.lib_exit_fn = cmap_lib_exit_fn,
.lib_engine = cmap_lib_engine,
.lib_engine_count = sizeof (cmap_lib_engine) / sizeof (struct corosync_lib_handler),
.exec_init_fn = cmap_exec_init_fn,
.exec_exit_fn = cmap_exec_exit_fn,
.exec_engine = cmap_exec_engine,
.exec_engine_count = sizeof (cmap_exec_engine) / sizeof (struct corosync_exec_handler),
.sync_init = cmap_sync_init,
.sync_process = cmap_sync_process,
.sync_activate = cmap_sync_activate,
.sync_abort = cmap_sync_abort
}
CS_LIB_ALLOW_INQUORATE
@ CS_LIB_ALLOW_INQUORATE
Definition coroapi.h:164
CS_LIB_FLOW_CONTROL_NOT_REQUIRED
@ CS_LIB_FLOW_CONTROL_NOT_REQUIRED
Definition coroapi.h:153
CMAP_SERVICE
@ CMAP_SERVICE
Definition corodefs.h:44
cmap_conn_info
Definition exec/cmap.c:126
corosync_exec_handler
The corosync_exec_handler struct.
Definition coroapi.h:475
corosync_lib_handler
The corosync_lib_handler struct.
Definition coroapi.h:467
sync_init
int sync_init(int(*sync_callbacks_retrieve)(int service_id, struct sync_callbacks *callbacks), void(*synchronization_completed)(void))
Definition sync.c:158

Definition at line 263 of file exec/cmap.c.

Referenced by cmap_get_service_engine_ver0().

## icmap_map

struct cmap_map icmap_map

Initial value:
= {
.map_get = icmap_get,
.map_set = icmap_set,
.map_adjust_int = icmap_adjust_int,
.map_delete = icmap_delete,
.map_is_key_ro = icmap_is_key_ro,
.map_iter_init = icmap_iter_init,
.map_iter_next = icmap_iter_next,
.map_iter_finalize = icmap_iter_finalize,
.map_track_add = icmap_track_add,
.map_track_delete = icmap_track_delete,
.map_track_get_user_data = icmap_track_get_user_data,
}
icmap_set
cs_error_t icmap_set(const char *key_name, const void *value, size_t value_len, icmap_value_types_t type)
Store value with value_len length and type as key_name name in global icmap.
Definition icmap.c:491
icmap_adjust_int
cs_error_t icmap_adjust_int(const char *key_name, int32_t step)
icmap_adjust_int
Definition icmap.c:983
icmap_delete
cs_error_t icmap_delete(const char *key_name)
Delete key from map.
Definition icmap.c:657
icmap_track_add
cs_error_t icmap_track_add(const char *key_name, int32_t track_type, icmap_notify_fn_t notify_fn, void *user_data, icmap_track_t *icmap_track)
Add tracking function for given key_name.
Definition icmap.c:1163
icmap_iter_init
icmap_iter_t icmap_iter_init(const char *prefix)
Initialize iterator with given prefix.
Definition icmap.c:1093
icmap_iter_next
const char * icmap_iter_next(icmap_iter_t iter, size_t *value_len, icmap_value_types_t *type)
Return next item in iterator iter.
Definition icmap.c:1099
icmap_get
cs_error_t icmap_get(const char *key_name, void *value, size_t *value_len, icmap_value_types_t *type)
Retrieve value of key key_name and store it in user preallocated value pointer.
Definition icmap.c:729
icmap_iter_finalize
void icmap_iter_finalize(icmap_iter_t iter)
Finalize iterator.
Definition icmap.c:1120
icmap_track_delete
cs_error_t icmap_track_delete(icmap_track_t icmap_track)
Remove previously added track.
Definition icmap.c:1208
icmap_track_get_user_data
void * icmap_track_get_user_data(icmap_track_t icmap_track)
Return user data associated with given track.
Definition icmap.c:1224
icmap_is_key_ro
int icmap_is_key_ro(const char *key_name)
Check in given key is read only.
Definition icmap.c:1276

Definition at line 98 of file exec/cmap.c.

## stats_map

struct cmap_map stats_map

Initial value:
= {
.map_get = stats_map_get,
.map_set = stats_map_set,
.map_adjust_int = stats_map_adjust_int,
.map_delete = stats_map_delete,
.map_is_key_ro = stats_map_is_key_ro,
.map_iter_init = stats_map_iter_init,
.map_iter_next = stats_map_iter_next,
.map_iter_finalize = stats_map_iter_finalize,
.map_track_add = stats_map_track_add,
.map_track_delete = stats_map_track_delete,
.map_track_get_user_data = stats_map_track_get_user_data,
}
stats_map_iter_next
const char * stats_map_iter_next(icmap_iter_t iter, size_t *value_len, icmap_value_types_t *type)
Definition stats.c:541
stats_map_track_get_user_data
void * stats_map_track_get_user_data(icmap_track_t icmap_track)
Definition stats.c:722
stats_map_delete
cs_error_t stats_map_delete(const char *key_name)
Definition stats.c:520
stats_map_track_delete
cs_error_t stats_map_track_delete(icmap_track_t icmap_track)
Definition stats.c:700
stats_map_iter_init
icmap_iter_t stats_map_iter_init(const char *prefix)
Definition stats.c:535
stats_map_is_key_ro
int stats_map_is_key_ro(const char *key_name)
Definition stats.c:525
stats_map_set
cs_error_t stats_map_set(const char *key_name, const void *value, size_t value_len, icmap_value_types_t type)
Definition stats.c:480
stats_map_iter_finalize
void stats_map_iter_finalize(icmap_iter_t iter)
Definition stats.c:555
stats_map_get
cs_error_t stats_map_get(const char *key_name, void *value, size_t *value_len, icmap_value_types_t *type)
Definition stats.c:325
stats_map_adjust_int
cs_error_t stats_map_adjust_int(const char *key_name, int32_t step)
Definition stats.c:515
stats_map_track_add
cs_error_t stats_map_track_add(const char *key_name, int32_t track_type, icmap_notify_fn_t notify_fn, void *user_data, icmap_track_t *icmap_track)
Definition stats.c:637

Definition at line 112 of file exec/cmap.c.

Referenced by LOGSYS_DECLARE_SUBSYS(), stats_map_get(), stats_map_init(), stats_map_iter_init(), stats_map_track_add(), and stats_map_track_delete().