14.36. Replication Session Hooks Callbacks
static void *test_repl_session_api[] = {
NULL, /* reserved for api broker use, must be zero */
test_repl_session_plugin_agmt_init_cb,
test_repl_session_plugin_pre_acquire_cb,
test_repl_session_plugin_reply_acquire_cb,
test_repl_session_plugin_post_acquire_cb,
test_repl_session_plugin_recv_acquire_cb,
test_repl_session_plugin_destroy_cb
};
int test_repl_session_plugin_init(Slapi_PBlock *pb)
{
...
if( slapi_apib_register(REPL_SESSION_v1_0_GUID, test_repl_session_api) ) {
slapi_log_error( SLAPI_LOG_FATAL, test_repl_session_plugin_name,
"<-- test_repl_session_plugin_start -- failed to register repl_session api -- end\n");
return -1;
}
...
}
Note
typedef declarations are used to define replication session hooks for Directory Server and its clients, including applications like Red Hat Enterprise IPA.
Table 14.17. Replication Session Hooks Types
| typedef | Description |
|---|---|
| repl_session_plugin_agmt_init_cb | Used to initialize the replication agreement to begin replication. |
| repl_session_plugin_pre_acquire_cb | Defines the data about the initiating master server to send to the replica. |
| repl_session_plugin_reply_acquire_cb | Defines the information about the replica to send to the master. |
| repl_session_plugin_post_acquire_cb | Posts the response from the replica to the master server. |
| repl_session_plugin_recv_acquire_cb | Receives the data from the replica. |
| repl_session_plugin_destroy_agmt_cb | Destroys a replication agreement when the operation is complete. |
14.36.1. repl_session_plugin_agmt_init_cb
typedef void * (*repl_session_plugin_agmt_init_cb)(const Slapi_DN *repl_subtree);
This function takes the following parameters:
| Parameter | Description |
|---|---|
| repl_subtree | Gives the subtree that is involved in replication. |
14.36.2. repl_session_plugin_pre_acquire_cb
typedef int (*repl_session_plugin_pre_acquire_cb)(void *cookie, const Slapi_DN *repl_subtree,
int is_total, char **data_guid, struct berval **data);This function takes the following parameters:
| Parameter | Description |
|---|---|
| cookie | Private data used by the plug-in. This is the value returned by the replication plug-in init function (if any) and passed to all plug-in functions. |
| repl_subtree | Gives the subtree that is involved in replication. |
| data_guid | Sends an identifier for the expected data. |
| data_guid | Contains the data. |
14.36.3. repl_session_plugin_reply_acquire_cb
typedef int (*repl_session_plugin_reply_acquire_cb)(const char *repl_subtree, int is_total,
char **data_guid, struct berval **data);This function takes the following parameters:
| Parameter | Description |
|---|---|
| cookie | Private data used by the plug-in. This is the value returned by the replication plug-in init function (if any) and passed to all plug-in functions. |
| repl_subtree | Gives the subtree that is involved in replication. |
| data_guid | Contains the identifier for the expected data. |
| data_guid | Contains the data. |
14.36.4. repl_session_plugin_post_acquire_cb
typedef int (*repl_session_plugin_post_acquire_cb)(void *cookie, const Slapi_DN *repl_subtree,
int is_total, const char *data_guid, const struct berval *data);This function takes the following parameters:
| Parameter | Description |
|---|---|
| cookie | Private data used by the plug-in. This is the value returned by the replication plug-in init function (if any) and passed to all plug-in functions. |
| repl_subtree | Gives the subtree that is involved in replication. |
| data_guid | Contains the identifier for the expected data. |
| data_guid | Contains the data. |
14.36.5. repl_session_plugin_recv_acquire_cb
typedef int (*repl_session_plugin_recv_acquire_cb)(const char *repl_subtree, int is_total,
const char *data_guid, const struct berval *data);This function takes the following parameters:
| Parameter | Description |
|---|---|
| cookie | Private data used by the plug-in. This is the value returned by the replication plug-in init function (if any) and passed to all plug-in functions. |
| repl_subtree | Gives the subtree that is involved in replication. |
| data_guid | Contains the identifier for the expected data. |
| data_guid | Contains the data. |
14.36.6. repl_session_plugin_destroy_agmt_cb
typedef void (*repl_session_plugin_destroy_agmt_cb)(void *cookie, const Slapi_DN *repl_subtree);
This function takes the following parameters:
| Parameter | Description |
|---|---|
| cookie | Private data used by the plug-in. This is the value returned by the replication plug-in init function (if any) and passed to all plug-in functions. |
| repl_subtree | Gives the subtree that is involved in replication. |

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.