-
大小: 1.09MB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-01-01
- 语言: 其他
- 标签:
资源简介
/**
* 规则函数: addRule(char *driver_name,USHORT type,USHORT protocol,char *sourceIp,char *sourceMask,USHORT sourcePort, char *destinationIp, char *destinationMask, USHORT destinationPort,BOOLEAN isDrop);
* 规则说明:
* type:参数
* LOCAL_PORT_FILTER类型: 端口过滤。
* BLANK_IP_FILTER类型: IP黑名单过滤。
* NET_FILTER类型:子网过滤。
*
代码片段和文件信息
#include
#include “ctr_filter.h“
#include “IPPackageFilter.h“
unsigned long inet_addr(const char *sIp)
{
int octets[4];
int i;
const char * auxCad = sIp;
unsigned long lIp = 0;
//we extract each octet of the ip address
//atoi will get characters until it found a non numeric character(in our case ‘.‘)
for(i = 0; i < 4; i++)
{
octets[i] = atoi(auxCad);
if(octets[i] < 0 || octets[i] > 255)
return 0;
lIp |= (octets[i] << (i*8));
//update auxCad to point to the next octet
auxCad = strchr(auxCad ‘.‘);
if(auxCad == NULL && i!=3)
return -1;
auxCad++;
}
return lIp;
}
unsigned short htons(unsigned short port)
{
unsigned short portRet;
portRet = ((port << 8) | (port >> 8));
return portRet;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2009-01-05 15:04 例子
目录 0 2009-01-05 15:04 例子\ctr_test
目录 0 2009-01-05 15:04 例子\ctr_test\ctr_test
文件 5411 2009-01-05 14:52 例子\ctr_test\ctr_test\ctr_filter.cpp
文件 119 2008-12-30 14:21 例子\ctr_test\ctr_test\ctr_filter.h
文件 3669 2008-12-30 16:34 例子\ctr_test\ctr_test\ctr_test.vcproj
目录 0 2009-01-05 15:04 例子\ctr_test\ctr_test\Debug
文件 2203 2009-01-05 15:03 例子\ctr_test\ctr_test\Debug\BuildLog.htm
文件 123832 2009-01-05 15:03 例子\ctr_test\ctr_test\Debug\ctr_filter.obj
文件 118784 2009-01-05 15:03 例子\ctr_test\ctr_test\Debug\ctr_test.exe
文件 703312 2009-01-05 15:03 例子\ctr_test\ctr_test\Debug\ctr_test.ilk
文件 2706432 2009-01-05 15:03 例子\ctr_test\ctr_test\Debug\ctr_test.pdb
文件 131091 2009-01-05 15:03 例子\ctr_test\ctr_test\Debug\TDriver.obj
文件 691200 2009-01-05 15:03 例子\ctr_test\ctr_test\Debug\vc70.idb
文件 479232 2009-01-05 15:03 例子\ctr_test\ctr_test\Debug\vc70.pdb
文件 3001 2009-01-05 14:33 例子\ctr_test\ctr_test\IPPackageFilter.h
文件 1587 2008-11-19 10:21 例子\ctr_test\ctr_test\stdafx.h
文件 15533 2008-11-20 14:01 例子\ctr_test\ctr_test\TDriver.cpp
文件 2973 2008-11-20 14:02 例子\ctr_test\ctr_test\TDriver.h
文件 60416 2009-01-05 15:04 例子\ctr_test\ctr_test.ncb
文件 914 2008-12-30 15:46 例子\ctr_test\ctr_test.sln
..A..H. 11264 2009-01-05 15:04 例子\ctr_test\ctr_test.suo
目录 0 2009-01-05 15:00 例子\IPPackageFilter
目录 0 2009-01-05 15:00 例子\IPPackageFilter\IPPackageFilter
文件 1826 2009-01-05 15:02 例子\IPPackageFilter\IPPackageFilter\buildchk.log
文件 3142 2009-01-05 15:02 例子\IPPackageFilter\IPPackageFilter\BuildLog.htm
文件 20 2008-12-18 09:34 例子\IPPackageFilter\IPPackageFilter\ddkbldenv.cmd
文件 222 2008-12-18 09:34 例子\IPPackageFilter\IPPackageFilter\ddkpostbld.cmd
文件 70 2008-12-18 09:34 例子\IPPackageFilter\IPPackageFilter\ddkprebld.cmd
文件 19433 2009-01-05 14:25 例子\IPPackageFilter\IPPackageFilter\IPPackageFilter.c
............此处省略17个文件信息
- 上一篇:jdk1.8下tools.jarurl
- 下一篇:组态王年月日报表制作步骤.rar
评论
共有 条评论