+ /* Create and populate a TID req structure */
+ if (!(tid_req = tid_req_new()))
+ return -1;
+
+ tid_req->conn = conn;
+ tid_req->gssctx = gssctx;
+
+ if ((NULL == (tid_req->rp_realm = tr_new_name(rp_realm))) ||
+ (NULL == (tid_req->realm = tr_new_name(realm))) ||
+ (NULL == (tid_req->comm = tr_new_name(comm)))) {
+ tr_err ( "tidc_send_request: Error duplicating names.\n");
+ goto error;
+ }
+
+ tid_req->tidc_dh = tr_dh_dup(tidc->client_dh);
+
+ /* generate an ID */
+ request_id = tr_random_id(NULL);
+ if (request_id) {
+ if (tid_req->request_id = tr_new_name(request_id))
+ tr_debug("tidc_send_request: Created TID request ID: %s", request_id);
+ else
+ tr_debug("tidc_send_request: Unable to set request ID, proceeding without one");
+ talloc_free(request_id);
+ } else
+ tr_debug("tidc_send_request: Failed to generate a TID request ID, proceeding without one");
+
+ rc = tidc_fwd_request(tidc, tid_req, resp_handler, cookie);
+ goto cleanup;
+ error:
+ rc = -1;
+ cleanup:
+ tid_req_free(tid_req);
+ return rc;
+}
+
+int tidc_fwd_request(TIDC_INSTANCE *tidc,
+ TID_REQ *tid_req,
+ TIDC_RESP_FUNC *resp_handler,
+ void *cookie)