diff --git a/utilities/wireshark_dissectors/openflow/packet-openflow.c b/utilities/wireshark_dissectors/openflow/packet-openflow.c index 1d91b57..1e40625 100644 --- a/utilities/wireshark_dissectors/openflow/packet-openflow.c +++ b/utilities/wireshark_dissectors/openflow/packet-openflow.c @@ -181,6 +181,7 @@ static const value_string names_ofp_port_reason[] = { * set when we call proto_register_field_array() in proto_register_openflow() */ static gint ofp = -1; +static gint ofp_pad = -1; /* Open Flow Header */ static gint ofp_header = -1; @@ -213,7 +214,6 @@ static gint ofp_match_dl_type = -1; static gint ofp_match_nw_src = -1; static gint ofp_match_nw_dst = -1; 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; @@ -260,7 +260,6 @@ static gint ofp_flow_mod_command = -1; static gint ofp_flow_mod_max_idle = -1; static gint ofp_flow_mod_buffer_id = -1; static gint ofp_flow_mod_priority = -1; -static gint ofp_flow_mod_pad = -1; static gint ofp_flow_mod_reserved = -1; static gint ofp_port_mod = -1; @@ -280,12 +279,10 @@ static gint ofp_stats_reply_body = -1; static gint ofp_flow_stats_request = -1; /* field: ofp_match */ static gint ofp_flow_stats_request_table_id = -1; -static gint ofp_flow_stats_request_pad = -1; static gint ofp_flow_stats_reply = -1; /* length won't be put in the tree */ static gint ofp_flow_stats_reply_table_id = -1; -static gint ofp_flow_stats_reply_pad = -1; /* field: ofp_match */ static gint ofp_flow_stats_reply_duration = -1; static gint ofp_flow_stats_reply_packet_count = -1; @@ -297,7 +294,6 @@ static gint ofp_flow_stats_reply_max_idle = -1; static gint ofp_aggregate_stats_request = -1; /* field: ofp_match */ static gint ofp_aggregate_stats_request_table_id = -1; -static gint ofp_aggregate_stats_request_pad = -1; static gint ofp_aggregate_stats_reply = -1; static gint ofp_aggregate_stats_reply_packet_count = -1; @@ -306,7 +302,6 @@ static gint ofp_aggregate_stats_reply_flow_count = -1; static gint ofp_table_stats = -1; static gint ofp_table_stats_table_id = -1; -static gint ofp_table_stats_pad = -1; static gint ofp_table_stats_name = -1; static gint ofp_table_stats_max_entries = -1; static gint ofp_table_stats_active_count = -1; @@ -314,7 +309,6 @@ static gint ofp_table_stats_matched_count = -1; static gint ofp_port_stats = -1; static gint ofp_port_stats_port_no = -1; -static gint ofp_port_stats_pad = -1; static gint ofp_port_stats_rx_count = -1; static gint ofp_port_stats_tx_count = -1; static gint ofp_port_stats_drop_count = -1; @@ -332,20 +326,17 @@ static gint ofp_packet_in_buffer_id = -1; static gint ofp_packet_in_total_len = -1; static gint ofp_packet_in_in_port = -1; static gint ofp_packet_in_reason = -1; -static gint ofp_packet_in_pad = -1; static gint ofp_packet_in_data_hdr = -1; static gint ofp_flow_expired = -1; /* field: ofp_match */ static gint ofp_flow_expired_priority = -1; -static gint ofp_flow_expired_pad = -1; static gint ofp_flow_expired_duration = -1; static gint ofp_flow_expired_packet_count = -1; static gint ofp_flow_expired_byte_count = -1; static gint ofp_port_status = -1; static gint ofp_port_status_reason = -1; -static gint ofp_port_status_pad = -1; /* field: ofp_phy_port */ static gint ofp_error_msg = -1; @@ -452,6 +443,9 @@ void proto_register_openflow() { &ofp, { "Data", "of.data", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "OpenFlow PDU", HFILL }}, + { &ofp_pad, + { "Pad", "of.pad", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Pad", HFILL }}, + { &ofp_header, { "Header", "of.header", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "OpenFlow Header", HFILL }}, @@ -582,9 +576,6 @@ void proto_register_openflow() { &ofp_match_nw_proto, { "IP Protocol", "of.match_", FT_UINT8, BASE_HEX, NO_STRINGS, NO_MASK, "IP Protocol", HFILL }}, - { &ofp_match_pad, - { "Pad", "of.match_pad", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Pad", HFILL }}, - { &ofp_match_tp_src, { "TCP/UDP Src Port", "of.match_tp_src", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "TCP/UDP Source Port", HFILL }}, @@ -750,9 +741,6 @@ void proto_register_openflow() { &ofp_packet_in_reason, { "Reason Sent", "of.pktin_reason", FT_UINT8, BASE_DEC, VALS(names_ofp_reason), NO_MASK, "Reason Packet Sent", HFILL }}, - { &ofp_packet_in_pad, - { "Padding", "of.pktin_pad", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Pad", HFILL }}, - { &ofp_packet_in_data_hdr, { "Frame Data", "of.pktin_data", FT_BYTES, BASE_NONE, NO_STRINGS, NO_MASK, "Frame Data", HFILL }}, @@ -793,9 +781,6 @@ void proto_register_openflow() { &ofp_flow_mod_priority, { "Priority", "of.fm_priority", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Priority", HFILL } }, - { &ofp_flow_mod_pad, - { "Pad", "of.fm_pad", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Pad", HFILL } }, - { &ofp_flow_mod_reserved, { "Reserved", "of.fm_reserved", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Reserved", HFILL } }, @@ -807,9 +792,6 @@ void proto_register_openflow() { &ofp_flow_expired_priority, { "Priority", "of.fe_priority", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "Priority", HFILL } }, - { &ofp_flow_expired_pad, - { "Pad", "of.fe_pad", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Pad", HFILL } }, - { &ofp_flow_expired_duration, { "Flow Duration (sec)", "of.fe_duration", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Time Flow was Alive (sec)", HFILL } }, @@ -836,9 +818,6 @@ void proto_register_openflow() { &ofp_port_status_reason, { "Reason", "of.ps_reason", FT_UINT8, BASE_DEC, VALS(names_ofp_port_reason), NO_MASK, "Reason", HFILL } }, - { &ofp_port_status_pad, - { "Pad", "of.ps_pad", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Pad", HFILL } }, - /* CSM: Stats Request */ { &ofp_stats_request, @@ -878,9 +857,6 @@ void proto_register_openflow() { &ofp_flow_stats_request_table_id, { "Table ID", "of.stats_flow_table_id", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Table ID", HFILL } }, - { &ofp_flow_stats_request_pad, - { "Pad", "of.stats_flow_pad", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Pad", HFILL } }, - /* CSM: Stats: Flow: Reply */ { &ofp_flow_stats_reply, { "Flow Stats Reply", "of.stats_flow_", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Flow Statistics Reply", HFILL } }, @@ -888,9 +864,6 @@ void proto_register_openflow() { &ofp_flow_stats_reply_table_id, { "Table ID", "of.stats_flow_table_id", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Table ID", HFILL } }, - { &ofp_flow_stats_reply_pad, - { "Pad", "of.stats_flow_pad", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Pad", HFILL } }, - { &ofp_flow_stats_reply_duration, { "Flow Duration (sec)", "of.stats_flow_duration", FT_UINT32, BASE_DEC, NO_STRINGS, NO_MASK, "Time Flow has Been Alive (sec)", HFILL } }, @@ -913,9 +886,6 @@ void proto_register_openflow() { &ofp_aggregate_stats_request_table_id, { "Table ID", "of.stats_aggr_table_id", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Table ID", HFILL } }, - { &ofp_aggregate_stats_request_pad, - { "Pad", "of.stats_aggr_pad", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Pad", HFILL } }, - /* CSM: Stats: Aggregate: Reply */ { &ofp_aggregate_stats_reply, { "Aggregate Stats Reply", "of.stats_aggr", FT_NONE, BASE_NONE, NO_STRINGS, NO_MASK, "Aggregate Statistics Reply", HFILL } }, @@ -936,9 +906,6 @@ void proto_register_openflow() { &ofp_port_stats_port_no, { "Port #", "of.stats_port_port_no", FT_UINT16, BASE_DEC, NO_STRINGS, NO_MASK, "", HFILL } }, - { &ofp_port_stats_pad, - { "Pad", "of.stats_port_pad", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "", HFILL } }, - { &ofp_port_stats_rx_count, { "# Packets Recv ", "of.stats_port_rx_count", FT_UINT64, BASE_DEC, NO_STRINGS, NO_MASK, "Number of Packets Received", HFILL } }, @@ -955,9 +922,6 @@ void proto_register_openflow() { &ofp_table_stats_table_id, { "Table ID", "of.stats_table_table_id", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Table ID", HFILL } }, - { &ofp_table_stats_pad, - { "Pad", "of.stats_table_pad", FT_UINT8, BASE_DEC, NO_STRINGS, NO_MASK, "Pad", HFILL } }, - { &ofp_table_stats_name, { "Name", "of.stats_table_name", FT_STRING, BASE_NONE, NO_STRINGS, NO_MASK, "Name", HFILL } }, @@ -1074,6 +1038,16 @@ static guint get_openflow_message_len(packet_info *pinfo, tvbuff_t *tvb, int off return (guint)tvb_get_ntohs(tvb, offset+2); /* length is at offset 2 in the header */ } +static void dissect_pad(proto_tree* tree, guint32 *offset, guint pad_byte_count) { +#if SHOW_PADDING + guint i; + for( i=0; i