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

📄 ~http_spec.~cpp

📁 一个基于智能的检测工具
💻 ~CPP
字号:
// Http_Spec.cpp: implementation of the CHttp_Spec class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "..\IIDS.h"
#include "Http_Spec.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

//##ModelId=407BA7B003D2
CHttp_Spec::CHttp_Spec()
{

}

//##ModelId=407BA7B003DA
CHttp_Spec::~CHttp_Spec()
{

}
/*****************************************
作者:汪兴东    最后修改时间2004.04.13
*******************************************
CHttp_Spec::Is_Http_Server_Data函数判断是否是服务器端网络数据包,

****************************************
参数:
p: 被判断的网络数据包
******************************************
返回值:
0: 是对从服务器端来的且不是HTTP REsponse头的TCP包
1:不是上述情况
*******************************************/
//##ModelId=407BA7B003BC
int CHttp_Spec::Is_Http_Server_Data(SPacket *p)
//优化性能,对从服务器端来的且不是HTTP REsponse头的TCP包不处理
{
    if(p->tcph && (p->packet_flags & PKT_FROM_SERVER))
    {        
        if( Is_Http_Protocol( p ) )
        {
            if( p->dsize > 4 )
	        {
                if( (p->data[0]!='H') || (p->data[1]!='T') || 
                    (p->data[2]!='T') || (p->data[3]!='P') )
                {
                    return 1;
                }

                if(p->dsize > global_int_Http_Flow_Byte_Count)
                {
                    p->dsize = global_int_Http_Flow_Byte_Count;  
                }
				//限制检查的字节数

                return 0;
            }   
            else
            {
                return 1;
            } 
        }
    }
   
    return 0;

}

⌨️ 快捷键说明

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