From 2a7b64c300f65f8700cbb4d9db531d64284bb588 Mon Sep 17 00:00:00 2001 From: David Underhill Date: Sat, 12 Jul 2008 00:54:05 -0700 Subject: [PATCH] Added partial support for Stats Request and Stats Reply, and full support for Error Message. --- .../wireshark_dissectors/openflow/Makefile | 2 +- .../openflow/packet-openflow.c | 71 +++++++++++++++++-- 2 files changed, 68 insertions(+), 5 deletions(-) diff --git a/utilities/wireshark_dissectors/openflow/Makefile b/utilities/wireshark_dissectors/openflow/Makefile index 0ddf5fe..56caaa1 100644 --- a/utilities/wireshark_dissectors/openflow/Makefile +++ b/utilities/wireshark_dissectors/openflow/Makefile @@ -47,7 +47,7 @@ INC_GLIB=/usr/include/glib-2.0 #/usr/pubsw/include/glib-2.0/ INC_OPENFLOW=../../../include INC_DIRS = -I. -I$(INC_GLIB) -I$(INC_OPENFLOW) -CFLAGS = $(INC_DIRS) -DHAVE_CONFIG_H -I$(WIRESHARK_SRC_DIR) -I/usr/local/include -I/usr/local/include -DINET6 -D_U_=__attribute__\(\(unused\)\) -Wall -Wno-unused -Wpointer-arith -g -I/usr/local/include -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/local/include/glib-2.0 -I/usr/lib/glib-2.0/include -fPIC -DPIC $(ENDIAN) $(DISSECT_PORT) +CFLAGS = $(INC_DIRS) -DHAVE_CONFIG_H -I$(WIRESHARK_SRC_DIR) -I/usr/local/include -I/usr/local/include -DINET6 -D_U_=__attribute__\(\(unused\)\) -Wall -Wpointer-arith -g -I/usr/local/include -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/local/include/glib-2.0 -I/usr/lib/glib-2.0/include -fPIC -DPIC $(ENDIAN) $(DISSECT_PORT) LDFLAGS = -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/local/lib -L/usr/local/lib -L$(WIRESHARK_SRC_DIR)/epan -L. -lgmodule-2.0 -ldl -lglib-2.0 -pthread -Wl,--export-dynamic -Wl,-soname -Wl,$(PLUGIN_NAME).so diff --git a/utilities/wireshark_dissectors/openflow/packet-openflow.c b/utilities/wireshark_dissectors/openflow/packet-openflow.c index 1206791..615e6ef 100644 --- a/utilities/wireshark_dissectors/openflow/packet-openflow.c +++ b/utilities/wireshark_dissectors/openflow/packet-openflow.c @@ -175,6 +175,8 @@ static const value_string names_ofp_port_reason[] = { { 0, NULL } }; +#define NUM_REPLIES 1 + /* These variables are used to hold the IDs of our fields; they are * set when we call proto_register_field_array() in proto_register_openflow() */ @@ -214,7 +216,6 @@ static gint ofp_match_nw_proto = -1; static gint ofp_match_pad = -1; static gint ofp_match_tp_src = -1; static gint ofp_match_tp_dst = -1; -static gint ofp_match_unknown = -1; static gint ofp_action = -1; static gint ofp_action_type = -1; @@ -273,6 +274,7 @@ static gint ofp_stats_request_body = -1; static gint ofp_stats_reply = -1; static gint ofp_stats_reply_type = -1; static gint ofp_stats_reply_flags = -1; +static gint ofp_stats_reply_flag[NUM_REPLIES]; static gint ofp_stats_reply_body = -1; static gint ofp_flow_stats_request = -1; @@ -380,6 +382,7 @@ static gint ett_ofp_flow_mod = -1; static gint ett_ofp_port_mod = -1; static gint ett_ofp_stats_request = -1; static gint ett_ofp_stats_reply = -1; +static gint ett_ofp_stats_reply_flags = -1; static gint ett_ofp_flow_stats_request = -1; static gint ett_ofp_flow_stats = -1; static gint ett_ofp_aggregate_stats_request = -1; @@ -436,6 +439,9 @@ void proto_register_openflow() for( i=0; i