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

bounds.h File Reference

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <assert.h>
#include <unistd.h>

Go to the source code of this file.

Defines

#define INLINE   inline
#define ERRORRET   return 0;

Functions

static INLINE int inBounds (u_int8_t *start, u_int8_t *end, u_int8_t *p)
static INLINE int SafeMemcpy (void *dst, void *src, size_t n, void *start, void *end)
static INLINE int SafeWrite (u_int8_t *start, u_int8_t *end, u_int8_t *dst, u_int8_t *src)
static int SafeRead (u_int8_t *start, u_int8_t *end, u_int8_t *src, u_int8_t *read)


Define Documentation

#define ERRORRET   return 0;
 

Definition at line 45 of file bounds.h.

Referenced by SafeMemcpy(), SafeRead(), and SafeWrite().

#define INLINE   inline
 

Definition at line 43 of file bounds.h.


Function Documentation

static INLINE int inBounds u_int8_t start,
u_int8_t end,
u_int8_t p
[static]
 

Definition at line 60 of file bounds.h.

Referenced by Asn1Detect(), byte_extract(), ByteJump(), ByteTest(), FTPBounce(), IsDataAt(), SafeMemcpy(), SafeRead(), SafeWrite(), SnortPcre(), string_extract(), and uniSearchReal().

static INLINE int SafeMemcpy void *  dst,
void *  src,
size_t  n,
void *  start,
void *  end
[static]
 

A Safer Memcpy

Parameters:
dst where to copy to
src where to copy from
n number of bytes to copy
start start of the dest buffer
end end of the dst buffer
Returns:
0 on failure, 1 on success

Definition at line 81 of file bounds.h.

References ERRORRET, inBounds(), and memcpy.

Referenced by Frag3Rebuild(), ParseReplacePattern(), PayloadReplace(), RebuildFrag(), RebuildTraverse(), and TraverseFunc().

static int SafeRead u_int8_t start,
u_int8_t end,
u_int8_t src,
u_int8_t read
[inline, static]
 

Definition at line 118 of file bounds.h.

References ERRORRET, and inBounds().

static INLINE int SafeWrite u_int8_t start,
u_int8_t end,
u_int8_t dst,
u_int8_t src
[static]
 

A Safer *a = *b

Parameters:
start start of the dst buffer
end end of the dst buffer
dst the location to write to
src the source to read from
Returns:
0 on failure, 1 on success

Definition at line 107 of file bounds.h.

References ERRORRET, and inBounds().


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