Lines Matching refs:cctx

309 static void kcm_reply_error(struct cli_ctx *cctx,
325 talloc_free(cctx);
329 TEVENT_FD_WRITEABLE(cctx->cfde);
337 struct cli_ctx *cctx;
351 struct cli_ctx *cctx;
356 cctx = req_ctx->cctx;
358 ret = kcm_output_construct(cctx, &req_ctx->op_io, &req_ctx->repbuf);
362 kcm_reply_error(cctx, ret, &req_ctx->repbuf);
366 TEVENT_FD_WRITEABLE(cctx->cfde);
375 struct cli_ctx *cctx;
377 cctx = req_ctx->cctx;
380 cctx->ev,
383 req_ctx->cctx->creds,
408 kcm_reply_error(req_ctx->cctx, ret, &req_ctx->repbuf);
461 * really want the cctx to be the memory context here so that if the client
463 static struct kcm_req_ctx *kcm_new_req(struct cli_ctx *cctx,
468 req = talloc_zero(cctx, struct kcm_req_ctx);
482 req->cctx = cctx;
488 static void kcm_recv(struct cli_ctx *cctx)
494 kctx = talloc_get_type(cctx->rctx->pvt_ctx, struct kcm_ctx);
495 req = talloc_get_type(cctx->state_ctx, struct kcm_req_ctx);
498 req = kcm_new_req(cctx, kctx);
502 talloc_free(cctx);
506 cctx->state_ctx = req;
509 ret = kcm_recv_data(req, cctx->cfd, &req->reqbuf);
513 talloc_free(cctx);
525 talloc_free(cctx);
538 TEVENT_FD_NOT_READABLE(cctx->cfde);
553 kcm_reply_error(cctx, ret, &req->repbuf);
556 static int kcm_send_data(struct cli_ctx *cctx)
561 req = talloc_get_type(cctx->state_ctx, struct kcm_req_ctx);
563 ret = kcm_write_iovec(cctx->cfd, &req->repbuf.v_len);
571 ret = kcm_write_iovec(cctx->cfd, &req->repbuf.v_rc);
579 ret = kcm_write_iovec(cctx->cfd, &req->repbuf.v_msg);
590 static void kcm_send(struct cli_ctx *cctx)
594 ret = kcm_send_data(cctx);
600 talloc_free(cctx);
605 TEVENT_FD_NOT_WRITEABLE(cctx->cfde);
606 TEVENT_FD_READABLE(cctx->cfde);
607 talloc_zfree(cctx->state_ctx);
618 int kcm_connection_setup(struct cli_ctx *cctx)
620 cctx->cfd_handler = kcm_fd_handler;