From 16ea51487e6db53a4199d834dde3a59624f10da8 Mon Sep 17 00:00:00 2001 From: yangwei Date: Thu, 23 May 2024 03:13:31 +0800 Subject: ✨ feat(stream meta get): 支持按路由方向获取sidlist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/public/stream_inc/stream_control.h | 2 ++ src/dealpkt/plug_support.c | 47 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/include/public/stream_inc/stream_control.h b/include/public/stream_inc/stream_control.h index cee6b1f..0f7ec24 100644 --- a/include/public/stream_inc/stream_control.h +++ b/include/public/stream_inc/stream_control.h @@ -69,6 +69,8 @@ enum MESA_stream_opt{ MSO_TCP_RTT_SCS, /* opt_val type must be unsigned short, the full RTT is server->tsg->client->tsg->server, this is |tsg->client->tsg| */ MSO_STREAM_C2S_SEGMENT_ID_LIST, MSO_STREAM_S2C_SEGMENT_ID_LIST, + MSO_STREAM_INBOND_SEGMENT_ID_LIST, + MSO_STREAM_OUTBOND_SEGMENT_ID_LIST, __MSO_MAX, }; diff --git a/src/dealpkt/plug_support.c b/src/dealpkt/plug_support.c index 6358187..0576fcc 100644 --- a/src/dealpkt/plug_support.c +++ b/src/dealpkt/plug_support.c @@ -1953,6 +1953,53 @@ int MESA_get_stream_opt(const struct streaminfo *pstream, enum MESA_stream_opt o } } break; + case MSO_STREAM_INBOND_SEGMENT_ID_LIST: + { + ret = -1; + *opt_val_len = 0; + void **value = (void **)opt_val; + struct rawpkt_metadata *meta = NULL; + int dir=MESA_dir_link_to_human(pstream_pr->stream_c2s_route_dir); + if (dir==(int)'I') + { + meta = pstream_pr->polling_inject_context->meta_stream_dir[DIR_C2S - 1]; + } + else + { + meta = pstream_pr->polling_inject_context->meta_stream_dir[DIR_S2C - 1]; + } + + if (meta) + { + *value = (void *)(&meta->raw_sid_list); + *opt_val_len = sizeof(struct segment_id_list); + ret = *opt_val_len; + } + } + break; + case MSO_STREAM_OUTBOND_SEGMENT_ID_LIST: + { + ret = -1; + *opt_val_len = 0; + void **value = (void **)opt_val; + struct rawpkt_metadata *meta = NULL; + int dir=MESA_dir_link_to_human(pstream_pr->stream_c2s_route_dir); + if (dir==(int)'E') + { + meta = pstream_pr->polling_inject_context->meta_stream_dir[DIR_C2S - 1]; + } + else + { + meta = pstream_pr->polling_inject_context->meta_stream_dir[DIR_S2C - 1]; + } + if (meta) + { + *value = (void *)(&meta->raw_sid_list); + *opt_val_len = sizeof(struct segment_id_list); + ret = *opt_val_len; + } + } + break; case MSO_STREAM_C2S_LINK_ID: case MSO_STREAM_S2C_LINK_ID: { -- cgit v1.2.3