summaryrefslogtreecommitdiff
path: root/src/dealpkt/plug_support.c
diff options
context:
space:
mode:
authorlijia <[email protected]>2024-11-19 10:10:51 +0800
committerlijia <[email protected]>2024-11-20 18:54:08 +0800
commit8d24a9cc945c2a6d0b0bfa447c7b4d1caec9397c (patch)
tree98ab11fcdf4d9ce7497da687f5564666718ab0cb /src/dealpkt/plug_support.c
parent6dd815e9e42ed52130c136e671bd83a05aaa34fd (diff)
TSG-23816: support stream uuid_t id
Diffstat (limited to 'src/dealpkt/plug_support.c')
-rw-r--r--src/dealpkt/plug_support.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/dealpkt/plug_support.c b/src/dealpkt/plug_support.c
index c2b3256..0542394 100644
--- a/src/dealpkt/plug_support.c
+++ b/src/dealpkt/plug_support.c
@@ -8,6 +8,7 @@
#ifdef __cplusplus
extern "C" {
#endif
+#include "ulid/ulid_wrap.h"
extern int G_TCP_FLOW_STAT_PROJECT_ID ;
extern int G_UDP_FLOW_STAT_PROJECT_ID ;
@@ -2172,6 +2173,24 @@ int MESA_get_stream_opt(const struct streaminfo *pstream, enum MESA_stream_opt o
}
break;
+ case MSO_STREAM_UUID:
+ {
+ if(*opt_val_len != sizeof(uuid_t)){
+ return -1;
+ }
+ if(uuid_is_null(pstream_pr->stream_uuid)){
+ ulid_uuid_generate(pstream_pr->stream_uuid);
+ if (MESA_handle_runtime_log_level_enabled(ABBR_SAPP_LOG_HANDLE, RLOG_LV_DEBUG)){
+ char uuid_string_buf[UUID_STR_LEN] = {0};
+ uuid_unparse(pstream_pr->stream_uuid, uuid_string_buf);
+ sapp_runtime_log(RLOG_LV_DEBUG, "%s, stream uuid: %s\n", printaddr(&pstream->addr, pstream->threadnum), uuid_string_buf);
+ }
+ }
+ memcpy(opt_val, pstream_pr->stream_uuid, sizeof(uuid_t));
+ 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;