summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-01-23 17:12:12 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-01-23 17:12:12 +0000
commit03ebdf91be3d0652e27c2813ee37b43bb29f9411 (patch)
treeb9495236fdee6d7773e320370ea4fd072db0eb43
parent86ac7d918622db3423e4acfaa71a65f2f1a86da6 (diff)
Add a connect only mode
-rw-r--r--test/scotest.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/test/scotest.c b/test/scotest.c
index 22da3497..f80d63bd 100644
--- a/test/scotest.c
+++ b/test/scotest.c
@@ -46,7 +46,8 @@ enum {
RECV,
RECONNECT,
MULTY,
- DUMP
+ DUMP,
+ CONNECT
};
static unsigned char *buf;
@@ -334,15 +335,16 @@ static void usage(void)
"\t-c reconnect (client)\n"
"\t-m multiple connects (client)\n"
"\t-r receive (server)\n"
- "\t-s send (client)\n");
+ "\t-s connect and send (client)\n"
+ "\t-n connect and be silent (client)\n");
}
int main(int argc ,char *argv[])
{
struct sigaction sa;
- int opt, mode = RECV;
+ int opt, sk, mode = RECV;
- while ((opt=getopt(argc,argv,"rdscmb:")) != EOF) {
+ while ((opt=getopt(argc,argv,"rdscmnb:")) != EOF) {
switch(opt) {
case 'r':
mode = RECV;
@@ -364,6 +366,10 @@ int main(int argc ,char *argv[])
mode = MULTY;
break;
+ case 'n':
+ mode = CONNECT;
+ break;
+
case 'b':
data_size = atoi(optarg);
break;
@@ -411,6 +417,13 @@ int main(int argc ,char *argv[])
case MULTY:
multy_connect_mode(argv[optind]);
break;
+
+ case CONNECT:
+ sk = do_connect(argv[optind]);
+ if (sk < 0)
+ exit(1);
+ dump_mode(sk);
+ break;
}
syslog(LOG_INFO, "Exit");