- /* send a TID request to the AAA server(s), and get the answer(s) */
- /* TBD -- Handle multiple servers */
-
- if (cfg_apc)
- expiration_interval = cfg_apc->expiration_interval;
- else expiration_interval = cfg_comm->expiration_interval;
- if (fwd_req->expiration_interval)
- fwd_req->expiration_interval = (expiration_interval < fwd_req->expiration_interval) ? expiration_interval : fwd_req->expiration_interval;
- else fwd_req->expiration_interval = expiration_interval;
- /* Create a TID client instance */
- if (NULL == (tidc = tidc_create())) {
- tr_crit("tr_tids_req_hander: Unable to allocate TIDC instance.");
- tids_send_err_response(tids, orig_req, "Memory allocation failure");
- return -1;
- }
- /* Use the DH parameters from the original request */
- /* TBD -- this needs to be fixed when we handle more than one req per conn */
- tidc->client_dh = orig_req->tidc_dh;
-
- /* Save information about this request for the response */
- resp_cookie.tr = tr;
- resp_cookie.orig_req = orig_req;
-
- /* Set-up TID connection */
- if (-1 == (fwd_req->conn = tidc_open_connection(tidc,
- aaa_servers->hostname->buf,
- TID_PORT,
- &(fwd_req->gssctx)))) {
- tr_notice("tr_tids_req_handler: Error in tidc_open_connection.");
- tids_send_err_response(tids, orig_req, "Can't open connection to next hop TIDS");
- return -1;
- };
-
- /* Send a TID request */
- if (0 > (rc = tidc_fwd_request(tidc, fwd_req, &tr_tidc_resp_handler, (void *)&resp_cookie))) {
- tr_notice("Error from tidc_fwd_request, rc = %d.", rc);
- tids_send_err_response(tids, orig_req, "Can't forward request to next hop TIDS");
- tid_req_free(orig_req);
- return -1;
- }
-
- tid_req_free(orig_req);
- return 0;