diff --git a/src/bif_arg.cc b/src/bif_arg.cc index 2befed495a..9ef1594fd8 100644 --- a/src/bif_arg.cc +++ b/src/bif_arg.cc @@ -24,7 +24,6 @@ static struct { }; extern const char* arg_list_name; -extern set enum_types; BuiltinFuncArg::BuiltinFuncArg(const char* arg_name, int arg_type) { @@ -45,9 +44,6 @@ BuiltinFuncArg::BuiltinFuncArg(const char* arg_name, const char* arg_type_str) type = i; type_str = ""; } - - if ( enum_types.find(type_str) != enum_types.end() ) - type = TYPE_ENUM; } void BuiltinFuncArg::PrintBro(FILE* fp) diff --git a/src/builtin-func.l b/src/builtin-func.l index 5d07a18fdb..14b0eb52a6 100644 --- a/src/builtin-func.l +++ b/src/builtin-func.l @@ -67,7 +67,6 @@ HEX [0-9a-fA-F]+ "event" return check_c_mode(TOK_EVENT); "const" return check_c_mode(TOK_CONST); "enum" return check_c_mode(TOK_ENUM); -"declare" return check_c_mode(TOK_DECLARE); "type" return check_c_mode(TOK_TYPE); "record" return check_c_mode(TOK_RECORD); diff --git a/src/builtin-func.y b/src/builtin-func.y index 3d914e66d6..44d63ad5db 100644 --- a/src/builtin-func.y +++ b/src/builtin-func.y @@ -67,9 +67,6 @@ extern const char* decl_name; int var_arg; // whether the number of arguments is variable std::vector args; -// enum types declared by "declare enum " -set enum_types; - extern int yyerror(const char[]); extern int yywarn(const char msg[]); extern int yylex(); @@ -154,7 +151,7 @@ void print_event_c_body(FILE *fp) %token TOK_LPP TOK_RPP TOK_LPB TOK_RPB TOK_LPPB TOK_RPPB TOK_VAR_ARG %token TOK_BOOL -%token TOK_FUNCTION TOK_REWRITER TOK_EVENT TOK_CONST TOK_ENUM TOK_DECLARE +%token TOK_FUNCTION TOK_REWRITER TOK_EVENT TOK_CONST TOK_ENUM %token TOK_TYPE TOK_RECORD %token TOK_WRITE TOK_PUSH TOK_EOF TOK_TRACE %token TOK_ARGS TOK_ARG TOK_ARGC @@ -202,15 +199,9 @@ definition: event_def | c_code_segment | enum_def | const_def - | declare_def | type_def ; -declare_def: TOK_DECLARE opt_ws TOK_ENUM opt_ws TOK_ID opt_ws ';' - { - enum_types.insert($5); - } - ; // XXX: Add the netvar glue so that the event engine knows about // the type. One still has to define the type in bro.init. diff --git a/src/event.bif b/src/event.bif index 3171b02dde..270f1b0d0b 100644 --- a/src/event.bif +++ b/src/event.bif @@ -1,10 +1,5 @@ # $Id: event.bif 6942 2009-11-16 03:54:08Z vern $ -# Declare to bifcl the following types as enum types. -declare enum dce_rpc_ptype; -declare enum dce_rpc_if_id; -declare enum rpc_status; - event bro_init%(%); event bro_done%(%); diff --git a/src/portmap-analyzer.pac b/src/portmap-analyzer.pac index 1e7921a9ff..6ad03f23d4 100644 --- a/src/portmap-analyzer.pac +++ b/src/portmap-analyzer.pac @@ -150,7 +150,7 @@ function PortmapCallFailed(connection: RPC_Conn, status: EnumRPCStatus): bool %{ // BroEnum::rpc_status st = static_cast(status); - BroEnum::rpc_status st = (BroEnum::rpc_status) status; + Val *st = new EnumVal((BroEnum::rpc_status) status, enum_rpc_status); switch ( call->proc() ) { case PMAPPROC_NULL: