alproto: improve AppProtoToString

Make AppProtoToString compilation fail on missing 'case's.
pull/1549/head
Victor Julien 10 years ago
parent 0bafc71689
commit 925aac854e

@ -30,8 +30,9 @@
const char *AppProtoToString(AppProto alproto)
{
const char *proto_name = NULL;
enum AppProtoEnum proto = alproto;
switch (alproto) {
switch (proto) {
case ALPROTO_HTTP:
proto_name = "http";
break;

@ -25,7 +25,7 @@
#ifndef __APP_LAYER_PROTOS_H__
#define __APP_LAYER_PROTOS_H__
enum {
enum AppProtoEnum {
ALPROTO_UNKNOWN = 0,
ALPROTO_HTTP,
ALPROTO_FTP,
@ -53,6 +53,7 @@ enum {
ALPROTO_MAX,
};
/* not using the enum as that is a unsigned int, so 4 bytes */
typedef uint16_t AppProto;
/**

Loading…
Cancel
Save