Various style fixes

pull/753/head
Victor Julien 12 years ago
parent 429c6388f6
commit 59327e0fd4

@ -1541,14 +1541,14 @@ void *AppLayerProtoDetectGetCtxThread(void)
for (i = 0; i < FLOW_PROTO_DEFAULT; i++) {
for (j = 0; j < 2; j++) {
if (max_pat_id == 0)
{
max_pat_id = alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id;
} else if (alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id &&
max_pat_id < alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id)
{
max_pat_id = alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id;
}
if (max_pat_id == 0) {
max_pat_id = alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id;
} else if (alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id &&
max_pat_id < alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id)
{
max_pat_id = alpd_ctx.ctx_ipp[i].ctx_pm[j].max_pat_id;
}
}
}
@ -1622,9 +1622,9 @@ AppProto AppLayerProtoDetectGetProtoByName(char *alproto_name)
if (alpd_ctx.alproto_names[a] != NULL &&
strlen(alpd_ctx.alproto_names[a]) == strlen(alproto_name) &&
(SCMemcmp(alpd_ctx.alproto_names[a], alproto_name, strlen(alproto_name)) == 0))
{
goto end;
}
{
goto end;
}
}
end:
@ -2666,27 +2666,6 @@ int AppLayerProtoDetectTest14(void)
return r;
}
typedef struct AppLayerProtoDetectPPTestDataElement_ {
char *alproto_name;
uint16_t alproto;

@ -226,8 +226,7 @@ void *AppLayerParserGetCtxThread(void)
for (i = 0; i < FLOW_PROTO_DEFAULT; i++) {
for (j = 0; j < ALPROTO_MAX; j++) {
tctx->alproto_local_storage[i][j] =
AppLayerParserGetProtocolParserLocalStorage(FlowGetReverseProtoMapping(i),
j);
AppLayerParserGetProtocolParserLocalStorage(FlowGetReverseProtoMapping(i), j);
}
}
@ -680,11 +679,11 @@ uint64_t AppLayerParserGetTransactionActive(uint16_t ipproto, AppProto alproto,
{
SCEnter();
AppLayerParserParserState *pstate_1 = (AppLayerParserParserState *)pstate;
AppLayerParserParserState *state = (AppLayerParserParserState *)pstate;
uint64_t active_id;
uint64_t log_id = pstate_1->log_id;
uint64_t inspect_id = pstate_1->inspect_id[direction & STREAM_TOSERVER ? 0 : 1];
uint64_t log_id = state->log_id;
uint64_t inspect_id = state->inspect_id[direction & STREAM_TOSERVER ? 0 : 1];
if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].logger == TRUE) {
active_id = (log_id < inspect_id) ? log_id : inspect_id;
} else {
@ -756,9 +755,9 @@ int AppLayerParserParse(void *tctx, Flow *f, AppProto alproto,
if (p->Parser[(flags & STREAM_TOSERVER) ? 0 : 1](f, alstate, pstate,
input, input_len,
alp_tctx->alproto_local_storage[FlowGetProtoMapping(f->proto)][alproto]) < 0)
{
goto error;
}
{
goto error;
}
}
/* set the packets to no inspection and reassembly if required */

@ -22,8 +22,8 @@
* \author Anoop Saldanha <anoopsaldanha@gmail.com>
*/
#ifndef __APP_LAYER_PARSER__H__
#define __APP_LAYER_PARSER__H__
#ifndef __APP_LAYER_PARSER_H__
#define __APP_LAYER_PARSER_H__
#include "decode-events.h"
#include "util-file.h"
@ -189,4 +189,4 @@ void AppLayerParserBackupParserTable(void);
void AppLayerParserRestoreParserTable(void);
#endif
#endif /* __APP_LAYER_PARSER__H__ */
#endif /* __APP_LAYER_PARSER_H__ */

@ -22,8 +22,8 @@
* \author Anoop Saldanha <anoopsaldanha@gmail.com>
*/
#ifndef __APP_LAYER_PROTOS__H__
#define __APP_LAYER_PROTOS__H__
#ifndef __APP_LAYER_PROTOS_H__
#define __APP_LAYER_PROTOS_H__
enum {
ALPROTO_UNKNOWN = 0,
@ -63,4 +63,4 @@ typedef uint16_t AppProto;
*/
const char *AppProtoToString(AppProto alproto);
#endif /* __APP_LAYER_PROTOS__H__ */
#endif /* __APP_LAYER_PROTOS_H__ */

@ -286,12 +286,12 @@ int AppLayerHandleTCPData(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
*/
if ((ssn->data_first_seen_dir != APP_LAYER_DATA_ALREADY_SENT_TO_APP_LAYER) &&
(first_data_dir) && !(first_data_dir & flags))
{
FlowSetSessionNoApplayerInspectionFlag(f);
StreamTcpSetStreamFlagAppProtoDetectionCompleted(&ssn->server);
StreamTcpSetStreamFlagAppProtoDetectionCompleted(&ssn->client);
goto failure;
}
{
FlowSetSessionNoApplayerInspectionFlag(f);
StreamTcpSetStreamFlagAppProtoDetectionCompleted(&ssn->server);
StreamTcpSetStreamFlagAppProtoDetectionCompleted(&ssn->client);
goto failure;
}
if (data_len > 0)
ssn->data_first_seen_dir = APP_LAYER_DATA_ALREADY_SENT_TO_APP_LAYER;

@ -20,8 +20,8 @@
* \author Anoop Saldanha <anoopsaldanha@gmail.com>
*/
#ifndef __APP_LAYER__H__
#define __APP_LAYER__H__
#ifndef __APP_LAYER_H__
#define __APP_LAYER_H__
#include "threadvars.h"
#include "decode.h"

Loading…
Cancel
Save