[ofw] [PATCH 3/4] dapltest: the quit command is missing changes for -n option.
Davis, Arlin R
arlin.r.davis at intel.com
Sun Feb 9 23:46:06 PST 2014
Server-port was not being set properly during param init phase on the client side.
Signed-off-by: Arlin Davis <arlin.r.davis at intel.com>
---
test/dapltest/cmd/dapl_params.c | 1 +
test/dapltest/cmd/dapl_quit_cmd.c | 10 +++++++++-
test/dapltest/include/dapl_quit_cmd.h | 1 +
3 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/test/dapltest/cmd/dapl_params.c b/test/dapltest/cmd/dapl_params.c
index e7a2006..f038324 100644
--- a/test/dapltest/cmd/dapl_params.c
+++ b/test/dapltest/cmd/dapl_params.c
@@ -199,6 +199,7 @@ bool DT_Params_Parse(int argc, char *argv[], Params_t * params_ptr)
params_ptr->ReliabilityLevel =
Quit_Cmd->ReliabilityLevel;
params_ptr->debug = Quit_Cmd->debug;
+ params_ptr->server_port = Quit_Cmd->port;
DT_NetAddrLookupHostAddress(¶ms_ptr->server_netaddr,
Quit_Cmd->server_name);
break;
diff --git a/test/dapltest/cmd/dapl_quit_cmd.c b/test/dapltest/cmd/dapl_quit_cmd.c
index d8536a7..d8930e4 100644
--- a/test/dapltest/cmd/dapl_quit_cmd.c
+++ b/test/dapltest/cmd/dapl_quit_cmd.c
@@ -35,6 +35,7 @@ void DT_Quit_Cmd_Init(Quit_Cmd_t * cmd)
{
memset((void *)cmd, 0, sizeof(Quit_Cmd_t));
cmd->ReliabilityLevel = DAT_QOS_BEST_EFFORT;
+ cmd->port = SERVER_PORT_NUMBER;
}
/*--------------------------------------------------------- */
@@ -45,7 +46,7 @@ DT_Quit_Cmd_Parse(Quit_Cmd_t * cmd,
int c;
for (;;) {
- c = DT_mygetopt_r(my_argc, my_argv, "ds:D:R:", opts);
+ c = DT_mygetopt_r(my_argc, my_argv, "ds:D:R:n", opts);
if (c == EOF) {
break;
}
@@ -72,6 +73,11 @@ DT_Quit_Cmd_Parse(Quit_Cmd_t * cmd,
DT_ParseQoS(opts->optarg);
break;
}
+ case 'n':
+ {
+ cmd->port = atoi(opts->optarg);
+ break;
+ }
case '?':
default:
{
@@ -113,6 +119,7 @@ void DT_Quit_Cmd_Usage(void)
DT_Mdep_printf("USAGE: ---- QUIT TEST ----\n");
DT_Mdep_printf("USAGE: dapltest -T Q\n");
DT_Mdep_printf("USAGE: -s <server Name>\n");
+ DT_Mdep_printf("USAGE: -n <server port number>\n");
DT_Mdep_printf("USAGE: [-D <device Name>]\n");
DT_Mdep_printf("USAGE: [-d] : debug (zero)\n");
DT_Mdep_printf("USAGE: [-R <service reliability>]\n");
@@ -129,4 +136,5 @@ void DT_Quit_Cmd_Print(Quit_Cmd_t * cmd)
{
DT_Mdep_printf("Quit_Cmd.server_name: %s\n", cmd->server_name);
DT_Mdep_printf("Quit_Cmd.device_name: %s\n", cmd->device_name);
+ DT_Mdep_printf("Quit_Cmd.port: %s\n", cmd->port);
}
diff --git a/test/dapltest/include/dapl_quit_cmd.h b/test/dapltest/include/dapl_quit_cmd.h
index 8aba24e..8640541 100644
--- a/test/dapltest/include/dapl_quit_cmd.h
+++ b/test/dapltest/include/dapl_quit_cmd.h
@@ -38,6 +38,7 @@ typedef struct
char device_name[256]; /* -D */
DAT_UINT32 debug; /* -d */
DAT_QOS ReliabilityLevel; /* -R */
+ DAT_CONN_QUAL port; /* -n */
} Quit_Cmd_t;
#pragma pack ()
--
1.7.3
More information about the ofw
mailing list