Skip to content

Commit

Permalink
Change which interface tcpprep will send "client" and "server"
Browse files Browse the repository at this point in the history
traffic to.  Now traffic client->server will be the primary
interface and server->client traffic will be secondary interface.
refs appneta#507
  • Loading branch information
synfinatic committed Apr 24, 2012
1 parent cd0ab87 commit 6abd467
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 14 deletions.
21 changes: 15 additions & 6 deletions src/tcpreplay_opts.def
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ flag = {
doc = <<- EOText
Select the algoritim used for sleeping between packets. Valid options are
"current" and "ver325". Current tends to be best for very high speeds, while
the older ver325 mode works best when trying to reproduce the most accurate timings
which is necessary for VOIP and other time sensitive protocols.
the older ver325 mode works best when trying to reproduce the most accurate
timings which is necessary for VOIP and other time sensitive protocols.
EOText;
};

Expand Down Expand Up @@ -291,17 +291,26 @@ flag = {
arg-type = string;
max = 1;
must-set;
descrip = "Server/primary traffic output interface";
doc = "";
descrip = "Client to server/RX/primary traffic output interface";
doc = <<- EOText
Required network interface used to send either all traffic or traffic which is
marked as 'primary' via tcpprep. Primary traffic is usually client-to-server
or inbound (RX) on khial virtual interfaces.
EOText;
};

flag = {
name = intf2;
value = I;
arg-type = string;
max = 1;
descrip = "Client/secondary traffic output interface";
doc = "";
descrip = "Server to client/TX/secondary traffic output interface";
doc = <<- EOText
Optional network interface used to send traffic which is marked as 'secondary'
via tcpprep. Secondary traffic is usually server-to-client or outbound
(TX) on khial virtual interfaces. Generally, it only makes sense to use this
option with --cachefile.
EOText;
};


Expand Down
12 changes: 4 additions & 8 deletions src/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,18 +272,14 @@ check_ip_tree(const int mode, const unsigned long ip)
}
#endif

/*
* FIXME: Is this logic correct? I think this might be backwards :(
*/

/* return node type if we found the node, else return the default (mode) */
if (node != NULL) {
switch (node->type) {
case DIR_SERVER:
return TCPR_DIR_C2S;
return TCPR_DIR_S2C;
break;
case DIR_CLIENT:
return TCPR_DIR_S2C;
return TCPR_DIR_C2S;
break;
case DIR_UNKNOWN:
case DIR_ANY:
Expand All @@ -297,10 +293,10 @@ check_ip_tree(const int mode, const unsigned long ip)
return_unknown:
switch (mode) {
case DIR_SERVER:
return TCPR_DIR_C2S;
return TCPR_DIR_S2C;
break;
case DIR_CLIENT:
return TCPR_DIR_S2C;
return TCPR_DIR_C2S;
break;
default:
return -1;
Expand Down
Binary file modified test/test.auto_bridge
Binary file not shown.
Binary file modified test/test.auto_client
Binary file not shown.
Binary file modified test/test.auto_first
Binary file not shown.
Binary file modified test/test.auto_router
Binary file not shown.
Binary file modified test/test.auto_server
Binary file not shown.
Binary file modified test/test.prep_config
Binary file not shown.
Binary file modified test/test2.rewrite_endpoint
Binary file not shown.
Binary file modified test/test2.rewrite_mac
Binary file not shown.
Binary file modified test/test2.rewrite_skip
Binary file not shown.

0 comments on commit 6abd467

Please sign in to comment.