#endif
}
+void main_service_ready (void)
+{
+ int res;
+ /*
+ * This must occur after totempg is initialized because "this_ip" must be set
+ */
+ res = corosync_service_defaults_link_and_init (api);
+ if (res == -1) {
+ log_printf (LOGSYS_LEVEL_ERROR, "Could not initialize default services\n");
+ corosync_exit_error (AIS_DONE_INIT_SERVICES);
+ }
+ evil_init (api);
+}
+
int main (int argc, char **argv)
{
const char *error_string;
corosync_poll_handle,
&totem_config);
+ totempg_service_ready_register (
+ main_service_ready);
+
totempg_groups_initialize (
&corosync_group_handle,
deliver_fn,
&corosync_group,
1);
- /*
- * This must occur after totempg is initialized because "this_ip" must be set
- */
- res = corosync_service_defaults_link_and_init (api);
- if (res == -1) {
- log_printf (LOGSYS_LEVEL_ERROR, "Could not initialize default services\n");
- corosync_exit_error (AIS_DONE_INIT_SERVICES);
- }
- evil_init (api);
-
if (minimum_sync_mode == CS_SYNC_V2) {
log_printf (LOGSYS_LEVEL_NOTICE, "Compatibility mode set to none. Using V2 of the synchronization engine.\n");
sync_v2_init (
return (res);
}
+
+extern void totemmrp_service_ready_register (
+ void (*totem_service_ready) (void))
+{
+ totemsrp_service_ready_register (
+ totemsrp_context,
+ totem_service_ready);
+}
extern int totemmrp_ring_reenable (void);
+extern void totemmrp_service_ready_register (
+ void (*totem_service_ready) (void));
+
#endif /* TOTEMMRP_H_DEFINED */
{
return (totemmrp_my_family_get());
}
+extern void totempg_service_ready_register (
+ void (*totem_service_ready) (void))
+{
+ totemmrp_service_ready_register (totem_service_ready);
+}
+
deliver_fn_context->instance = instance;
deliver_fn_context->context = context;
deliver_fn_context->iface_no = i;
-printf ("deliver fn context %p\n", deliver_fn_context);
totemnet_initialize (
poll_handle,
const unsigned int *joined_list, size_t joined_list_entries,
const struct memb_ring_id *ring_id);
+ void (*totemsrp_service_ready_fn) (void);
+
int global_seqno;
int my_token_held;
unsigned int *iface_count)
{
struct totemsrp_instance *instance = (struct totemsrp_instance *)srp_context;
- int res;
+ int res = 0;
unsigned int found = 0;
unsigned int i;
"Created or loaded sequence id %lld.%s for this ring.\n",
instance->my_ring_id.seq,
totemip_print (&instance->my_ring_id.rep));
+ if (instance->totemsrp_service_ready_fn) {
+ instance->totemsrp_service_ready_fn ();
+ }
}
if (instance->iface_changes >= instance->totem_config->interface_count) {
void totemsrp_net_mtu_adjust (struct totem_config *totem_config) {
totem_config->net_mtu -= sizeof (struct mcast);
}
+
+void totemsrp_service_ready_register (
+ void *context,
+ void (*totem_service_ready) (void))
+{
+ struct totemsrp_instance *instance = (struct totemsrp_instance *)context;
+
+ instance->totemsrp_service_ready_fn = totem_service_ready;
+}
extern int totemsrp_ring_reenable (
void *srp_context);
+void totemsrp_service_ready_register (
+ void *srp_context,
+ void (*totem_service_ready) (void));
+
#endif /* TOTEMSRP_H_DEFINED */
extern int totempg_ring_reenable (void);
+extern void totempg_service_ready_register (
+ void (*totem_service_ready) (void));
+
#ifdef __cplusplus
}
#endif