Skip to content

Commit

Permalink
fix all apis
Browse files Browse the repository at this point in the history
Signed-off-by: Ric Li <[email protected]>
  • Loading branch information
ricmli committed Dec 6, 2023
1 parent c97cdc1 commit 31aa122
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/src/rx_st20p_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static int app_rx_st20p_init(struct st_app_context* ctx,
: ctx->rx_sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
memcpy(
ops.mcast_sip_addr[MTL_SESSION_PORT_P],
ops.port.mcast_sip_addr[MTL_SESSION_PORT_P],
st20p ? st20p->base.mcast_src_ip[MTL_PORT_P] : ctx->rx_mcast_sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(
Expand All @@ -213,7 +213,7 @@ static int app_rx_st20p_init(struct st_app_context* ctx,
: ctx->rx_sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
memcpy(
ops.mcast_sip_addr[MTL_SESSION_PORT_R],
ops.port.mcast_sip_addr[MTL_SESSION_PORT_R],
st20p ? st20p->base.mcast_src_ip[MTL_PORT_R] : ctx->rx_mcast_sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
snprintf(
Expand Down
4 changes: 2 additions & 2 deletions app/src/rx_st22p_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static int app_rx_st22p_init(struct st_app_context* ctx,
: ctx->rx_sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
memcpy(
ops.mcast_sip_addr[MTL_SESSION_PORT_P],
ops.port.mcast_sip_addr[MTL_SESSION_PORT_P],
st22p ? st22p->base.mcast_src_ip[MTL_PORT_P] : ctx->rx_mcast_sip_addr[MTL_PORT_P],
MTL_IP_ADDR_LEN);
snprintf(
Expand All @@ -158,7 +158,7 @@ static int app_rx_st22p_init(struct st_app_context* ctx,
: ctx->rx_sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
memcpy(
ops.mcast_sip_addr[MTL_SESSION_PORT_R],
ops.port.mcast_sip_addr[MTL_SESSION_PORT_R],
st22p ? st22p->base.mcast_src_ip[MTL_PORT_R] : ctx->rx_mcast_sip_addr[MTL_PORT_R],
MTL_IP_ADDR_LEN);
snprintf(
Expand Down
4 changes: 3 additions & 1 deletion include/st20_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,7 @@ struct st20_rx_ops {
* Include the PCIE port and other required info.
*/
struct st22_rx_ops {
/** Mandatory. source IP address of sender */
/** Mandatory. source IP address of sender or multicast IP address */
uint8_t sip_addr[MTL_SESSION_PORT_MAX][MTL_IP_ADDR_LEN];
/** Mandatory. 1 or 2, num of ports this session attached to */
uint8_t num_port;
Expand All @@ -1450,6 +1450,8 @@ struct st22_rx_ops {
/** Mandatory. 7 bits payload type define in RFC3550 */
uint8_t payload_type;

/** Optional. source filter IP address of multicast */
uint8_t mcast_sip_addr[MTL_SESSION_PORT_MAX][MTL_IP_ADDR_LEN];
/** Optional. Synchronization source defined in RFC3550, RX session will check the
* incoming RTP packets match the ssrc. Leave to zero to disable the ssrc check */
uint32_t ssrc;
Expand Down
4 changes: 3 additions & 1 deletion include/st20_redundant_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct st20r_rx_ops {
const char* name;
/** private data to the callback function */
void* priv;
/** source IP address of sender */
/** source IP address of sender or multicast IP address */
uint8_t sip_addr[MTL_SESSION_PORT_MAX][MTL_IP_ADDR_LEN];
/** num of ports this session attached to, must be 2 */
uint8_t num_port;
Expand Down Expand Up @@ -91,6 +91,8 @@ struct st20r_rx_ops {
/** Optional. Synchronization source defined in RFC3550, RX session will check the
* incoming RTP packets match the ssrc. Leave to zero to disable the ssrc check */
uint32_t ssrc;
/** Optional. source filter IP address of multicast */
uint8_t mcast_sip_addr[MTL_SESSION_PORT_MAX][MTL_IP_ADDR_LEN];

/** flags, value in ST20R_RX_FLAG_* */
uint32_t flags;
Expand Down
4 changes: 3 additions & 1 deletion include/st_pipeline_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ struct st_tx_port {

/** The structure info for st rx port, used in creating session. */
struct st_rx_port {
/** Mandatory. source IP address of sender */
/** Mandatory. source IP address of sender or multicast IP address */
uint8_t sip_addr[MTL_SESSION_PORT_MAX][MTL_IP_ADDR_LEN];
/** Mandatory. 1 or 2, num of ports this session attached to */
uint8_t num_port;
Expand All @@ -730,6 +730,8 @@ struct st_rx_port {
/** Optional. Synchronization source defined in RFC3550, RX session will check the
* incoming RTP packets match the ssrc. Leave to zero to disable the ssrc check */
uint32_t ssrc;
/** Optional. source filter IP address of multicast */
uint8_t mcast_sip_addr[MTL_SESSION_PORT_MAX][MTL_IP_ADDR_LEN];
};

/** The structure describing how to create a tx st2110-20 pipeline session. */
Expand Down
1 change: 1 addition & 0 deletions lib/src/st2110/pipeline/st20_pipeline_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ static int rx_st20p_create_transport(struct mtl_main_impl* impl, struct st20p_rx
ops_rx.num_port = RTE_MIN(ops->port.num_port, MTL_SESSION_PORT_MAX);
for (int i = 0; i < ops_rx.num_port; i++) {
memcpy(ops_rx.sip_addr[i], ops->port.sip_addr[i], MTL_IP_ADDR_LEN);
memcpy(ops_rx.mcast_sip_addr[i], ops->port.mcast_sip_addr[i], MTL_IP_ADDR_LEN);
snprintf(ops_rx.port[i], MTL_PORT_MAX_LEN, "%s", ops->port.port[i]);
ops_rx.udp_port[i] = ops->port.udp_port[i];
}
Expand Down
1 change: 1 addition & 0 deletions lib/src/st2110/pipeline/st22_pipeline_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ static int rx_st22p_create_transport(struct mtl_main_impl* impl, struct st22p_rx
ops_rx.num_port = RTE_MIN(ops->port.num_port, MTL_SESSION_PORT_MAX);
for (int i = 0; i < ops_rx.num_port; i++) {
memcpy(ops_rx.sip_addr[i], ops->port.sip_addr[i], MTL_IP_ADDR_LEN);
memcpy(ops_rx.mcast_sip_addr[i], ops->port.mcast_sip_addr[i], MTL_IP_ADDR_LEN);
snprintf(ops_rx.port[i], MTL_PORT_MAX_LEN, "%s", ops->port.port[i]);
ops_rx.udp_port[i] = ops->port.udp_port[i];
}
Expand Down
2 changes: 2 additions & 0 deletions lib/src/st2110/redundant/st20_redundant_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ static int rx_st20r_create_transport(struct st20r_rx_ctx* ctx, struct st20r_rx_o
ops_rx.priv = transport;
ops_rx.num_port = 1;
memcpy(ops_rx.sip_addr[MTL_SESSION_PORT_P], ops->sip_addr[port], MTL_IP_ADDR_LEN);
memcpy(ops_rx.mcast_sip_addr[MTL_SESSION_PORT_P], ops->mcast_sip_addr[port],
MTL_IP_ADDR_LEN);
snprintf(ops_rx.port[MTL_SESSION_PORT_P], MTL_PORT_MAX_LEN, "%s", ops->port[port]);
ops_rx.udp_port[MTL_SESSION_PORT_P] = ops->udp_port[port];

Expand Down

0 comments on commit 31aa122

Please sign in to comment.