Lines Matching defs:add_ctx

64     struct mbof_add_ctx *add_ctx;
345 static int mbof_append_addop(struct mbof_add_ctx *add_ctx,
354 if (add_ctx->add_list) {
359 lastop = add_ctx->add_list;
370 addop = talloc_zero(add_ctx, struct mbof_add_operation);
375 addop->add_ctx = add_ctx;
379 if (add_ctx->add_list) {
382 add_ctx->add_list = addop;
388 static int mbof_add_fill_ghop_ex(struct mbof_add_ctx *add_ctx,
417 ldb_debug(ldb_module_get_ctx(add_ctx->ctx->module),
424 ret = mbof_append_muop(add_ctx, &add_ctx->muops,
425 &add_ctx->num_muops,
448 static int mbof_add_fill_ghop(struct mbof_add_ctx *add_ctx,
451 static int mbof_add_missing(struct mbof_add_ctx *add_ctx, struct ldb_dn *dn);
452 static int mbof_add_cleanup(struct mbof_add_ctx *add_ctx);
455 static int mbof_add_muop(struct mbof_add_ctx *add_ctx);
462 struct mbof_add_ctx *add_ctx;
502 add_ctx = talloc_zero(ctx, struct mbof_add_ctx);
503 if (!add_ctx) {
506 add_ctx->ctx = ctx;
508 add_ctx->msg = ldb_msg_copy(add_ctx, req->op.add.message);
509 if (!add_ctx->msg) {
512 add_ctx->msg_dn = add_ctx->msg->dn;
515 el = ldb_msg_find_element(add_ctx->msg, DB_MEMBER);
517 add_ctx->terminate = true;
521 parents = talloc_zero(add_ctx, struct mbof_dn_array);
529 parents->dns[0] = add_ctx->msg_dn;
535 valdn = ldb_dn_from_ldb_val(add_ctx, ldb, &el->values[i]);
546 ret = mbof_append_addop(add_ctx, parents, valdn);
554 ret = ldb_build_add_req(&add_req, ldb, add_ctx,
555 add_ctx->msg, req->controls,
556 add_ctx, mbof_add_callback,
568 struct mbof_add_ctx *add_ctx;
572 add_ctx = talloc_get_type(req->context, struct mbof_add_ctx);
573 ctx = add_ctx->ctx;
597 if (add_ctx->terminate) {
604 if (add_ctx->current_op == NULL) {
608 ret = mbof_next_add(add_ctx->add_list);
610 else if (add_ctx->current_op->next) {
612 ret = mbof_next_add(add_ctx->current_op->next);
616 if (add_ctx->missing) {
617 ret = mbof_add_cleanup(add_ctx);
619 else if (add_ctx->muops) {
620 ret = mbof_add_muop(add_ctx);
647 struct mbof_add_ctx *add_ctx;
651 add_ctx = addop->add_ctx;
652 ctx = add_ctx->ctx;
656 add_ctx->current_op = addop;
674 struct mbof_add_ctx *add_ctx;
680 add_ctx = addop->add_ctx;
681 ctx = add_ctx->ctx;
724 ret = mbof_add_missing(add_ctx, addop->entry_dn);
729 if (add_ctx->current_op->next) {
730 ret = mbof_next_add(add_ctx->current_op->next);
734 if (add_ctx->missing) {
735 ret = mbof_add_cleanup(add_ctx);
737 else if (add_ctx->muops) {
738 ret = mbof_add_muop(add_ctx);
772 struct mbof_add_ctx *add_ctx;
784 add_ctx = addop->add_ctx;
785 ctx = add_ctx->ctx;
788 parents = talloc_zero(add_ctx, struct mbof_dn_array);
848 else if (add_ctx->muops) {
849 return mbof_add_muop(add_ctx);
866 valdn = ldb_dn_from_ldb_val(add_ctx, ldb, &el->values[i]);
878 ret = mbof_append_addop(add_ctx, parents, valdn);
896 ret = mbof_append_muop(add_ctx, &add_ctx->muops,
897 &add_ctx->num_muops,
917 ret = mbof_add_fill_ghop(add_ctx, addop->entry, parents);
952 ret = ldb_build_mod_req(&mod_req, ldb, add_ctx,
954 add_ctx, mbof_add_callback,
964 static int mbof_add_fill_ghop(struct mbof_add_ctx *add_ctx,
976 return mbof_add_fill_ghop_ex(add_ctx, entry, parents,
980 static int mbof_add_missing(struct mbof_add_ctx *add_ctx, struct ldb_dn *dn)
984 mdn = talloc(add_ctx, struct mbof_dn);
991 mdn->next = add_ctx->missing;
992 add_ctx->missing = mdn;
998 static int mbof_add_cleanup(struct mbof_add_ctx *add_ctx)
1009 ctx = add_ctx->ctx;
1013 for (iter = add_ctx->missing; iter; iter = iter->next) {
1020 msg = ldb_msg_new(add_ctx);
1023 msg->dn = add_ctx->msg_dn;
1034 for (i = 0, iter = add_ctx->missing; iter; iter = iter->next, i++) {
1043 ret = ldb_build_mod_req(&mod_req, ldb, add_ctx,
1045 add_ctx, mbof_add_cleanup_callback,
1057 struct mbof_add_ctx *add_ctx;
1061 add_ctx = talloc_get_type(req->context, struct mbof_add_ctx);
1062 ctx = add_ctx->ctx;
1086 if (add_ctx->muops) {
1087 ret = mbof_add_muop(add_ctx);
1107 static int mbof_add_muop(struct mbof_add_ctx *add_ctx)
1115 ctx = add_ctx->ctx;
1118 msg = ldb_msg_new(add_ctx);
1121 msg->dn = add_ctx->muops[add_ctx->cur_muop].dn;
1122 msg->elements = add_ctx->muops[add_ctx->cur_muop].el;
1125 ret = ldb_build_mod_req(&mod_req, ldb, add_ctx,
1127 add_ctx, mbof_add_muop_callback,
1146 struct mbof_add_ctx *add_ctx;
1150 add_ctx = talloc_get_type(req->context, struct mbof_add_ctx);
1151 ctx = add_ctx->ctx;
1175 add_ctx->cur_muop++;
1176 if (add_ctx->cur_muop < add_ctx->num_muops) {
1177 ret = mbof_add_muop(add_ctx);
3638 struct mbof_add_ctx *add_ctx;
3654 add_ctx = talloc_zero(mod_ctx, struct mbof_add_ctx);
3655 if (!add_ctx) {
3658 add_ctx->ctx = ctx;
3659 add_ctx->msg_dn = mod_ctx->msg->dn;
3663 ret = mbof_add_fill_ghop_ex(add_ctx, mod_ctx->entry,
3682 ret = mbof_append_addop(add_ctx, parents, ael->dns[i]);
3688 return mbof_next_add(add_ctx->add_list);
3691 return mbof_add_muop(add_ctx);