diff options
| author | yangwei <[email protected]> | 2024-06-05 20:51:37 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2024-06-05 20:51:37 +0800 |
| commit | fb66c180298e5984b588bfee9ae671787a82c19b (patch) | |
| tree | 542e59a7e42a0c4301aedb4e656d65bd03ea9b56 | |
| parent | 265cfeb2441f7c3c576f0486a00423631208c324 (diff) | |
✨ feat(stream_rawpkt.h): add MESA_detain_rawpkt_get0
| -rw-r--r-- | include/public/stream_inc/stream_rawpkt.h | 1 | ||||
| -rw-r--r-- | src/dealpkt/plug_support.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/public/stream_inc/stream_rawpkt.h b/include/public/stream_inc/stream_rawpkt.h index 61796a8..448bbf0 100644 --- a/include/public/stream_inc/stream_rawpkt.h +++ b/include/public/stream_inc/stream_rawpkt.h @@ -124,6 +124,7 @@ int MESA_detain_pkt_forward(struct detain_pkt *pkt); int MESA_detain_pkt_forward_based_on_stream(const struct streaminfo *pstream, struct detain_pkt *dpkt);
void MESA_detain_pkt_free(struct detain_pkt *pkt);
+void *MESA_detain_rawpkt_get0(struct detain_pkt *pkt);
void sapp_emit_datapath_telemetry(const void *raw_pkt, const char * module, const char *str);
diff --git a/src/dealpkt/plug_support.c b/src/dealpkt/plug_support.c index 9f0fcc6..d82585b 100644 --- a/src/dealpkt/plug_support.c +++ b/src/dealpkt/plug_support.c @@ -27,6 +27,12 @@ static struct segment_id_list *segment_id_list_dup(sapp_mem_type_t type, int tid return dlist;
}
+inline void *MESA_detain_rawpkt_get0(struct detain_pkt *pkt)
+{
+ if(pkt==NULL)return NULL;
+ return (void *)pkt->original;
+}
+
struct detain_pkt* MESA_rawpkt_detain(const struct streaminfo *pstream, const void *rawpkt)
{
if(pstream == NULL || rawpkt == NULL)return NULL;
|
