Changes to send TPQ request from client.
authorMargaret Wasserman <mrw@painless-security.com>
Wed, 5 Dec 2012 05:37:47 +0000 (00:37 -0500)
committerMargaret Wasserman <mrw@painless-security.com>
Wed, 5 Dec 2012 05:37:47 +0000 (00:37 -0500)
include/tpq.h
tpq/example/tpqc_main.c

index c1f93bb..941fd6b 100644 (file)
@@ -37,6 +37,7 @@
 
 #define TPQ_PORT       12309
 
+#include <gsscon.h>
 typedef struct tpq_name {
   char *buf;
   int len;
@@ -76,8 +77,8 @@ TPQ_NAME *tpq_new_name (char *name);
 TPQ_NAME *tpq_dup_name (TPQ_NAME *from);
 
 TPQC_INSTANCE *tpqc_create (void);
-int tpqc_open_connection (TPQC_INSTANCE *tpqc, char *server);
-int tpqc_send_request (TPQC_INSTANCE *tpqc, int conn, char *realm, char *coi, TPQC_RESP_FUNC *resp_handler, void *cookie);
+int tpqc_open_connection (TPQC_INSTANCE *tpqc, char *server, gss_ctx_id_t *gssctx);
+int tpqc_send_request (TPQC_INSTANCE *tpqc, int conn, gss_ctx_id_t gssctx, char *realm, char *coi, TPQC_RESP_FUNC *resp_handler, void *cookie);
 void tpqc_destroy (TPQC_INSTANCE *tpqc);
 
 TPQS_INSTANCE *tpqs_create ();
index 55fdc64..7732144 100644 (file)
@@ -35,6 +35,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+#include <gsscon.h>
 #include <tpq.h>
 
 static int tpqc_response_received = 0;
@@ -64,6 +65,7 @@ int main (int argc,
   void *cookie = NULL;
   int conn = 0;
   int rc;
+  gss_ctx_id_t gssctx;
 
   /* Parse command-line arguments */ 
   if (argc != 4) {
@@ -80,14 +82,15 @@ int main (int argc,
   tpqc = tpqc_create();
 
   /* Set-up TPQ connection */
-  if (-1 == (conn = tpqc_open_connection(tpqc, server))) {
+  if (-1 == (conn = tpqc_open_connection(tpqc, server, &gssctx))) {
     /* Handle error */
     printf("Error in tpqc_open_connection.\n");
     return 1;
   };
 
   /* Send a TPQ request */
-  if (rc = tpqc_send_request(tpqc, conn, realm, coi, &tpqc_resp_handler, NULL)) {
+  if (rc = tpqc_send_request(tpqc, conn, gssctx, realm, coi, 
+                            &tpqc_resp_handler, NULL)) {
     /* Handle error */
     printf("Error in tpqc_send_request, rc = %d.\n", rc);
     return 1;