Commit cae6d77a authored by powelld's avatar powelld
parents 9ba69184 4f2d73b8
#define DEBUG
#include <pthread.h>
#include <assert.h>
#include <getopt.h>
......@@ -354,7 +352,7 @@ int main(const int iArgC, char *papsArgV[])
exit(-1);
}
int iBytesSent=SSL_write(tConfig.pSSL, text->valuestring, strlen(text->valuestring));
printf ("[CLIENT DEBUG] Sent %d bytes { %s }\n", iBytesSent, text->valuestring);
printf ("[CLIENT] Sent %d bytes { %s }\n", iBytesSent, text->valuestring);
}
cJSON_Delete(json);
......
echo "Starting Middlebox"
../middlebox 8423 127.0.0.1:8423 simpleMiddlebox &
mboxpid=$(pidof ../mcmbox)
mboxpid=$(pidof middlebox)
sleep .3
echo "Starting Server"
../server ./simpleEchoScript.sh &
serverpid=$(pidof ../mcserver)
serverpid=$(pidof server)
sleep .3
......
python processRequest.py $1
\ No newline at end of file
python3 processRequest.py $1
echo "Starting Middlebox"
../middlebox 8423 127.0.0.1:8423 webMiddlebox &
mboxpid=$(pidof ../mcmbox)
mboxpid=$(pidof middlebox)
sleep .3
echo "Starting Server"
../server ./pythonHandlerScript.sh &
serverpid=$(pidof ../mcserver)
serverpid=$(pidof server)
sleep .3
......
......@@ -2,13 +2,13 @@
echo "Starting Middlebox"
../middlebox 8423 127.0.0.1:8423 simpleMiddlebox &
mboxpid=$(pidof ../mcmbox)
mboxpid=$(pidof middlebox)
#sleep .3
echo "Starting Server"
../server ./simpleEchoScript.sh &
serverpid=$(pidof ../mcserver)
serverpid=$(pidof server)
#sleep .3
......
......@@ -2,13 +2,13 @@
echo "Starting Middlebox"
../middlebox 8423 127.0.0.1:8423 simpleMiddlebox ./replacementScript.sh &
mboxpid=$(pidof ../mcmbox)
mboxpid=$(pidof middlebox)
#sleep .3
echo "Starting Server"
../server ./simpleEchoScript.sh &
serverpid=$(pidof ../mcserver)
serverpid=$(pidof server)
#sleep .3
......
......@@ -4,13 +4,13 @@ sudo tcpdump -i lo -w client_to_mbox.pcap port 8423 &
echo "Starting Middlebox"
../middlebox 8423 127.0.0.1:8423 simpleMiddlebox &
mboxpid=$(pidof ../mcmbox)
mboxpid=$(pidof middlebox)
#sleep .3
echo "Starting Server"
../server ./simpleEchoScript.sh &
serverpid=$(pidof ../mcserver)
serverpid=$(pidof server)
#sleep .3
......
{
"contexts" :
[
"Context A"
],
"middleboxes" :
[
{
"url" : "127.0.0.1:8423",
"readAccess": [],
"writeAccess": []
}
],
"slicedData" : [
{
"slice" : 0,
"data" : "Just testing!"
}
]
}
#define DEBUG
#include "common.h"
#include <time.h>
#include <stdbool.h>
......@@ -302,11 +300,11 @@ int handle_previous_hop_data(SSL* prev_ssl, SSL* next_ssl)
status = SSL_get_error(prev_ssl, r);
if (status == SSL_ERROR_ZERO_RETURN || status != SSL_ERROR_NONE)
{
printf ("[MBOX ERROR PREVHOP] Error code %ld\n", status);
//printf ("[MBOX ERROR PREVHOP] Error code %ld\n", status);
ERR_print_errors_fp(stdout);
char tempBuf[100];
ERR_error_string(status, tempBuf);
printf("[MBOX ERROR PREVHOP] Connection with previous hop closed, exiting previous hop handler (error %s)\n", tempBuf);
printf("[MBOX PREVHOP] Connection with previous hop closed, exiting previous hop handler (SSL reason %s)\n", tempBuf);
break;
}
else if (status != SSL_ERROR_NONE)
......@@ -379,7 +377,7 @@ int handle_next_hop_data(SSL* prev_ssl, SSL* next_ssl)
status = SSL_get_error(next_ssl, r);
if (status == SSL_ERROR_ZERO_RETURN || status != SSL_ERROR_NONE)
{
printf("[MBOX ERROR NEXTHOP] Connection with next hop closed, exiting next hop handler and also closing previous hop connection\n");
printf("[MBOX NEXTHOP] Connection with next hop closed, exiting next hop handler and also closing previous hop connection\n");
break;
}
else if (status != SSL_ERROR_NONE)
......@@ -474,7 +472,7 @@ int main(int argc, char **argv)
if (argc < 4)
{
printf ("Usage: mcmbox port proxy-address midlebox-id [command handler...]\n");
printf ("Usage: middlebox port proxy-address midlebox-id [command handler...]\n");
exit(0);
}
port = atoi(argv[1]);
......
echo "Starting Middlebox"
./middlebox 8423 127.0.0.1:8423 simpleMiddlebox &
mboxpid=$(pidof ./middlebox)
sleep .3
echo "Starting Server"
./server &
serverpid=$(pidof ./server)
sleep .3
echo "Starting Client"
./client
echo "Cleaning up"
kill $mboxpid
kill $serverpid
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment