feature: packet IO support IP reassembly
This commit is contained in:
@@ -8,17 +8,36 @@ extern "C"
|
||||
#include "stellar/mq.h"
|
||||
#include "stellar/packet_manager.h"
|
||||
|
||||
struct packet_manager *packet_manager_new(struct mq_schema *mq_schema, const char *toml_file);
|
||||
#define PACKET_QUEUE_MAX (PACKET_STAGE_MAX + 1)
|
||||
|
||||
struct packet_manager_stat
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint64_t pkts_ingress;
|
||||
uint64_t pkts_egress;
|
||||
} total;
|
||||
struct
|
||||
{
|
||||
uint64_t pkts_in; // include the packets that are scheduled
|
||||
uint64_t pkts_out; // include the packets that are claimed
|
||||
uint64_t pkts_claim;
|
||||
uint64_t pkts_schedule;
|
||||
} queue[PACKET_QUEUE_MAX]; // the last queue is for sending packets
|
||||
};
|
||||
|
||||
struct packet_manager *packet_manager_new(struct mq_schema *mq_schema, uint64_t thread_num);
|
||||
void packet_manager_free(struct packet_manager *pkt_mgr);
|
||||
|
||||
void packet_manager_init(struct packet_manager *pkt_mgr, uint16_t thread_id, struct mq_runtime *mq_rt);
|
||||
int packet_manager_init(struct packet_manager *pkt_mgr, uint16_t thread_id, struct mq_runtime *mq_rt);
|
||||
void packet_manager_ingress(struct packet_manager *pkt_mgr, uint16_t thread_id, struct packet *pkt);
|
||||
struct packet *packet_manager_egress(struct packet_manager *pkt_mgr, uint16_t thread_id);
|
||||
void packet_manager_dispatch(struct packet_manager *pkt_mgr, uint16_t thread_id);
|
||||
|
||||
struct packet_manager_stat *packet_manager_get_stat(struct packet_manager *pkt_mgr, uint16_t thread_id);
|
||||
void packet_manager_print_stat(struct packet_manager *pkt_mgr, uint16_t thread_id);
|
||||
|
||||
const char *packet_stage_to_str(enum packet_stage stage);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user