capture 1.2.0
这是一个基于 PcapPlusPlus、PF_RING 和 ClickHouse 构建的高性能网络流量分析系统,专注于实时流量捕获、解析与存储。
|
存储网络流统一属性的结构体 More...
#include <flowUniAttr.h>
Public Member Functions | |
void | clear () |
清空所有流数据 | |
void | resize () |
调整流数据数组大小 |
Public Attributes | |
uint32_t | hash_val |
流标识的哈希值 | |
std::string | src_ip |
源IP地址 | |
std::string | dst_ip |
目标IP地址 | |
uint16_t | protocol |
传输层协议类型(TCP=0, UDP=1, ICMP=2) | |
uint16_t | src_port |
源端口号(ICMP不适用) | |
uint16_t | dst_port |
目标端口号(ICMP不适用) | |
size_t | packet_count = 0 |
此流中的包数量 | |
std::vector< uint32_t > | packet_len |
包长度序列 | |
std::vector< uint32_t > | tv_sec |
时间戳秒数序列 | |
std::vector< uint32_t > | tv_nsec |
时间戳纳秒数序列 | |
std::vector< uint16_t > | ttl |
生存时间值序列 | |
std::vector< uint16_t > | tos |
服务类型值序列 | |
std::vector< uint16_t > | id |
IP标识值序列 | |
std::vector< uint16_t > | offset |
片偏移值序列 | |
std::vector< uint16_t > | protocol_ip |
IP协议值序列 | |
std::vector< uint16_t > | len_load |
负载长度序列 | |
std::vector< uint32_t > | ack_num |
确认号序列(仅TCP) | |
std::vector< uint32_t > | seq_num |
序列号序列(仅TCP) | |
std::vector< uint16_t > | flag |
TCP标志值序列 | |
std::vector< uint16_t > | window |
TCP窗口大小序列 | |
std::vector< uint16_t > | len_udp |
UDP长度值序列 | |
std::vector< uint16_t > | icmp_type |
ICMP类型值序列 | |
std::vector< uint16_t > | icmp_code |
ICMP代码值序列 |
存储网络流统一属性的结构体
此结构包含从属于同一网络流的包中提取的所有相关属性, 包括IP头部、传输层信息和协议特定数据。所有uint8类型都转换为 uint16以防止写入CSV文件时的类型问题。
|
inline |
清空所有流数据
将流结构重置为初始状态
|
inline |
调整流数据数组大小
截断超过最大长度的数组,并在需要时用零填充
std::vector<uint32_t> flowUniAttr::ack_num |
确认号序列(仅TCP)
std::string flowUniAttr::dst_ip |
目标IP地址
uint16_t flowUniAttr::dst_port |
目标端口号(ICMP不适用)
std::vector<uint16_t> flowUniAttr::flag |
TCP标志值序列
uint32_t flowUniAttr::hash_val |
流标识的哈希值
std::vector<uint16_t> flowUniAttr::icmp_code |
ICMP代码值序列
std::vector<uint16_t> flowUniAttr::icmp_type |
ICMP类型值序列
std::vector<uint16_t> flowUniAttr::id |
IP标识值序列
std::vector<uint16_t> flowUniAttr::len_load |
负载长度序列
std::vector<uint16_t> flowUniAttr::len_udp |
UDP长度值序列
std::vector<uint16_t> flowUniAttr::offset |
片偏移值序列
size_t flowUniAttr::packet_count = 0 |
此流中的包数量
std::vector<uint32_t> flowUniAttr::packet_len |
包长度序列
uint16_t flowUniAttr::protocol |
传输层协议类型(TCP=0, UDP=1, ICMP=2)
std::vector<uint16_t> flowUniAttr::protocol_ip |
IP协议值序列
std::vector<uint32_t> flowUniAttr::seq_num |
序列号序列(仅TCP)
std::string flowUniAttr::src_ip |
源IP地址
uint16_t flowUniAttr::src_port |
源端口号(ICMP不适用)
std::vector<uint16_t> flowUniAttr::tos |
服务类型值序列
std::vector<uint16_t> flowUniAttr::ttl |
生存时间值序列
std::vector<uint32_t> flowUniAttr::tv_nsec |
时间戳纳秒数序列
std::vector<uint32_t> flowUniAttr::tv_sec |
时间戳秒数序列
std::vector<uint16_t> flowUniAttr::window |
TCP窗口大小序列