C:/fscan/HTTPCore/CallBack.h File Reference

#include "HTTP.h"
#include <stdio.h>
#include <windows.h>

Include dependency graph for CallBack.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define CBTYPE_CLIENT_REQUEST   0x01
#define CBTYPE_CLIENT_RESPONSE   0x02
#define CBTYPE_PROXY_REQUEST   0x04
#define CBTYPE_PROXY_RESPONSE   0x08
#define CBTYPE_CALLBACK_ALL   0xFFFFFFFF
#define CBTYPE_UNKNOWN_CALLBACK   0xFFFFFFF0
#define CBRET_STATUS_NEXT_CB_CONTINUE   0
#define CBRET_STATUS_NEXT_CB_BLOCK   1
#define CBRET_STATUS_CANCEL_REQUEST   2

Typedefs

typedef int(* HTTP_IO_REQUEST_CALLBACK )(int cbType, HTTPHANDLE HTTPHandle, PHTTP_DATA *request, PHTTP_DATA *response)

Functions

void RegisterHTTPCallBack (unsigned int cbType, HTTP_IO_REQUEST_CALLBACK cb)
 This function Registers an HTTP Callback Handler and is called from external plugins.
int RemoveHTTPCallBack (unsigned int cbType, HTTP_IO_REQUEST_CALLBACK cb)
 This function unregisters a previously loaded Callback.
int DoCallBack (int cbType, HTTPHANDLE HTTPHandle, PHTTP_DATA *request, PHTTP_DATA *response)
 CallBack Dispatcher. This function is called from the HTTPCore Module ( SendRawHttpRequest() ) and will send http information against registered callbacks.


Detailed Description

Fast HTTP Auth Scanner - HTTP Callbacks Engine. This file contains functions needed to handle callbacks. This functions must be called from external plugins to record or modify information related to http requests.
Author:
Andres Tarasco Acuna - http://www.tarasco.org (c) 2007 - 2008

Definition in file CallBack.h.


Define Documentation

#define CBRET_STATUS_CANCEL_REQUEST   2

Definition at line 39 of file CallBack.h.

Referenced by DoCallBack().

#define CBRET_STATUS_NEXT_CB_BLOCK   1

Definition at line 38 of file CallBack.h.

Referenced by DoCallBack().

#define CBRET_STATUS_NEXT_CB_CONTINUE   0

Definition at line 37 of file CallBack.h.

Referenced by CBLogFile(), and DoCallBack().

#define CBTYPE_CALLBACK_ALL   0xFFFFFFFF

Definition at line 32 of file CallBack.h.

#define CBTYPE_CLIENT_REQUEST   0x01

Definition at line 25 of file CallBack.h.

#define CBTYPE_CLIENT_RESPONSE   0x02

Definition at line 26 of file CallBack.h.

#define CBTYPE_PROXY_REQUEST   0x04

Definition at line 30 of file CallBack.h.

#define CBTYPE_PROXY_RESPONSE   0x08

Definition at line 31 of file CallBack.h.

Referenced by CBLogFile().

#define CBTYPE_UNKNOWN_CALLBACK   0xFFFFFFF0

Definition at line 33 of file CallBack.h.


Typedef Documentation

typedef int(* HTTP_IO_REQUEST_CALLBACK)(int cbType, HTTPHANDLE HTTPHandle, PHTTP_DATA *request, PHTTP_DATA *response)

Definition at line 19 of file CallBack.h.


Function Documentation

int DoCallBack ( int  cbType,
HTTPHANDLE  HTTPHandle,
PHTTP_DATA request,
PHTTP_DATA response 
)

CallBack Dispatcher. This function is called from the HTTPCore Module ( SendRawHttpRequest() ) and will send http information against registered callbacks.

Parameters:
cbType CallBack Source Type. Valid options are CBTYPE_CLIENT_REQUEST , CBTYPE_CLIENT_RESPONSE , CBTYPE_BROWSER_REQUEST , CBTYPE_SERVER_RESPONSE
HTTPHandle HTTP Connection Handle with information about remote target (like ip address, port, ssl, protocol version,...)
request struct containing all information related to the HTTP Request.
response struct containing information about http reponse. This parameter could be NULL if the callback type is CBTYPE_CLIENT_REQUEST or CBTYPE_CLIENT_RESPONSE because request was not send yet.
Returns:
the return value CBRET_STATUS_NEXT_CB_CONTINUE indicates that the request (modified or not) its ok. If a registered handler blocks the request then CBRET_STATUS_CANCEL_REQUEST is returned. This value indicates that the response is locked
Note:
a Blocked PHTTP_DATA request or response can be used for example when implementing an ADS filtering.

Definition at line 78 of file CallBack.cpp.

References _cb_list::cb, CBItems, CBRET_STATUS_CANCEL_REQUEST, CBRET_STATUS_NEXT_CB_BLOCK, and CBRET_STATUS_NEXT_CB_CONTINUE.

void RegisterHTTPCallBack ( unsigned int  cbType,
HTTP_IO_REQUEST_CALLBACK  cb 
)

This function Registers an HTTP Callback Handler and is called from external plugins.

Parameters:
cbType CallBack Type. Valid options are CBTYPE_CLIENT_REQUEST , CBTYPE_CLIENT_RESPONSE , CBTYPE_BROWSER_REQUEST , CBTYPE_SERVER_RESPONSE. Use CBTYPE_CALLBACK_ALL to match every possible callback (including undefined ones).
cb CallBack Address. This is the Address of the CallBack Function that will receive HTTP parameters.
Returns:
If an error is detected, 0 is returned.
Note:
Registered callback functions are also responsible for handling undefined CallBack types. If a registered callback function does not know how to handle an specific callback type must ingore the data. For more information read the plugin development documentation.

Definition at line 31 of file CallBack.cpp.

References _cb_list::cb, CBItems, and _cb_list::cbType.

int RemoveHTTPCallBack ( unsigned int  cbType,
HTTP_IO_REQUEST_CALLBACK  cb 
)

This function unregisters a previously loaded Callback.

Parameters:
cbType CallBack Type. Valid options are CBTYPE_CLIENT_REQUEST , CBTYPE_CLIENT_RESPONSE , CBTYPE_BROWSER_REQUEST , CBTYPE_SERVER_RESPONSE or CBTYPE_CALLBACK_ALL to match every possible callback
cb CallBack Address. This is the Address of the CallBack Function that was receiving HTTP parameters.
Returns:
Returns the number of removed Callbacks.
Note:
Its possible to remove all Callback types against a fucntion using CBTYPE_CALLBACK_ALL.

Definition at line 46 of file CallBack.cpp.

References _cb_list::cb, and CBItems.


Generated on Sun Jan 18 00:32:04 2009 for Fast HTTP Vulnerability Scanner by  doxygen 1.5.4