diff --git a/evaluation/demonstration/client.c b/evaluation/demonstration/client.c index 80cc5f91ac45f0c0439cef615673d2bcafefe9e7..8bd37aac1d6135add7c8513e66b257c4314c3750 100644 --- a/evaluation/demonstration/client.c +++ b/evaluation/demonstration/client.c @@ -154,7 +154,7 @@ client_Connect(SSL_CTX *ptSSLctx, ClientConfig *ptConf) iStatus=COMMON_AppendProxy(ptConf->pSSL,ptConf->MiddleboxURLs[i]); } /*step 2.2 - add server url*/ - iStatus=COMMON_AppendClientServer(ptConf->pSSL,ptConf->serverURL,1); + iStatus=COMMON_SetServer(ptConf->pSSL,ptConf->serverURL); /*step 3 - set the middlebox access permissions*/ /*for demonstration purposed, we will set by the following rule: @@ -168,7 +168,7 @@ client_Connect(SSL_CTX *ptSSLctx, ClientConfig *ptConf) /*grant server*/ iStatus=COMMON_SetProxyAccessPermissionByID(ptConf->pSSL,ptConf->pSSL->slices[j]->slice_id, ptConf->numMiddleboxes-1, 1,1); - for(i=0;i!=ptConf->numMiddleboxes-1;i++) { /*change to i=1 if client included*/ + for(i=0;i!=ptConf->numMiddleboxes/*-1*/;i++) { /*change to i=1 if client included*/ char *sMBoxUrl=ptConf->pSSL->proxies[i]->address; char *sPort=strchr(sMBoxUrl,':'); assert(sPort); diff --git a/evaluation/demonstration/common.c b/evaluation/demonstration/common.c index 7f08ffd22a9d1fb71e4561a0ee2af62a8385f7fa..8293861066fd34be98064003d8a000aaec29355e 100644 --- a/evaluation/demonstration/common.c +++ b/evaluation/demonstration/common.c @@ -139,28 +139,13 @@ COMMON_AppendProxy(SSL *ptSSL, return SUCCESS; } ERROR_STATUS -COMMON_AppendClientServer(SSL *ptSSL, - const char *psURL, int isServer) +COMMON_SetServer(SSL *ptSSL, + const char *psURL) { char *psUrlCpy=NULL; - if(ptSSL->proxies_len>=(sizeof(ptSSL->proxies)/sizeof(ptSSL->proxies[0]))) - return ARRAY_OVERFLOW; - - /*SPP_generate_proxy will generate something with the string provide - * but there is no guarantee that it will be sensible if - * invalid data is passed in*/ psUrlCpy=strdup(psURL); - /* TODO - SPP_generate_proxy probably won't assign the correct ID's - * to denote server and client - */ - if(isServer) { - ptSSL->proxies[ptSSL->proxies_len] = SPP_generate_proxy(ptSSL, psUrlCpy); - (ptSSL->proxies_len)++; - } else { /*isClient*/ - memmove(&ptSSL->proxies[1],&ptSSL->proxies[0],ptSSL->proxies_len * sizeof(*ptSSL->proxies)); - ptSSL->proxies[0] = SPP_generate_proxy(ptSSL, psUrlCpy); - } + ptSSL->spp_server_address = psUrlCpy; return SUCCESS; } ERROR_STATUS diff --git a/evaluation/demonstration/common.h b/evaluation/demonstration/common.h index 1ebc06afe65a238dcb8c8cae8e788516178ea53a..1259ba000617bf4830d50b7659a6a844083c8c75 100644 --- a/evaluation/demonstration/common.h +++ b/evaluation/demonstration/common.h @@ -8,8 +8,8 @@ #include #include -#define DEFAULT_SERVER_PORT 168888 -#define DEFAULT_MBOX_PORT 169000 +#define DEFAULT_SERVER_PORT 4433 +#define DEFAULT_MBOX_PORT 8423 #define str(x) #x #define xstr(x) str(x) @@ -71,8 +71,8 @@ ERROR_STATUS COMMON_AppendProxy(SSL *ptSSL, const char *psProxyURL); ERROR_STATUS -COMMON_AppendClientServer(SSL *ptSSL, - const char *psURL, int isServer); +COMMON_SetServer(SSL *ptSSL, + const char *psURL); ERROR_STATUS COMMON_AppendContext(SSL *ptSSL, const char *psContextDesc);