Beispiel #1
0
void dyndns_test_timer(void *pvt)
{
    struct dyndns_test_ctx *ctx = talloc_get_type(pvt, struct dyndns_test_ctx);
    static int ncalls = 0;

    ncalls++;
    if (ncalls == 1) {
        be_nsupdate_timer_schedule(ctx->tctx->ev, ctx->update_ctx);
    } else if (ncalls == 2) {
        ctx->tctx->done = true;
    }
    ctx->tctx->error = ERR_OK;
}
Beispiel #2
0
void ad_dyndns_timer(void *pvt)
{
    struct ad_options *ctx = talloc_get_type(pvt, struct ad_options);
    struct sdap_id_ctx *sdap_ctx = ctx->id_ctx->sdap_id_ctx;
    struct tevent_req *req;

    req = sdap_dyndns_timer_conn_send(ctx, sdap_ctx->be->ev, sdap_ctx,
                                      ctx->dyndns_ctx);
    if (req == NULL) {
        DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory\n"));
        /* Not much we can do. Just attempt to reschedule */
        be_nsupdate_timer_schedule(sdap_ctx->be->ev, ctx->dyndns_ctx);
        return;
    }
    tevent_req_set_callback(req, ad_dyndns_timer_connected, ctx);
}
Beispiel #3
0
void ad_dyndns_update(void *pvt)
{
    struct ad_options *ctx = talloc_get_type(pvt, struct ad_options);
    struct sdap_id_ctx *sdap_ctx = ctx->id_ctx->sdap_id_ctx;
    struct tevent_req *req;

    /* Schedule timer after provider went offline */
    be_nsupdate_timer_schedule(sdap_ctx->be->ev, ctx->dyndns_ctx);

    req = ad_dyndns_update_send(ctx);
    if (req == NULL) {
        DEBUG(SSSDBG_CRIT_FAILURE, ("Could not update DNS\n"));
        return;
    }
    tevent_req_set_callback(req, ad_dyndns_nsupdate_done, NULL);
}