summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoryangwei <[email protected]>2024-09-12 15:33:29 +0800
committeryangwei <[email protected]>2024-09-12 15:33:29 +0800
commitadfc240bd036c3467b785e183e2ecd6f82e65a50 (patch)
treeeaf906562947215d709dfbf83da02ccf44405085 /include
parent44797065bc0886ba3dd430ee4ec8968c9d18fdb2 (diff)
🌈 style(remove unicode comments): 移除乱码注释
Diffstat (limited to 'include')
-rw-r--r--include/private/deal_ipv4.h21
-rw-r--r--include/private/ip_reassembly.h83
-rw-r--r--include/private/stream_manage.h8
3 files changed, 49 insertions, 63 deletions
diff --git a/include/private/deal_ipv4.h b/include/private/deal_ipv4.h
index d700395..2012d75 100644
--- a/include/private/deal_ipv4.h
+++ b/include/private/deal_ipv4.h
@@ -14,14 +14,10 @@
#endif
//#define IPV4_FRAG_TIMEOUT (30)
-/*
- 2015-12-02 lijia modify,
- ��ȻRFC�涨, 30�������з�Ƭ������ɾ��ǺϷ���,
- ���ʵ�����, IPv4��Ƭ�����6���ڻ�δ�������, ����Ϊ�ǹ�����Ϊ�򶪰�, ֱ��free.
-*/
+
#define IPV4_FRAG_TIMEOUT (6)
-#define IPV4_FRAG_RESERVED_HDR_LEN (20) /* Ԥ����һ��IP��Ƭͷ������ */
+#define IPV4_FRAG_RESERVED_HDR_LEN (20)
#define IPV4_FRAG_NUM_PER_IPQ (100)
@@ -33,25 +29,20 @@
#define IPv4_FRAG_MF 0x2000 /* Flag: "More Fragments" */
#define IPv4_FRAG_OFFSET 0x1FFF /* "Fragment Offset" part */
-#define IPv4_HDR_MAX_LEN (60) /* IPv4���ͷ������ */
+#define IPv4_HDR_MAX_LEN (60)
struct ipv4_frag_key{
unsigned int ip_src; /* source address, network order */
unsigned int ip_dst; /* dest address, network order */
unsigned short identification; /* network order */
unsigned char protocol;
- char __pad__[5]; /* ����ṹ8�ֽڶ��� */
+ char __pad__[5];
#if USE_MESA_STREAM_HASH
- struct streaminfo_private *pstream_pr; /* �����ڱȽϵ�ַ, ʵ�ʲ�����HASH���� */
+ struct streaminfo_private *pstream_pr;
#endif
};
struct ipv4_frag_private{
- /*
- ԭʼIP���ĵ�һ����Ƭͷ������, ��ʼ��ʱ��Ϊinit_len = 20, ����׼IPͷ������, �Ա�֤�󲿷����������ȷ��.
- ����յ���һ����Ƭ��, ԭʼ��ͷʵ�ʳ���actual_len = 40, ����init_len,
- ��Ҫ��realloc�ڴ�, Ȼ��ʵ�����ݲ������memmove(actual_len - init_len).
- */
int raw_ip_hdr_len;
};
@@ -59,7 +50,6 @@ struct ipv4_frag_private{
extern "C" {
#endif
-/* �Ƿ�ΪIPv4˽�е�ַ */
static inline int is_private_addr_v4(u_int ip_add)
{
/* 10/8 */
@@ -79,7 +69,6 @@ static inline int is_private_addr_v4(u_int ip_add)
return 0;
}
-/* �Ƿ�ΪIPv4�鲥��ַ */
static inline int is_multicast_addr_v4(u_int ip_add)
{
/* 224~239 */
diff --git a/include/private/ip_reassembly.h b/include/private/ip_reassembly.h
index 6b91f1c..5248177 100644
--- a/include/private/ip_reassembly.h
+++ b/include/private/ip_reassembly.h
@@ -4,20 +4,20 @@
#include "stream_internal.h"
-#define USE_MESA_STREAM_HASH (1) /* ʹ�û�������ģʽ�µ�HASH�� */
+#define USE_MESA_STREAM_HASH (1)
#if USE_MESA_STREAM_HASH
#include "MESA_htable.h"
#endif
-#define IP_FRAG_DEFAULT_BUF_SIZE (2048) /* Ԥ����Ĭ��IP��Ƭ���黺������С, ͨ��ͳ�Ƶó�, ������IP������С��2KB��ռ90%���� */
+#define IP_FRAG_DEFAULT_BUF_SIZE (2048)
-#define IP_FRAG_OK (0x00) /* ������� */
-#define IP_FRAG_INVALID_PACKET (0x10) /* ��Ч��Ƭ�����˷�Ƭ�����ٴ���������������ͬһIPQ����һ����Ƭ�� */
-#define IP_FRAG_DISCARD (0x08) /* ������Ƭ���������ͷ�����IPQ���� */
-#define IP_FRAG_IGNORE (0x04) /* ������Ƭ�����Ժ�ͬһIPQ���еķ�Ƭ�������ٴ������������IPQ��ֱ����ʱ */
+#define IP_FRAG_OK (0x00)
+#define IP_FRAG_INVALID_PACKET (0x10)
+#define IP_FRAG_DISCARD (0x08)
+#define IP_FRAG_IGNORE (0x04)
-#define IP_FRAG_FIRST_IN (0x02) /* ���յ��˵�һ����Ƭ�� */
-#define IP_FRAG_LAST_IN (0x01) /* ���յ������һ����Ƭ�� */
+#define IP_FRAG_FIRST_IN (0x02)
+#define IP_FRAG_LAST_IN (0x01)
struct addr_list{
@@ -26,59 +26,56 @@ struct addr_list{
};
-/* һ����Ƭ�� */
struct ip_frags{
- int offset; /* �˷�Ƭ����һ���ֽ����ԭʼ����ƫ���� */
- int end; /* �˷�Ƭ�����һ���ֽ����ԭʼ����ƫ���� */
- struct ip_frags *next; /* �˷�Ƭ���ڷ�Ƭ�����еĺ�̽ڵ� */
- struct ip_frags *prev; /* �˷�Ƭ���ڷ�Ƭ�����е�ǰ���ڵ� */
+ int offset;
+ int end;
+ struct ip_frags *next;
+ struct ip_frags *prev;
};
-/* ��Ƭ������� */
struct frag_ipq{
- int buf_size; /* ��IP������ij��� */
- short last_in; /* ��־λ���յ���һ���������һ���� */
- short attack_flag; /* ��־λ���Ƿ��⵽���⹥�����ݰ� */
- int tot_len; /* ��ǰ�յ���Ƭ�������ƫ���� */
- int meat; /* ʵ���յ���IP��Ƭ����Ч���ݳ��� */
- unsigned int hash_index; /* ����������HASHֵ���Ժ��ظ�ʹ�ã������ٴμ��� */
+ int buf_size;
+ short last_in;
+ short attack_flag;
+ int tot_len;
+ int meat;
+ unsigned int hash_index;
int hash_key_size;
- int private_len; /* ��Э��������صĶ����������� */
- int frags_num; /* �յ��ķ�Ƭ������ */
- time_t create_time; /* ipq����ʱ�䣬���յ���һ����Ƭ����ʱ�� */
- void *new_iph; /* ��������IP��ͷ��ָ�� */
- struct ip_frags *fragments; /* ��Ƭ������ͷ */
- struct ip_frags *fragments_tail; /* ��Ƭ������β */
+ int private_len;
+ int frags_num;
+ time_t create_time;
+ void *new_iph;
+ struct ip_frags *fragments;
+ struct ip_frags *fragments_tail;
int frags_len;
#if USE_MESA_STREAM_HASH
- int thread_num; /* ʹ����HASHʱ, thread_num���ô���, ���ڴ˽ṹ�� */
+ int thread_num;
#else
- struct frag_ipq *hash_prev; /* HASH��ͻ������ǰ���ڵ� */
- struct frag_ipq *hash_next; /* HASH��ͻ�����ĺ�̽ڵ� */
- struct frag_ipq *lru_prev; /* LRU������ǰ���ڵ� */
- struct frag_ipq *lru_next; /* LRU�����ĺ�̽ڵ� */
+ struct frag_ipq *hash_prev;
+ struct frag_ipq *hash_next;
+ struct frag_ipq *lru_prev;
+ struct frag_ipq *lru_next;
#endif
- void *hash_key; /* hash key����Э���޹أ��ɹ���ģ������ռ䣬������hash_key_sizeָ�� */
- void *private_info; /* ��Э��������صĶ�������������������ռ�, ������private_lenָ�� */
- raw_ipfrag_list_t *ipfrag_list; /* ��ʱ�洢����ԭʼ��Ƭ�� */
+ void *hash_key;
+ void *private_info;
+ raw_ipfrag_list_t *ipfrag_list;
};
-/* ��Ƭ����Ĺ����ṹ�������Э��汾�޹� */
struct frag_manage{
- int thread_num; /* �߳�ID */
- unsigned int total_mem; /* ��ǰռ���ڴ����� */
+ int thread_num;
+ unsigned int total_mem;
#if USE_MESA_STREAM_HASH
MESA_htable_handle frag_hash_table;
#else
- unsigned int hash_table_size; /* HASH����С */
+ unsigned int hash_table_size;
int __pad__;
- struct frag_ipq **frag_hash_table; /* HASH��ͷָ�� */
- unsigned int (*hash_index)(void *hash_key); /* HASH����ָ�� */
- int (*hash_cmp)(void *hash_key1, void *hash_key2); /* key�ȽϺ���ָ�� */
- struct frag_ipq *lru_head; /* lru����ͷ */
- struct frag_ipq *lru_tail; /* lru����β */
+ struct frag_ipq **frag_hash_table;
+ unsigned int (*hash_index)(void *hash_key);
+ int (*hash_cmp)(void *hash_key1, void *hash_key2);
+ struct frag_ipq *lru_head;
+ struct frag_ipq *lru_tail;
#endif
int scratch_frag_cnt;
int scratch_frag_len;
diff --git a/include/private/stream_manage.h b/include/private/stream_manage.h
index 38a7988..d6bcb95 100644
--- a/include/private/stream_manage.h
+++ b/include/private/stream_manage.h
@@ -62,7 +62,7 @@ extern int tcp_support_all;
#define STREAM_LINK_RESET 4
#define STREAM_LINK_TIMEOUT 5
#define STREAM_LINK_LRU_OUT 6
-#define STREAM_FAKE_CLOSE_BY_DEPRIVE 7 /* �����������KILL_FOLLOW, KILL_OTHER��, ��ǿ��CLOSE�IJ��״̬ */
+#define STREAM_FAKE_CLOSE_BY_DEPRIVE 7
#define STREAM_CLOSE_BY_DUMPFILE_END 8 /* 2021-05-20 lijia add, for pcap dumpfile mode */
@@ -104,11 +104,11 @@ struct stream_index_list_item
struct global_stream
{
struct streamindex **tcp_stream_table;
- unsigned short *tcp_stream_talbe_hash_count; /* lijia comment: һ��HASH_Slot�³�ͻ����Ԫ�ظ��� */
+ unsigned short *tcp_stream_talbe_hash_count;
struct stream_list tcpList[MAX_TCP_STATE];
struct streamindex **udp_stream_table;
- unsigned short *udp_stream_talbe_hash_count;/* lijia comment: һ��HASH_Slot�³�ͻ����Ԫ�ظ��� */
+ unsigned short *udp_stream_talbe_hash_count;
struct stream_list udpList[MAX_UDP_STATE];
STAILQ_HEAD(STREAM_INDEX_LIST,stream_index_list_item) freeList;
@@ -131,7 +131,7 @@ typedef struct _stStreamFunInfo
struct timeout timeout;
const struct streaminfo *pstream;
int set_timer_s;
- int entry_id; /* ȫ��Ψһ��id, ����ÿ�������ں�����ִ��ʱ��ͳ�� */
+ int entry_id;
char pad[7];
char appState;
enum fun_type_t funtype;/* 2014-12-31 lqy add */