From 16144fe38aec318cbb129c566822b487ec715a82 Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Sat, 31 Aug 2013 08:06:26 +0530 Subject: [PATCH] Rename function pointer var to use the FuncPtr typing convention. Resupply "dns" as the alproto name for ALPROTO_DNS. --- src/app-layer-detect-proto.c | 4 ++-- src/app-layer-parser.c | 2 +- src/app-layer-parser.h | 2 +- src/app-layer-protos.c | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index 073d598043..76263961cc 100644 --- a/src/app-layer-detect-proto.c +++ b/src/app-layer-detect-proto.c @@ -576,8 +576,8 @@ uint16_t AppLayerDetectGetProto(AlpProtoDetectCtx *ctx, uint16_t pm_matches = AppLayerDetectGetProtoPMParser(ctx, tctx, f, buf, buflen, flags, ipproto, pm_results); uint8_t dir = (flags & STREAM_TOSERVER) ? 0 : 1; for (uint16_t i = 0; i < pm_matches; i++) { - if (al_proto_table[pm_results[i]].pp_alproto_map[dir] != NULL) { - if (pm_results[i] != al_proto_table[pm_results[i]].pp_alproto_map[dir](buf, buflen, NULL)) { + if (al_proto_table[pm_results[i]].PPAlprotoMap[dir] != NULL) { + if (pm_results[i] != al_proto_table[pm_results[i]].PPAlprotoMap[dir](buf, buflen, NULL)) { /* \todo set event - Needs some deliberation */ continue; } diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index b4f5e7d501..9b86782a7a 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -2280,7 +2280,7 @@ void AppLayerMapProbingParserAgainstAlproto(uint16_t al_proto, uint8_t flags, ProbingParserFPtr ProbingParser) { - al_proto_table[al_proto].pp_alproto_map[(flags & STREAM_TOSERVER) ? 0 : 1] = ProbingParser; + al_proto_table[al_proto].PPAlprotoMap[(flags & STREAM_TOSERVER) ? 0 : 1] = ProbingParser; return; } diff --git a/src/app-layer-parser.h b/src/app-layer-parser.h index 07c42d9097..d7e7b5ab31 100644 --- a/src/app-layer-parser.h +++ b/src/app-layer-parser.h @@ -72,7 +72,7 @@ typedef struct AppLayerProto_ { int (*StateGetEventInfo)(const char *event_name, int *event_id, AppLayerEventType *event_type); - ProbingParserFPtr pp_alproto_map[2]; + ProbingParserFPtr PPAlprotoMap[2]; /* The current values taken are STREAM_TOSERVER, STREAM_TOCLIENT */ uint8_t flags; diff --git a/src/app-layer-protos.c b/src/app-layer-protos.c index 37e3b34999..1bfe8c43ce 100644 --- a/src/app-layer-protos.c +++ b/src/app-layer-protos.c @@ -83,6 +83,8 @@ const char *TmModuleAlprotoToString(enum AppProto proto) proto_name = "dnsudp"; break; case ALPROTO_DNS: + proto_name = "dns"; + break; case ALPROTO_FAILED: case ALPROTO_TEST: case ALPROTO_MAX: