✨ feat(packet_io): add gtest_packet_io
This commit is contained in:
14
src/main.cpp
14
src/main.cpp
@@ -5,7 +5,7 @@
|
||||
|
||||
struct packet_io_loop_arg
|
||||
{
|
||||
struct device *dev;
|
||||
struct packet_io_device *dev;
|
||||
int thread_id;
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@ void packet_io_loop(struct packet_io_loop_arg *arg)
|
||||
struct session_event *event;
|
||||
while(1)
|
||||
{
|
||||
int fetch_num = packetio_rx(arg->dev, arg->thread_id, &rx_pkt, 1);
|
||||
int fetch_num = packet_io_rx(arg->dev, arg->thread_id, &rx_pkt, 1);
|
||||
if(fetch_num > 0)
|
||||
{
|
||||
event = session_manager_commit(rx_pkt);
|
||||
@@ -26,7 +26,7 @@ void packet_io_loop(struct packet_io_loop_arg *arg)
|
||||
}
|
||||
|
||||
//clean session_manager event queue
|
||||
packetio_tx(arg->dev, arg->thread_id, &rx_pkt, 1);
|
||||
packet_io_tx(arg->dev, arg->thread_id, &rx_pkt, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -39,10 +39,10 @@ void packet_io_loop(struct packet_io_loop_arg *arg)
|
||||
}
|
||||
|
||||
|
||||
struct device *packetio_init(int worker_thread_num, const char *instance_name, const char *device_name)
|
||||
struct packet_io_device *packet_io_init(int worker_thread_num, const char *instance_name, const char *device_name)
|
||||
{
|
||||
struct packetio_instance * instance = packetio_create(instance_name);
|
||||
struct device *dev = packetio_open_device(instance, device_name, worker_thread_num, worker_thread_num);
|
||||
struct packet_io_instance * instance = packet_io_create(PACKET_IO_PCAP, instance_name);
|
||||
struct packet_io_device *dev = packet_io_open_device(instance, device_name, worker_thread_num, worker_thread_num);
|
||||
return dev;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ int main(int argc, char ** argv)
|
||||
//config_manager_init
|
||||
|
||||
session_manager_session_event_register(http_decoder, SESSION_TYPE_HTTP);
|
||||
//packetio_init
|
||||
//packet_io_init
|
||||
|
||||
//create_worker_thread
|
||||
|
||||
|
||||
Reference in New Issue
Block a user