Allow caller to set port number for tidc_open_connection(). Install
authorMargaret Wasserman <mrw@painless-security.com>
Thu, 13 Mar 2014 13:13:32 +0000 (09:13 -0400)
committerMargaret Wasserman <mrw@painless-security.com>
Thu, 13 Mar 2014 13:13:32 +0000 (09:13 -0400)
include/trust_router/tr_constraints.h, so that freeradius will build
with updated TID code.

Makefile.am
common/tr_config.c
common/tr_constraint.c
include/tr_filter.h
include/trust_router/tid.h
include/trust_router/tr_constraint.h [moved from include/tr_constraint.h with 100% similarity]
tid/example/tidc_main.c
tid/tidc.c
tr/manual.cfg
tr/tr_main.c

index e8233aa..927c218 100644 (file)
@@ -40,14 +40,14 @@ libtr_tid_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0 -no-undefined
 
 pkginclude_HEADERS = include/trust_router/tid.h include/trust_router/tr_name.h \
        include/trust_router/tr_dh.h \
-       include/trust_router/tr_versioning.h
+       include/trust_router/tr_constraint.h \
+       include/trust_router/tr_versioning.h 
 
 noinst_HEADERS = include/gsscon.h include/tr_config.h \
        include/tr_msg.h include/tr.h \
        include/tr_idp.h include/tr_rp.h \
        include/tr_comm.h include/tr_apc.h \
-       include/tr_filter.h \
-       include/tr_constraint.h
+       include/tr_filter.h
 
 
 EXTRA_DIST = trust_router.spec
index 64ba9ae..be851dc 100644 (file)
@@ -40,7 +40,7 @@
 #include <tr_config.h>
 #include <tr.h>
 #include <tr_filter.h>
-#include <tr_constraint.h>
+#include <trust_router/tr_constraint.h>
 void tr_print_config (FILE *stream, TR_CFG *cfg) {
   fprintf(stream, "tr_print_config: Not yet implemented.\n");
   return;
index c6360ce..aa3d4fc 100644 (file)
@@ -34,7 +34,7 @@
 #include <jansson.h>
 
 #include <tr_filter.h>
-#include <tr_constraint.h>
+#include <trust_router/tr_constraint.h>
 
 TR_CONSTRAINT_SET *tr_constraint_set_from_fline (TR_FLINE *fline)
 {
index 2e4b10b..b744c9b 100644 (file)
@@ -36,7 +36,7 @@
 #define TR_FILTER_H
 
 #include <trust_router/tr_name.h>
-#include <tr_constraint.h>
+#include <trust_router/tr_constraint.h>
 #include <jansson.h>
 
 #define TR_MAX_FILTERS 5
index 76e2cdd..74281ca 100644 (file)
@@ -40,7 +40,7 @@
 
 #include <trust_router/tr_name.h>
 #include <trust_router/tr_versioning.h>
-#include <tr_constraint.h>
+#include <trust_router/tr_constraint.h>
 
 #include <gssapi.h>
 
@@ -158,7 +158,7 @@ void tid_resp_set_servers(TID_RESP *resp, TID_SRVR_BLK *servers);
 
 /* TID Client functions, in tid/tidc.c */
 TR_EXPORT TIDC_INSTANCE *tidc_create (void);
-TR_EXPORT int tidc_open_connection (TIDC_INSTANCE *tidc, char *server, gss_ctx_id_t *gssctx);
+TR_EXPORT int tidc_open_connection (TIDC_INSTANCE *tidc, char *server, unsigned int port, gss_ctx_id_t *gssctx);
 TR_EXPORT int tidc_send_request (TIDC_INSTANCE *tidc, int conn, gss_ctx_id_t gssctx, char *rp_realm, char *realm, char *coi, TIDC_RESP_FUNC *resp_handler, void *cookie);
 TR_EXPORT int tidc_fwd_request (TIDC_INSTANCE *tidc, TID_REQ *req, TIDC_RESP_FUNC *resp_handler, void *cookie);
 TR_EXPORT void tidc_destroy (TIDC_INSTANCE *tidc);
index 480dde5..751a504 100644 (file)
@@ -118,7 +118,7 @@ int main (int argc,
   }
 
   /* Set-up TID connection */
-  if (-1 == (conn = tidc_open_connection(tidc, server, &gssctx))) {
+  if (-1 == (conn = tidc_open_connection(tidc, server, TID_PORT, &gssctx))) {
     /* Handle error */
     printf("Error in tidc_open_connection.\n");
     return 1;
index 2e3f06c..f35854e 100644 (file)
@@ -63,12 +63,13 @@ void tidc_destroy (TIDC_INSTANCE *tidc)
 
 int tidc_open_connection (TIDC_INSTANCE *tidc, 
                          char *server,
+                         unsigned int port,
                          gss_ctx_id_t *gssctx)
 {
   int err = 0;
   int conn = -1;
 
-  err = gsscon_connect(server, TID_PORT, "trustidentity", &conn, gssctx);
+  err = gsscon_connect(server, port, "trustidentity", &conn, gssctx);
 
   if (!err)
     return conn;
index a1259ab..399878c 100644 (file)
@@ -1,3 +1,2 @@
 {"tr_internal":{"max_tree_depth": 4,
-                "tids_port": 12309,
                 "hostname":"moonshot-proxy.local"}}
\ No newline at end of file
index d229e33..6830f6d 100644 (file)
@@ -194,6 +194,7 @@ static int tr_tids_req_handler (TIDS_INSTANCE *tids,
   /* Set-up TID connection */
   if (-1 == (fwd_req->conn = tidc_open_connection(tidc, 
                                                  aaa_servers->hostname->buf,
+                                                 TID_PORT,
                                              &(fwd_req->gssctx)))) {
     fprintf(stderr, "tr_tids_req_handler: Error in tidc_open_connection.\n");
     tids_send_err_response(tids, orig_req, "Can't open connection to next hop TIDS");