diff options
| author | yangwei <[email protected]> | 2023-11-17 21:32:52 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2023-11-17 21:32:52 +0800 |
| commit | 950e828f70524039ebda7bdaa4d35a2e602e405e (patch) | |
| tree | b07898259764c31fc06041c8667c8abd03228183 | |
| parent | b5c0f0a9ec0051ccb2133534954912f79d00456d (diff) | |
✨ feat(MESA_stream_opt): 增加按路由方向获取ROUTE_CTX,marsio模式onlyv4.3.33
| -rw-r--r-- | include/public/stream_inc/stream_control.h | 2 | ||||
| -rw-r--r-- | include/public/stream_inc/stream_rawpkt.h | 4 | ||||
| -rw-r--r-- | src/dealpkt/plug_support.c | 32 |
3 files changed, 33 insertions, 5 deletions
diff --git a/include/public/stream_inc/stream_control.h b/include/public/stream_inc/stream_control.h index 89579f1..13c6262 100644 --- a/include/public/stream_inc/stream_control.h +++ b/include/public/stream_inc/stream_control.h @@ -57,6 +57,8 @@ enum MESA_stream_opt{ MSO_STREAM_INBOND_LINK_ID,
MSO_STREAM_OUTBOND_LINK_ID,
MSO_STREAM_C2S_ROUTE_DIRECTION,
+ MSO_STREAM_INBOND_ROUTE_CTX,
+ MSO_STREAM_OUTBOND_ROUTE_CTX,
__MSO_MAX,
};
diff --git a/include/public/stream_inc/stream_rawpkt.h b/include/public/stream_inc/stream_rawpkt.h index ce0063d..22b2422 100644 --- a/include/public/stream_inc/stream_rawpkt.h +++ b/include/public/stream_inc/stream_rawpkt.h @@ -27,8 +27,8 @@ enum{ RAW_PKT_GET_ORIGINAL_LOWEST_ETH_SMAC, /* value type is char[6],��ʵԭʼ��������smac��ַ,mirrorģʽ��, ��ͬ��RAW_PKT_GET_DATA, ����ʹ��stream->pfather����ƫ��; inline + vxlan + mrtunnatģʽ��, ��ͬ��RAW_PKT_GET_VXLAN_OUTER_GDEV_MAC; */
RAW_PKT_GET_ORIGINAL_LOWEST_ETH_DMAC, /* value type is char[6],��ʵԭʼ��������dmac��ַ,mirrorģʽ��, ��ͬ��RAW_PKT_GET_DATA, ����ʹ��stream->pfather����ƫ��; inline + vxlan + mrtunnatģʽ��, ��ͬ��RAW_PKT_GET_VXLAN_OUTER_LOCAL_MAC; */
- RAW_PKT_GET_ROUTE_CTX, /* max value size char[64] */
- RAW_PKT_GET_SID_LIST, /* value defined in stream_control.h, struct segment_id_list */
+ RAW_PKT_GET_ROUTE_CTX, /* get current stream route_dir route_ctx, max value size char[64] */
+ RAW_PKT_GET_SID_LIST, /* get current stream route_dir route_ctx, value defined in stream_control.h, struct segment_id_list */
RAW_PKT_GET_IS_CTRL_PKT,
};
diff --git a/src/dealpkt/plug_support.c b/src/dealpkt/plug_support.c index 692ecda..592903a 100644 --- a/src/dealpkt/plug_support.c +++ b/src/dealpkt/plug_support.c @@ -1761,9 +1761,9 @@ int MESA_get_stream_opt(const struct streaminfo *pstream, enum MESA_stream_opt o if ((STREAM_TYPE_TCP != pstream->type) || pdetail_pr->flow_stat == NULL || *opt_val_len != sizeof(unsigned int))
{
sapp_runtime_log(RLOG_LV_INFO,
- "%s,MESA_get_stream_opt() MSO_STREAM_C2S_SYN_NUM error: stream type is not tcp or "
- "empyt flow_stat!\n",
- printaddr(&pstream->addr, pstream->threadnum));
+ "%s,MESA_get_stream_opt() MSO_STREAM_C2S_SYN_NUM error: stream type is not tcp or "
+ "empyt flow_stat!\n",
+ printaddr(&pstream->addr, pstream->threadnum));
ret = -1;
}
else
@@ -1869,6 +1869,32 @@ int MESA_get_stream_opt(const struct streaminfo *pstream, enum MESA_stream_opt o }
break;
}
+ case MSO_STREAM_INBOND_ROUTE_CTX:
+ {
+ ret = -1;
+ *opt_val_len = 0;
+ void **value = (void **)opt_val;
+ if (pstream_pr->polling_inject_context->meta[DIR_ROUTE_DOWN])
+ {
+ *value = (void *)pstream_pr->polling_inject_context->meta[DIR_ROUTE_DOWN]->data;
+ *opt_val_len = sizeof(pstream_pr->polling_inject_context->meta[DIR_ROUTE_DOWN]->sz_data);
+ ret = 0;
+ }
+ break;
+ }
+ case MSO_STREAM_OUTBOND_ROUTE_CTX:
+ {
+ ret = -1;
+ *opt_val_len = 0;
+ void **value = (void **)opt_val;
+ if (pstream_pr->polling_inject_context->meta[DIR_ROUTE_UP])
+ {
+ *value = (void *)pstream_pr->polling_inject_context->meta[DIR_ROUTE_UP]->data;
+ *opt_val_len = sizeof(pstream_pr->polling_inject_context->meta[DIR_ROUTE_UP]->sz_data);
+ ret = 0;
+ }
+ break;
+ }
default:
sapp_runtime_log(RLOG_LV_INFO, "%s,MESA_get_stream_opt() error:unsupport MESA_stream_opt type:%d!\n",printaddr(&pstream->addr, pstream->threadnum), (int)opt);
ret = -1;
|
