- 论坛徽章:
- 1
|
本帖最后由 jiufei19 于 2011-07-29 17:07 编辑
大家好,继续阅读连接跟踪中ftp helper的help函数,其中看到了struct nf_ct_ftp_master这个结构体,其定义如下:
struct nf_ct_ftp_master {
/* Valid seq positions for cmd matching after newline */
u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER];
/* 0 means seq_match_aft_nl not set */
int seq_aft_nl_num[IP_CT_DIR_MAX];
};
其中成员seq_aft_nl数组包含4个成员,分别对应一个连接的两个方向,每个方向各有两个记录的序号。然后在help函数中又有如下调用语句:
if (!find_nl_seq(ntohl(th->seq), ct_ftp_info, dir))
而find_nl_seq函数定义如下:
static int find_nl_seq(u32 seq, const struct nf_ct_ftp_master *info, int dir)
{
unsigned int i;
for (i = 0; i < info->seq_aft_nl_num[dir]; i++)
if (info->seq_aft_nl[dir] == seq)
return 1;
return 0;
}
该find_nl_seq函数对某个方向的所有可能记录的序号进行比对,我现在的疑问就是数组seq_aft_nl[dir]的初值在哪里设置的?我搜索了整个源码没有找到对其进行初始赋值的地方,除了在update_nl_seq函数中有赋值操作,望大家解惑,谢谢! |
|