capture 1.2.0
这是一个基于 PcapPlusPlus、PF_RING 和 ClickHouse 构建的高性能网络流量分析系统,专注于实时流量捕获、解析与存储。
|
#include <PfRingDeviceList.h>
#include <Packet.h>
#include <iostream>
#include <getopt.h>
#include "headers/packet_handler.h"
#include "headers/PacketStats.h"
#include <IPv4Layer.h>
#include <PcapFileDevice.h>
#include <chrono>
#include <signal.h>
#include <atomic>
#include <thread>
#include <clickhouse/client.h>
#include <csignal>
#include <pcap.h>
Macros | |
#define | EXIT_WITH_ERROR(reason) |
#define | numOfCaptureThreads 12 |
Functions | |
void | onPacketArrives (pcpp::RawPacket *packet, uint32_t numOfPackets, uint8_t threadId, pcpp::PfRingDevice *dev, void *cookie) |
pcpp::PfRingDevice * | init (std::string interfaceNameOrIP="enp7s0") |
void | startCapture (pcpp::PfRingDevice *device, PacketStats *stats) |
void | stopCapture (pcpp::PfRingDevice *device) |
void | signal_handler (int signum) |
int | main (int argc, char *argv[]) |
Variables | |
std::atomic< long long > | packet_count |
pcpp::PfRingDevice * | dev |
volatile sig_atomic_t | is_stop = 0 |
#define EXIT_WITH_ERROR | ( | reason | ) |
#define numOfCaptureThreads 12 |
pcpp::PfRingDevice * init | ( | std::string | interfaceNameOrIP = "enp7s0" | ) |
如果不存在表,就创建表
int main | ( | int | argc, |
char * | argv[] ) |
void onPacketArrives | ( | pcpp::RawPacket * | packet, |
uint32_t | numOfPackets, | ||
uint8_t | threadId, | ||
pcpp::PfRingDevice * | dev, | ||
void * | cookie ) |
void signal_handler | ( | int | signum | ) |
void startCapture | ( | pcpp::PfRingDevice * | device, |
PacketStats * | stats ) |
void stopCapture | ( | pcpp::PfRingDevice * | device | ) |
pcpp::PfRingDevice* dev |
volatile sig_atomic_t is_stop = 0 |
std::atomic<long long> packet_count |