Skip to content

Commit

Permalink
test: add '--mcast_only' option (#710)
Browse files Browse the repository at this point in the history
Signed-off-by: Ric Li <[email protected]>
  • Loading branch information
ricmli authored Jan 17, 2024
1 parent adb1367 commit c746ff6
Show file tree
Hide file tree
Showing 8 changed files with 314 additions and 96 deletions.
171 changes: 129 additions & 42 deletions tests/src/st20_test.cpp

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions tests/src/st20p_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,12 @@ static void st20p_rx_digest_test(enum st_fps fps[], int width[], int height[],
ops_tx.name = "st20p_test";
ops_tx.priv = test_ctx_tx[i];
ops_tx.port.num_port = 1;
memcpy(ops_tx.port.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_tx.port.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_tx.port.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
snprintf(ops_tx.port.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_P]);
ops_tx.port.udp_port[MTL_SESSION_PORT_P] = ST20P_TEST_UDP_PORT + i * 2;
Expand Down Expand Up @@ -960,8 +964,12 @@ static void st20p_rx_digest_test(enum st_fps fps[], int width[], int height[],
ops_rx.name = "st20p_test";
ops_rx.priv = test_ctx_rx[i];
ops_rx.port.num_port = 1;
memcpy(ops_rx.port.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_rx.port.ip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_rx.port.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(ops_rx.port.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_R]);
ops_rx.port.udp_port[MTL_SESSION_PORT_P] = ST20P_TEST_UDP_PORT + i * 2;
Expand Down
91 changes: 69 additions & 22 deletions tests/src/st22_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,12 @@ static void st22_rx_fps_test(enum st22_type type[], enum st_fps fps[], int width
ops_tx.name = "st22_test";
ops_tx.priv = test_ctx_tx[i];
ops_tx.num_port = 1;
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
snprintf(ops_tx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_P]);
ops_tx.udp_port[MTL_SESSION_PORT_P] = 15000 + i * 2;
Expand Down Expand Up @@ -454,8 +458,12 @@ static void st22_rx_fps_test(enum st22_type type[], enum st_fps fps[], int width
ops_rx.name = "st22_test";
ops_rx.priv = test_ctx_rx[i];
ops_rx.num_port = 1;
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(ops_rx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_R]);
ops_rx.udp_port[MTL_SESSION_PORT_P] = 15000 + i * 2;
Expand Down Expand Up @@ -607,6 +615,9 @@ static void st22_rx_update_src_test(int tx_sessions, enum st_test_level level) {
else if (1 == i)
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else if (ctx->mcast_only)
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_2],
MTL_IP_ADDR_LEN);
else
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
Expand Down Expand Up @@ -656,8 +667,12 @@ static void st22_rx_update_src_test(int tx_sessions, enum st_test_level level) {
ops_rx.name = "st22_test";
ops_rx.priv = test_ctx_rx[i];
ops_rx.num_port = 1;
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_2],
MTL_IP_ADDR_LEN);
else
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(ops_rx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_R]);
ops_rx.udp_port[MTL_SESSION_PORT_P] = 15000 + i * 2;
Expand Down Expand Up @@ -832,8 +847,12 @@ static void st22_rx_after_start_test(enum st_fps fps[], int width[], int height[
ops_tx.name = "st22_test";
ops_tx.priv = test_ctx_tx[i];
ops_tx.num_port = 1;
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
snprintf(ops_tx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_P]);
ops_tx.udp_port[MTL_SESSION_PORT_P] = 15000 + i * 2;
Expand Down Expand Up @@ -881,8 +900,12 @@ static void st22_rx_after_start_test(enum st_fps fps[], int width[], int height[
ops_rx.name = "st22_test";
ops_rx.priv = test_ctx_rx[i];
ops_rx.num_port = 1;
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(ops_rx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_R]);
ops_rx.udp_port[MTL_SESSION_PORT_P] = 15000 + i * 2;
Expand Down Expand Up @@ -999,8 +1022,12 @@ static void st22_rx_dump_test(enum st_fps fps[], int width[], int height[],
ops_tx.name = "st22_test";
ops_tx.priv = test_ctx_tx[i];
ops_tx.num_port = 1;
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
snprintf(ops_tx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_P]);
ops_tx.udp_port[MTL_SESSION_PORT_P] = 15000 + i * 2;
Expand Down Expand Up @@ -1048,8 +1075,12 @@ static void st22_rx_dump_test(enum st_fps fps[], int width[], int height[],
ops_rx.name = "st22_test";
ops_rx.priv = test_ctx_rx[i];
ops_rx.num_port = 1;
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(ops_rx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_R]);
ops_rx.udp_port[MTL_SESSION_PORT_P] = 15000 + i * 2;
Expand Down Expand Up @@ -1226,8 +1257,12 @@ static void st22_rx_digest_test(enum st_fps fps[], int width[], int height[],
ops_tx.name = "st22_test";
ops_tx.priv = test_ctx_tx[i];
ops_tx.num_port = 1;
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
snprintf(ops_tx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_P]);
ops_tx.udp_port[MTL_SESSION_PORT_P] = 15000 + i * 2;
Expand Down Expand Up @@ -1291,8 +1326,12 @@ static void st22_rx_digest_test(enum st_fps fps[], int width[], int height[],
ops_rx.name = "st22_test";
ops_rx.priv = test_ctx_rx[i];
ops_rx.num_port = 1;
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(ops_rx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_R]);
ops_rx.udp_port[MTL_SESSION_PORT_P] = 15000 + i * 2;
Expand Down Expand Up @@ -1443,8 +1482,12 @@ static void st22_tx_user_pacing_test(int width[], int height[], int pkt_data_len
ops_tx.name = "st22_test";
ops_tx.priv = test_ctx_tx[i];
ops_tx.num_port = 1;
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
snprintf(ops_tx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_P]);
ops_tx.udp_port[MTL_SESSION_PORT_P] = 15000 + i * 2;
Expand Down Expand Up @@ -1488,8 +1531,12 @@ static void st22_tx_user_pacing_test(int width[], int height[], int pkt_data_len
ops_rx.name = "st22_test";
ops_rx.priv = test_ctx_rx[i];
ops_rx.num_port = 1;
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(ops_rx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_R]);
ops_rx.udp_port[MTL_SESSION_PORT_P] = 15000 + i * 2;
Expand Down
16 changes: 12 additions & 4 deletions tests/src/st22p_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,12 @@ static void st22p_rx_digest_test(enum st_fps fps[], int width[], int height[],
ops_tx.name = "st22p_test";
ops_tx.priv = test_ctx_tx[i];
ops_tx.port.num_port = 1;
memcpy(ops_tx.port.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_tx.port.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_tx.port.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
snprintf(ops_tx.port.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_P]);
ops_tx.port.udp_port[MTL_SESSION_PORT_P] = ST22P_TEST_UDP_PORT + i * 2;
Expand Down Expand Up @@ -1006,8 +1010,12 @@ static void st22p_rx_digest_test(enum st_fps fps[], int width[], int height[],
ops_rx.name = "st22p_test";
ops_rx.priv = test_ctx_rx[i];
ops_rx.port.num_port = 1;
memcpy(ops_rx.port.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_rx.port.ip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_rx.port.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(ops_rx.port.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_R]);
ops_rx.port.udp_port[MTL_SESSION_PORT_P] = ST22P_TEST_UDP_PORT + i * 2;
Expand Down
59 changes: 45 additions & 14 deletions tests/src/st30_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,12 @@ static void st30_rx_fps_test(enum st30_type type[], enum st30_sampling sample[],
ops_tx.name = "st30_test";
ops_tx.priv = test_ctx_tx[i];
ops_tx.num_port = 1;
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
snprintf(ops_tx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_P]);
ops_tx.udp_port[MTL_SESSION_PORT_P] = 20000 + i * 2;
Expand Down Expand Up @@ -504,8 +508,12 @@ static void st30_rx_fps_test(enum st30_type type[], enum st30_sampling sample[],
ops_rx.name = "st30_test";
ops_rx.priv = test_ctx_rx[i];
ops_rx.num_port = 1;
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(ops_rx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_R]);
ops_rx.udp_port[MTL_SESSION_PORT_P] = 20000 + i * 2;
Expand Down Expand Up @@ -841,6 +849,9 @@ static void st30_rx_update_src_test(enum st30_type type, int tx_sessions,
else if (1 == i)
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else if (ctx->mcast_only)
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_2],
MTL_IP_ADDR_LEN);
else
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
Expand Down Expand Up @@ -883,8 +894,12 @@ static void st30_rx_update_src_test(enum st30_type type, int tx_sessions,
ops_rx.name = "st30_test";
ops_rx.priv = test_ctx_rx[i];
ops_rx.num_port = 1;
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_2],
MTL_IP_ADDR_LEN);
else
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(ops_rx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_R]);
ops_rx.udp_port[MTL_SESSION_PORT_P] = 20000 + i * 2;
Expand Down Expand Up @@ -1127,8 +1142,12 @@ static void st30_rx_meta_test(enum st30_fmt fmt[], enum st30_sampling sampling[]
ops_tx.name = "st30_meta_test";
ops_tx.priv = test_ctx_tx[i];
ops_tx.num_port = 1;
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
snprintf(ops_tx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_P]);
ops_tx.udp_port[MTL_SESSION_PORT_P] = 20000 + i * 2;
Expand Down Expand Up @@ -1172,8 +1191,12 @@ static void st30_rx_meta_test(enum st30_fmt fmt[], enum st30_sampling sampling[]
ops_rx.name = "st30_meta_test";
ops_rx.priv = test_ctx_rx[i];
ops_rx.num_port = 1;
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(ops_rx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_R]);
ops_rx.udp_port[MTL_SESSION_PORT_P] = 20000 + i * 2;
Expand Down Expand Up @@ -1310,8 +1333,12 @@ static void st30_create_after_start_test(enum st30_type type[],
ops_tx.name = "st30_test";
ops_tx.priv = test_ctx_tx[i];
ops_tx.num_port = 1;
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_tx.dip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
snprintf(ops_tx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_P]);
ops_tx.udp_port[MTL_SESSION_PORT_P] = 20000 + i * 2;
Expand Down Expand Up @@ -1351,8 +1378,12 @@ static void st30_create_after_start_test(enum st30_type type[],
ops_rx.name = "st30_test";
ops_rx.priv = test_ctx_rx[i];
ops_rx.num_port = 1;
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
if (ctx->mcast_only)
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->mcast_ip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
else
memcpy(ops_rx.ip_addr[MTL_SESSION_PORT_P], ctx->para.sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(ops_rx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s",
ctx->para.port[MTL_PORT_R]);
ops_rx.udp_port[MTL_SESSION_PORT_P] = 20000 + i * 2;
Expand Down
Loading

0 comments on commit c746ff6

Please sign in to comment.