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

#include "CallBack.h"
#include <stdio.h>
#include <stdlib.h>

Include dependency graph for CallBack.cpp:

Go to the source code of this file.

Data Structures

struct  _cb_list

Typedefs

typedef struct _cb_list CB_LIST
typedef struct _cb_listPCB_LIST

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.

Variables

static PCB_LIST CBList = NULL
static unsigned int CBItems = 0


Typedef Documentation

typedef struct _cb_list CB_LIST

typedef struct _cb_list * PCB_LIST


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.


Variable Documentation

unsigned int CBItems = 0 [static]

Definition at line 19 of file CallBack.cpp.

Referenced by DoCallBack(), RegisterHTTPCallBack(), and RemoveHTTPCallBack().

PCB_LIST CBList = NULL [static]

Definition at line 18 of file CallBack.cpp.


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