*
* Copyright 2005, Luis E. Garcia Ontanon <luis.ontanon@gmail.com>
*
-* $Id $
+* $Id$
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
*/
#include "mate.h"
+#include "mate_grammar.h"
#define DUMMY void*
LoAL* current_gogkeys;
} gog_statement_t;
-static void configuration_error(mate_config* mc, gchar* fmt, ...) {
+static void configuration_error(mate_config* mc, const gchar* fmt, ...) {
static gchar error_buffer[256];
- gchar* incl;
+ const gchar* incl;
gint i;
mate_config_frame* current_frame;
va_list list;
pdu_decl ::= PDU_KW NAME(NAME) PROTO_KW field(FIELD) TRANSPORT_KW proto_stack(STACK) pdu_setup(SETUP) SEMICOLON. {
mate_cfg_pdu* cfg = new_pducfg(NAME);
extraction_t *extraction, *next_extraction;
+ GPtrArray* transport_stack = g_ptr_array_new();
+ int i;
if (! cfg ) configuration_error(mc,"could not create Pdu %s.",NAME);
cfg->drop_unassigned = (SETUP->flags) ? SETUP->flags->drop_unassigned : mc->defaults.pdu.drop_unassigned;
g_string_sprintfa(mc->protos_filter,"||%s",FIELD->abbrev);
+
+ /* flip the transport_stack */
+ for (i = STACK->len - 1; STACK->len; i--) {
+ g_ptr_array_add(transport_stack,g_ptr_array_remove_index(STACK,i));
+ }
+
+ g_ptr_array_free(STACK,FALSE);
- cfg->transport_ranges = STACK;
+ cfg->transport_ranges = transport_stack;
cfg->payload_ranges = SETUP->payload;
if (SETUP->criteria) {