quorum.h File Reference
`#include <corosync/corotypes.h>`
Include dependency graph for include/corosync/quorum.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | quorum_ring_id
struct | quorum_callbacks_t
| The quorum_callbacks_t struct. More...
struct | quorum_model_data_t
struct | quorum_model_v0_data_t
struct | quorum_model_v1_data_t

## Macros

#define | QUORUM_FREE 0
#define | QUORUM_SET 1

## Typedefs

typedef uint64_t | quorum_handle_t
| quorum_handle_t
typedef void(* | quorum_notification_fn_t) (quorum_handle_t handle, uint32_t quorate, uint64_t ring_seq, uint32_t view_list_entries, uint32_t *view_list)
| The quorum_notification_fn_t callback.
typedef void(* | quorum_v1_quorum_notification_fn_t) (quorum_handle_t handle, uint32_t quorate, struct quorum_ring_id ring_id, uint32_t member_list_entries, const uint32_t *member_list)
typedef void(* | quorum_v1_nodelist_notification_fn_t) (quorum_handle_t handle, struct quorum_ring_id ring_id, uint32_t member_list_entries, const uint32_t *member_list, uint32_t joined_list_entries, const uint32_t *joined_list, uint32_t left_list_entries, const uint32_t *left_list)

## Enumerations

enum | quorum_model_t { QUORUM_MODEL_V0 = 0 , QUORUM_MODEL_V1 = 1 }

## Functions

cs_error_t | quorum_initialize (quorum_handle_t *handle, quorum_callbacks_t *callbacks, uint32_t *quorum_type)
| Create a new quorum connection.
cs_error_t | quorum_model_initialize (quorum_handle_t *handle, quorum_model_t model, quorum_model_data_t *model_data, uint32_t *quorum_type, void *context)
cs_error_t | quorum_finalize (quorum_handle_t handle)
| Close the quorum handle.
cs_error_t | quorum_fd_get (quorum_handle_t handle, int *fd)
| Get a file descriptor on which to poll.
cs_error_t | quorum_dispatch (quorum_handle_t handle, cs_dispatch_flags_t dispatch_types)
| Dispatch messages and configuration changes.
cs_error_t | quorum_getquorate (quorum_handle_t handle, int *quorate)
| Get quorum information.
cs_error_t | quorum_trackstart (quorum_handle_t handle, unsigned int flags)
| Track node and quorum changes.
cs_error_t | quorum_trackstop (quorum_handle_t handle)
| quorum_trackstop
cs_error_t | quorum_context_set (quorum_handle_t handle, const void *context)
| quorum_context_set
cs_error_t | quorum_context_get (quorum_handle_t handle, const void **context)
| quorum_context_get

## Macro Definition Documentation

## QUORUM_FREE

#define QUORUM_FREE 0

Definition at line 106 of file include/corosync/quorum.h.

## QUORUM_SET

#define QUORUM_SET 1

Definition at line 107 of file include/corosync/quorum.h.

## Typedef Documentation

## quorum_handle_t

typedef uint64_t quorum_handle_t

quorum_handle_t

Definition at line 51 of file include/corosync/quorum.h.

## quorum_notification_fn_t

typedef void(* quorum_notification_fn_t) (quorum_handle_t handle, uint32_t quorate, uint64_t ring_seq, uint32_t view_list_entries, uint32_t *view_list)

The quorum_notification_fn_t callback.

Definition at line 61 of file include/corosync/quorum.h.

## quorum_v1_nodelist_notification_fn_t

typedef void(* quorum_v1_nodelist_notification_fn_t) (quorum_handle_t handle, struct quorum_ring_id ring_id, uint32_t member_list_entries, const uint32_t *member_list, uint32_t joined_list_entries, const uint32_t *joined_list, uint32_t left_list_entries, const uint32_t *left_list)

Definition at line 76 of file include/corosync/quorum.h.

## quorum_v1_quorum_notification_fn_t

typedef void(* quorum_v1_quorum_notification_fn_t) (quorum_handle_t handle, uint32_t quorate, struct quorum_ring_id ring_id, uint32_t member_list_entries, const uint32_t *member_list)

Definition at line 69 of file include/corosync/quorum.h.

## Enumeration Type Documentation

## quorum_model_t

enum quorum_model_t

Enumerator
QUORUM_MODEL_V0 |
QUORUM_MODEL_V1 |

Definition at line 43 of file include/corosync/quorum.h.

## Function Documentation

## quorum_context_get()

cs_error_t quorum_context_get | ( | quorum_handle_t | handle,
|  | const void ** | context
| ) |  |

quorum_context_get

Parameters

  handle |
  context |

Returns

Definition at line 299 of file lib/quorum.c.

References quorum_inst::context, CS_OK, hdb_error_to_cs(), and nodeid.

## quorum_context_set()

cs_error_t quorum_context_set | ( | quorum_handle_t | handle,
|  | const void * | context
| ) |  |

quorum_context_set

Parameters

  handle |
  context |

Returns

Definition at line 318 of file lib/quorum.c.

References quorum_inst::context, CS_OK, hdb_error_to_cs(), and nodeid.

## quorum_dispatch()

cs_error_t quorum_dispatch | ( | quorum_handle_t | handle,
|  | cs_dispatch_flags_t | dispatch_types
| ) |  |

Dispatch messages and configuration changes.

Parameters

  handle |
  dispatch_types |

Returns

Definition at line 418 of file lib/quorum.c.

References quorum_inst::c, CS_DISPATCH_ALL, CS_DISPATCH_BLOCKING, CS_DISPATCH_ONE, CS_DISPATCH_ONE_NONBLOCKING, CS_ERR_BAD_HANDLE, CS_ERR_INVALID_PARAM, CS_ERR_LIBRARY, CS_ERR_TRY_AGAIN, CS_OK, quorum_inst::finalize, hdb_error_to_cs(), IPC_DISPATCH_SIZE, res_lib_quorum_v1_nodelist_notification::member_list, MESSAGE_RES_QUORUM_NOTIFICATION, MESSAGE_RES_QUORUM_V1_NODELIST_NOTIFICATION, MESSAGE_RES_QUORUM_V1_QUORUM_NOTIFICATION, nodeid, memb_ring_id::nodeid, qb_to_cs_error(), QUORUM_MODEL_V0, QUORUM_MODEL_V1, ring_id, memb_ring_id::seq, res_lib_quorum_notification::view_list, and res_lib_quorum_v1_quorum_notification::view_list.

Referenced by sam_initialize().

## quorum_fd_get()

cs_error_t quorum_fd_get | ( | quorum_handle_t | handle,
|  | int * | fd
| ) |  |

Get a file descriptor on which to poll.

Note
  quorum_handle_t is NOT a file descriptor and may not be used directly.

Parameters

  handle |
  fd |

Returns

Definition at line 279 of file lib/quorum.c.

References quorum_inst::c, CS_OK, hdb_error_to_cs(), nodeid, and qb_to_cs_error().

Referenced by sam_initialize().

## quorum_finalize()

cs_error_t quorum_finalize | ( | quorum_handle_t | handle | ) |

Close the quorum handle.

Parameters

  handle |

Returns

Definition at line 209 of file lib/quorum.c.

References CS_ERR_BAD_HANDLE, CS_OK, quorum_inst::finalize, hdb_error_to_cs(), and nodeid.

Referenced by sam_initialize(), and sam_register().

## quorum_getquorate()

cs_error_t quorum_getquorate | ( | quorum_handle_t | handle,
|  | int * | quorate
| ) |  |

Get quorum information.

Parameters

  handle |
  quorate |

Returns

Definition at line 237 of file lib/quorum.c.

References quorum_inst::c, CS_IPC_TIMEOUT_MS, CS_OK, hdb_error_to_cs(), MESSAGE_REQ_QUORUM_GETQUORATE, nodeid, qb_to_cs_error(), res_lib_quorum_getquorate::quorate, and quorate.

## quorum_initialize()

cs_error_t quorum_initialize | ( | quorum_handle_t * | handle,
|  | quorum_callbacks_t * | callbacks,
|  | uint32_t * | quorum_type
| ) |  |

Create a new quorum connection.

Parameters

  handle |
  callbacks |
  quorum_type |

Returns

Definition at line 73 of file lib/quorum.c.

References nodeid, quorum_model_initialize(), QUORUM_MODEL_V0, quorum_callbacks_t::quorum_notify_fn, and quorum_model_v0_data_t::quorum_notify_fn.

Referenced by sam_initialize().

## quorum_model_initialize()

cs_error_t quorum_model_initialize | ( | quorum_handle_t * | handle,
|  | quorum_model_t | model,
|  | quorum_model_data_t * | model_data,
|  | uint32_t * | quorum_type,
|  | void * | context
| ) |  |

Definition at line 90 of file lib/quorum.c.

References quorum_inst::c, quorum_inst::context, CS_ERR_INVALID_PARAM, CS_OK, quorum_inst::finalize, hdb_error_to_cs(), IPC_REQUEST_SIZE, MESSAGE_REQ_QUORUM_GETTYPE, MESSAGE_REQ_QUORUM_MODEL_GETTYPE, quorum_model_data_t::model, quorum_inst::model_data, quorum_inst::model_v0_data, quorum_inst::model_v1_data, nodeid, qb_to_cs_error(), QUORUM_MODEL_V0, QUORUM_MODEL_V1, and res_lib_quorum_gettype::quorum_type.

Referenced by quorum_initialize().

## quorum_trackstart()

cs_error_t quorum_trackstart | ( | quorum_handle_t | handle,
|  | unsigned int | flags
| ) |  |

Track node and quorum changes.

Parameters

  handle |
  flags |

Returns

Definition at line 338 of file lib/quorum.c.

References quorum_inst::c, CS_IPC_TIMEOUT_MS, CS_OK, flags, hdb_error_to_cs(), MESSAGE_REQ_QUORUM_TRACKSTART, nodeid, qb_to_cs_error(), and req_lib_quorum_trackstart::track_flags.

Referenced by sam_initialize().

## quorum_trackstop()

cs_error_t quorum_trackstop | ( | quorum_handle_t | handle | ) |

quorum_trackstop

Parameters

  handle |

Returns

Definition at line 379 of file lib/quorum.c.

References quorum_inst::c, CS_IPC_TIMEOUT_MS, CS_OK, hdb_error_to_cs(), MESSAGE_REQ_QUORUM_TRACKSTOP, nodeid, and qb_to_cs_error().