Ipaddressfilter_src
#if !defined(AFX_IPADDRESSFILTER_H__AC1B7F27_82E5_11D2_A28C_006067323266__INCLUDED_)
#define AFX_IPADDRESSFILTER_H__AC1B7F27_82E5_11D2_A28C_006067323266__INCLUDED_
// IPADDRESSFILTER.H - Header file for your Internet Server
// IP Address Sample Filter
#include "resource.h"
// The maximum number of addresses we will cache. If there will be a large number
// of simultaneous addresses, bump this value
#define MAX_CACHED_ADDRESSES 100
// The position after which we'll move a cache entry to the front of the list
#define LIST_REORDER_THRESHOLD 6
// The maximum length of an IP address
#define MAX_IP_ADDRESS 64
// This is the name of the file that contains the ip addresses.
// Wildcards can be used for the host part only (172.16.*.1 is not allowed).
//
// The format of the file is:
//
// 127.*
// 172.16.1.6
// 172.16.2.*
// 172.16.*
//
#define IP_LIST_FILE "c:\\winnt\\system32\\inetsrv\\ipaddressdb.txt"
// The html page showing access denied.
#define NO_ACCESS "C:\\InetPub\\wwwroot\\NoAccess.htm"
// Constants
#define ISWHITE(ch) ((ch) && ((ch) == ' ' || (ch) == '\t' || (ch) == '\n' || (ch) == '\r'))
// Cached ip address structure
typedef struct _IP_INFO
{
LIST_ENTRY ListEntry; // Double linked list entry
CHAR achIPAddress[MAX_IP_ADDRESS]; // ip address
} IP_INFO, *PIP_INFO;
class CIPAddressFilter : public CHttpFilter
{
public:
CIPAddressFilter();
~CIPAddressFilter();
// Overrides
// ClassWizard generated virtual function overrides
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//{{AFX_VIRTUAL(CIPAddressFilter)
public:
virtual BOOL GetFilterVersion(PHTTP_FILTER_VERSION pVer);
virtual DWORD OnUrlMap(CHttpFilterContext* pCtxt, PHTTP_FILTER_URL_MAP pMapInfo);
//}}AFX_VIRTUAL
// Implementation
protected:
BOOL Initialize();
static BOOL ValidateIPAddress(const CHAR* pszIPAddress, OUT BOOL* pfValid);
// Database routines
BOOL InitializeIPAddressDatabase();
static BOOL LookupIPAddressInDb(const CHAR* pszIPAddress, OUT BOOL* pfFound);
VOID TerminateIPAddressDatabase();
// Cache routines
BOOL InitializeCache();
static BOOL LookupIPAddressInCache(const CHAR* pszIPAddress, BOOL* pfFound);
static BOOL AddIPAddressToCache(const CHAR* pszIPAddress);
VOID TerminateCache();
protected:
BOOL m_fCacheInitialized; // Indicates whether the cache is initialized
static DWORD m_cCacheItems; // Number of items in the cache
static CHAR* m_pszIPAddressFile; // Buffer for ip addresses database
static LIST_ENTRY m_CacheListHead; // Circular double linked list of cached addresses
static CRITICAL_SECTION m_csCacheLock; // Critical section protects cache list
//{{AFX_MSG(CIPAddressFilter)
//}}AFX_MSG
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_IPADDRESSFILTER_H__AC1B7F27_82E5_11D2_A28C_006067323266__INCLUDED)
#define AFX_IPADDRESSFILTER_H__AC1B7F27_82E5_11D2_A28C_006067323266__INCLUDED_
// IPADDRESSFILTER.H - Header file for your Internet Server
// IP Address Sample Filter
#include "resource.h"
// The maximum number of addresses we will cache. If there will be a large number
// of simultaneous addresses, bump this value
#define MAX_CACHED_ADDRESSES 100
// The position after which we'll move a cache entry to the front of the list
#define LIST_REORDER_THRESHOLD 6
// The maximum length of an IP address
#define MAX_IP_ADDRESS 64
// This is the name of the file that contains the ip addresses.
// Wildcards can be used for the host part only (172.16.*.1 is not allowed).
//
// The format of the file is:
//
// 127.*
// 172.16.1.6
// 172.16.2.*
// 172.16.*
//
#define IP_LIST_FILE "c:\\winnt\\system32\\inetsrv\\ipaddressdb.txt"
// The html page showing access denied.
#define NO_ACCESS "C:\\InetPub\\wwwroot\\NoAccess.htm"
// Constants
#define ISWHITE(ch) ((ch) && ((ch) == ' ' || (ch) == '\t' || (ch) == '\n' || (ch) == '\r'))
// Cached ip address structure
typedef struct _IP_INFO
{
LIST_ENTRY ListEntry; // Double linked list entry
CHAR achIPAddress[MAX_IP_ADDRESS]; // ip address
} IP_INFO, *PIP_INFO;
class CIPAddressFilter : public CHttpFilter
{
public:
CIPAddressFilter();
~CIPAddressFilter();
// Overrides
// ClassWizard generated virtual function overrides
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//{{AFX_VIRTUAL(CIPAddressFilter)
public:
virtual BOOL GetFilterVersion(PHTTP_FILTER_VERSION pVer);
virtual DWORD OnUrlMap(CHttpFilterContext* pCtxt, PHTTP_FILTER_URL_MAP pMapInfo);
//}}AFX_VIRTUAL
// Implementation
protected:
BOOL Initialize();
static BOOL ValidateIPAddress(const CHAR* pszIPAddress, OUT BOOL* pfValid);
// Database routines
BOOL InitializeIPAddressDatabase();
static BOOL LookupIPAddressInDb(const CHAR* pszIPAddress, OUT BOOL* pfFound);
VOID TerminateIPAddressDatabase();
// Cache routines
BOOL InitializeCache();
static BOOL LookupIPAddressInCache(const CHAR* pszIPAddress, BOOL* pfFound);
static BOOL AddIPAddressToCache(const CHAR* pszIPAddress);
VOID TerminateCache();
protected:
BOOL m_fCacheInitialized; // Indicates whether the cache is initialized
static DWORD m_cCacheItems; // Number of items in the cache
static CHAR* m_pszIPAddressFile; // Buffer for ip addresses database
static LIST_ENTRY m_CacheListHead; // Circular double linked list of cached addresses
static CRITICAL_SECTION m_csCacheLock; // Critical section protects cache list
//{{AFX_MSG(CIPAddressFilter)
//}}AFX_MSG
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_IPADDRESSFILTER_H__AC1B7F27_82E5_11D2_A28C_006067323266__INCLUDED)
...全文
相关推荐
PANO_20261029_160547.jpg
jdjjdjd
Special-Comfy-part1.7z.053
ComfyUI专用模型资源分卷压缩包,Special-Comfy-part1系列第053卷。7z分卷格式,单卷900MB,需配合全部分卷解压使用。
Special-Comfy-part1.7z.036
ComfyUI专用模型资源分卷压缩包,Special-Comfy-part1系列第036卷。7z分卷格式,单卷900MB,需配合全部分卷解压使用。
国央企创新负责人如何通过平台实现技术供需的智能匹配与资源协同?.docx
国央企创新负责人如何通过平台实现技术供需的智能匹配与资源协同?
AI 开发同城桶装水配送系统上门订水小程序源码
AI 开发的上门送水 uniapp 小程序模板,包含水品展示、水票购买、订单状态管理、地址管理、邀请好友推广等功能,支持多端发布,方便线下水站二次开发上线运营。 想订水的人可以在电脑或手机的网页里使用,也可以在微信里打开网页使用。 底部有三个主入口:首页、购物车、我的。 先记住三个词,后面会反复用到: 站点:负责给你送水的附近门店。换了地址,可能要换站点。 水票:事先买好的送水券。下单时如果还有剩余,可以直接拿水票抵,不用再付钱。 水贝:平台里的余额,可以当钱用。购物车和付款时都能看到还剩多少。 押桶:桶装水的空桶要先交押金。送水时一般是空桶换满桶,押桶数量不够就不能下这类需要压桶的水。


