⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 match_tcp_port.c

📁 Firestorm NIDS是一个性能非常高的网络入侵检测系统 (NIDS)。目前
💻 C
字号:
#include "match_tcp.h"int tcp_src_match(struct packet *pkt, void *priv, unsigned int l, int n){	struct shortrange *p=(struct shortrange *)priv;	u_int16_t port=ntohs(pkt->layer[l+1].h.tcp->sport);	return n^(port>=p->min && port<=p->max);}int tcp_dst_match(struct packet *pkt, void *priv, unsigned int l, int n){	struct shortrange *p=(struct shortrange *)priv;	u_int16_t port=ntohs(pkt->layer[l+1].h.tcp->dport);	return n^(port>=p->min && port<=p->max);}proc_match_match tcp_port_validate(proc_match_match fn, char *args,	void **priv, struct criteria *m){	if ( !args ) return NULL;	if ( !template_shortrange(args, priv) ) return NULL;	return fn;}proc_match_match tcp_src_validate(char *args, void **priv,	struct criteria *m, u_int32_t *c){	if ( !args ) return NULL;	return tcp_port_validate(tcp_src_match, args, priv, m);}proc_match_match tcp_dst_validate(char *args, void **priv,	struct criteria *m, u_int32_t *c){	if ( !args ) return NULL;	return tcp_port_validate(tcp_dst_match, args, priv, m);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -