summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 41b26e0..1e1f084 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -40,9 +40,6 @@ struct worker_thread_ctx
void *worker_thread_cycle(void *arg)
{
- //uint64_t counter = 0;
- //size_t data_len = 0;
- //pid_t tid = syscall(SYS_gettid);
struct stellar_packet *rx_pkt[64];
struct stellar_session *session;
struct worker_thread_ctx *thread_arg = (struct worker_thread_ctx *)arg;
@@ -50,30 +47,6 @@ void *worker_thread_cycle(void *arg)
for (size_t i = 0; i < thread_arg->dev_num; i++) {
ssize_t fetch_num = packet_io_device_rx(thread_arg->pdev[i], thread_arg->thread_id, rx_pkt, 5);
for (ssize_t j = 0; j < fetch_num; j++) {
-/*
- char *buf_addr = get_stellar_packet_data(rx_pkt[j], &data_len);
- struct ethhdr *eth_hdr = (struct ethhdr *)buf_addr;
- uint16_t eth_type = ntohs(eth_hdr->h_proto);
- if (eth_type == ETHERNET_TYPE_IP) {
- struct ip *ip_hdr = (struct ip *)(eth_hdr + 1);
- char sip_str[64] = {0};
- char dip_str[64] = {0};
- strncpy_safe(sip_str, inet_ntoa(ip_hdr->ip_src), sizeof(sip_str));
- strncpy_safe(dip_str, inet_ntoa(ip_hdr->ip_dst), sizeof(dip_str));
-
- //printf("sip: %s dip: %s, ip_len:%u\n", sip_str, dip_str, ntohs(ip_hdr->ip_len));
- } else if (eth_type == ETHERNET_TYPE_IPV6) {
- }
- }
- counter += fetch_num;
- printf("tid: %d counter:%lu\n", tid, counter);
- if (fetch_num == 0) {
- sleep(1);
- continue;
- }
-
- packet_io_pkts_free(thread_arg->pdev[i], thread_arg->tid, rx_pkt, fetch_num);
-*/
session = session_manager_commit(thread_arg->session_mgr, rx_pkt[j], thread_arg->thread_id);
while(session) {
plugin_manager_dispatch(thread_arg->plugin_mgr, session, thread_arg->thread_id);