feature: add packet_manager API definition

This commit is contained in:
luwenpeng
2024-09-13 15:53:49 +08:00
parent 16b5174d94
commit 06c498409f
2 changed files with 34 additions and 9 deletions

View File

@@ -0,0 +1,25 @@
#pragma once
#ifdef __cplusplus
extern "C"
{
#endif
#include "packet.h"
struct packet_manager;
struct packet_manager_schema;
struct packet_manager_runtime;
struct packet_manager_schema *packet_manager_get_schema(struct packet_manager *pkt_mgr);
struct packet_manager_runtime *packet_manager_get_runtime(struct packet_manager *pkt_mgr, uint16_t thr_idx);
typedef void on_packet_stage_callback(enum packet_stage stage, struct packet *pkt, void *args);
int packet_manager_schema_add_subscriber(struct packet_manager_schema *schema, enum packet_stage stage, on_packet_stage_callback cb, void *args);
void packet_manager_runtime_take_packet(struct packet_manager_runtime *pkt_mgr_rt, struct packet *pkt);
void packet_manager_runtime_schedule_packet(struct packet_manager_runtime *pkt_mgr_rt, struct packet *pkt, enum packet_stage stage);
#ifdef __cplusplus
}
#endif