TSG-13837 decrypted traffic steering适配mrzcpd新增MR_BUFF_USER_0类型

This commit is contained in:
luwenpeng
2023-04-21 19:06:12 +08:00
parent 6243971b3f
commit 4136cc3671
3 changed files with 33 additions and 10 deletions

View File

@@ -15,12 +15,13 @@
#include "ctrl_packet.h"
#include "global_metrics.h"
#define RX_BURST_MAX 128
#define MR_MASK_DECRYPTED 0x01
/******************************************************************************
* struct
******************************************************************************/
#define RX_BURST_MAX 128
struct config
{
int bypass_all_traffic;
@@ -91,13 +92,20 @@ int mbuff_get_metadata(marsio_buff_t *rx_buff, struct metadata *meta)
else
{
meta->is_ctrl_pkt = 0;
#if 0
if (marsio_buff_get_metadata(rx_buff, MR_IS_DECRYPTED, &(meta->is_decrypted), sizeof(meta->is_decrypted)) <= 0)
uint16_t user_data = 0;
if (marsio_buff_get_metadata(rx_buff, MR_BUFF_USER_0, &user_data, sizeof(user_data)) <= 0)
{
LOG_ERROR("%s: unable to get is_decrypted from metadata", LOG_TAG_PKTIO);
return -1;
}
#endif
if (user_data & MR_MASK_DECRYPTED)
{
meta->is_decrypted = 1;
}
else
{
meta->is_decrypted = 0;
}
}
meta->sids.num = marsio_buff_get_sid_list(rx_buff, meta->sids.elems, sizeof(meta->sids.elems) / sizeof(meta->sids.elems[0]));
@@ -143,14 +151,17 @@ int mbuff_set_metadata(marsio_buff_t *tx_buff, struct metadata *meta)
}
else
{
// TODO
#if 0
if (marsio_buff_set_metadata(tx_buff, MR_IS_DECRYPTED, &(meta->is_decrypted), sizeof(meta->is_decrypted)) != 0)
uint16_t user_data = 0;
if (meta->is_decrypted)
{
user_data = MR_MASK_DECRYPTED;
}
if (marsio_buff_set_metadata(tx_buff, MR_BUFF_USER_0, &user_data, sizeof(user_data)) != 0)
{
LOG_ERROR("%s: unable to set is_decrypted for metadata", LOG_TAG_PKTIO);
return -1;
}
#endif
}
if (meta->sids.num > 0)