@ -1,4 +1,4 @@
/* Copyright (C) 2007-201 0 Open Information Security Foundation
/* Copyright (C) 2007-201 4 Open Information Security Foundation
*
*
* You can copy , redistribute or modify this Program under the terms of
* You can copy , redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* the GNU General Public License version 2 as published by the Free
@ -1006,32 +1006,15 @@ int SCACPreparePatterns(MpmCtx *mpm_ctx)
memset ( ctx - > pid_pat_list , 0 , ( ctx - > max_pat_id + 1 ) * sizeof ( SCACPatternList ) ) ;
memset ( ctx - > pid_pat_list , 0 , ( ctx - > max_pat_id + 1 ) * sizeof ( SCACPatternList ) ) ;
for ( i = 0 ; i < mpm_ctx - > pattern_cnt ; i + + ) {
for ( i = 0 ; i < mpm_ctx - > pattern_cnt ; i + + ) {
if ( ctx - > parray [ i ] - > flags & MPM_PATTERN_FLAG_NOCASE ) {
if ( ! ( ctx - > parray [ i ] - > flags & MPM_PATTERN_FLAG_NOCASE ) ) {
if ( ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . case_state = = 0 )
ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . cs = SCMalloc ( ctx - > parray [ i ] - > len ) ;
ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . case_state = 1 ;
if ( ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . cs = = NULL ) {
else if ( ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . case_state = = 1 )
SCLogError ( SC_ERR_MEM_ALLOC , " Error allocating memory " ) ;
ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . case_state = 1 ;
exit ( EXIT_FAILURE ) ;
else
}
ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . case_state = 3 ;
memcpy ( ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . cs ,
} else {
ctx - > parray [ i ] - > original_pat , ctx - > parray [ i ] - > len ) ;
//if (memcmp(ctx->parray[i]->original_pat, ctx->parray[i]->ci,
ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . patlen = ctx - > parray [ i ] - > len ;
// ctx->parray[i]->len) != 0) {
ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . cs = SCMalloc ( ctx - > parray [ i ] - > len ) ;
if ( ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . cs = = NULL ) {
SCLogError ( SC_ERR_MEM_ALLOC , " Error allocating memory " ) ;
exit ( EXIT_FAILURE ) ;
}
memcpy ( ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . cs ,
ctx - > parray [ i ] - > original_pat , ctx - > parray [ i ] - > len ) ;
ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . patlen = ctx - > parray [ i ] - > len ;
if ( ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . case_state = = 0 )
ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . case_state = 2 ;
else if ( ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . case_state = = 2 )
ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . case_state = 2 ;
else
ctx - > pid_pat_list [ ctx - > parray [ i ] - > id ] . case_state = 3 ;
//}
}
}
}
}
@ -1264,9 +1247,7 @@ uint32_t SCACSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx,
buf + i - pid_pat_list [ pids [ k ] & 0x0000FFFF ] . patlen + 1 ,
buf + i - pid_pat_list [ pids [ k ] & 0x0000FFFF ] . patlen + 1 ,
pid_pat_list [ pids [ k ] & 0x0000FFFF ] . patlen ) ! = 0 ) {
pid_pat_list [ pids [ k ] & 0x0000FFFF ] . patlen ) ! = 0 ) {
/* inside loop */
/* inside loop */
if ( pid_pat_list [ pids [ k ] & 0x0000FFFF ] . case_state ! = 3 ) {
continue ;
continue ;
}
}
}
if ( pmq - > pattern_id_bitarray [ ( pids [ k ] & 0x0000FFFF ) / 8 ] & ( 1 < < ( ( pids [ k ] & 0x0000FFFF ) % 8 ) ) ) {
if ( pmq - > pattern_id_bitarray [ ( pids [ k ] & 0x0000FFFF ) / 8 ] & ( 1 < < ( ( pids [ k ] & 0x0000FFFF ) % 8 ) ) ) {
;
;
@ -1305,9 +1286,7 @@ uint32_t SCACSearch(MpmCtx *mpm_ctx, MpmThreadCtx *mpm_thread_ctx,
buf + i - pid_pat_list [ pids [ k ] & 0x0000FFFF ] . patlen + 1 ,
buf + i - pid_pat_list [ pids [ k ] & 0x0000FFFF ] . patlen + 1 ,
pid_pat_list [ pids [ k ] & 0x0000FFFF ] . patlen ) ! = 0 ) {
pid_pat_list [ pids [ k ] & 0x0000FFFF ] . patlen ) ! = 0 ) {
/* inside loop */
/* inside loop */
if ( pid_pat_list [ pids [ k ] & 0x0000FFFF ] . case_state ! = 3 ) {
continue ;
continue ;
}
}
}
if ( pmq - > pattern_id_bitarray [ ( pids [ k ] & 0x0000FFFF ) / 8 ] & ( 1 < < ( ( pids [ k ] & 0x0000FFFF ) % 8 ) ) ) {
if ( pmq - > pattern_id_bitarray [ ( pids [ k ] & 0x0000FFFF ) / 8 ] & ( 1 < < ( ( pids [ k ] & 0x0000FFFF ) % 8 ) ) ) {
;
;
@ -1973,9 +1952,7 @@ uint32_t SCACCudaPacketResultsProcessing(Packet *p, MpmCtx *mpm_ctx,
buf + offset - pid_pat_list [ pids [ k ] & 0x0000FFFF ] . patlen + 1 ,
buf + offset - pid_pat_list [ pids [ k ] & 0x0000FFFF ] . patlen + 1 ,
pid_pat_list [ pids [ k ] & 0x0000FFFF ] . patlen ) ! = 0 ) {
pid_pat_list [ pids [ k ] & 0x0000FFFF ] . patlen ) ! = 0 ) {
/* inside loop */
/* inside loop */
if ( pid_pat_list [ pids [ k ] & 0x0000FFFF ] . case_state ! = 3 ) {
continue ;
continue ;
}
}
}
if ( pmq - > pattern_id_bitarray [ ( pids [ k ] & 0x0000FFFF ) / 8 ] & ( 1 < < ( ( pids [ k ] & 0x0000FFFF ) % 8 ) ) ) {
if ( pmq - > pattern_id_bitarray [ ( pids [ k ] & 0x0000FFFF ) / 8 ] & ( 1 < < ( ( pids [ k ] & 0x0000FFFF ) % 8 ) ) ) {
;
;