[PACKET_IO] add pio_packet structure for pcap_live/pcap_file mode

This commit is contained in:
liuwentan
2022-08-09 15:58:46 +08:00
parent 7442cb09d5
commit c2d5b9cdb7
17 changed files with 157 additions and 360 deletions

View File

@@ -29,18 +29,20 @@ void packet_io_loop(struct packet_io_loop_arg *arg)
int fetch_num = packet_io_device_rx(arg->dev, arg->thread_id, &rx_pkt, 1);
if(fetch_num > 0)
{
/*
event = session_manager_commit(rx_pkt);
while(event)
{
plugin_manager_dispatch(event);
event = session_manager_fetch_event();
}
}*/
printf("fetch_num:%d\n", fetch_num);
//clean session_manager event queue
packet_io_device_tx(arg->dev, arg->thread_id, &rx_pkt, 1);
}
else
{
printf("no fetch num\n");
//dispatch to time event
//dispatch to trigger polling event
@@ -79,9 +81,11 @@ int main(int argc, char ** argv)
/* packet io init */
packet_io_init("stellar", g_engine_instance.config.packet_io.mode, 2);
session_manager_session_event_register(http_decoder, SESSION_TYPE_HTTP);
//session_manager_session_event_register(http_decoder, SESSION_TYPE_HTTP);
struct packet_io_loop_arg arg;
while (1) {
//packet_io_loop();
}
//create_worker_thread
//main_loop