Преглед изворни кода

Adds doxygen stubs to include directory

Signed-off-by: Michael Jones <jonesmz@jonesmz.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Michael Jones пре 9 година
родитељ
комит
dfae95cce9

+ 84 - 2
include/corosync/cfg.h

@@ -60,15 +60,24 @@ typedef enum {
 	COROSYNC_CFG_SHUTDOWN_FLAG_IMMEDIATE = 2,
 } corosync_cfg_shutdown_flags_t;
 
+/**
+ * @brief enum corosync_cfg_shutdown_reply_flags_t
+ */
 typedef enum {
 	COROSYNC_CFG_SHUTDOWN_FLAG_NO = 0,
 	COROSYNC_CFG_SHUTDOWN_FLAG_YES = 1,
 } corosync_cfg_shutdown_reply_flags_t;
 
+/**
+ * @brief corosync_cfg_shutdown_callback_t callback
+ */
 typedef void (*corosync_cfg_shutdown_callback_t) (
 	corosync_cfg_handle_t cfg_handle,
 	corosync_cfg_shutdown_flags_t flags);
 
+/**
+ * @brief struct corosync_cfg_shutdown_callback_t
+ */
 typedef struct {
 	corosync_cfg_shutdown_callback_t corosync_cfg_shutdown_callback;
 } corosync_cfg_callbacks_t;
@@ -89,7 +98,6 @@ typedef struct
 	char address[sizeof(struct sockaddr_in6)];
 } corosync_cfg_node_address_t;
 
-
 /*
  * Interfaces
  */
@@ -97,25 +105,56 @@ typedef struct
 extern "C" {
 #endif
 
+/**
+ * @brief corosync_cfg_initialize
+ * @param cfg_handle
+ * @param cfg_callbacks
+ * @return
+ */
 cs_error_t
 corosync_cfg_initialize (
 	corosync_cfg_handle_t *cfg_handle,
 	const corosync_cfg_callbacks_t *cfg_callbacks);
 
+/**
+ * @brief corosync_cfg_fd_get
+ * @param cfg_handle
+ * @param selection_fd
+ * @return
+ */
 cs_error_t
 corosync_cfg_fd_get (
 	corosync_cfg_handle_t cfg_handle,
 	int32_t *selection_fd);
 
+/**
+ * @brief corosync_cfg_dispatch
+ * @param cfg_handle
+ * @param dispatch_flags
+ * @return
+ */
 cs_error_t
 corosync_cfg_dispatch (
 	corosync_cfg_handle_t cfg_handle,
 	cs_dispatch_flags_t dispatch_flags);
 
+/**
+ * @brief corosync_cfg_finalize
+ * @param cfg_handle
+ * @return
+ */
 cs_error_t
 corosync_cfg_finalize (
 	corosync_cfg_handle_t cfg_handle);
 
+/**
+ * @brief corosync_cfg_ring_status_get
+ * @param cfg_handle
+ * @param interface_names
+ * @param status
+ * @param interface_count
+ * @return
+ */
 cs_error_t
 corosync_cfg_ring_status_get (
 	corosync_cfg_handle_t cfg_handle,
@@ -123,27 +162,59 @@ corosync_cfg_ring_status_get (
 	char ***status,
 	unsigned int *interface_count);
 
+/**
+ * @brief corosync_cfg_ring_reenable
+ * @param cfg_handle
+ * @return
+ */
 cs_error_t
 corosync_cfg_ring_reenable (
 	corosync_cfg_handle_t cfg_handle);
 
+/**
+ * @brief corosync_cfg_kill_node
+ * @param cfg_handle
+ * @param nodeid
+ * @param reason
+ * @return
+ */
 cs_error_t
 corosync_cfg_kill_node (
 	corosync_cfg_handle_t cfg_handle,
 	unsigned int nodeid,
 	const char *reason);
 
+/**
+ * @brief corosync_cfg_try_shutdown
+ * @param cfg_handle
+ * @param flags
+ * @return
+ */
 cs_error_t
 corosync_cfg_try_shutdown (
 	corosync_cfg_handle_t cfg_handle,
 	corosync_cfg_shutdown_flags_t flags);
 
-
+/**
+ * @brief corosync_cfg_replyto_shutdown
+ * @param cfg_handle
+ * @param flags
+ * @return
+ */
 cs_error_t
 corosync_cfg_replyto_shutdown (
 	corosync_cfg_handle_t cfg_handle,
 	corosync_cfg_shutdown_reply_flags_t flags);
 
+/**
+ * @brief corosync_cfg_get_node_addrs
+ * @param cfg_handle
+ * @param nodeid
+ * @param max_addrs
+ * @param num_addrs
+ * @param addrs
+ * @return
+ */
 cs_error_t
 corosync_cfg_get_node_addrs (
 	corosync_cfg_handle_t cfg_handle,
@@ -152,11 +223,22 @@ corosync_cfg_get_node_addrs (
 	int *num_addrs,
 	corosync_cfg_node_address_t *addrs);
 
+/**
+ * @brief corosync_cfg_local_get
+ * @param handle
+ * @param local_nodeid
+ * @return
+ */
 cs_error_t
 corosync_cfg_local_get (
 	corosync_cfg_handle_t handle,
 	unsigned int *local_nodeid);
 
+/**
+ * @brief corosync_cfg_reload_config
+ * @param handle
+ * @return
+ */
 cs_error_t corosync_cfg_reload_config (
 	corosync_cfg_handle_t handle);
 

+ 41 - 18
include/corosync/cmap.h

@@ -78,14 +78,15 @@ typedef uint64_t cmap_track_handle_t;
 #define CMAP_TRACK_ADD		4
 #define CMAP_TRACK_DELETE	1
 #define CMAP_TRACK_MODIFY	2
-/*
+
+/**
  * Whole prefix is tracked, instead of key only (so "totem." tracking means that
  * "totem.nodeid", "totem.version", ... applies). This value is also never returned
  * inside of callback and is used only in adding track
  */
 #define CMAP_TRACK_PREFIX	8
 
-/*
+/**
  * Possible types of value. Binary is raw data without trailing zero with given length
  */
 typedef enum {
@@ -103,7 +104,7 @@ typedef enum {
     CMAP_VALUETYPE_BINARY	= 12,
 } cmap_value_types_t;
 
-/*
+/**
  * Structure passed as new_value and old_value in change callback. It contains type of
  * key, length of key and pointer to value of key
  */
@@ -113,7 +114,7 @@ struct cmap_notify_value {
 	const void *data;
 };
 
-/*
+/**
  * Prototype for notify callback function. Even is one of CMAP_TRACK_* event, key_name is
  * changed key, new and old_value contains values or are zeroed (in other words, type is non
  * existing 0 type) if there were no old (creating of key) or new (deleting of key) value.
@@ -144,7 +145,7 @@ extern cs_error_t cmap_initialize (
 extern cs_error_t cmap_finalize (
 	cmap_handle_t handle);
 
-/*
+/**
  * Get a file descriptor on which to poll.  cmap_handle_t is NOT a
  * file descriptor and may not be used directly.
  * @param handle cmap handle initialized by cmap_initialize
@@ -162,18 +163,26 @@ extern cs_error_t cmap_fd_get (
 extern cs_error_t cmap_dispatch (
 	cmap_handle_t handle,
 	cs_dispatch_flags_t dispatch_types);
-/*
- * Get/set context variable
+/**
+ * @brief cmap_context_get
+ * @param handle
+ * @param context
+ * @return
  */
 extern cs_error_t cmap_context_get (
 	cmap_handle_t handle,
 	const void **context);
 
+/**
+ * @brief cmap_context_set
+ * @param handle
+ * @param context
+ * @return
+ */
 extern cs_error_t cmap_context_set (
 	cmap_handle_t handle,
 	const void *context);
 
-
 /**
  * Store value in cmap
  * @param handle cmap handle
@@ -212,7 +221,8 @@ extern cs_error_t cmap_set_string(cmap_handle_t handle, const char *key_name, co
 extern cs_error_t cmap_delete(cmap_handle_t handle, const char *key_name);
 
 /**
- * Retrieve value of key key_name and store it in user preallocated value pointer.
+ * @brief Retrieve value of key key_name and store it in user preallocated value pointer.
+ *
  * value can be NULL, and then only value_len and/or type is returned (both of them
  * can also be NULL). If value is not NULL, actual length of value in map is checked
  * against value_len. If *value_len is shorter then length of value in map, error
@@ -248,8 +258,10 @@ extern cs_error_t cmap_get_float(cmap_handle_t handle, const char *key_name, flo
 extern cs_error_t cmap_get_double(cmap_handle_t handle, const char *key_name, double *dbl);
 
 /**
- * Shortcut for cmap_get for string type. Returned string is newly allocated and
- * caller is responsible for freeing memory
+ * @brief Shortcut for cmap_get for string type.
+ *
+ * Returned string is newly allocated and caller is responsible for freeing memory
+ *
  * @param handle cmap handle
  * @param key_name name of key to get value from
  * @param str pointer where char pointer will be stored
@@ -257,21 +269,24 @@ extern cs_error_t cmap_get_double(cmap_handle_t handle, const char *key_name, do
 extern cs_error_t cmap_get_string(cmap_handle_t handle, const char *key_name, char **str);
 
 /**
- * Increment value of key_name if it is [u]int* type
+ * @brief Increment value of key_name if it is [u]int* type
+ *
  * @param handle cmap handle
  * @param key_name key name
  */
 extern cs_error_t cmap_inc(cmap_handle_t handle, const char *key_name);
 
 /**
- * Decrement value of key_name if it is [u]int* type
+ * @brief Decrement value of key_name if it is [u]int* type
+ *
  * @param handle cmap handle
  * @param key_name key name
  */
 extern cs_error_t cmap_dec(cmap_handle_t handle, const char *key_name);
 
 /**
- * Initialize iterator with given prefix
+ * @brief Initialize iterator with given prefix
+ *
  * @param handle cmap handle
  * @param prefix prefix to iterate on
  * @param cmap_iter_handle value used for getting next value of iterator and/or deleting iteration
@@ -279,7 +294,9 @@ extern cs_error_t cmap_dec(cmap_handle_t handle, const char *key_name);
 extern cs_error_t cmap_iter_init(cmap_handle_t handle, const char *prefix, cmap_iter_handle_t *cmap_iter_handle);
 
 /**
- * Return next item in iterator iter. value_len and type are optional (= can be NULL), but if set,
+ * @brief Return next item in iterator iter.
+ *
+ * value_len and type are optional (= can be NULL), but if set,
  * length of returned value and/or type is returned.
  *
  * @param handle cmap handle
@@ -297,14 +314,20 @@ extern cs_error_t cmap_iter_next(
 		cmap_value_types_t *type);
 
 /**
- * Finalize iterator
+ * @brief Finalize iterator
+ * @param handle
+ * @param iter_handle
+ * @return
  */
 extern cs_error_t cmap_iter_finalize(cmap_handle_t handle, cmap_iter_handle_t iter_handle);
 
-/*
- * Add tracking function for given key_name. Tracked changes (add|modify|delete) depend on track_type,
+/**
+ * @brief Add tracking function for given key_name.
+ *
+ * Tracked changes (add|modify|delete) depend on track_type,
  * which is bitwise or of CMAP_TRACK_* values. notify_fn is called on change, where user_data pointer
  * is passed (unchanged). Value which can be used to delete tracking is passed as cmap_track.
+ *
  * @param handle cmap handle
  * @param key_name name of key to track changes on
  * @param track_type bitwise-or of CMAP_TRACK_* values

+ 61 - 1
include/corosync/coroapi.h

@@ -44,11 +44,18 @@
 #include <qb/qbloop.h>
 #include <corosync/swab.h>
 
+/**
+ * @brief The mar_message_source_t struct
+ */
 typedef struct {
 	uint32_t nodeid __attribute__((aligned(8)));
 	void *conn __attribute__((aligned(8)));
 } mar_message_source_t __attribute__((aligned(8)));
 
+/**
+ * @brief swab_mar_message_source_t
+ * @param to_swab
+ */
 static inline void swab_mar_message_source_t (mar_message_source_t *to_swab)
 {
 	swab32 (to_swab->nodeid);
@@ -61,10 +68,16 @@ static inline void swab_mar_message_source_t (mar_message_source_t *to_swab)
 }
 
 #ifndef TIMER_HANDLE_T
+/**
+ * @brief corosync_timer_handle_t
+ */
 typedef qb_loop_timer_handle corosync_timer_handle_t;
 #define TIMER_HANDLE_T 1
 #endif
 
+/**
+ * @brief The corosync_tpg_group struct
+ */
 struct corosync_tpg_group {
 	const void *group;
 	size_t group_len;
@@ -92,6 +105,9 @@ struct corosync_tpg_group {
 #define MILLI_2_NANO_SECONDS 1000000ULL
 
 #if !defined(TOTEM_IP_ADDRESS)
+/**
+ * @brief The totem_ip_address struct
+ */
 struct totem_ip_address {
 	unsigned int   nodeid;
 	unsigned short family;
@@ -100,6 +116,9 @@ struct totem_ip_address {
 #endif
 
 #if !defined(MEMB_RING_ID)
+/**
+ * @brief The memb_ring_id struct
+ */
 struct memb_ring_id {
 	struct totem_ip_address rep;
 	unsigned long long seq;
@@ -107,6 +126,9 @@ struct memb_ring_id {
 #endif
 
 #if !defined(TOTEM_CONFIGURATION_TYPE)
+/**
+ * @brief The totem_configuration_type enum
+ */
 enum totem_configuration_type {
 	TOTEM_CONFIGURATION_REGULAR,
 	TOTEM_CONFIGURATION_TRANSITIONAL
@@ -114,12 +136,18 @@ enum totem_configuration_type {
 #endif
 
 #if !defined(TOTEM_CALLBACK_TOKEN_TYPE)
+/**
+ * @brief The totem_callback_token_type enum
+ */
 enum totem_callback_token_type {
 	TOTEM_CALLBACK_TOKEN_RECEIVED = 1,
 	TOTEM_CALLBACK_TOKEN_SENT = 2
 };
 #endif
 
+/**
+ * @brief The cs_lib_flow_control enum
+ */
 enum cs_lib_flow_control {
 	CS_LIB_FLOW_CONTROL_REQUIRED = 1,
 	CS_LIB_FLOW_CONTROL_NOT_REQUIRED = 2
@@ -128,12 +156,18 @@ enum cs_lib_flow_control {
 #define COROSYNC_LIB_FLOW_CONTROL_REQUIRED CS_LIB_FLOW_CONTROL_REQUIRED
 #define COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED CS_LIB_FLOW_CONTROL_NOT_REQUIRED
 
+/**
+ * @brief The cs_lib_allow_inquorate enum
+ */
 enum cs_lib_allow_inquorate {
 	CS_LIB_DISALLOW_INQUORATE = 0, /* default */
 	CS_LIB_ALLOW_INQUORATE = 1
 };
 
 #if !defined (COROSYNC_FLOW_CONTROL_STATE)
+/**
+ * @brief The cs_flow_control_state enum
+ */
 enum cs_flow_control_state {
 	CS_FLOW_CONTROL_STATE_DISABLED,
 	CS_FLOW_CONTROL_STATE_ENABLED
@@ -143,7 +177,9 @@ enum cs_flow_control_state {
 #define CS_FLOW_CONTROL_STATE_ENABLED CS_FLOW_CONTROL_STATE_ENABLED
 
 #endif /* COROSYNC_FLOW_CONTROL_STATE */
-
+/**
+ * @brief The cs_fatal_error_t enum.
+ */
 typedef enum {
 	COROSYNC_FATAL_ERROR_EXIT = -1,
 	COROSYNC_LIBAIS_SOCKET = -6,
@@ -157,14 +193,23 @@ typedef enum {
 #define corosync_fatal_error_t cs_fatal_error_t;
 
 #ifndef QUORUM_H_DEFINED
+/**
+ *@brief The quorum_callback_fn_t callback
+ */
 typedef void (*quorum_callback_fn_t) (int quorate, void *context);
 
+/**
+ * @brief The quorum_callin_functions struct
+ */
 struct quorum_callin_functions {
 	int (*quorate) (void);
 	int (*register_callback) (quorum_callback_fn_t callback_fn, void *contexxt);
 	int (*unregister_callback) (quorum_callback_fn_t callback_fn, void *context);
 };
 
+/**
+ * @brief The sync_callback_fn_t callback
+ */
 typedef void (*sync_callback_fn_t) (
 	const unsigned int *view_list,
 	size_t view_list_entries,
@@ -174,6 +219,9 @@ typedef void (*sync_callback_fn_t) (
 #endif /* QUORUM_H_DEFINED */
 
 
+/**
+ * @brief The corosync_api_v1 struct
+ */
 struct corosync_api_v1 {
 	/*
 	 * Time and timer APIs
@@ -414,20 +462,32 @@ struct corosync_api_v1 {
 
 #define SERVICES_COUNT_MAX 64
 
+/**
+ * @brief The corosync_lib_handler struct
+ */
 struct corosync_lib_handler {
 	void (*lib_handler_fn) (void *conn, const void *msg);
 	enum cs_lib_flow_control flow_control;
 };
 
+/**
+ * @brief The corosync_exec_handler struct
+ */
 struct corosync_exec_handler {
 	void (*exec_handler_fn) (const void *msg, unsigned int nodeid);
 	void (*exec_endian_convert_fn) (void *msg);
 };
 
+/**
+ * @brief The corosync_service_engine_iface_ver0 struct
+ */
 struct corosync_service_engine_iface_ver0 {
         struct corosync_service_engine *(*corosync_get_service_engine_ver0) (void);
 };
 
+/**
+ * @brief The corosync_service_engine struct
+ */
 struct corosync_service_engine {
 	const char *name;
 	unsigned short id;

+ 3 - 0
include/corosync/corodefs.h

@@ -37,6 +37,9 @@
 
 #include <netinet/in.h>
 
+/**
+ * @brief The corosync_service_types enum
+ */
 enum corosync_service_types {
 	CMAP_SERVICE = 0,
 	CFG_SERVICE = 1,

+ 38 - 1
include/corosync/corotypes.h

@@ -45,6 +45,9 @@
 extern "C" {
 #endif
 
+/**
+ * @brief cs_time_t
+ */
 typedef int64_t cs_time_t;
 
 #define CS_FALSE 0
@@ -53,17 +56,27 @@ typedef int64_t cs_time_t;
 #define CS_TIME_END    ((cs_time_t)0x7FFFFFFFFFFFFFFFULL)
 #define CS_MAX(x, y) (((x) > (y)) ? (x) : (y))
 
+/**
+ * @brief The cs_name_t struct
+ */
 typedef struct {
    uint16_t length;
    uint8_t value[CS_MAX_NAME_LENGTH];
 } cs_name_t;
 
+
+/**
+ * @brief The cs_version_t struct
+ */
 typedef struct {
    char releaseCode;
    unsigned char majorVersion;
    unsigned char minorVersion;
 } cs_version_t;
 
+/**
+ * @brief The cs_dispatch_flags_t enum
+ */
 typedef enum {
 	CS_DISPATCH_ONE = 1,
 	CS_DISPATCH_ALL = 2,
@@ -75,6 +88,9 @@ typedef enum {
 #define CS_TRACK_CHANGES 0x02
 #define CS_TRACK_CHANGES_ONLY 0x04
 
+/**
+ * @brief The cs_error_t enum
+ */
 typedef enum {
    CS_OK = 1,
    CS_ERR_LIBRARY = 2,
@@ -116,6 +132,11 @@ typedef enum {
 #define CS_TIME_US_IN_MSEC  1000ULL
 #define CS_TIME_NS_IN_MSEC  1000000ULL
 #define CS_TIME_NS_IN_USEC  1000ULL
+
+/**
+ * @brief cs_timestamp_get
+ * @return
+ */
 static inline uint64_t cs_timestamp_get(void)
 {
 	uint64_t result;
@@ -135,9 +156,25 @@ static inline uint64_t cs_timestamp_get(void)
 
 	return result;
 }
-
+/**
+ * @brief qb_to_cs_error
+ * @param result
+ * @return
+ */
 cs_error_t qb_to_cs_error (int result);
+
+/**
+ * @brief cs_strerror
+ * @param err
+ * @return
+ */
 const char * cs_strerror(cs_error_t err);
+
+/**
+ * @brief hdb_error_to_cs
+ * @param res
+ * @return
+ */
 cs_error_t hdb_error_to_cs (int res);
 
 #ifdef __cplusplus

+ 151 - 15
include/corosync/cpg.h

@@ -47,10 +47,19 @@ extern "C" {
  *
  * @{
  */
+/**
+ * @brief cpg_handle_t
+ */
 typedef uint64_t cpg_handle_t;
 
+/**
+ * @brief cpg_iteration_handle_t
+ */
 typedef uint64_t cpg_iteration_handle_t;
 
+/**
+ * @brief The cpg_guarantee_t enum
+ */
 typedef enum {
 	CPG_TYPE_UNORDERED, /**< not implemented */
 	CPG_TYPE_FIFO,      /**< same as agreed */
@@ -58,12 +67,18 @@ typedef enum {
 	CPG_TYPE_SAFE       /**< not implemented */
 } cpg_guarantee_t;
 
+/**
+ * @brief The cpg_flow_control_state_t enum
+ */
 typedef enum {
 	CPG_FLOW_CONTROL_DISABLED, /**< flow control is disabled - new messages may be sent */
 	CPG_FLOW_CONTROL_ENABLED   /**< flow control is enabled - new messages should not be sent */
 } cpg_flow_control_state_t;
 
 
+/**
+ * @brief The cpg_reason_t enum
+ */
 typedef enum {
 	CPG_REASON_JOIN = 1,
 	CPG_REASON_LEAVE = 2,
@@ -72,16 +87,25 @@ typedef enum {
 	CPG_REASON_PROCDOWN = 5
 } cpg_reason_t;
 
+/**
+ * @brief The cpg_iteration_type_t enum
+ */
 typedef enum {
 	CPG_ITERATION_NAME_ONLY = 1,
 	CPG_ITERATION_ONE_GROUP = 2,
 	CPG_ITERATION_ALL = 3,
 } cpg_iteration_type_t;
 
+/**
+ * @brief The cpg_model_t enum
+ */
 typedef enum {
 	CPG_MODEL_V1 = 1,
 } cpg_model_t;
 
+/**
+ * @brief The cpg_address struct
+ */
 struct cpg_address {
 	uint32_t nodeid;
 	uint32_t pid;
@@ -89,6 +113,9 @@ struct cpg_address {
 };
 
 #define CPG_MAX_NAME_LENGTH 128
+/**
+ * @brief The cpg_name struct
+ */
 struct cpg_name {
 	uint32_t length;
 	char value[CPG_MAX_NAME_LENGTH];
@@ -96,17 +123,26 @@ struct cpg_name {
 
 #define CPG_MEMBERS_MAX 128
 
+/**
+ * @brief The cpg_iteration_description_t struct
+ */
 struct cpg_iteration_description_t {
 	struct cpg_name group;
 	uint32_t nodeid;
 	uint32_t pid;
 };
 
+/**
+ * @brief The cpg_ring_id struct
+ */
 struct cpg_ring_id {
 	uint32_t nodeid;
 	uint64_t seq;
 };
 
+/**
+ * @brief The cpg_deliver_fn_t callback
+ */
 typedef void (*cpg_deliver_fn_t) (
 	cpg_handle_t handle,
 	const struct cpg_name *group_name,
@@ -119,6 +155,9 @@ typedef void (*cpg_deliver_fn_t) (
 	void *msg,
 	size_t msg_len);
 
+/**
+ * @brief The cpg_confchg_fn_t callback
+ */
 typedef void (*cpg_confchg_fn_t) (
 	cpg_handle_t handle,
 	const struct cpg_name *group_name,
@@ -126,23 +165,35 @@ typedef void (*cpg_confchg_fn_t) (
 	const struct cpg_address *left_list, size_t left_list_entries,
 	const struct cpg_address *joined_list, size_t joined_list_entries);
 
+/**
+ * @brief The cpg_totem_confchg_fn_t callback
+ */
 typedef void (*cpg_totem_confchg_fn_t) (
 	cpg_handle_t handle,
 	struct cpg_ring_id ring_id,
 	uint32_t member_list_entries,
 	const uint32_t *member_list);
 
+/**
+ * @brief The cpg_callbacks_t struct
+ */
 typedef struct {
 	cpg_deliver_fn_t cpg_deliver_fn;
 	cpg_confchg_fn_t cpg_confchg_fn;
 } cpg_callbacks_t;
 
+/**
+ * @brief The cpg_model_data_t struct
+ */
 typedef struct {
 	cpg_model_t model;
 } cpg_model_data_t;
 
 #define CPG_MODEL_V1_DELIVER_INITIAL_TOTEM_CONF 0x01
 
+/**
+ * @brief The cpg_model_v1_data_t struct
+ */
 typedef struct {
 	cpg_model_t model;
 	cpg_deliver_fn_t cpg_deliver_fn;
@@ -155,14 +206,22 @@ typedef struct {
 /** @} */
 
 /**
- * Create a new cpg connection
+ * @brief Create a new cpg connection
+ * @param handle
+ * @param callbacks
+ * @return
  */
 cs_error_t cpg_initialize (
 	cpg_handle_t *handle,
 	cpg_callbacks_t *callbacks);
 
 /**
- * Create a new cpg connection, initialize with model
+ * @brief Create a new cpg connection, initialize with model
+ * @param handle
+ * @param model
+ * @param model_data
+ * @param context
+ * @return
  */
 cs_error_t cpg_model_initialize (
 	cpg_handle_t *handle,
@@ -171,69 +230,93 @@ cs_error_t cpg_model_initialize (
 	void *context);
 
 /**
- * Close the cpg handle
+ * @brief Close the cpg handle
+ * @param handle
+ * @return
  */
 cs_error_t cpg_finalize (
 	cpg_handle_t handle);
 
 /**
- * Get a file descriptor on which to poll.
+ * @brief Get a file descriptor on which to poll.
  *
  * cpg_handle_t is NOT a file descriptor and may not be used directly.
+ *
+ * @param handle
+ * @param fd
+ * @return
  */
 cs_error_t cpg_fd_get (
 	cpg_handle_t handle,
 	int *fd);
 
 /**
- * Get maximum size of a message that will not be fragmented
+ * @brief Get maximum size of a message that will not be fragmented
+ * @param handle
+ * @param size
+ * @return
  */
 cs_error_t cpg_max_atomic_msgsize_get (
 	cpg_handle_t handle,
 	uint32_t *size);
 
 /**
- * Get contexts for a CPG handle
+ * @brief Get contexts for a CPG handle
+ * @param handle
+ * @param context
+ * @return
  */
 cs_error_t cpg_context_get (
 	cpg_handle_t handle,
 	void **context);
 
 /**
- * Set contexts for a CPG handle
+ * @brief Set contexts for a CPG handle
+ * @param handle
+ * @param context
+ * @return
  */
 cs_error_t cpg_context_set (
 	cpg_handle_t handle,
 	void *context);
 
-
 /**
- * Dispatch messages and configuration changes
+ * @brief  Dispatch messages and configuration changes
+ * @param handle
+ * @param dispatch_types
+ * @return
  */
 cs_error_t cpg_dispatch (
 	cpg_handle_t handle,
 	cs_dispatch_flags_t dispatch_types);
 
 /**
- * Join one or more groups.
+ * @brief Join one or more groups.
  *
  * messages multicasted with cpg_mcast_joined will be sent to every
  * group that has been joined on handle handle.  Any message multicasted
  * to a group that has been previously joined will be delivered in cpg_dispatch
+ *
+ * @param handle
+ * @param group
+ * @return
  */
 cs_error_t cpg_join (
 	cpg_handle_t handle,
 	const struct cpg_name *group);
 
 /**
- * Leave one or more groups
+ * @brief Leave one or more groups
+ * @param handle
+ * @param group
+ * @return
  */
 cs_error_t cpg_leave (
 	cpg_handle_t handle,
 	const struct cpg_name *group);
 
 /**
- * Multicast to groups joined with cpg_join.
+ * @brief Multicast to groups joined with cpg_join.
  *
  * @param handle
  * @param guarantee
@@ -248,31 +331,68 @@ cs_error_t cpg_mcast_joined (
 	unsigned int iov_len);
 
 /**
- * Get membership information from cpg
+ * @brief Get membership information from cpg
+ * @param handle
+ * @param groupName
+ * @param member_list
+ * @param member_list_entries
+ * @return
  */
 cs_error_t cpg_membership_get (
 	cpg_handle_t handle,
 	struct cpg_name *groupName,
 	struct cpg_address *member_list,
 	int *member_list_entries);
-
+/**
+ * @brief cpg_local_get
+ * @param handle
+ * @param local_nodeid
+ * @return
+ */
 cs_error_t cpg_local_get (
 	cpg_handle_t handle,
 	unsigned int *local_nodeid);
 
+/**
+ * @brief cpg_flow_control_state_get
+ * @param handle
+ * @param flow_control_enabled
+ * @return
+ */
 cs_error_t cpg_flow_control_state_get (
 	cpg_handle_t handle,
 	cpg_flow_control_state_t *flow_control_enabled);
 
+/**
+ * @brief cpg_zcb_alloc
+ * @param handle
+ * @param size
+ * @param buffer
+ * @return
+ */
 cs_error_t cpg_zcb_alloc (
 	cpg_handle_t handle,
 	size_t size,
 	void **buffer);
 
+/**
+ * @brief cpg_zcb_free
+ * @param handle
+ * @param buffer
+ * @return
+ */
 cs_error_t cpg_zcb_free (
 	cpg_handle_t handle,
 	void *buffer);
 
+/**
+ * @brief cpg_zcb_mcast_joined
+ * @param handle
+ * @param guarantee
+ * @param msg
+ * @param msg_len
+ * @return
+ */
 cs_error_t cpg_zcb_mcast_joined (
 	cpg_handle_t handle,
 	cpg_guarantee_t guarantee,
@@ -280,7 +400,12 @@ cs_error_t cpg_zcb_mcast_joined (
 	size_t msg_len);
 
 /**
- * Iteration
+ * @brief cpg_iteration_initialize
+ * @param handle
+ * @param iteration_type
+ * @param group
+ * @param cpg_iteration_handle
+ * @return
  */
 cs_error_t cpg_iteration_initialize(
 	cpg_handle_t handle,
@@ -288,10 +413,21 @@ cs_error_t cpg_iteration_initialize(
 	const struct cpg_name *group,
 	cpg_iteration_handle_t *cpg_iteration_handle);
 
+/**
+ * @brief cpg_iteration_next
+ * @param handle
+ * @param description
+ * @return
+ */
 cs_error_t cpg_iteration_next(
 	cpg_iteration_handle_t handle,
 	struct cpg_iteration_description_t *description);
 
+/**
+ * @brief cpg_iteration_finalize
+ * @param handle
+ * @return
+ */
 cs_error_t cpg_iteration_finalize (
 	cpg_iteration_handle_t handle);
 

+ 85 - 1
include/corosync/hdb.h

@@ -59,20 +59,37 @@ typedef qb_handle_t hdb_handle_t;
 
 #define hdb_handle_database qb_hdb
 
+/**
+ * @brief hdb_database_lock
+ * @param mutex
+ */
 static inline void hdb_database_lock (pthread_mutex_t *mutex)
 {
 	pthread_mutex_lock (mutex);
 }
 
+/**
+ * @brief hdb_database_unlock
+ * @param mutex
+ */
 static inline void hdb_database_unlock (pthread_mutex_t *mutex)
 {
 	pthread_mutex_unlock (mutex);
 }
+
+/**
+ * @brief hdb_database_lock_init
+ * @param mutex
+ */
 static inline void hdb_database_lock_init (pthread_mutex_t *mutex)
 {
 	pthread_mutex_init (mutex, NULL);
 }
 
+/**
+ * @brief hdb_database_lock_destroy
+ * @param mutex
+ */
 static inline void hdb_database_lock_destroy (pthread_mutex_t *mutex)
 {
 	pthread_mutex_destroy (mutex);
@@ -80,19 +97,33 @@ static inline void hdb_database_lock_destroy (pthread_mutex_t *mutex)
 
 #define DECLARE_HDB_DATABASE QB_HDB_DECLARE
 
+/**
+ * @brief hdb_create
+ * @param handle_database
+ */
 static inline void hdb_create (
 	struct hdb_handle_database *handle_database)
 {
 	qb_hdb_create (handle_database);
 }
 
+/**
+ * @brief hdb_destroy
+ * @param handle_database
+ */
 static inline void hdb_destroy (
 	struct hdb_handle_database *handle_database)
 {
 	qb_hdb_destroy (handle_database);
 }
 
-
+/**
+ * @brief hdb_handle_create
+ * @param handle_database
+ * @param instance_size
+ * @param handle_id_out
+ * @return
+ */
 static inline int hdb_handle_create (
 	struct hdb_handle_database *handle_database,
 	int instance_size,
@@ -102,6 +133,13 @@ static inline int hdb_handle_create (
 		handle_id_out));
 }
 
+/**
+ * @brief hdb_handle_get
+ * @param handle_database
+ * @param handle_in
+ * @param instance
+ * @return
+ */
 static inline int hdb_handle_get (
 	struct hdb_handle_database *handle_database,
 	hdb_handle_t handle_in,
@@ -110,6 +148,13 @@ static inline int hdb_handle_get (
 	return (qb_hdb_handle_get (handle_database, handle_in, instance));
 }
 
+/**
+ * @brief hdb_handle_get_always
+ * @param handle_database
+ * @param handle_in
+ * @param instance
+ * @return
+ */
 static inline int hdb_handle_get_always (
 	struct hdb_handle_database *handle_database,
 	hdb_handle_t handle_in,
@@ -118,6 +163,12 @@ static inline int hdb_handle_get_always (
 	return (qb_hdb_handle_get_always (handle_database, handle_in, instance));
 }
 
+/**
+ * @brief hdb_handle_put
+ * @param handle_database
+ * @param handle_in
+ * @return
+ */
 static inline int hdb_handle_put (
 	struct hdb_handle_database *handle_database,
 	hdb_handle_t handle_in)
@@ -125,6 +176,12 @@ static inline int hdb_handle_put (
 	return (qb_hdb_handle_put (handle_database, handle_in));
 }
 
+/**
+ * @brief hdb_handle_destroy
+ * @param handle_database
+ * @param handle_in
+ * @return
+ */
 static inline int hdb_handle_destroy (
 	struct hdb_handle_database *handle_database,
 	hdb_handle_t handle_in)
@@ -132,6 +189,12 @@ static inline int hdb_handle_destroy (
 	return (qb_hdb_handle_destroy (handle_database, handle_in));
 }
 
+/**
+ * @brief hdb_handle_refcount_get
+ * @param handle_database
+ * @param handle_in
+ * @return
+ */
 static inline int hdb_handle_refcount_get (
 	struct hdb_handle_database *handle_database,
 	hdb_handle_t handle_in)
@@ -139,12 +202,23 @@ static inline int hdb_handle_refcount_get (
 	return (qb_hdb_handle_refcount_get (handle_database, handle_in));
 }
 
+/**
+ * @brief hdb_iterator_reset
+ * @param handle_database
+ */
 static inline void hdb_iterator_reset (
 	struct hdb_handle_database *handle_database)
 {
 	qb_hdb_iterator_reset (handle_database);
 }
 
+/**
+ * @brief hdb_iterator_next
+ * @param handle_database
+ * @param instance
+ * @param handle
+ * @return
+ */
 static inline int hdb_iterator_next (
 	struct hdb_handle_database *handle_database,
 	void **instance,
@@ -153,11 +227,21 @@ static inline int hdb_iterator_next (
 	return (qb_hdb_iterator_next (handle_database, instance, handle));
 }
 
+/**
+ * @brief hdb_base_convert
+ * @param handle
+ * @return
+ */
 static inline unsigned int hdb_base_convert (hdb_handle_t handle)
 {
 	return (qb_hdb_base_convert (handle));
 }
 
+/**
+ * @brief hdb_nocheck_convert
+ * @param handle
+ * @return
+ */
 static inline unsigned long long hdb_nocheck_convert (unsigned int handle)
 {
 	return (qb_hdb_nocheck_convert (handle));

+ 231 - 75
include/corosync/icmap.h

@@ -42,17 +42,17 @@
 extern "C" {
 #endif
 
-/*
+/**
  * Maximum length of key in icmap
  */
 #define ICMAP_KEYNAME_MAXLEN		255
 
-/*
+/**
  * Minimum lenght of key in icmap
  */
 #define ICMAP_KEYNAME_MINLEN		3
 
-/*
+/**
  * Possible types of value. Binary is raw data without trailing zero with given length
  */
 typedef enum {
@@ -76,14 +76,15 @@ typedef enum {
 #define ICMAP_TRACK_ADD		4
 #define ICMAP_TRACK_DELETE	1
 #define ICMAP_TRACK_MODIFY	2
-/*
+
+/**
  * Whole prefix is tracked, instead of key only (so "totem." tracking means that
  * "totem.nodeid", "totem.version", ... applies). This value is also never returned
  * inside of callback and is used only in adding track
  */
 #define ICMAP_TRACK_PREFIX	8
 
-/*
+/**
  * Structure passed as new_value and old_value in change callback. It contains type of
  * key, length of key and pointer to value of key
  */
@@ -93,7 +94,7 @@ struct icmap_notify_value {
 	const void *data;
 };
 
-/*
+/**
  * Prototype for notify callback function. Even is one of ICMAP_TRACK_* event, key_name is
  * changed key, new and old_value contains values or are zeroed (in other words, type is non
  * existing 0 type) if there were no old (creating of key) or new (deleting of key) value.
@@ -106,8 +107,9 @@ typedef void (*icmap_notify_fn_t) (
 	struct icmap_notify_value old_value,
 	void *user_data);
 
-/*
- * icmap type.
+/**
+ * @brief icmap type.
+ *
  * icmap.c contains global variable (icmap_global_map) of this type. This
  * is used in every non-reentant call. Also only in this table are implemented
  * operations like set_ro and tracking of values. Other tables (created by
@@ -115,48 +117,61 @@ typedef void (*icmap_notify_fn_t) (
  */
 typedef struct icmap_map *icmap_map_t;
 
-/*
- * Itterator type
+/**
+ * @brief Itterator type
  */
 typedef qb_map_iter_t *icmap_iter_t;
 
-/*
- * Track type
+/**
+ * @brief Track type
  */
 typedef struct icmap_track *icmap_track_t;
 
-/*
- * Initialize global icmap
+/**
+ * @brief Initialize global icmap
+ * @return
  */
 extern cs_error_t icmap_init(void);
 
-/*
- * Initialize additional (local, reentrant) icmap_map. Content of variable
+/**
+ * @brief Initialize additional (local, reentrant) icmap_map. Content of variable
  * result is undefined if return code is not CS_OK.
+ * @param result
+ * @return
  */
 extern cs_error_t icmap_init_r(icmap_map_t *result);
 
-/*
- * Finalize global icmap
+/**
+ * @brief Finalize global icmap
  */
 extern void icmap_fini(void);
 
-/*
- * Finalize local, reentrant icmap
+/**
+ * @brief Finalize local, reentrant icmap
+ * @param map
  */
 extern void icmap_fini_r(const icmap_map_t map);
 
-/*
- * Return global icmap
+/**
+ * @brief Return global icmap
+ * @return
  */
 extern icmap_map_t icmap_get_global_map(void);
 
-/*
- * Compare value of key with name key_name1 in map1 with key with name key_name2
- * in map2. Two values must have same type, length and value to be considered equal.
+/**
+ * @brief Compare value of key with name key_name1 in map1 with key with name key_name2
+ * in map2.
+ *
+ * Two values must have same type, length and value to be considered equal.
  * Function returns 0 when any of map1, key_name1, map2, key_name2 are NULL, or
  * key_name is not found in map, or keys are not equal. != 0 is returned when
  * values are equal.
+ *
+ * @param map1
+ * @param key_name1
+ * @param map2
+ * @param key_name2
+ * @return
  */
 extern int icmap_key_value_eq(
 	const icmap_map_t map1,
@@ -164,8 +179,13 @@ extern int icmap_key_value_eq(
 	const icmap_map_t map2,
 	const char *key_name2);
 
-/*
- * Store value with value_len length and type as key_name name in global icmap.
+/**
+ * @brief Store value with value_len length and type as key_name name in global icmap.
+ * @param key_name
+ * @param value
+ * @param value_len
+ * @param type
+ * @return
  */
 extern cs_error_t icmap_set(
 	const char *key_name,
@@ -173,8 +193,14 @@ extern cs_error_t icmap_set(
 	size_t value_len,
         icmap_value_types_t type);
 
-/*
- * Reentrant version of icmap_set
+/**
+ * @brief Reentrant version of icmap_set
+ * @param map
+ * @param key_name
+ * @param value
+ * @param value_len
+ * @param type
+ * @return
  */
 extern cs_error_t icmap_set_r(
 	const icmap_map_t map,
@@ -210,20 +236,35 @@ extern cs_error_t icmap_set_float_r(const icmap_map_t map, const char *key_name,
 extern cs_error_t icmap_set_double_r(const icmap_map_t map, const char *key_name, double value);
 extern cs_error_t icmap_set_string_r(const icmap_map_t map, const char *key_name, const char *value);
 
-/*
- * Delete key from map
+/**
+ * @brief Delete key from map
+ * @param key_name
+ * @return
  */
 extern cs_error_t icmap_delete(const char *key_name);
 
+/**
+ * @brief icmap_delete_r
+ * @param map
+ * @param key_name
+ * @return
+ */
 extern cs_error_t icmap_delete_r(const icmap_map_t map, const char *key_name);
 
-/*
- * Retrieve value of key key_name and store it in user preallocated value pointer.
- * value can be NULL, and then only value_len and/or type is returned (both of them
+/**
+ * @brief Retrieve value of key key_name and store it in user preallocated value pointer.
+ *
+ * Value can be NULL, and then only value_len and/or type is returned (both of them
  * can also be NULL). If value is not NULL, actual length of value in map is checked
  * against value_len. If *value_len is shorter then length of value in map, error
  * CS_ERR_INVALID_PARAM is returned. After successful copy of value, value_len is
  * set to actual length of value in map.
+ *
+ * @param key_name
+ * @param value
+ * @param value_len
+ * @param type
+ * @return
  */
 extern cs_error_t icmap_get(
 	const char *key_name,
@@ -231,8 +272,14 @@ extern cs_error_t icmap_get(
 	size_t *value_len,
         icmap_value_types_t *type);
 
-/*
- * Same as icmap_get but it's reentrant and operates on given icmap_map
+/**
+ * @brief Same as icmap_get but it's reentrant and operates on given icmap_map
+ * @param map
+ * @param key_name
+ * @param value
+ * @param value_len
+ * @param type
+ * @return
  */
 extern cs_error_t icmap_get_r(
 	const icmap_map_t map,
@@ -269,82 +316,176 @@ extern cs_error_t icmap_get_uint64_r(const icmap_map_t map, const char *key_name
 extern cs_error_t icmap_get_float_r(const icmap_map_t map, const char *key_name, float *flt);
 extern cs_error_t icmap_get_double_r(const icmap_map_t map, const char *key_name, double *dbl);
 
-/*
- * Shortcut for icmap_get for string type. Returned string is newly allocated and
+/**
+ * @brief Shortcut for icmap_get for string type.
+ *
+ * Returned string is newly allocated and
  * caller is responsible for freeing memory
+ *
+ * @param key_name
+ * @param str
+ * @return
  */
 extern cs_error_t icmap_get_string(const char *key_name, char **str);
 
-/*
+/**
+ * @brief icmap_adjust_int
+ *
  * Defined only for [u]int* values. It adds step to current value.
+ *
+ * @param key_name
+ * @param step
+ * @return
  */
 extern cs_error_t icmap_adjust_int(const char *key_name, int32_t step);
 
+/**
+ * @brief icmap_adjust_int_r
+ * @param map
+ * @param key_name
+ * @param step
+ * @return
+ */
 extern cs_error_t icmap_adjust_int_r(const icmap_map_t map, const char *key_name, int32_t step);
 
-/*
+/**
+ * @brief icmap_fast_adjust_int
+ *
  * Defined only for [u]int* values. It adds step to current value. Difference
  * between this function and icmap_adjust_int is given in fact, that in
  * tracking callback, old value is undefined, but whole process is done
  * without malloc/memcpy.
+ *
+ * @param key_name
+ * @param step
+ * @return
  */
 extern cs_error_t icmap_fast_adjust_int(const char *key_name, int32_t step);
 
+/**
+ * @brief icmap_fast_adjust_int_r
+ * @param map
+ * @param key_name
+ * @param step
+ * @return
+ */
 extern cs_error_t icmap_fast_adjust_int_r(const icmap_map_t map, const char *key_name, int32_t step);
 
-/*
- * Increase stored value by one
+/**
+ * @brief Increase stored value by one
+ * @param key_name
+ * @return
  */
 extern cs_error_t icmap_inc(const char *key_name);
 
+/**
+ * @brief icmap_inc_r
+ * @param map
+ * @param key_name
+ * @return
+ */
 extern cs_error_t icmap_inc_r(const icmap_map_t map, const char *key_name);
 
-/*
- * Decrease stored value by one
+/**
+ * @brief Decrease stored value by one
+ * @param key_name
+ * @return
  */
 extern cs_error_t icmap_dec(const char *key_name);
 
+/**
+ * @brief icmap_dec_r
+ * @param map
+ * @param key_name
+ * @return
+ */
 extern cs_error_t icmap_dec_r(const icmap_map_t map, const char *key_name);
 
-/*
- * Increase stored value by one. Difference between this function and icmap_inc
+/**
+ * @brief Increase stored value by one.
+ *
+ * Difference between this function and icmap_inc
  * is same as between icmap_adjust_int and icmap_fast_adjust_int.
+ *
+ * @param key_name
+ * @return
  */
 extern cs_error_t icmap_fast_inc(const char *key_name);
 
+/**
+ * @brief icmap_fast_inc_r
+ * @param map
+ * @param key_name
+ * @return
+ */
 extern cs_error_t icmap_fast_inc_r(const icmap_map_t map, const char *key_name);
 
-/*
- * Decrease stored value by one. Difference between this function and icmap_dec
+/**
+ * @brief Decrease stored value by one.
+ *
+ * Difference between this function and icmap_dec
  * is same as between icmap_adjust_int and icmap_fast_adjust_int.
+ *
+ * @param key_name
+ * @return
  */
 extern cs_error_t icmap_fast_dec(const char *key_name);
 
+/**
+ * @brief icmap_fast_dec_r
+ * @param map
+ * @param key_name
+ * @return
+ */
 extern cs_error_t icmap_fast_dec_r(const icmap_map_t map, const char *key_name);
 
-/*
- * Initialize iterator with given prefix
+/**
+ * @brief Initialize iterator with given prefix
+ * @param prefix
+ * @return
  */
 extern icmap_iter_t icmap_iter_init(const char *prefix);
 
+/**
+ * @brief icmap_iter_init_r
+ * @param map
+ * @param prefix
+ * @return
+ */
 extern icmap_iter_t icmap_iter_init_r(const icmap_map_t map, const char *prefix);
 
-/*
- * Return next item in iterator iter. value_len and type are optional (= can be NULL), but if set,
- * length of returned value and/or type is returned. Function returns following key_name or NULL if
- * iteration is over.
+/**
+ * @brief Return next item in iterator iter.
+ *
+ * value_len and type are optional (= can be NULL), but if set, length of returned value
+ * and/or type is returned. Function returns following key_name or NULL if iteration is over.
+ *
+ * @param iter
+ * @param value_len
+ * @param type
+ * @return
  */
 extern const char *icmap_iter_next(icmap_iter_t iter, size_t *value_len, icmap_value_types_t *type);
 
-/*
- * Finalize iterator
+/**
+ * @brief Finalize iterator
+ * @param iter
  */
 extern void icmap_iter_finalize(icmap_iter_t iter);
 
-/*
- * Add tracking function for given key_name. Tracked changes (add|modify|delete) depend on track_type,
- * which is bitwise or of ICMAP_TRACK_* values. notify_fn is called on change, where user_data pointer
- * is passed (unchanged). Value which can be used to delete tracking is passed as icmap_track.
+/**
+ * @brief Add tracking function for given key_name.
+ *
+ * Tracked changes (add|modify|delete) depend on track_type, which is bitwise or of ICMAP_TRACK_* values.
+ * notify_fn is called on change, where user_data pointer is passed (unchanged).
+ * Value which can be used to delete tracking is passed as icmap_track.
+ *
+ * @param key_name
+ * @param track_type
+ * @param notify_fn
+ * @param user_data
+ * @param icmap_track
+ * @return
  */
 extern cs_error_t icmap_track_add(
 	const char *key_name,
@@ -353,36 +494,51 @@ extern cs_error_t icmap_track_add(
 	void *user_data,
 	icmap_track_t *icmap_track);
 
-/*
- * Return user data associated with given track
+/**
+ * @brief Return user data associated with given track
+ * @param icmap_track
+ * @return
  */
 extern void *icmap_track_get_user_data(icmap_track_t icmap_track);
 
-/*
- * Remove previously added track
+/**
+ * @brief Remove previously added track
+ * @param icmap_track
+ * @return
  */
 extern cs_error_t icmap_track_delete(icmap_track_t icmap_track);
 
-/*
- * Set read-only access for given key (key_name) or prefix, if prefix is set. ro_access
- * can be !0, which means, that old information about ro of this key is deleted.
- * Read-only access is used only in CMAP service! (in other word it prevents users
- * from deleting/changing key, but doesn't guarantee anything for internal icmap users.
+/**
+ * @brief Set read-only access for given key (key_name) or prefix,
+ * If prefix is set. ro_access can be !0, which means, that old information
+ * about ro of this key is deleted. Read-only access is used only in CMAP service!
+ * (in other word it prevents users from deleting/changing key, but doesn't
+ *  guarantee anything for internal icmap users.)
+ * @param key_name
+ * @param prefix
+ * @param ro_access
+ * @return
  */
 extern cs_error_t icmap_set_ro_access(const char *key_name, int prefix, int ro_access);
 
-/*
- * Check in given key is read only. Returns !0 if so, otherwise (key is rw) 0.
+/**
+ * @brief Check in given key is read only. Returns !0 if so, otherwise (key is rw) 0.
+ * @param key_name
+ * @return
  */
 extern int icmap_is_key_ro(const char *key_name);
 
-/*
- * Converts given key_name to valid key name (replacing all prohibited characters by _)
+/**
+ * @brief Converts given key_name to valid key name (replacing all prohibited characters by _)
+ * @param key_name
  */
 extern void icmap_convert_name_to_valid_name(char *key_name);
 
-/*
- * Copy content of src_map icmap to dst_map icmap.
+/**
+ * @brief Copy content of src_map icmap to dst_map icmap.
+ * @param dst_map
+ * @param src_map
+ * @return
  */
 extern cs_error_t icmap_copy_map(icmap_map_t dst_map, const icmap_map_t src_map);
 

+ 66 - 0
include/corosync/ipc_cfg.h

@@ -47,6 +47,9 @@
  */
 #define CFG_MAX_INTERFACES			16
 
+/**
+ * @brief The req_lib_cfg_types enum
+ */
 enum req_lib_cfg_types {
 	MESSAGE_REQ_CFG_RINGSTATUSGET = 0,
 	MESSAGE_REQ_CFG_RINGREENABLE = 1,
@@ -59,6 +62,9 @@ enum req_lib_cfg_types {
 	MESSAGE_REQ_CFG_CRYPTO_SET = 8
 };
 
+/**
+ * @brief The res_lib_cfg_types enum
+ */
 enum res_lib_cfg_types {
         MESSAGE_RES_CFG_RINGSTATUSGET = 0,
         MESSAGE_RES_CFG_RINGREENABLE = 1,
@@ -78,10 +84,16 @@ enum res_lib_cfg_types {
 	MESSAGE_RES_CFG_RELOAD_CONFIG = 15
 };
 
+/**
+ * @brief The req_lib_cfg_ringstatusget struct
+ */
 struct req_lib_cfg_ringstatusget {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cfg_ringstatusget struct
+ */
 struct res_lib_cfg_ringstatusget {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint32_t interface_count __attribute__((aligned(8)));
@@ -89,52 +101,85 @@ struct res_lib_cfg_ringstatusget {
 	char interface_status[CFG_MAX_INTERFACES][CFG_INTERFACE_STATUS_MAX_LEN] __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cfg_ringreenable struct
+ */
 struct req_lib_cfg_ringreenable {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cfg_ringreenable struct
+ */
 struct res_lib_cfg_ringreenable {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cfg_killnode struct
+ */
 struct req_lib_cfg_killnode {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	unsigned int nodeid __attribute__((aligned(8)));
 	cs_name_t reason __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cfg_killnode struct
+ */
 struct res_lib_cfg_killnode {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cfg_tryshutdown struct
+ */
 struct req_lib_cfg_tryshutdown {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	unsigned int flags;
 };
 
+/**
+ * @brief The res_lib_cfg_tryshutdown struct
+ */
 struct res_lib_cfg_tryshutdown {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cfg_replytoshutdown struct
+ */
 struct req_lib_cfg_replytoshutdown {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	unsigned int response;
 };
 
+/**
+ * @brief The res_lib_cfg_replytoshutdown struct
+ */
 struct res_lib_cfg_replytoshutdown {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cfg_testshutdown struct
+ */
 struct res_lib_cfg_testshutdown {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	unsigned int flags;
 };
 
+/**
+ * @brief The req_lib_cfg_get_node_addrs struct
+ */
 struct req_lib_cfg_get_node_addrs {
         struct qb_ipc_request_header header __attribute__((aligned(8)));
 	unsigned int nodeid;
 };
 
+/**
+ * @brief The res_lib_cfg_get_node_addrs struct
+ */
 struct res_lib_cfg_get_node_addrs {
         struct qb_ipc_response_header header __attribute__((aligned(8)));
 	unsigned int family;
@@ -143,23 +188,38 @@ struct res_lib_cfg_get_node_addrs {
 	char addrs[];
 };
 
+/**
+ * @brief The req_lib_cfg_local_get struct
+ */
 struct req_lib_cfg_local_get {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cfg_local_get struct
+ */
 struct res_lib_cfg_local_get {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint32_t local_nodeid __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cfg_reload_config struct
+ */
 struct req_lib_cfg_reload_config {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cfg_reload_config struct
+ */
 struct res_lib_cfg_reload_config {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief corosync_administrative_target_t enum
+ */
 typedef enum {
 	AIS_AMF_ADMINISTRATIVETARGET_SERVICEUNIT = 0,
 	AIS_AMF_ADMINISTRATIVETARGET_SERVICEGROUP = 1,
@@ -167,12 +227,18 @@ typedef enum {
 	AIS_AMF_ADMINISTRATIVETARGET_NODE = 3
 } corosync_administrative_target_t;
 
+/**
+ * @brief corosync_administrative_state_t enum
+ */
 typedef enum {
 	AIS_AMF_ADMINISTRATIVESTATE_UNLOCKED = 0,
 	AIS_AMF_ADMINISTRATIVESTATE_LOCKED = 1,
 	AIS_AMF_ADMINISTRATIVESTATE_STOPPING = 2
 } corosync_administrative_state_t;
 
+/**
+ * @brief corosync_shutdown_flags_t enum
+ */
 typedef enum {
 	CFG_SHUTDOWN_FLAG_REQUEST = 0,
 	CFG_SHUTDOWN_FLAG_REGARDLESS = 1,

+ 63 - 0
include/corosync/ipc_cmap.h

@@ -39,6 +39,9 @@
 #include <corosync/corotypes.h>
 #include <corosync/mar_gen.h>
 
+/**
+ * @brief The req_cmap_types enum
+ */
 enum req_cmap_types {
 	MESSAGE_REQ_CMAP_SET = 0,
 	MESSAGE_REQ_CMAP_DELETE = 1,
@@ -51,6 +54,9 @@ enum req_cmap_types {
 	MESSAGE_REQ_CMAP_TRACK_DELETE = 8,
 };
 
+/**
+ * @brief The res_cmap_types enum
+ */
 enum res_cmap_types {
 	MESSAGE_RES_CMAP_SET = 0,
 	MESSAGE_RES_CMAP_DELETE = 1,
@@ -64,6 +70,9 @@ enum res_cmap_types {
 	MESSAGE_RES_CMAP_NOTIFY_CALLBACK = 9,
 };
 
+/**
+ * @brief The req_lib_cmap_set struct
+ */
 struct req_lib_cmap_set {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
@@ -72,25 +81,40 @@ struct req_lib_cmap_set {
 	mar_uint8_t value[] __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cmap_set struct
+ */
 struct res_lib_cmap_set {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cmap_delete struct
+ */
 struct req_lib_cmap_delete {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cmap_delete struct
+ */
 struct res_lib_cmap_delete {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cmap_get struct
+ */
 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)));
 };
 
+/**
+ * @brief The res_lib_cmap_get struct
+ */
 struct res_lib_cmap_get {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_size_t value_len __attribute__((aligned(8)));
@@ -98,31 +122,49 @@ struct res_lib_cmap_get {
 	mar_uint8_t value[] __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cmap_adjust_int struct
+ */
 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)));
 };
 
+/**
+ * @brief The res_lib_cmap_adjust_int struct
+ */
 struct res_lib_cmap_adjust_int {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cmap_iter_init struct
+ */
 struct req_lib_cmap_iter_init {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	mar_name_t prefix __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cmap_iter_init struct
+ */
 struct res_lib_cmap_iter_init {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint64_t iter_handle __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cmap_iter_next struct
+ */
 struct req_lib_cmap_iter_next {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	mar_uint64_t iter_handle __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cmap_iter_next struct
+ */
 struct res_lib_cmap_iter_next {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
@@ -130,15 +172,24 @@ struct res_lib_cmap_iter_next {
 	mar_uint8_t type __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cmap_iter_finalize struct
+ */
 struct req_lib_cmap_iter_finalize {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	mar_uint64_t iter_handle __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cmap_iter_finalize struct
+ */
 struct res_lib_cmap_iter_finalize {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cmap_track_add struct
+ */
 struct req_lib_cmap_track_add {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
@@ -146,21 +197,33 @@ struct req_lib_cmap_track_add {
 	mar_uint64_t track_inst_handle __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cmap_track_add struct
+ */
 struct res_lib_cmap_track_add {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint64_t track_handle __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cmap_track_delete struct
+ */
 struct req_lib_cmap_track_delete {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	mar_uint64_t track_handle __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cmap_track_delete struct
+ */
 struct res_lib_cmap_track_delete {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint64_t track_inst_handle __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cmap_notify_callback struct
+ */
 struct res_lib_cmap_notify_callback {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint64_t track_inst_handle __attribute__((aligned(8)));

+ 148 - 0
include/corosync/ipc_cpg.h

@@ -42,6 +42,9 @@
 
 #define CPG_ZC_PATH_LEN				128
 
+/**
+ * @brief The req_cpg_types enum
+ */
 enum req_cpg_types {
 	MESSAGE_REQ_CPG_JOIN = 0,
 	MESSAGE_REQ_CPG_LEAVE = 1,
@@ -58,6 +61,9 @@ enum req_cpg_types {
 	MESSAGE_REQ_CPG_PARTIAL_MCAST = 12,
 };
 
+/**
+ * @brief The res_cpg_types enum
+ */
 enum res_cpg_types {
 	MESSAGE_RES_CPG_JOIN = 0,
 	MESSAGE_RES_CPG_LEAVE = 1,
@@ -80,6 +86,9 @@ enum res_cpg_types {
 	MESSAGE_RES_CPG_PARTIAL_SEND = 18,
 };
 
+/**
+ * @brief The lib_cpg_confchg_reason enum
+ */
 enum lib_cpg_confchg_reason {
 	CONFCHG_CPG_REASON_JOIN = 1,
 	CONFCHG_CPG_REASON_LEAVE = 2,
@@ -88,22 +97,37 @@ enum lib_cpg_confchg_reason {
 	CONFCHG_CPG_REASON_PROCDOWN = 5
 };
 
+/**
+ * @brief The lib_cpg_partial_types enum
+ */
 enum lib_cpg_partial_types {
 	LIBCPG_PARTIAL_FIRST = 1,
 	LIBCPG_PARTIAL_CONTINUED = 2,
 	LIBCPG_PARTIAL_LAST = 3,
 };
 
+/**
+ * @brief mar_cpg_name_t struct
+ */
 typedef struct {
 	uint32_t length __attribute__((aligned(8)));
 	char value[CPG_MAX_NAME_LENGTH] __attribute__((aligned(8)));
 } mar_cpg_name_t;
 
+/**
+ * @brief swab_mar_cpg_name_t
+ * @param to_swab
+ */
 static inline void swab_mar_cpg_name_t (mar_cpg_name_t *to_swab)
 {
 	swab_mar_uint32_t (&to_swab->length);
 }
 
+/**
+ * @brief marshall_from_mar_cpg_name_t
+ * @param dest
+ * @param src
+ */
 static inline void marshall_from_mar_cpg_name_t (
 	struct cpg_name *dest,
 	const mar_cpg_name_t *src)
@@ -112,6 +136,11 @@ static inline void marshall_from_mar_cpg_name_t (
 	memcpy (&dest->value, &src->value, CPG_MAX_NAME_LENGTH);
 }
 
+/**
+ * @brief marshall_to_mar_cpg_name_t
+ * @param dest
+ * @param src
+ */
 static inline void marshall_to_mar_cpg_name_t (
 	mar_cpg_name_t *dest,
 	const struct cpg_name *src)
@@ -120,12 +149,20 @@ static inline void marshall_to_mar_cpg_name_t (
 	memcpy (&dest->value, &src->value, CPG_MAX_NAME_LENGTH);
 }
 
+/**
+ * @brief mar_cpg_address_t struct
+ */
 typedef struct {
         mar_uint32_t nodeid __attribute__((aligned(8)));
         mar_uint32_t pid __attribute__((aligned(8)));
         mar_uint32_t reason __attribute__((aligned(8)));
 } mar_cpg_address_t;
 
+/**
+ * @brief marshall_from_mar_cpg_address_t
+ * @param dest
+ * @param src
+ */
 static inline void marshall_from_mar_cpg_address_t (
 	struct cpg_address *dest,
 	const mar_cpg_address_t *src)
@@ -135,6 +172,11 @@ static inline void marshall_from_mar_cpg_address_t (
 	dest->reason = src->reason;
 }
 
+/**
+ * @brief marshall_to_mar_cpg_address_t
+ * @param dest
+ * @param src
+ */
 static inline void marshall_to_mar_cpg_address_t (
 	mar_cpg_address_t *dest,
 	const struct cpg_address *src)
@@ -144,6 +186,12 @@ static inline void marshall_to_mar_cpg_address_t (
 	dest->reason = src->reason;
 }
 
+/**
+ * @brief mar_name_compare
+ * @param g1
+ * @param g2
+ * @return
+ */
 static inline int mar_name_compare (
 		const mar_cpg_name_t *g1,
 		const mar_cpg_name_t *g2)
@@ -153,12 +201,20 @@ static inline int mar_name_compare (
 		g1->length - g2->length);
 }
 
+/**
+ * @brief mar_cpg_iteration_description_t struct
+ */
 typedef struct {
 	mar_cpg_name_t group;
 	mar_uint32_t nodeid;
 	mar_uint32_t pid;
 } mar_cpg_iteration_description_t;
 
+/**
+ * @brief marshall_from_mar_cpg_iteration_description_t
+ * @param dest
+ * @param src
+ */
 static inline void marshall_from_mar_cpg_iteration_description_t(
 	struct cpg_iteration_description_t *dest,
 	const mar_cpg_iteration_description_t *src)
@@ -168,11 +224,19 @@ static inline void marshall_from_mar_cpg_iteration_description_t(
 	marshall_from_mar_cpg_name_t (&dest->group, &src->group);
 };
 
+/**
+ * @brief mar_cpg_ring_id_t struct
+ */
 typedef struct {
         mar_uint32_t nodeid __attribute__((aligned(8)));
         mar_uint64_t seq __attribute__((aligned(8)));
 } mar_cpg_ring_id_t;
 
+/**
+ * @brief marshall_from_mar_cpg_ring_id_t
+ * @param dest
+ * @param src
+ */
 static inline void marshall_from_mar_cpg_ring_id_t (
 	struct cpg_ring_id *dest,
 	const mar_cpg_ring_id_t *src)
@@ -181,6 +245,9 @@ static inline void marshall_from_mar_cpg_ring_id_t (
 	dest->seq = src->seq;
 }
 
+/**
+ * @brief The req_lib_cpg_join struct
+ */
 struct req_lib_cpg_join {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
@@ -188,31 +255,52 @@ struct req_lib_cpg_join {
 	mar_uint32_t flags __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cpg_join struct
+ */
 struct res_lib_cpg_join {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cpg_finalize struct
+ */
 struct req_lib_cpg_finalize {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cpg_finalize struct
+ */
 struct res_lib_cpg_finalize {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cpg_local_get struct
+ */
 struct req_lib_cpg_local_get {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cpg_local_get struct
+ */
 struct res_lib_cpg_local_get {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint32_t local_nodeid __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cpg_partial_send struct
+ */
 struct res_lib_cpg_partial_send {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cpg_mcast struct
+ */
 struct req_lib_cpg_mcast {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint32_t guarantee __attribute__((aligned(8)));
@@ -220,6 +308,9 @@ struct req_lib_cpg_mcast {
 	mar_uint8_t message[] __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cpg_partial_mcast struct
+ */
 struct req_lib_cpg_partial_mcast {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint32_t guarantee __attribute__((aligned(8)));
@@ -229,6 +320,9 @@ struct req_lib_cpg_partial_mcast {
 	mar_uint8_t message[] __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cpg_mcast struct
+ */
 struct res_lib_cpg_mcast {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
@@ -245,6 +339,9 @@ struct res_lib_cpg_deliver_callback {
 	mar_uint8_t message[] __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cpg_partial_deliver_callback struct
+ */
 struct res_lib_cpg_partial_deliver_callback {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
@@ -256,22 +353,34 @@ struct res_lib_cpg_partial_deliver_callback {
 	mar_uint8_t message[] __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cpg_flowcontrol_callback struct
+ */
 struct res_lib_cpg_flowcontrol_callback {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint32_t flow_control_state __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cpg_membership_get struct
+ */
 struct req_lib_cpg_membership_get {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cpg_membership_get struct
+ */
 struct res_lib_cpg_membership_get {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint32_t member_count __attribute__((aligned(8)));
 	mar_cpg_address_t member_list[PROCESSOR_COUNT_MAX];
 };
 
+/**
+ * @brief The res_lib_cpg_confchg_callback struct
+ */
 struct res_lib_cpg_confchg_callback {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
@@ -283,6 +392,9 @@ struct res_lib_cpg_confchg_callback {
 //	struct cpg_address joined_list[];
 };
 
+/**
+ * @brief The res_lib_cpg_totem_confchg_callback struct
+ */
 struct res_lib_cpg_totem_confchg_callback {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_cpg_ring_id_t ring_id __attribute__((aligned(8)));
@@ -290,63 +402,99 @@ struct res_lib_cpg_totem_confchg_callback {
 	mar_uint32_t member_list[];
 };
 
+/**
+ * @brief The req_lib_cpg_leave struct
+ */
 struct req_lib_cpg_leave {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
 	mar_uint32_t pid __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cpg_leave struct
+ */
 struct res_lib_cpg_leave {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cpg_iterationinitialize struct
+ */
 struct req_lib_cpg_iterationinitialize {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	mar_cpg_name_t group_name __attribute__((aligned(8)));
 	mar_uint32_t iteration_type __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cpg_iterationinitialize struct
+ */
 struct res_lib_cpg_iterationinitialize {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	hdb_handle_t iteration_handle __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cpg_iterationnext struct
+ */
 struct req_lib_cpg_iterationnext {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	hdb_handle_t iteration_handle __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cpg_iterationnext struct
+ */
 struct res_lib_cpg_iterationnext {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_cpg_iteration_description_t description __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_cpg_iterationfinalize struct
+ */
 struct req_lib_cpg_iterationfinalize {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	hdb_handle_t iteration_handle __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_cpg_iterationfinalize struct
+ */
 struct res_lib_cpg_iterationfinalize {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief mar_req_coroipcc_zc_alloc_t struct
+ */
 typedef struct {
         struct qb_ipc_request_header header __attribute__((aligned(8)));
         size_t map_size __attribute__((aligned(8)));
         char path_to_file[CPG_ZC_PATH_LEN] __attribute__((aligned(8)));
 } mar_req_coroipcc_zc_alloc_t __attribute__((aligned(8)));
 
+/**
+ * @brief mar_req_coroipcc_zc_free_t struct
+ */
 typedef struct {
         struct qb_ipc_request_header header __attribute__((aligned(8)));
         size_t map_size __attribute__((aligned(8)));
 	uint64_t server_address __attribute__((aligned(8)));
 } mar_req_coroipcc_zc_free_t __attribute__((aligned(8)));
 
+/**
+ * @brief mar_req_coroipcc_zc_execute_t struct
+ */
 typedef struct {
         struct qb_ipc_request_header header __attribute__((aligned(8)));
 	uint64_t server_address __attribute__((aligned(8)));
 } mar_req_coroipcc_zc_execute_t __attribute__((aligned(8)));
 
+/**
+ * @brief coroipcs_zc_header struct
+ */
 struct coroipcs_zc_header {
 	int map_size;
 	uint64_t server_address;

+ 18 - 1
include/corosync/ipc_quorum.h

@@ -37,6 +37,9 @@
 #include <corosync/corotypes.h>
 #include <corosync/mar_gen.h>
 
+/**
+ * @brief The req_quorum_types enum
+ */
 enum req_quorum_types {
 	MESSAGE_REQ_QUORUM_GETQUORATE = 0,
 	MESSAGE_REQ_QUORUM_TRACKSTART,
@@ -44,6 +47,9 @@ enum req_quorum_types {
 	MESSAGE_REQ_QUORUM_GETTYPE
 };
 
+/**
+ * @brief The res_quorum_types enum
+ */
 enum res_quorum_types {
 	MESSAGE_RES_QUORUM_GETQUORATE = 0,
 	MESSAGE_RES_QUORUM_TRACKSTART,
@@ -52,17 +58,25 @@ enum res_quorum_types {
 	MESSAGE_RES_QUORUM_GETTYPE
 };
 
+/**
+ * @brief The req_lib_quorum_trackstart struct
+ */
 struct req_lib_quorum_trackstart {
         struct qb_ipc_request_header header __attribute__((aligned(8)));
 	unsigned int track_flags;
 };
 
-
+/**
+ * @brief The res_lib_quorum_getquorate struct
+ */
 struct res_lib_quorum_getquorate {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint32_t quorate;
 };
 
+/**
+ * @brief The res_lib_quorum_notification struct
+ */
 struct res_lib_quorum_notification {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_int32_t quorate __attribute__((aligned(8)));
@@ -71,6 +85,9 @@ struct res_lib_quorum_notification {
 	mar_uint32_t view_list[];
 };
 
+/**
+ * @brief The res_lib_quorum_gettype struct
+ */
 struct res_lib_quorum_gettype {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint32_t quorum_type;

+ 64 - 0
include/corosync/ipc_votequorum.h

@@ -40,6 +40,9 @@
 #define VOTEQUORUM_QDEVICE_MAX_NAME_LEN      255
 #define VOTEQUORUM_QDEVICE_DEFAULT_TIMEOUT 10000
 
+/**
+ * @brief The req_votequorum_types enum
+ */
 enum req_votequorum_types {
 	MESSAGE_REQ_VOTEQUORUM_GETINFO = 0,
 	MESSAGE_REQ_VOTEQUORUM_SETEXPECTED,
@@ -53,6 +56,9 @@ enum req_votequorum_types {
 	MESSAGE_REQ_VOTEQUORUM_QDEVICE_MASTER_WINS
 };
 
+/**
+ * @brief The res_votequorum_types enum
+ */
 enum res_votequorum_types {
 	MESSAGE_RES_VOTEQUORUM_STATUS = 0,
 	MESSAGE_RES_VOTEQUORUM_GETINFO,
@@ -61,27 +67,42 @@ enum res_votequorum_types {
 	MESSAGE_RES_VOTEQUORUM_EXPECTEDVOTES_NOTIFICATION
 };
 
+/**
+ * @brief The mar_votequorum_ring_id struct
+ */
 struct mar_votequorum_ring_id {
 	mar_uint32_t nodeid;
 	mar_uint64_t seq;
 };
 
+/**
+ * @brief The req_lib_votequorum_qdevice_register struct
+ */
 struct req_lib_votequorum_qdevice_register {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	char name[VOTEQUORUM_QDEVICE_MAX_NAME_LEN];
 };
 
+/**
+ * @brief The req_lib_votequorum_qdevice_unregister struct
+ */
 struct req_lib_votequorum_qdevice_unregister {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	char name[VOTEQUORUM_QDEVICE_MAX_NAME_LEN];
 };
 
+/**
+ * @brief The req_lib_votequorum_qdevice_update struct
+ */
 struct req_lib_votequorum_qdevice_update {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	char oldname[VOTEQUORUM_QDEVICE_MAX_NAME_LEN];
 	char newname[VOTEQUORUM_QDEVICE_MAX_NAME_LEN];
 };
 
+/**
+ * @brief The req_lib_votequorum_qdevice_poll struct
+ */
 struct req_lib_votequorum_qdevice_poll {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	char name[VOTEQUORUM_QDEVICE_MAX_NAME_LEN];
@@ -89,38 +110,59 @@ struct req_lib_votequorum_qdevice_poll {
 	struct mar_votequorum_ring_id ring_id __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_votequorum_qdevice_master_wins struct
+ */
 struct req_lib_votequorum_qdevice_master_wins {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	char name[VOTEQUORUM_QDEVICE_MAX_NAME_LEN];
 	unsigned int allow;
 };
 
+/**
+ * @brief The req_lib_votequorum_setvotes struct
+ */
 struct req_lib_votequorum_setvotes {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	unsigned int votes;
 	int nodeid;
 };
 
+/**
+ * @brief The req_lib_votequorum_setexpected struct
+ */
 struct req_lib_votequorum_setexpected {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	unsigned int expected_votes;
 };
 
+/**
+ * @brief The req_lib_votequorum_trackstart struct
+ */
 struct req_lib_votequorum_trackstart {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	uint64_t context;
 	unsigned int track_flags;
 };
 
+/**
+ * @brief The req_lib_votequorum_general struct
+ */
 struct req_lib_votequorum_general {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The req_lib_votequorum_getinfo struct
+ */
 struct req_lib_votequorum_getinfo {
 	struct qb_ipc_request_header header __attribute__((aligned(8)));
 	int nodeid;
 };
 
+/**
+ * @brief The res_lib_votequorum_status struct
+ */
 struct res_lib_votequorum_status {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 };
@@ -140,6 +182,9 @@ struct res_lib_votequorum_status {
 #define VOTEQUORUM_NODESTATE_DEAD       2
 #define VOTEQUORUM_NODESTATE_LEAVING    3
 
+/**
+ * @brief The res_lib_votequorum_getinfo struct
+ */
 struct res_lib_votequorum_getinfo {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	unsigned int nodeid;
@@ -154,11 +199,17 @@ struct res_lib_votequorum_getinfo {
 	char qdevice_name[VOTEQUORUM_QDEVICE_MAX_NAME_LEN];
 };
 
+/**
+ * @brief The votequorum_node struct
+ */
 struct votequorum_node {
 	mar_uint32_t nodeid;
 	mar_uint32_t state;
 };
 
+/**
+ * @brief The res_lib_votequorum_notification struct
+ */
 struct res_lib_votequorum_notification {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint32_t quorate __attribute__((aligned(8)));
@@ -168,12 +219,20 @@ struct res_lib_votequorum_notification {
 	struct votequorum_node node_list[] __attribute__((aligned(8)));
 };
 
+/**
+ * @brief The res_lib_votequorum_expectedvotes_notification struct
+ */
 struct res_lib_votequorum_expectedvotes_notification {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));
 	mar_uint64_t context __attribute__((aligned(8)));
 	mar_uint32_t expected_votes __attribute__((aligned(8)));
 };
 
+/**
+ * @brief marshall_from_mar_votequorum_ring_id
+ * @param dest
+ * @param src
+ */
 static inline void marshall_from_mar_votequorum_ring_id (
 	votequorum_ring_id_t *dest,
 	const struct mar_votequorum_ring_id *src)
@@ -182,6 +241,11 @@ static inline void marshall_from_mar_votequorum_ring_id (
 	dest->seq = src->seq;
 };
 
+/**
+ * @brief marshall_to_mar_votequorum_ring_id
+ * @param dest
+ * @param src
+ */
 static inline void marshall_to_mar_votequorum_ring_id (
 	struct mar_votequorum_ring_id *dest,
 	const votequorum_ring_id_t *src)

+ 110 - 8
include/corosync/logsys.h

@@ -93,57 +93,102 @@ extern "C" {
 
 #ifndef LOGSYS_UTILS_ONLY
 
-/*
- * configuration bits that can only be done for the whole system
+/**
+ * @brief configuration bits that can only be done for the whole system
+ * @param format
+ * @return
  */
 extern int logsys_format_set (
 	const char *format);
 
+/**
+ * @brief logsys_format_get
+ * @return
+ */
 extern char *logsys_format_get (void);
 
-/*
- * per system/subsystem settings.
+/**
+ * @brief per system/subsystem settings.
  *
  * NOTE: once a subsystem is created and configured, changing
  * the default does NOT affect the subsystems.
  *
  * Pass a NULL subsystem to change them all
+ *
+ * @param subsys
+ * @param facility
+ * @return
  */
 extern int logsys_config_syslog_facility_set (
 	const char *subsys,
 	unsigned int facility);
 
+/**
+ * @brief logsys_config_syslog_priority_set
+ * @param subsys
+ * @param priority
+ * @return
+ */
 extern int logsys_config_syslog_priority_set (
 	const char *subsys,
 	unsigned int priority);
 
+/**
+ * @brief logsys_config_mode_set
+ * @param subsys
+ * @param mode
+ * @return
+ */
 extern int logsys_config_mode_set (
 	const char *subsys,
 	unsigned int mode);
 
+/**
+ * @brief logsys_config_mode_get
+ * @param subsys
+ * @return
+ */
 extern unsigned int logsys_config_mode_get (
 	const char *subsys);
 
+/**
+ * @brief logsys_config_apply
+ */
 void logsys_config_apply(void);
 
-/*
- * to close a logfile, just invoke this function with a NULL
+/**
+ * @brief to close a logfile, just invoke this function with a NULL
  * file or if you want to change logfile, the old one will
  * be closed for you.
+ *
+ * @param subsys
+ * @param error_string
+ * @param file
+ * @return
  */
 extern int logsys_config_file_set (
 	const char *subsys,
 	const char **error_string,
 	const char *file);
 
+/**
+ * @brief logsys_config_logfile_priority_set
+ * @param subsys
+ * @param priority
+ * @return
+ */
 extern int logsys_config_logfile_priority_set (
 	const char *subsys,
 	unsigned int priority);
 
-/*
- * enabling debug, disable message priority filtering.
+/**
+ * @brief enabling debug, disable message priority filtering.
  * everything is sent everywhere. priority values
  * for file and syslog are not overwritten.
+ *
+ * @param subsys
+ * @param value
+ * @return
  */
 extern int logsys_config_debug_set (
 	const char *subsys,
@@ -154,29 +199,75 @@ extern int logsys_config_debug_set (
  *
  * convert facility/priority to/from name/values
  */
+/**
+ * @brief logsys_priority_id_get
+ * @param name
+ * @return
+ */
 extern int logsys_priority_id_get (
 	const char *name);
 
+/**
+ * @brief logsys_priority_name_get
+ * @param priority
+ * @return
+ */
 extern const char *logsys_priority_name_get (
 	unsigned int priority);
 
+/**
+ * @brief _logsys_system_setup
+ * @param mainsystem
+ * @param mode
+ * @param syslog_facility
+ * @param syslog_priority
+ * @return
+ */
 extern int _logsys_system_setup(
 	const char *mainsystem,
 	unsigned int mode,
 	int syslog_facility,
 	int syslog_priority);
 
+/**
+ * @brief logsys_system_fini
+ */
 extern void logsys_system_fini (void);
 
+/**
+ * @brief _logsys_config_subsys_get
+ * @param subsys
+ * @return
+ */
 extern int _logsys_config_subsys_get (
 	const char *subsys);
 
+/**
+ * @brief _logsys_subsys_create
+ * @param subsys
+ * @param filename
+ * @return
+ */
 extern int _logsys_subsys_create (const char *subsys, const char *filename);
 
+/**
+ * @brief logsys_thread_start
+ * @return
+ */
 extern int logsys_thread_start (void);
 
+/**
+ * @brief logsys_subsys_id
+ */
 static int logsys_subsys_id __attribute__((unused)) = LOGSYS_MAX_SUBSYS_COUNT;
 
+/**
+ * @brief The LOGSYS_DECLARE_SYSTEM macro
+ * @param name
+ * @param mode
+ * @param syslog_facility
+ * @param syslog_priority
+ */
 #define LOGSYS_DECLARE_SYSTEM(name,mode,syslog_facility,syslog_priority)\
 __attribute__ ((constructor))						\
 static void logsys_system_init (void)					\
@@ -194,6 +285,10 @@ static void logsys_system_init (void)					\
 #define LOGSYS_DECLARE_SECTION
 #endif
 
+/**
+ * @brief The LOGSYS_DECLARE_SUBSYS macro
+ * @param subsys
+ */
 #define LOGSYS_DECLARE_SUBSYS(subsys)					\
 __attribute__ ((constructor))						\
 static void logsys_subsys_init (void)					\
@@ -208,6 +303,13 @@ static void logsys_subsys_init (void)					\
 	}								\
 }
 
+/**
+ * @brief The LOGSYS_PERROR macro
+ * @param err_num
+ * @param level
+ * @param fmt
+ * @param args
+ */
 #define LOGSYS_PERROR(err_num, level, fmt, args...) do {						\
 		char _error_str[LOGSYS_MAX_PERROR_MSG_LEN];						\
 		const char *_error_ptr = qb_strerror_r(err_num, _error_str, sizeof(_error_str));	\

+ 101 - 1
include/corosync/mar_gen.h

@@ -53,46 +53,83 @@ typedef uint16_t mar_uint16_t;
 typedef uint32_t mar_uint32_t;
 typedef uint64_t mar_uint64_t;
 
+/**
+ * @brief swab_mar_int8_t
+ * @param to_swab
+ */
 static inline void swab_mar_int8_t (mar_int8_t *to_swab)
 {
 	return;
 }
 
+/**
+ * @brief swab_mar_int16_t
+ * @param to_swab
+ */
 static inline void swab_mar_int16_t (mar_int16_t *to_swab)
 {
 	*to_swab = swab16 (*to_swab);
 }
 
+/**
+ * @brief swab_mar_int32_t
+ * @param to_swab
+ */
 static inline void swab_mar_int32_t (mar_int32_t *to_swab)
 {
 	*to_swab = swab32 (*to_swab);
 }
 
+/**
+ * @brief swab_mar_int64_t
+ * @param to_swab
+ */
 static inline void swab_mar_int64_t (mar_int64_t *to_swab)
 {
 	*to_swab = swab64 (*to_swab);
 }
 
+/**
+ * @brief swab_mar_uint8_t
+ * @param to_swab
+ */
 static inline void swab_mar_uint8_t (mar_uint8_t *to_swab)
 {
 	return;
 }
 
+/**
+ * @brief swab_mar_uint16_t
+ * @param to_swab
+ */
 static inline void swab_mar_uint16_t (mar_uint16_t *to_swab)
 {
 	*to_swab = swab16 (*to_swab);
 }
 
+/**
+ * @brief swab_mar_uint32_t
+ * @param to_swab
+ */
 static inline void swab_mar_uint32_t (mar_uint32_t *to_swab)
 {
 	*to_swab = swab32 (*to_swab);
 }
 
+/**
+ * @brief swab_mar_uint64_t
+ * @param to_swab
+ */
 static inline void swab_mar_uint64_t (mar_uint64_t *to_swab)
 {
 	*to_swab = swab64 (*to_swab);
 }
 
+/**
+ * @brief swabbin
+ * @param data
+ * @param len
+ */
 static inline void swabbin(char *data, size_t len)
 {
 	int i;
@@ -105,25 +142,47 @@ static inline void swabbin(char *data, size_t len)
 	}
 }
 
+/**
+ * @brief swabflt
+ * @param flt
+ */
 static inline void swabflt(float *flt)
 {
 	swabbin((char *)flt, sizeof(*flt));
 }
 
+/**
+ * @brief swabdbl
+ * @param dbl
+ */
 static inline void swabdbl(double *dbl)
 {
 	swabbin((char *)dbl, sizeof(*dbl));
 }
 
+/**
+ * @brief mar_name_t struct
+ */
 typedef struct {
 	mar_uint16_t length __attribute__((aligned(8)));
 	mar_uint8_t value[CS_MAX_NAME_LENGTH] __attribute__((aligned(8)));
 } mar_name_t;
 
+/**
+ * @brief get_mar_name_t
+ * @param name
+ * @return
+ */
 static inline const char *get_mar_name_t (const mar_name_t *name) {
         return ((const char *)name->value);
 }
 
+/**
+ * @brief mar_name_match
+ * @param name1
+ * @param name2
+ * @return
+ */
 static inline int mar_name_match(const mar_name_t *name1, const mar_name_t *name2)
 {
         if (name1->length == name2->length) {
@@ -134,12 +193,20 @@ static inline int mar_name_match(const mar_name_t *name1, const mar_name_t *name
         return 0;
 }
 
-
+/**
+ * @brief swab_mar_name_t
+ * @param to_swab
+ */
 static inline void swab_mar_name_t (mar_name_t *to_swab)
 {
 	swab_mar_uint16_t (&to_swab->length);
 }
 
+/**
+ * @brief marshall_from_mar_name_t
+ * @param dest
+ * @param src
+ */
 static inline void marshall_from_mar_name_t (
 	cs_name_t *dest,
 	const mar_name_t *src)
@@ -148,6 +215,11 @@ static inline void marshall_from_mar_name_t (
 	memcpy (dest->value, src->value, CS_MAX_NAME_LENGTH);
 }
 
+/**
+ * @brief marshall_to_mar_name_t
+ * @param dest
+ * @param src
+ */
 static inline void marshall_to_mar_name_t (
 	mar_name_t *dest,
 	const cs_name_t *src)
@@ -156,13 +228,23 @@ static inline void marshall_to_mar_name_t (
 	memcpy (dest->value, src->value, CS_MAX_NAME_LENGTH);
 }
 
+/**
+ * @brief mar_bool_t enum
+ */
 typedef enum {
 	MAR_FALSE = 0,
 	MAR_TRUE = 1
 } mar_bool_t;
 
+/**
+ * @brief mar_time_t
+ */
 typedef mar_uint64_t mar_time_t;
 
+/**
+ * @brief swab_mar_time_t
+ * @param to_swab
+ */
 static inline void swab_mar_time_t (mar_time_t *to_swab)
 {
 	swab_mar_uint64_t (to_swab);
@@ -184,20 +266,38 @@ static inline void swab_mar_time_t (mar_time_t *to_swab)
 #define MAR_TRACK_CHANGES 0x02
 #define MAR_TRACK_CHANGES_ONLY 0x04
 
+/**
+ * @brief mar_invocation_t
+ */
 typedef mar_uint64_t mar_invocation_t;
 
+/**
+ * @brief swab_mar_invocation_t
+ * @param to_swab
+ */
 static inline void swab_mar_invocation_t (mar_invocation_t *to_swab)
 {
 	swab_mar_uint64_t (to_swab);
 }
 
+/**
+ * @brief mar_size_t
+ */
 typedef mar_uint64_t mar_size_t;
 
+/**
+ * @brief swab_mar_size_t
+ * @param to_swab
+ */
 static inline void swab_mar_size_t (mar_size_t *to_swab)
 {
 	swab_mar_uint64_t (to_swab);
 }
 
+/**
+ * @brief swab_coroipc_request_header_t
+ * @param to_swab
+ */
 static inline void swab_coroipc_request_header_t (struct qb_ipc_request_header *to_swab)
 {
 	swab_mar_int32_t (&to_swab->size);

+ 51 - 8
include/corosync/quorum.h

@@ -40,8 +40,14 @@
 extern "C" {
 #endif
 
+/**
+ * @brief quorum_handle_t
+ */
 typedef uint64_t quorum_handle_t;
 
+/**
+ * @brief The quorum_notification_fn_t callback
+ */
 typedef void (*quorum_notification_fn_t) (
 	quorum_handle_t handle,
 	uint32_t quorate,
@@ -50,6 +56,9 @@ typedef void (*quorum_notification_fn_t) (
 	uint32_t *view_list
 	);
 
+/**
+ * @brief The quorum_callbacks_t struct
+ */
 typedef struct {
 	quorum_notification_fn_t quorum_notify_fn;
 } quorum_callbacks_t;
@@ -58,7 +67,11 @@ typedef struct {
 #define QUORUM_SET	1
 
 /**
- * Create a new quorum connection
+ * @brief Create a new quorum connection
+ * @param handle
+ * @param callbacks
+ * @param quorum_type
+ * @return
  */
 cs_error_t quorum_initialize (
 	quorum_handle_t *handle,
@@ -66,50 +79,80 @@ cs_error_t quorum_initialize (
 	uint32_t *quorum_type);
 
 /**
- * Close the quorum handle
+ * @brief Close the quorum handle
+ * @param handle
+ * @return
  */
 cs_error_t quorum_finalize (
 	quorum_handle_t handle);
 
-
 /**
- * Get a file descriptor on which to poll.
+ * @brief Get a file descriptor on which to poll.
  *
  * @note quorum_handle_t is NOT a file descriptor and may not be used directly.
+ *
+ * @param handle
+ * @param fd
+ * @return
  */
 cs_error_t quorum_fd_get (
 	quorum_handle_t handle,
 	int *fd);
 
 /**
- * Dispatch messages and configuration changes
+ * @brief Dispatch messages and configuration changes
+ * @param handle
+ * @param dispatch_types
+ * @return
  */
 cs_error_t quorum_dispatch (
 	quorum_handle_t handle,
 	cs_dispatch_flags_t dispatch_types);
 
-
 /**
- * Get quorum information.
+ * @brief Get quorum information.
+ * @param handle
+ * @param quorate
+ * @return
  */
 cs_error_t quorum_getquorate (
 	quorum_handle_t handle,
 	int *quorate);
 
 /**
- * Track node and quorum changes
+ * @brief Track node and quorum changes
+ * @param handle
+ * @param flags
+ * @return
  */
 cs_error_t quorum_trackstart (
 	quorum_handle_t handle,
 	unsigned int flags );
 
+/**
+ * @brief quorum_trackstop
+ * @param handle
+ * @return
+ */
 cs_error_t quorum_trackstop (
 	quorum_handle_t handle);
 
+/**
+ * @brief quorum_context_set
+ * @param handle
+ * @param context
+ * @return
+ */
 cs_error_t quorum_context_set (
 	quorum_handle_t handle,
 	const void *context);
 
+/**
+ * @brief quorum_context_get
+ * @param handle
+ * @param context
+ * @return
+ */
 cs_error_t quorum_context_get (
 	quorum_handle_t handle,
 	const void **context);

+ 16 - 13
include/corosync/sam.h

@@ -40,6 +40,9 @@
 extern "C" {
 #endif
 
+/**
+ * @brief sam_recovery_policy_t enum
+ */
 typedef enum {
 	SAM_RECOVERY_POLICY_QUIT = 1,
 	SAM_RECOVERY_POLICY_RESTART = 2,
@@ -51,12 +54,12 @@ typedef enum {
 } sam_recovery_policy_t;
 
 /**
- * Callback definition for event driven checking
+ * @brief Callback definition for event driven checking
  */
 typedef int (*sam_hc_callback_t)(void);
 
 /**
- * Create a new SAM connection.
+ * @brief Create a new SAM connection.
  *
  * This function must be called before any other.
  * It is recommended to call it as one of first in application.
@@ -78,7 +81,7 @@ cs_error_t sam_initialize (
         sam_recovery_policy_t recovery_policy);
 
 /**
- * Close the SAM handle.
+ * @brief Close the SAM handle.
  *
  * This function should be called as late as possible.
  * (in reality, if you plan just quit, and checking is stopped, there is no need
@@ -91,7 +94,7 @@ cs_error_t sam_initialize (
 cs_error_t sam_finalize (void);
 
 /**
- * Start healthchecking.
+ * @brief Start healthchecking.
  *
  * From this time, you should call every time_interval
  * sam_hc_send, otherwise, recovery action will be taken.
@@ -102,7 +105,7 @@ cs_error_t sam_finalize (void);
 cs_error_t sam_start (void);
 
 /**
- * Stop healthchecking.
+ * @brief Stop healthchecking.
  *
  * Oposite of #sam_start. You can call sam_start and sam_stop how many
  * times you want.
@@ -114,7 +117,7 @@ cs_error_t sam_start (void);
 cs_error_t sam_stop (void);
 
 /**
- * Set warning signal to be send.
+ * @brief Set warning signal to be send.
  *
  * Default signal is SIGTERM. You can use SIGKILL to emulate NOT sending
  * warning signal and just send SIGKILL.
@@ -126,7 +129,7 @@ cs_error_t sam_stop (void);
 cs_error_t sam_warn_signal_set (int warn_signal);
 
 /**
- * Register application.
+ * @brief Register application.
  *
  * This is one of most crucial function. In case, your
  * application will be restarted, you will always return to point after calling
@@ -148,7 +151,7 @@ cs_error_t sam_register (
 	unsigned int *instance_id);
 
 /**
- * Send healthcheck confirmation.
+ * @brief Send healthcheck confirmation.
  *
  * This should be called after #sam_start
  *
@@ -159,7 +162,7 @@ cs_error_t sam_register (
 cs_error_t sam_hc_send (void);
 
 /**
- * Register healtcheck callback.
+ * @brief Register healtcheck callback.
  *
  * After you will call this function, and set
  * cb to something else then NULL, SAM is automatically switched from
@@ -179,7 +182,7 @@ cs_error_t sam_hc_send (void);
 cs_error_t sam_hc_callback_register (sam_hc_callback_t cb);
 
 /**
- * Return size of stored data.
+ * @brief Return size of stored data.
  *
  * @param size Pointer to variable, where stored data size is returned. If
  *        nothing or NULL is stored, then 0 is returned.
@@ -192,7 +195,7 @@ cs_error_t sam_hc_callback_register (sam_hc_callback_t cb);
 cs_error_t sam_data_getsize (size_t *size);
 
 /**
- * Return stored data.
+ * @brief Return stored data.
  *
  * @param data Pointer to place, where to store data
  * @param size Allocated size of data
@@ -206,7 +209,7 @@ cs_error_t sam_data_restore (
 	size_t size);
 
 /**
- * Store user data.
+ * @brief Store user data.
  *
  * Such stored data survives restart of child.
  *
@@ -226,7 +229,7 @@ cs_error_t sam_data_store (
 	size_t size);
 
 /**
- * Marks child as failed.
+ * @brief Marks child as failed.
  *
  * This can be called only with SAM_RECOVERY_POLICY_CMAP flag set and
  * makes sense only for SAM_RECOVERY_POLICY_RESTART. This will kill child without sending warn

+ 86 - 0
include/corosync/sq.h

@@ -37,6 +37,9 @@
 #include <errno.h>
 #include <string.h>
 
+/**
+ * @brief The sq struct
+ */
 struct sq {
 	unsigned int head;
 	unsigned int size;
@@ -58,6 +61,7 @@ struct sq {
  *	used to calculate a less-then or less-then-equal comparison.
  */
 #define ADJUST_ROLLOVER_POINT 0x80000000
+
 /**
  * ADJUST_ROLLOVER_VALUE is the value by which both values in a comparison are
  *	adjusted if either value in a comparison is greater then
@@ -65,6 +69,12 @@ struct sq {
  */
 #define ADJUST_ROLLOVER_VALUE 0x10000
 
+/**
+ * @brief sq_lt_compare
+ * @param a
+ * @param b
+ * @return
+ */
 static inline int sq_lt_compare (unsigned int a, unsigned int b) {
 	if ((a > ADJUST_ROLLOVER_POINT) || (b > ADJUST_ROLLOVER_POINT)) {
 		if ((a - ADJUST_ROLLOVER_VALUE) < (b - ADJUST_ROLLOVER_VALUE)) {
@@ -78,6 +88,12 @@ static inline int sq_lt_compare (unsigned int a, unsigned int b) {
 	return (0);
 }
 
+/**
+ * @brief sq_lte_compare
+ * @param a
+ * @param b
+ * @return
+ */
 static inline int sq_lte_compare (unsigned int a, unsigned int b) {
 	if ((a > ADJUST_ROLLOVER_POINT) || (b > ADJUST_ROLLOVER_POINT)) {
 		if ((a - ADJUST_ROLLOVER_VALUE) <= (b - ADJUST_ROLLOVER_VALUE)) {
@@ -91,6 +107,14 @@ static inline int sq_lte_compare (unsigned int a, unsigned int b) {
 	return (0);
 }
 
+/**
+ * @brief sq_init
+ * @param sq
+ * @param item_count
+ * @param size_per_item
+ * @param head_seqid
+ * @return
+ */
 static inline int sq_init (
 	struct sq *sq,
 	int item_count,
@@ -123,6 +147,11 @@ static inline int sq_init (
 	return (0);
 }
 
+/**
+ * @brief sq_reinit
+ * @param sq
+ * @param head_seqid
+ */
 static inline void sq_reinit (struct sq *sq, unsigned int head_seqid)
 {
 	sq->head = 0;
@@ -134,6 +163,11 @@ static inline void sq_reinit (struct sq *sq, unsigned int head_seqid)
 	memset (sq->items_miss_count, 0, sq->item_count * sizeof (unsigned int));
 }
 
+/**
+ * @brief sq_assert
+ * @param sq
+ * @param pos
+ */
 static inline void sq_assert (const struct sq *sq, unsigned int pos)
 {
 	unsigned int i;
@@ -144,6 +178,12 @@ static inline void sq_assert (const struct sq *sq, unsigned int pos)
 		assert (sq->items_inuse[i] == 0);
 	}
 }
+
+/**
+ * @brief sq_copy
+ * @param sq_dest
+ * @param sq_src
+ */
 static inline void sq_copy (struct sq *sq_dest, const struct sq *sq_src)
 {
 	sq_assert (sq_src, 20);
@@ -161,12 +201,23 @@ static inline void sq_copy (struct sq *sq_dest, const struct sq *sq_src)
 		sq_src->item_count * sizeof (unsigned int));
 }
 
+/**
+ * @brief sq_free
+ * @param sq
+ */
 static inline void sq_free (struct sq *sq) {
 	free (sq->items);
 	free (sq->items_inuse);
 	free (sq->items_miss_count);
 }
 
+/**
+ * @brief sq_item_add
+ * @param sq
+ * @param item
+ * @param seqid
+ * @return
+ */
 static inline void *sq_item_add (
 	struct sq *sq,
 	void *item,
@@ -194,6 +245,12 @@ static inline void *sq_item_add (
 	return (sq_item);
 }
 
+/**
+ * @brief sq_item_inuse
+ * @param sq
+ * @param seq_id
+ * @return
+ */
 static inline unsigned int sq_item_inuse (
 	const struct sq *sq,
 	unsigned int seq_id) {
@@ -216,6 +273,12 @@ static inline unsigned int sq_item_inuse (
 	return (sq->items_inuse[sq_position] != 0);
 }
 
+/**
+ * @brief sq_item_miss_count
+ * @param sq
+ * @param seq_id
+ * @return
+ */
 static inline unsigned int sq_item_miss_count (
 	const struct sq *sq,
 	unsigned int seq_id)
@@ -227,12 +290,23 @@ static inline unsigned int sq_item_miss_count (
 	return (sq->items_miss_count[sq_position]);
 }
 
+/**
+ * @brief sq_size_get
+ * @param sq
+ * @return
+ */
 static inline unsigned int sq_size_get (
 	const struct sq *sq)
 {
 	return sq->size;
 }
 
+/**
+ * @brief sq_in_range
+ * @param sq
+ * @param seq_id
+ * @return
+ */
 static inline unsigned int sq_in_range (
 	const struct sq *sq,
 	unsigned int seq_id)
@@ -262,6 +336,13 @@ static inline unsigned int sq_in_range (
 
 }
 
+/**
+ * @brief sq_item_get
+ * @param sq
+ * @param seq_id
+ * @param sq_item_out
+ * @return
+ */
 static inline unsigned int sq_item_get (
 	const struct sq *sq,
 	unsigned int seq_id,
@@ -293,6 +374,11 @@ static inline unsigned int sq_item_get (
 	return (0);
 }
 
+/**
+ * @brief sq_items_release
+ * @param sq
+ * @param seqid
+ */
 static inline void sq_items_release (struct sq *sq, unsigned int seqid)
 {
 	unsigned int oldhead;

+ 13 - 0
include/corosync/swab.h

@@ -32,6 +32,10 @@
  */
 #include <sys/types.h>
 
+/**
+ * @brief The swab16 macro
+ * @param x
+ */
 #define swab16(x) \
 ({ \
 	uint16_t __x = (x); \
@@ -40,6 +44,10 @@
 		(((uint16_t)(__x) & (uint16_t)0xff00U) >> 8) )); \
 })
 
+/**
+ * @brief The swab32 macro
+ * @param x
+ */
 #define swab32(x) \
 ({ \
 	uint32_t __x = (x); \
@@ -49,6 +57,11 @@
 		(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >>  8) | \
 		(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) )); \
 })
+
+/**
+ * @brief The swab64 macro
+ * @param x
+ */
 #define swab64(x) \
 ({ \
 	uint64_t __x = (x); \

+ 115 - 36
include/corosync/votequorum.h

@@ -42,30 +42,36 @@
 extern "C" {
 #endif
 
+/**
+ * @brief votequorum_handle_t
+ */
 typedef uint64_t votequorum_handle_t;
 
-#define VOTEQUORUM_INFO_TWONODE                 1
-#define VOTEQUORUM_INFO_QUORATE                 2
-#define VOTEQUORUM_INFO_WAIT_FOR_ALL            4
-#define VOTEQUORUM_INFO_LAST_MAN_STANDING       8
-#define VOTEQUORUM_INFO_AUTO_TIE_BREAKER       16
-#define VOTEQUORUM_INFO_ALLOW_DOWNSCALE        32
-#define VOTEQUORUM_INFO_QDEVICE_REGISTERED     64
-#define VOTEQUORUM_INFO_QDEVICE_ALIVE         128
-#define VOTEQUORUM_INFO_QDEVICE_CAST_VOTE     256
-#define VOTEQUORUM_INFO_QDEVICE_MASTER_WINS   512
-
-#define VOTEQUORUM_QDEVICE_NODEID               0
-#define VOTEQUORUM_QDEVICE_MAX_NAME_LEN       255
-#define VOTEQUORUM_QDEVICE_DEFAULT_TIMEOUT  10000
+#define VOTEQUORUM_INFO_TWONODE                  1
+#define VOTEQUORUM_INFO_QUORATE                  2
+#define VOTEQUORUM_INFO_WAIT_FOR_ALL             4
+#define VOTEQUORUM_INFO_LAST_MAN_STANDING        8
+#define VOTEQUORUM_INFO_AUTO_TIE_BREAKER         16
+#define VOTEQUORUM_INFO_ALLOW_DOWNSCALE          32
+#define VOTEQUORUM_INFO_QDEVICE_REGISTERED       64
+#define VOTEQUORUM_INFO_QDEVICE_ALIVE            128
+#define VOTEQUORUM_INFO_QDEVICE_CAST_VOTE        256
+#define VOTEQUORUM_INFO_QDEVICE_MASTER_WINS      512
+
+#define VOTEQUORUM_QDEVICE_NODEID                0
+#define VOTEQUORUM_QDEVICE_MAX_NAME_LEN          255
+#define VOTEQUORUM_QDEVICE_DEFAULT_TIMEOUT       10000
 #define VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT  30000
 
-#define VOTEQUORUM_NODESTATE_MEMBER             1
-#define VOTEQUORUM_NODESTATE_DEAD               2
-#define VOTEQUORUM_NODESTATE_LEAVING            3
+#define VOTEQUORUM_NODESTATE_MEMBER              1
+#define VOTEQUORUM_NODESTATE_DEAD                2
+#define VOTEQUORUM_NODESTATE_LEAVING             3
 
 /** @} */
 
+/**
+ * @brief The votequorum_info struct
+ */
 struct votequorum_info {
 	unsigned int node_id;
 	unsigned int node_state;
@@ -79,16 +85,25 @@ struct votequorum_info {
 	char qdevice_name[VOTEQUORUM_QDEVICE_MAX_NAME_LEN];
 };
 
+/**
+ * @brief The votequorum_node_t struct
+ */
 typedef struct {
 	uint32_t nodeid;
 	uint32_t state;
 } votequorum_node_t;
 
+/**
+ * @brief The votequorum_ring_id_t struct
+ */
 typedef struct {
 	uint32_t nodeid;
 	uint64_t seq;
 } votequorum_ring_id_t;
 
+/**
+ * @brief The votequorum_notification_fn_t callback
+ */
 typedef void (*votequorum_notification_fn_t) (
 	votequorum_handle_t handle,
 	uint64_t context,
@@ -97,50 +112,69 @@ typedef void (*votequorum_notification_fn_t) (
 	uint32_t node_list_entries,
 	votequorum_node_t node_list[]);
 
+/**
+ * @brief The votequorum_expectedvotes_notification_fn_t callback
+ */
 typedef void (*votequorum_expectedvotes_notification_fn_t) (
 	votequorum_handle_t handle,
 	uint64_t context,
 	uint32_t expected_votes);
 
+/**
+ * @brief The votequorum_callbacks_t struct
+ */
 typedef struct {
 	votequorum_notification_fn_t votequorum_notify_fn;
 	votequorum_expectedvotes_notification_fn_t votequorum_expectedvotes_notify_fn;
 } votequorum_callbacks_t;
 
-
 /**
- * Create a new quorum connection
+ * @brief Create a new quorum connection
+ * @param handle
+ * @param callbacks
+ * @return
  */
 cs_error_t votequorum_initialize (
 	votequorum_handle_t *handle,
 	votequorum_callbacks_t *callbacks);
 
 /**
- * Close the quorum handle
+ * @brief Close the quorum handle
+ * @param handle
+ * @return
  */
 cs_error_t votequorum_finalize (
 	votequorum_handle_t handle);
 
-
 /**
- * Dispatch messages and configuration changes
+ * @brief Dispatch messages and configuration changes
+ * @param handle
+ * @param dispatch_types
+ * @return
  */
 cs_error_t votequorum_dispatch (
 	votequorum_handle_t handle,
 	cs_dispatch_flags_t dispatch_types);
 
 /**
- * Get a file descriptor on which to poll.
+ * @brief Get a file descriptor on which to poll.
+ *
+ * @note votequorum_handle_t is NOT a file descriptor and may not be used directly.
  *
- * @note votequorum_handle_t is NOT a file descriptor and may not be
- *       used directly.
+ * @param handle
+ * @param fd
+ * @return
  */
 cs_error_t votequorum_fd_get (
 	votequorum_handle_t handle,
 	int *fd);
 
 /**
- * Get quorum information.
+ * @brief Get quorum information.
+ * @param handle
+ * @param nodeid
+ * @param info
+ * @return
  */
 cs_error_t votequorum_getinfo (
 	votequorum_handle_t handle,
@@ -148,14 +182,21 @@ cs_error_t votequorum_getinfo (
 	struct votequorum_info *info);
 
 /**
- * set expected_votes
+ * @brief set expected_votes
+ * @param handle
+ * @param expected_votes
+ * @return
  */
 cs_error_t votequorum_setexpected (
 	votequorum_handle_t handle,
 	unsigned int expected_votes);
 
 /**
- * set votes for a node
+ * @brief set votes for a node
+ * @param handle
+ * @param nodeid
+ * @param votes
+ * @return
  */
 cs_error_t votequorum_setvotes (
 	votequorum_handle_t handle,
@@ -163,45 +204,74 @@ cs_error_t votequorum_setvotes (
 	unsigned int votes);
 
 /**
- * Track node and quorum changes
+ * @brief Track node and quorum changes
+ * @param handle
+ * @param context
+ * @param flags
+ * @return
  */
 cs_error_t votequorum_trackstart (
 	votequorum_handle_t handle,
 	uint64_t context,
-	unsigned int flags );
+        unsigned int flags);
 
+/**
+ * @brief votequorum_trackstop
+ * @param handle
+ * @return
+ */
 cs_error_t votequorum_trackstop (
 	votequorum_handle_t handle);
 
 /**
- * Save and retrieve private data/context
+ * @brief Save and retrieve private data/context
+ * @param handle
+ * @param context
+ * @return
  */
 cs_error_t votequorum_context_get (
 	votequorum_handle_t handle,
 	void **context);
 
+/**
+ * @brief votequorum_context_set
+ * @param handle
+ * @param context
+ * @return
+ */
 cs_error_t votequorum_context_set (
 	votequorum_handle_t handle,
 	void *context);
 
 /**
- * Register a quorum device
+ * @brief Register a quorum device
  *
  * it will be DEAD until polled
+ *
+ * @param handle
+ * @param name
+ * @return
  */
 cs_error_t votequorum_qdevice_register (
 	votequorum_handle_t handle,
 	const char *name);
 
 /**
- * Unregister a quorum device
+ * @brief Unregister a quorum device
+ * @param handle
+ * @param name
+ * @return
  */
 cs_error_t votequorum_qdevice_unregister (
 	votequorum_handle_t handle,
 	const char *name);
 
 /**
- * Update registered name of a quorum device
+ * @brief Update registered name of a quorum device
+ * @param handle
+ * @param oldname
+ * @param newname
+ * @return
  */
 cs_error_t votequorum_qdevice_update (
 	votequorum_handle_t handle,
@@ -209,7 +279,12 @@ cs_error_t votequorum_qdevice_update (
 	const char *newname);
 
 /**
- * Poll a quorum device
+ * @brief Poll a quorum device
+ * @param handle
+ * @param name
+ * @param cast_vote
+ * @param ring_id
+ * @return
  */
 cs_error_t votequorum_qdevice_poll (
 	votequorum_handle_t handle,
@@ -218,7 +293,11 @@ cs_error_t votequorum_qdevice_poll (
 	votequorum_ring_id_t ring_id);
 
 /**
- * Allow qdevice to tell votequorum if master_wins can be enabled or not
+ * @brief Allow qdevice to tell votequorum if master_wins can be enabled or not
+ * @param handle
+ * @param name
+ * @param allow
+ * @return
  */
 cs_error_t votequorum_qdevice_master_wins (
 	votequorum_handle_t handle,