Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

hi_norm.h File Reference

Contains function prototypes for normalization routines. More...

#include <sys/types.h>
#include "hi_include.h"
#include "hi_ui_config.h"
#include "hi_si.h"

Go to the source code of this file.

Functions

int hi_norm_init (HTTPINSPECT_GLOBAL_CONF *GlobalConf)
int hi_normalization (HI_SESSION *Session, int iInspectMode)
int hi_norm_uri (HI_SESSION *Session, u_char *uribuf, int *uribuf_size, u_char *uri, int uri_size)


Detailed Description

Contains function prototypes for normalization routines.

Author:
Daniel Roelker <droelker@sourcefire.com>
Contains stuctures and headers for normalization routines.

NOTES:

Definition in file hi_norm.h.


Function Documentation

int hi_norm_init HTTPINSPECT_GLOBAL_CONF GlobalConf  ) 
 

Initialize the arrays neccessary to normalize the HTTP protocol fields.

Currently, we set a hex_lookup array where we can convert the hex encoding that we encounter in the URI into numbers we deal with.

Parameters:
GlobalConf pointer to the global configuration of HttpInspect
Returns:
HI_SUCCESS function successful

Definition at line 1477 of file hi_norm.c.

References BASE36_VAL, hex_lookup, HEX_VAL, HI_SUCCESS, memset, NO_HEX_VAL, and valid_lookup.

Referenced by HttpInspectInit().

int hi_norm_uri HI_SESSION Session,
u_char *  uribuf,
int *  uribuf_size,
u_char *  uri,
int  uri_size
 

Normalize the URI into the URI normalize buffer.

This is the routine that users call to normalize the URI. It iterates through the URI buffer decoding the next character and is then checked for any directory problems before writing the decoded character into the normalizing buffer.

We return the length of the normalized URI buffer in the variable, uribuf_size. This value is passed in as the max size of the normalization buffer, which we then set in iMaxUriBufSize for later reference.

If there was some sort of problem during normalizing we set the normalized URI buffer size to 0 and return HI_NONFATAL_ERR.

Parameters:
ServerConf the pointer to the server configuration
uribuf the pointer to the normalize uri buffer
uribuf_size the size of the normalize buffer
uri the pointer to the unnormalized uri buffer
uri_size the size of the unnormalized uri buffer
Returns:
integer
Return values:
HI_NONFATAL_ERR there was a problem during normalizing, the uribuf_size is also set to 0
HI_SUCCESS Normalizing the URI was successful

Definition at line 1376 of file hi_norm.c.

References CheckLongDir(), s_URI_NORM_STATE::dir_count, END_OF_BUFFER, GetDecodedByte(), hi_eo_client_event_log(), HI_EO_CLIENT_NON_RFC_CHAR, hi_eo_generate_event(), HI_NONFATAL_ERR, HI_SUCCESS, hi_util_in_bounds(), InspectUriChar(), s_HTTPINSPECT_CONF::non_rfc_chars, NULL, s_URI_NORM_STATE::param, and s_HI_SESSION::server_conf.

Referenced by UriNorm().

int hi_normalization HI_SESSION Session,
int  iInspectMode
 

Wrap the logic for normalizing different inspection modes.

We call the various normalization modes here, and adjust the appropriate Session constructs.

Parameters:
Session pointer to the session structure.
iInspectMode the type of inspection/normalization to do
Returns:
integer
Return values:
HI_SUCCESS function successful
HI_INVALID_ARG invalid argument

Definition at line 1555 of file hi_norm.c.

References hi_client_norm(), HI_INVALID_ARG, HI_SI_CLIENT_MODE, and HI_SUCCESS.

Referenced by SnortHttpInspect().


Generated on Sun May 14 14:51:24 2006 by  doxygen 1.4.2