📄 fw_rule.h
字号:
/**************************************************************
规则结构
***************************************************************/
struct Schedule {
char enable; //是否使用时间表
int start_time;
int end_time; //起始和终止时间
};
struct Keyword {
UINT id; //关键字id
char *keyword; //关键字
int len; //关键字长度
short *overlap; //回退值
struct Keyword *next; //下一个节点
};
struct KeyList {
USHORT port; //端口
struct Keyword *pkeyword; //关键字链表
struct KeyList *next; //下一个节点
};
struct Fw_Global {
char fw_status; //防火墙状态
char chkdata_enable; //是否允许检查数据包内容
struct KeyList *pkeylist; //关键字
char log_enable; //是否允许记日志
char warn_enable; //是否允许报警
char fw_mode; //除了禁止的都允许、除了允许的都禁止
struct Schedule schedule;
};
struct Fw_Rule_Node {
ULONG ID; //序列号
char action; //动作(允许、禁止)
ULONG ip; //远程主机
int mask; //掩码
char sp_operator; //源端口算子(>、<、=…)
USHORT s_port[2];
char dp_operator; //目的端口算子(>、<、=…)
USHORT d_port[2];
char direct; //方向
char log_enable; //是否记录日志
char warn_enable; //是否报警
struct Schedule schedule; //时间表
UCHAR tcpflag; //tcp标志,等于0不判断
struct Fw_Rule_Node *next; //指向下个节点的指针
};
struct Fw_Rule {
char enable; //是否允许协议
struct Fw_Rule_Node *pin, *pout; //指向下个in, out节点的指针
};
//总体结构:
struct Fw_Rules {
struct Fw_Global global;
struct Fw_Rule tcp;
struct Fw_Rule udp;
struct Fw_Rule icmp;
struct Fw_Rule ip;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -