1 /* packet-openflow_v4.c
2  * Routines for OpenFlow dissection
3  * Copyright 2013, Anders Broman <anders.broman@ericsson.com>
4  * Copyright 2013, Zoltan Lajos Kis <zoltan.lajos.kis@ericsson.com>
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * SPDX-License-Identifier: GPL-2.0-or-later
11  *
12  * Ref https://www.opennetworking.org/sdn-resources/onf-specifications/openflow
13  */
14 
15 #include "config.h"
16 
17 #include <epan/packet.h>
18 #include <epan/etypes.h>
19 #include <epan/expert.h>
20 #include <epan/ipproto.h>
21 
22 void proto_register_openflow_v4(void);
23 void proto_reg_handoff_openflow_v4(void);
24 static int dissect_openflow_message_v4(tvbuff_t *, packet_info *, proto_tree *, int);
25 
26 static dissector_handle_t eth_withoutfcs_handle;
27 
28 static int proto_openflow_v4 = -1;
29 static int hf_openflow_v4_version = -1;
30 static int hf_openflow_v4_type = -1;
31 static int hf_openflow_v4_length = -1;
32 static int hf_openflow_v4_xid = -1;
33 static int hf_openflow_v4_oxm_class = -1;
34 static int hf_openflow_v4_oxm_field = -1;
35 static int hf_openflow_v4_oxm_field_basic = -1;
36 static int hf_openflow_v4_oxm_hm = -1;
37 static int hf_openflow_v4_oxm_length = -1;
38 static int hf_openflow_v4_oxm_experimenter_experimenter = -1;
39 static int hf_openflow_v4_oxm_experimenter_value = -1;
40 static int hf_openflow_v4_oxm_value = -1;
41 static int hf_openflow_v4_oxm_value_etheraddr = -1;
42 static int hf_openflow_v4_oxm_value_vlan_present = -1;
43 static int hf_openflow_v4_oxm_value_vlan_vid = -1;
44 static int hf_openflow_v4_oxm_value_ethertype = -1;
45 static int hf_openflow_v4_oxm_value_ipv4addr = -1;
46 static int hf_openflow_v4_oxm_value_ipv6addr = -1;
47 static int hf_openflow_v4_oxm_value_ipproto = -1;
48 static int hf_openflow_v4_oxm_value_uint16 = -1;
49 static int hf_openflow_v4_oxm_value_uint24 = -1;
50 static int hf_openflow_v4_oxm_value_uint32 = -1;
51 static int hf_openflow_v4_oxm_mask = -1;
52 static int hf_openflow_v4_oxm_mask_etheraddr = -1;
53 static int hf_openflow_v4_oxm_mask_ipv4addr = -1;
54 static int hf_openflow_v4_oxm_mask_ipv6addr = -1;
55 static int hf_openflow_v4_oxm_mask_vlan = -1;
56 static int hf_openflow_v4_match_type = -1;
57 static int hf_openflow_v4_match_length = -1;
58 static int hf_openflow_v4_match_pad = -1;
59 static int hf_openflow_v4_action_type = -1;
60 static int hf_openflow_v4_action_length = -1;
61 static int hf_openflow_v4_action_experimenter_experimenter = -1;
62 static int hf_openflow_v4_action_output_port = -1;
63 static int hf_openflow_v4_action_output_max_len = -1;
64 static int hf_openflow_v4_action_output_pad = -1;
65 static int hf_openflow_v4_action_copy_ttl_out_pad = -1;
66 static int hf_openflow_v4_action_copy_ttl_in_pad = -1;
67 static int hf_openflow_v4_action_set_mpls_ttl_ttl = -1;
68 static int hf_openflow_v4_action_set_mpls_ttl_pad = -1;
69 static int hf_openflow_v4_action_dec_mpls_ttl_pad = -1;
70 static int hf_openflow_v4_action_push_vlan_ethertype = -1;
71 static int hf_openflow_v4_action_push_vlan_pad = -1;
72 static int hf_openflow_v4_action_pop_vlan_pad = -1;
73 static int hf_openflow_v4_action_push_mpls_ethertype = -1;
74 static int hf_openflow_v4_action_push_mpls_pad = -1;
75 static int hf_openflow_v4_action_pop_mpls_ethertype = -1;
76 static int hf_openflow_v4_action_pop_mpls_pad = -1;
77 static int hf_openflow_v4_action_set_queue_queue_id = -1;
78 static int hf_openflow_v4_action_group_group_id = -1;
79 static int hf_openflow_v4_action_set_nw_ttl_ttl = -1;
80 static int hf_openflow_v4_action_set_nw_ttl_pad = -1;
81 static int hf_openflow_v4_action_dec_nw_ttl_pad = -1;
82 static int hf_openflow_v4_action_set_field_pad = -1;
83 static int hf_openflow_v4_action_push_pbb_ethertype = -1;
84 static int hf_openflow_v4_action_push_pbb_pad = -1;
85 static int hf_openflow_v4_action_pop_pbb_pad = -1;
86 static int hf_openflow_v4_instruction_type = -1;
87 static int hf_openflow_v4_instruction_length = -1;
88 static int hf_openflow_v4_instruction_experimenter_experimenter = -1;
89 static int hf_openflow_v4_instruction_goto_table_table_id = -1;
90 static int hf_openflow_v4_instruction_goto_table_pad = -1;
91 static int hf_openflow_v4_instruction_write_metadata_pad = -1;
92 static int hf_openflow_v4_instruction_write_metadata_value = -1;
93 static int hf_openflow_v4_instruction_write_metadata_mask = -1;
94 static int hf_openflow_v4_instruction_actions_pad = -1;
95 static int hf_openflow_v4_instruction_meter_meter_id = -1;
96 static int hf_openflow_v4_port_port_no = -1;
97 static int hf_openflow_v4_port_pad = -1;
98 static int hf_openflow_v4_port_hw_addr = -1;
99 static int hf_openflow_v4_port_pad2 = -1;
100 static int hf_openflow_v4_port_name = -1;
101 static int hf_openflow_v4_port_config = -1;
102 static int hf_openflow_v4_port_config_port_down = -1;
103 static int hf_openflow_v4_port_config_no_recv = -1;
104 static int hf_openflow_v4_port_config_no_fwd = -1;
105 static int hf_openflow_v4_port_config_no_packet_in = -1;
106 static int hf_openflow_v4_port_state = -1;
107 static int hf_openflow_v4_port_state_link_down = -1;
108 static int hf_openflow_v4_port_state_blocked = -1;
109 static int hf_openflow_v4_port_state_live = -1;
110 static int hf_openflow_v4_port_current = -1;
111 static int hf_openflow_v4_port_current_10mb_hd = -1;
112 static int hf_openflow_v4_port_current_10mb_fd = -1;
113 static int hf_openflow_v4_port_current_100mb_hd = -1;
114 static int hf_openflow_v4_port_current_100mb_fd = -1;
115 static int hf_openflow_v4_port_current_1gb_hd = -1;
116 static int hf_openflow_v4_port_current_1gb_fd = -1;
117 static int hf_openflow_v4_port_current_10gb_fd = -1;
118 static int hf_openflow_v4_port_current_40gb_fd = -1;
119 static int hf_openflow_v4_port_current_100gb_fd = -1;
120 static int hf_openflow_v4_port_current_1tb_fd = -1;
121 static int hf_openflow_v4_port_current_other = -1;
122 static int hf_openflow_v4_port_current_copper = -1;
123 static int hf_openflow_v4_port_current_fiber = -1;
124 static int hf_openflow_v4_port_current_autoneg = -1;
125 static int hf_openflow_v4_port_current_pause = -1;
126 static int hf_openflow_v4_port_current_pause_asym = -1;
127 static int hf_openflow_v4_port_advertised = -1;
128 static int hf_openflow_v4_port_advertised_10mb_hd = -1;
129 static int hf_openflow_v4_port_advertised_10mb_fd = -1;
130 static int hf_openflow_v4_port_advertised_100mb_hd = -1;
131 static int hf_openflow_v4_port_advertised_100mb_fd = -1;
132 static int hf_openflow_v4_port_advertised_1gb_hd = -1;
133 static int hf_openflow_v4_port_advertised_1gb_fd = -1;
134 static int hf_openflow_v4_port_advertised_10gb_fd = -1;
135 static int hf_openflow_v4_port_advertised_40gb_fd = -1;
136 static int hf_openflow_v4_port_advertised_100gb_fd = -1;
137 static int hf_openflow_v4_port_advertised_1tb_fd = -1;
138 static int hf_openflow_v4_port_advertised_other = -1;
139 static int hf_openflow_v4_port_advertised_copper = -1;
140 static int hf_openflow_v4_port_advertised_fiber = -1;
141 static int hf_openflow_v4_port_advertised_autoneg = -1;
142 static int hf_openflow_v4_port_advertised_pause = -1;
143 static int hf_openflow_v4_port_advertised_pause_asym = -1;
144 static int hf_openflow_v4_port_supported = -1;
145 static int hf_openflow_v4_port_supported_10mb_hd = -1;
146 static int hf_openflow_v4_port_supported_10mb_fd = -1;
147 static int hf_openflow_v4_port_supported_100mb_hd = -1;
148 static int hf_openflow_v4_port_supported_100mb_fd = -1;
149 static int hf_openflow_v4_port_supported_1gb_hd = -1;
150 static int hf_openflow_v4_port_supported_1gb_fd = -1;
151 static int hf_openflow_v4_port_supported_10gb_fd = -1;
152 static int hf_openflow_v4_port_supported_40gb_fd = -1;
153 static int hf_openflow_v4_port_supported_100gb_fd = -1;
154 static int hf_openflow_v4_port_supported_1tb_fd = -1;
155 static int hf_openflow_v4_port_supported_other = -1;
156 static int hf_openflow_v4_port_supported_copper = -1;
157 static int hf_openflow_v4_port_supported_fiber = -1;
158 static int hf_openflow_v4_port_supported_autoneg = -1;
159 static int hf_openflow_v4_port_supported_pause = -1;
160 static int hf_openflow_v4_port_supported_pause_asym = -1;
161 static int hf_openflow_v4_port_peer = -1;
162 static int hf_openflow_v4_port_peer_10mb_hd = -1;
163 static int hf_openflow_v4_port_peer_10mb_fd = -1;
164 static int hf_openflow_v4_port_peer_100mb_hd = -1;
165 static int hf_openflow_v4_port_peer_100mb_fd = -1;
166 static int hf_openflow_v4_port_peer_1gb_hd = -1;
167 static int hf_openflow_v4_port_peer_1gb_fd = -1;
168 static int hf_openflow_v4_port_peer_10gb_fd = -1;
169 static int hf_openflow_v4_port_peer_40gb_fd = -1;
170 static int hf_openflow_v4_port_peer_100gb_fd = -1;
171 static int hf_openflow_v4_port_peer_1tb_fd = -1;
172 static int hf_openflow_v4_port_peer_other = -1;
173 static int hf_openflow_v4_port_peer_copper = -1;
174 static int hf_openflow_v4_port_peer_fiber = -1;
175 static int hf_openflow_v4_port_peer_autoneg = -1;
176 static int hf_openflow_v4_port_peer_pause = -1;
177 static int hf_openflow_v4_port_peer_pause_asym = -1;
178 static int hf_openflow_v4_port_curr_speed = -1;
179 static int hf_openflow_v4_port_max_speed = -1;
180 static int hf_openflow_v4_meter_band_type = -1;
181 static int hf_openflow_v4_meter_band_len = -1;
182 static int hf_openflow_v4_meter_band_rate = -1;
183 static int hf_openflow_v4_meter_band_burst_size = -1;
184 static int hf_openflow_v4_meter_band_drop_pad = -1;
185 static int hf_openflow_v4_meter_band_dscp_remark_prec_level = -1;
186 static int hf_openflow_v4_meter_band_dscp_remark_pad= -1;
187 static int hf_openflow_v4_meter_band_experimenter_experimenter = -1;
188 static int hf_openflow_v4_hello_element_type = -1;
189 static int hf_openflow_v4_hello_element_length = -1;
190 static int hf_openflow_v4_hello_element_version_bitmap = -1;
191 static int hf_openflow_v4_hello_element_pad = -1;
192 static int hf_openflow_v4_error_type = -1;
193 static int hf_openflow_v4_error_hello_failed_code = -1;
194 static int hf_openflow_v4_error_bad_request_code = -1;
195 static int hf_openflow_v4_error_bad_action_code = -1;
196 static int hf_openflow_v4_error_bad_instruction_code = -1;
197 static int hf_openflow_v4_error_bad_match_code = -1;
198 static int hf_openflow_v4_error_flow_mod_failed_code = -1;
199 static int hf_openflow_v4_error_group_mod_failed_code = -1;
200 static int hf_openflow_v4_error_port_mod_failed_code = -1;
201 static int hf_openflow_v4_error_table_mod_failed_code = -1;
202 static int hf_openflow_v4_error_queue_op_failed_code = -1;
203 static int hf_openflow_v4_error_switch_config_failed_code = -1;
204 static int hf_openflow_v4_error_role_request_failed_code = -1;
205 static int hf_openflow_v4_error_meter_mod_failed_code = -1;
206 static int hf_openflow_v4_error_table_features_failed_code = -1;
207 static int hf_openflow_v4_error_code = -1;
208 static int hf_openflow_v4_error_data_text = -1;
209 static int hf_openflow_v4_error_data_body = -1;
210 static int hf_openflow_v4_error_experimenter = -1;
211 static int hf_openflow_v4_echo_data = -1;
212 static int hf_openflow_v4_experimenter_experimenter = -1;
213 static int hf_openflow_v4_experimenter_exp_type = -1;
214 static int hf_openflow_v4_switch_features_datapath_id = -1;
215 static int hf_openflow_v4_switch_features_n_buffers = -1;
216 static int hf_openflow_v4_switch_features_n_tables = -1;
217 static int hf_openflow_v4_switch_features_auxiliary_id = -1;
218 static int hf_openflow_v4_switch_features_pad = -1;
219 static int hf_openflow_v4_switch_features_capabilities = -1;
220 static int hf_openflow_v4_switch_features_capabilities_flow_stats = -1;
221 static int hf_openflow_v4_switch_features_capabilities_table_stats = -1;
222 static int hf_openflow_v4_switch_features_capabilities_port_stats = -1;
223 static int hf_openflow_v4_switch_features_capabilities_group_stats = -1;
224 static int hf_openflow_v4_switch_features_capabilities_ip_reasm = -1;
225 static int hf_openflow_v4_switch_features_capabilities_queue_stats = -1;
226 static int hf_openflow_v4_switch_features_capabilities_port_blocked = -1;
227 static int hf_openflow_v4_switch_features_reserved = -1;
228 static int hf_openflow_v4_switch_config_flags = -1;
229 static int hf_openflow_v4_switch_config_flags_fragments = -1;
230 static int hf_openflow_v4_switch_config_miss_send_len = -1;
231 static int hf_openflow_v4_packet_in_buffer_id = -1;
232 static int hf_openflow_v4_packet_in_total_len = -1;
233 static int hf_openflow_v4_packet_in_reason = -1;
234 static int hf_openflow_v4_packet_in_table_id = -1;
235 static int hf_openflow_v4_packet_in_cookie = -1;
236 static int hf_openflow_v4_packet_in_pad = -1;
237 static int hf_openflow_v4_flow_removed_cookie = -1;
238 static int hf_openflow_v4_flow_removed_priority = -1;
239 static int hf_openflow_v4_flow_removed_reason = -1;
240 static int hf_openflow_v4_flow_removed_table_id = -1;
241 static int hf_openflow_v4_flow_removed_duration_sec = -1;
242 static int hf_openflow_v4_flow_removed_duration_nsec = -1;
243 static int hf_openflow_v4_flow_removed_idle_timeout = -1;
244 static int hf_openflow_v4_flow_removed_hard_timeout = -1;
245 static int hf_openflow_v4_flow_removed_packet_count = -1;
246 static int hf_openflow_v4_flow_removed_byte_count = -1;
247 static int hf_openflow_v4_port_status_reason = -1;
248 static int hf_openflow_v4_port_status_pad = -1;
249 static int hf_openflow_v4_packet_out_buffer_id = -1;
250 static int hf_openflow_v4_packet_out_in_port = -1;
251 static int hf_openflow_v4_packet_out_acts_len = -1;
252 static int hf_openflow_v4_packet_out_pad = -1;
253 static int hf_openflow_v4_flowmod_cookie = -1;
254 static int hf_openflow_v4_flowmod_cookie_mask = -1;
255 static int hf_openflow_v4_flowmod_table_id = -1;
256 static int hf_openflow_v4_flowmod_command = -1;
257 static int hf_openflow_v4_flowmod_idle_timeout = -1;
258 static int hf_openflow_v4_flowmod_hard_timeout = -1;
259 static int hf_openflow_v4_flowmod_priority = -1;
260 static int hf_openflow_v4_flowmod_buffer_id = -1;
261 static int hf_openflow_v4_flowmod_out_port = -1;
262 static int hf_openflow_v4_flowmod_out_group = -1;
263 static int hf_openflow_v4_flowmod_flags = -1;
264 static int hf_openflow_v4_flowmod_flags_send_flow_rem = -1;
265 static int hf_openflow_v4_flowmod_flags_check_overlap = -1;
266 static int hf_openflow_v4_flowmod_flags_reset_counts = -1;
267 static int hf_openflow_v4_flowmod_flags_no_packet_counts = -1;
268 static int hf_openflow_v4_flowmod_flags_no_byte_counts = -1;
269 static int hf_openflow_v4_flowmod_pad = -1;
270 static int hf_openflow_v4_bucket_length = -1;
271 static int hf_openflow_v4_bucket_weight = -1;
272 static int hf_openflow_v4_bucket_watch_port = -1;
273 static int hf_openflow_v4_bucket_watch_group = -1;
274 static int hf_openflow_v4_bucket_pad = -1;
275 static int hf_openflow_v4_groupmod_command = -1;
276 static int hf_openflow_v4_groupmod_type = -1;
277 static int hf_openflow_v4_groupmod_pad = -1;
278 static int hf_openflow_v4_groupmod_group_id = -1;
279 static int hf_openflow_v4_portmod_port_no = -1;
280 static int hf_openflow_v4_portmod_pad = -1;
281 static int hf_openflow_v4_portmod_hw_addr = -1;
282 static int hf_openflow_v4_portmod_pad2 = -1;
283 static int hf_openflow_v4_portmod_config = -1;
284 static int hf_openflow_v4_portmod_config_port_down = -1;
285 static int hf_openflow_v4_portmod_config_no_recv = -1;
286 static int hf_openflow_v4_portmod_config_no_fwd = -1;
287 static int hf_openflow_v4_portmod_config_no_packet_in = -1;
288 static int hf_openflow_v4_portmod_mask = -1;
289 static int hf_openflow_v4_portmod_mask_port_down = -1;
290 static int hf_openflow_v4_portmod_mask_no_recv = -1;
291 static int hf_openflow_v4_portmod_mask_no_fwd = -1;
292 static int hf_openflow_v4_portmod_mask_no_packet_in = -1;
293 static int hf_openflow_v4_portmod_advertise = -1;
294 static int hf_openflow_v4_portmod_advertise_10mb_hd = -1;
295 static int hf_openflow_v4_portmod_advertise_10mb_fd = -1;
296 static int hf_openflow_v4_portmod_advertise_100mb_hd = -1;
297 static int hf_openflow_v4_portmod_advertise_100mb_fd = -1;
298 static int hf_openflow_v4_portmod_advertise_1gb_hd = -1;
299 static int hf_openflow_v4_portmod_advertise_1gb_fd = -1;
300 static int hf_openflow_v4_portmod_advertise_10gb_fd = -1;
301 static int hf_openflow_v4_portmod_advertise_40gb_fd = -1;
302 static int hf_openflow_v4_portmod_advertise_100gb_fd = -1;
303 static int hf_openflow_v4_portmod_advertise_1tb_fd = -1;
304 static int hf_openflow_v4_portmod_advertise_other = -1;
305 static int hf_openflow_v4_portmod_advertise_copper = -1;
306 static int hf_openflow_v4_portmod_advertise_fiber = -1;
307 static int hf_openflow_v4_portmod_advertise_autoneg = -1;
308 static int hf_openflow_v4_portmod_advertise_pause = -1;
309 static int hf_openflow_v4_portmod_advertise_pause_asym = -1;
310 static int hf_openflow_v4_portmod_pad3 = -1;
311 static int hf_openflow_v4_tablemod_table_id = -1;
312 static int hf_openflow_v4_tablemod_pad = -1;
313 static int hf_openflow_v4_tablemod_config = -1;
314 static int hf_openflow_v4_flow_stats_request_table_id = -1;
315 static int hf_openflow_v4_flow_stats_request_pad = -1;
316 static int hf_openflow_v4_flow_stats_request_out_port = -1;
317 static int hf_openflow_v4_flow_stats_request_out_group = -1;
318 static int hf_openflow_v4_flow_stats_request_pad2 = -1;
319 static int hf_openflow_v4_flow_stats_request_cookie = -1;
320 static int hf_openflow_v4_flow_stats_request_cookie_mask = -1;
321 static int hf_openflow_v4_aggregate_stats_request_table_id = -1;
322 static int hf_openflow_v4_aggregate_stats_request_pad = -1;
323 static int hf_openflow_v4_aggregate_stats_request_out_port = -1;
324 static int hf_openflow_v4_aggregate_stats_request_out_group = -1;
325 static int hf_openflow_v4_aggregate_stats_request_pad2 = -1;
326 static int hf_openflow_v4_aggregate_stats_request_cookie = -1;
327 static int hf_openflow_v4_aggregate_stats_request_cookie_mask = -1;
328 static int hf_openflow_v4_table_feature_prop_type = -1;
329 static int hf_openflow_v4_table_feature_prop_length = -1;
330 static int hf_openflow_v4_table_feature_prop_next_tables_next_table_id = -1;
331 static int hf_openflow_v4_table_feature_prop_experimenter_experimenter = -1;
332 static int hf_openflow_v4_table_feature_prop_experimenter_exp_type = -1;
333 static int hf_openflow_v4_table_feature_prop_pad = -1;
334 static int hf_openflow_v4_table_features_length = -1;
335 static int hf_openflow_v4_table_features_table_id = -1;
336 static int hf_openflow_v4_table_features_pad = -1;
337 static int hf_openflow_v4_table_features_name = -1;
338 static int hf_openflow_v4_table_features_metadata_match = -1;
339 static int hf_openflow_v4_table_features_metadata_write = -1;
340 static int hf_openflow_v4_table_features_config = -1;
341 static int hf_openflow_v4_table_features_max_entries = -1;
342 static int hf_openflow_v4_port_stats_request_port_no = -1;
343 static int hf_openflow_v4_port_stats_request_pad = -1;
344 static int hf_openflow_v4_queue_stats_request_port_no = -1;
345 static int hf_openflow_v4_queue_stats_request_queue_id = -1;
346 static int hf_openflow_v4_group_stats_request_group_id = -1;
347 static int hf_openflow_v4_group_stats_request_pad = -1;
348 static int hf_openflow_v4_meter_stats_request_meter_id = -1;
349 static int hf_openflow_v4_meter_stats_request_pad = -1;
350 static int hf_openflow_v4_meter_config_request_meter_id = -1;
351 static int hf_openflow_v4_meter_config_request_pad = -1;
352 static int hf_openflow_v4_multipart_request_type = -1;
353 static int hf_openflow_v4_multipart_request_flags = -1;
354 static int hf_openflow_v4_multipart_request_flags_more = -1;
355 static int hf_openflow_v4_multipart_request_pad = -1;
356 static int hf_openflow_v4_multipart_request_experimenter_experimenter = -1;
357 static int hf_openflow_v4_multipart_request_experimenter_exp_type = -1;
358 static int hf_openflow_v4_switch_description_mfr_desc = -1;
359 static int hf_openflow_v4_switch_description_hw_desc = -1;
360 static int hf_openflow_v4_switch_description_sw_desc = -1;
361 static int hf_openflow_v4_switch_description_serial_num = -1;
362 static int hf_openflow_v4_switch_description_dp_desc = -1;
363 static int hf_openflow_v4_flow_stats_length = -1;
364 static int hf_openflow_v4_flow_stats_table_id = -1;
365 static int hf_openflow_v4_flow_stats_pad = -1;
366 static int hf_openflow_v4_flow_stats_duration_sec = -1;
367 static int hf_openflow_v4_flow_stats_duration_nsec = -1;
368 static int hf_openflow_v4_flow_stats_priority = -1;
369 static int hf_openflow_v4_flow_stats_idle_timeout = -1;
370 static int hf_openflow_v4_flow_stats_hard_timeout = -1;
371 static int hf_openflow_v4_flow_stats_flags = -1;
372 static int hf_openflow_v4_flow_stats_flags_send_flow_rem = -1;
373 static int hf_openflow_v4_flow_stats_flags_check_overlap = -1;
374 static int hf_openflow_v4_flow_stats_flags_reset_counts = -1;
375 static int hf_openflow_v4_flow_stats_flags_no_packet_counts = -1;
376 static int hf_openflow_v4_flow_stats_flags_no_byte_counts = -1;
377 static int hf_openflow_v4_flow_stats_pad2 = -1;
378 static int hf_openflow_v4_flow_stats_cookie = -1;
379 static int hf_openflow_v4_flow_stats_packet_count = -1;
380 static int hf_openflow_v4_flow_stats_byte_count = -1;
381 static int hf_openflow_v4_aggregate_stats_packet_count = -1;
382 static int hf_openflow_v4_aggregate_stats_byte_count = -1;
383 static int hf_openflow_v4_aggregate_stats_flow_count = -1;
384 static int hf_openflow_v4_aggregate_stats_pad = -1;
385 static int hf_openflow_v4_table_stats_table_id = -1;
386 static int hf_openflow_v4_table_stats_pad = -1;
387 static int hf_openflow_v4_table_stats_active_count = -1;
388 static int hf_openflow_v4_table_stats_lookup_count = -1;
389 static int hf_openflow_v4_table_stats_match_count = -1;
390 static int hf_openflow_v4_port_stats_port_no = -1;
391 static int hf_openflow_v4_port_stats_pad = -1;
392 static int hf_openflow_v4_port_stats_rx_packets = -1;
393 static int hf_openflow_v4_port_stats_tx_packets = -1;
394 static int hf_openflow_v4_port_stats_rx_bytes = -1;
395 static int hf_openflow_v4_port_stats_tx_bytes = -1;
396 static int hf_openflow_v4_port_stats_rx_dropped = -1;
397 static int hf_openflow_v4_port_stats_tx_dropped = -1;
398 static int hf_openflow_v4_port_stats_rx_errors = -1;
399 static int hf_openflow_v4_port_stats_tx_errors = -1;
400 static int hf_openflow_v4_port_stats_rx_frame_error = -1;
401 static int hf_openflow_v4_port_stats_rx_over_error = -1;
402 static int hf_openflow_v4_port_stats_rx_crc_error = -1;
403 static int hf_openflow_v4_port_stats_collisions = -1;
404 static int hf_openflow_v4_port_stats_duration_sec = -1;
405 static int hf_openflow_v4_port_stats_duration_nsec = -1;
406 static int hf_openflow_v4_queue_stats_port_no = -1;
407 static int hf_openflow_v4_queue_stats_queue_id = -1;
408 static int hf_openflow_v4_queue_stats_tx_bytes = -1;
409 static int hf_openflow_v4_queue_stats_tx_packets = -1;
410 static int hf_openflow_v4_queue_stats_tx_errors = -1;
411 static int hf_openflow_v4_queue_stats_duration_sec = -1;
412 static int hf_openflow_v4_queue_stats_duration_nsec = -1;
413 static int hf_openflow_v4_bucket_counter_packet_count = -1;
414 static int hf_openflow_v4_bucket_counter_byte_count = -1;
415 static int hf_openflow_v4_group_stats_length = -1;
416 static int hf_openflow_v4_group_stats_pad = -1;
417 static int hf_openflow_v4_group_stats_group_id = -1;
418 static int hf_openflow_v4_group_stats_ref_count = -1;
419 static int hf_openflow_v4_group_stats_pad2 = -1;
420 static int hf_openflow_v4_group_stats_packet_count = -1;
421 static int hf_openflow_v4_group_stats_byte_count = -1;
422 static int hf_openflow_v4_group_desc_length = -1;
423 static int hf_openflow_v4_group_desc_type = -1;
424 static int hf_openflow_v4_group_desc_pad = -1;
425 static int hf_openflow_v4_group_desc_group_id = -1;
426 static int hf_openflow_v4_group_features_types = -1;
427 static int hf_openflow_v4_group_features_types_all = -1;
428 static int hf_openflow_v4_group_features_types_select = -1;
429 static int hf_openflow_v4_group_features_types_indirect = -1;
430 static int hf_openflow_v4_group_features_types_ff = -1;
431 static int hf_openflow_v4_group_features_capabilities = -1;
432 static int hf_openflow_v4_group_features_capabilities_select_weight = -1;
433 static int hf_openflow_v4_group_features_capabilities_select_liveness = -1;
434 static int hf_openflow_v4_group_features_capabilities_chaining = -1;
435 static int hf_openflow_v4_group_features_capabilities_chaining_checks = -1;
436 static int hf_openflow_v4_group_features_max_groups_all = -1;
437 static int hf_openflow_v4_group_features_max_groups_select = -1;
438 static int hf_openflow_v4_group_features_max_groups_indirect = -1;
439 static int hf_openflow_v4_group_features_max_groups_ff = -1;
440 static int hf_openflow_v4_group_features_actions_all = -1;
441 static int hf_openflow_v4_group_features_actions_all_output = -1;
442 static int hf_openflow_v4_group_features_actions_all_copy_ttl_out = -1;
443 static int hf_openflow_v4_group_features_actions_all_copy_ttl_in = -1;
444 static int hf_openflow_v4_group_features_actions_all_set_mpls_ttl = -1;
445 static int hf_openflow_v4_group_features_actions_all_dec_mpls_ttl = -1;
446 static int hf_openflow_v4_group_features_actions_all_push_vlan = -1;
447 static int hf_openflow_v4_group_features_actions_all_pop_vlan = -1;
448 static int hf_openflow_v4_group_features_actions_all_push_mpls = -1;
449 static int hf_openflow_v4_group_features_actions_all_pop_mpls = -1;
450 static int hf_openflow_v4_group_features_actions_all_set_queue = -1;
451 static int hf_openflow_v4_group_features_actions_all_group = -1;
452 static int hf_openflow_v4_group_features_actions_all_set_nw_ttl = -1;
453 static int hf_openflow_v4_group_features_actions_all_dec_nw_ttl = -1;
454 static int hf_openflow_v4_group_features_actions_all_set_field = -1;
455 static int hf_openflow_v4_group_features_actions_all_push_pbb = -1;
456 static int hf_openflow_v4_group_features_actions_all_pop_pbb = -1;
457 static int hf_openflow_v4_group_features_actions_select = -1;
458 static int hf_openflow_v4_group_features_actions_select_output = -1;
459 static int hf_openflow_v4_group_features_actions_select_copy_ttl_out = -1;
460 static int hf_openflow_v4_group_features_actions_select_copy_ttl_in = -1;
461 static int hf_openflow_v4_group_features_actions_select_set_mpls_ttl = -1;
462 static int hf_openflow_v4_group_features_actions_select_dec_mpls_ttl = -1;
463 static int hf_openflow_v4_group_features_actions_select_push_vlan = -1;
464 static int hf_openflow_v4_group_features_actions_select_pop_vlan = -1;
465 static int hf_openflow_v4_group_features_actions_select_push_mpls = -1;
466 static int hf_openflow_v4_group_features_actions_select_pop_mpls = -1;
467 static int hf_openflow_v4_group_features_actions_select_set_queue = -1;
468 static int hf_openflow_v4_group_features_actions_select_group = -1;
469 static int hf_openflow_v4_group_features_actions_select_set_nw_ttl = -1;
470 static int hf_openflow_v4_group_features_actions_select_dec_nw_ttl = -1;
471 static int hf_openflow_v4_group_features_actions_select_set_field = -1;
472 static int hf_openflow_v4_group_features_actions_select_push_pbb = -1;
473 static int hf_openflow_v4_group_features_actions_select_pop_pbb = -1;
474 static int hf_openflow_v4_group_features_actions_indirect = -1;
475 static int hf_openflow_v4_group_features_actions_indirect_output = -1;
476 static int hf_openflow_v4_group_features_actions_indirect_copy_ttl_out = -1;
477 static int hf_openflow_v4_group_features_actions_indirect_copy_ttl_in = -1;
478 static int hf_openflow_v4_group_features_actions_indirect_set_mpls_ttl = -1;
479 static int hf_openflow_v4_group_features_actions_indirect_dec_mpls_ttl = -1;
480 static int hf_openflow_v4_group_features_actions_indirect_push_vlan = -1;
481 static int hf_openflow_v4_group_features_actions_indirect_pop_vlan = -1;
482 static int hf_openflow_v4_group_features_actions_indirect_push_mpls = -1;
483 static int hf_openflow_v4_group_features_actions_indirect_pop_mpls = -1;
484 static int hf_openflow_v4_group_features_actions_indirect_set_queue = -1;
485 static int hf_openflow_v4_group_features_actions_indirect_group = -1;
486 static int hf_openflow_v4_group_features_actions_indirect_set_nw_ttl = -1;
487 static int hf_openflow_v4_group_features_actions_indirect_dec_nw_ttl = -1;
488 static int hf_openflow_v4_group_features_actions_indirect_set_field = -1;
489 static int hf_openflow_v4_group_features_actions_indirect_push_pbb = -1;
490 static int hf_openflow_v4_group_features_actions_indirect_pop_pbb = -1;
491 static int hf_openflow_v4_group_features_actions_ff = -1;
492 static int hf_openflow_v4_group_features_actions_ff_output = -1;
493 static int hf_openflow_v4_group_features_actions_ff_copy_ttl_out = -1;
494 static int hf_openflow_v4_group_features_actions_ff_copy_ttl_in = -1;
495 static int hf_openflow_v4_group_features_actions_ff_set_mpls_ttl = -1;
496 static int hf_openflow_v4_group_features_actions_ff_dec_mpls_ttl = -1;
497 static int hf_openflow_v4_group_features_actions_ff_push_vlan = -1;
498 static int hf_openflow_v4_group_features_actions_ff_pop_vlan = -1;
499 static int hf_openflow_v4_group_features_actions_ff_push_mpls = -1;
500 static int hf_openflow_v4_group_features_actions_ff_pop_mpls = -1;
501 static int hf_openflow_v4_group_features_actions_ff_set_queue = -1;
502 static int hf_openflow_v4_group_features_actions_ff_group = -1;
503 static int hf_openflow_v4_group_features_actions_ff_set_nw_ttl = -1;
504 static int hf_openflow_v4_group_features_actions_ff_dec_nw_ttl = -1;
505 static int hf_openflow_v4_group_features_actions_ff_set_field = -1;
506 static int hf_openflow_v4_group_features_actions_ff_push_pbb = -1;
507 static int hf_openflow_v4_group_features_actions_ff_pop_pbb = -1;
508 static int hf_openflow_v4_meter_band_stats_packet_band_count = -1;
509 static int hf_openflow_v4_meter_band_stats_byte_band_count = -1;
510 static int hf_openflow_v4_meter_stats_meter_id = -1;
511 static int hf_openflow_v4_meter_stats_len = -1;
512 static int hf_openflow_v4_meter_stats_pad = -1;
513 static int hf_openflow_v4_meter_stats_flow_count = -1;
514 static int hf_openflow_v4_meter_stats_packet_in_count = -1;
515 static int hf_openflow_v4_meter_stats_byte_in_count = -1;
516 static int hf_openflow_v4_meter_stats_duration_sec = -1;
517 static int hf_openflow_v4_meter_stats_duration_nsec = -1;
518 static int hf_openflow_v4_meter_config_len = -1;
519 static int hf_openflow_v4_meter_config_flags = -1;
520 static int hf_openflow_v4_meter_config_flags_kbps = -1;
521 static int hf_openflow_v4_meter_config_flags_pktps = -1;
522 static int hf_openflow_v4_meter_config_flags_burst = -1;
523 static int hf_openflow_v4_meter_config_flags_stats = -1;
524 static int hf_openflow_v4_meter_config_meter_id = -1;
525 static int hf_openflow_v4_meter_features_max_meter = -1;
526 static int hf_openflow_v4_meter_features_band_types = -1;
527 static int hf_openflow_v4_meter_features_band_types_drop = -1;
528 static int hf_openflow_v4_meter_features_band_types_dscp_remark = -1;
529 static int hf_openflow_v4_meter_features_capabilities = -1;
530 static int hf_openflow_v4_meter_features_capabilities_kbps = -1;
531 static int hf_openflow_v4_meter_features_capabilities_pktps = -1;
532 static int hf_openflow_v4_meter_features_capabilities_burst = -1;
533 static int hf_openflow_v4_meter_features_capabilities_stats = -1;
534 static int hf_openflow_v4_meter_features_max_bands = -1;
535 static int hf_openflow_v4_meter_features_max_color = -1;
536 static int hf_openflow_v4_meter_features_pad = -1;
537 static int hf_openflow_v4_multipart_reply_type = -1;
538 static int hf_openflow_v4_multipart_reply_flags = -1;
539 static int hf_openflow_v4_multipart_reply_flags_more = -1;
540 static int hf_openflow_v4_multipart_reply_pad = -1;
541 static int hf_openflow_v4_multipart_reply_experimenter_experimenter = -1;
542 static int hf_openflow_v4_multipart_reply_experimenter_exp_type = -1;
543 static int hf_openflow_v4_queue_get_config_request_port = -1;
544 static int hf_openflow_v4_queue_get_config_request_pad = -1;
545 static int hf_openflow_v4_queue_prop_property = -1;
546 static int hf_openflow_v4_queue_prop_len = -1;
547 static int hf_openflow_v4_queue_prop_pad = -1;
548 static int hf_openflow_v4_queue_prop_min_rate_rate = -1;
549 static int hf_openflow_v4_queue_prop_min_rate_pad = -1;
550 static int hf_openflow_v4_queue_prop_max_rate_rate = -1;
551 static int hf_openflow_v4_queue_prop_max_rate_pad = -1;
552 static int hf_openflow_v4_queue_prop_experimenter_experimenter = -1;
553 static int hf_openflow_v4_queue_prop_experimenter_pad = -1;
554 static int hf_openflow_v4_packet_queue_queue_id = -1;
555 static int hf_openflow_v4_packet_queue_port = -1;
556 static int hf_openflow_v4_packet_queue_len = -1;
557 static int hf_openflow_v4_packet_queue_pad = -1;
558 static int hf_openflow_v4_queue_get_config_reply_port = -1;
559 static int hf_openflow_v4_queue_get_config_reply_pad = -1;
560 static int hf_openflow_v4_role_request_role = -1;
561 static int hf_openflow_v4_role_request_pad = -1;
562 static int hf_openflow_v4_role_request_generation_id = -1;
563 static int hf_openflow_v4_role_reply_role = -1;
564 static int hf_openflow_v4_role_reply_pad = -1;
565 static int hf_openflow_v4_role_reply_generation_id = -1;
566 static int hf_openflow_v4_async_config_packet_in_mask_master = -1;
567 static int hf_openflow_v4_async_config_packet_in_mask_master_no_match = -1;
568 static int hf_openflow_v4_async_config_packet_in_mask_master_action = -1;
569 static int hf_openflow_v4_async_config_packet_in_mask_master_invalid_ttl = -1;
570 static int hf_openflow_v4_async_config_packet_in_mask_slave = -1;
571 static int hf_openflow_v4_async_config_packet_in_mask_slave_no_match = -1;
572 static int hf_openflow_v4_async_config_packet_in_mask_slave_action = -1;
573 static int hf_openflow_v4_async_config_packet_in_mask_slave_invalid_ttl = -1;
574 static int hf_openflow_v4_async_config_port_status_mask_master = -1;
575 static int hf_openflow_v4_async_config_port_status_mask_master_add = -1;
576 static int hf_openflow_v4_async_config_port_status_mask_master_delete = -1;
577 static int hf_openflow_v4_async_config_port_status_mask_master_modify = -1;
578 static int hf_openflow_v4_async_config_port_status_mask_slave = -1;
579 static int hf_openflow_v4_async_config_port_status_mask_slave_add = -1;
580 static int hf_openflow_v4_async_config_port_status_mask_slave_delete = -1;
581 static int hf_openflow_v4_async_config_port_status_mask_slave_modify = -1;
582 static int hf_openflow_v4_async_config_flow_removed_mask_master = -1;
583 static int hf_openflow_v4_async_config_flow_removed_mask_master_idle_timeout = -1;
584 static int hf_openflow_v4_async_config_flow_removed_mask_master_hard_timeout = -1;
585 static int hf_openflow_v4_async_config_flow_removed_mask_master_delete = -1;
586 static int hf_openflow_v4_async_config_flow_removed_mask_master_group_delete = -1;
587 static int hf_openflow_v4_async_config_flow_removed_mask_slave = -1;
588 static int hf_openflow_v4_async_config_flow_removed_mask_slave_idle_timeout = -1;
589 static int hf_openflow_v4_async_config_flow_removed_mask_slave_hard_timeout = -1;
590 static int hf_openflow_v4_async_config_flow_removed_mask_slave_delete = -1;
591 static int hf_openflow_v4_async_config_flow_removed_mask_slave_group_delete = -1;
592 static int hf_openflow_v4_metermod_command = -1;
593 static int hf_openflow_v4_metermod_flags = -1;
594 static int hf_openflow_v4_metermod_flags_kbps = -1;
595 static int hf_openflow_v4_metermod_flags_pktps = -1;
596 static int hf_openflow_v4_metermod_flags_burst = -1;
597 static int hf_openflow_v4_metermod_flags_stats = -1;
598 static int hf_openflow_v4_metermod_meter_id = -1;
599 
600 static gint ett_openflow_v4 = -1;
601 static gint ett_openflow_v4_flowmod_flags = -1;
602 static gint ett_openflow_v4_bucket = -1;
603 static gint ett_openflow_v4_oxm = -1;
604 static gint ett_openflow_v4_match = -1;
605 static gint ett_openflow_v4_action = -1;
606 static gint ett_openflow_v4_instruction = -1;
607 static gint ett_openflow_v4_port = -1;
608 static gint ett_openflow_v4_port_config = -1;
609 static gint ett_openflow_v4_port_state = -1;
610 static gint ett_openflow_v4_port_current = -1;
611 static gint ett_openflow_v4_port_advertised = -1;
612 static gint ett_openflow_v4_port_supported = -1;
613 static gint ett_openflow_v4_port_peer = -1;
614 static gint ett_openflow_v4_meter_band  = -1;
615 static gint ett_openflow_v4_hello_element = -1;
616 static gint ett_openflow_v4_error_data = -1;
617 static gint ett_openflow_v4_switch_features_capabilities = -1;
618 static gint ett_openflow_v4_switch_config_flags = -1;
619 static gint ett_openflow_v4_packet_in_data = -1;
620 static gint ett_openflow_v4_packet_out_data = -1;
621 static gint ett_openflow_v4_portmod_config = -1;
622 static gint ett_openflow_v4_portmod_mask = -1;
623 static gint ett_openflow_v4_portmod_advertise = -1;
624 static gint ett_openflow_v4_table_features = -1;
625 static gint ett_openflow_v4_table_feature_prop = -1;
626 static gint ett_openflow_v4_table_feature_prop_instruction_id = -1;
627 static gint ett_openflow_v4_table_feature_prop_action_id = -1;
628 static gint ett_openflow_v4_table_feature_prop_oxm_id = -1;
629 static gint ett_openflow_v4_multipart_request_flags = -1;
630 static gint ett_openflow_v4_flow_stats = -1;
631 static gint ett_openflow_v4_flow_stats_flags = -1;
632 static gint ett_openflow_v4_table_stats = -1;
633 static gint ett_openflow_v4_port_stats = -1;
634 static gint ett_openflow_v4_queue_stats = -1;
635 static gint ett_openflow_v4_bucket_counter = -1;
636 static gint ett_openflow_v4_group_stats = -1;
637 static gint ett_openflow_v4_group_desc = -1;
638 static gint ett_openflow_v4_group_features_types = -1;
639 static gint ett_openflow_v4_group_features_capabilities = -1;
640 static gint ett_openflow_v4_group_features_actions_all = -1;
641 static gint ett_openflow_v4_group_features_actions_select = -1;
642 static gint ett_openflow_v4_group_features_actions_indirect = -1;
643 static gint ett_openflow_v4_group_features_actions_ff = -1;
644 static gint ett_openflow_v4_meter_band_stats = -1;
645 static gint ett_openflow_v4_meter_stats = -1;
646 static gint ett_openflow_v4_meter_config = -1;
647 static gint ett_openflow_v4_meter_config_flags = -1;
648 static gint ett_openflow_v4_meter_features_band_types = -1;
649 static gint ett_openflow_v4_meter_features_capabilities = -1;
650 static gint ett_openflow_v4_multipart_reply_flags = -1;
651 static gint ett_openflow_v4_queue_prop = -1;
652 static gint ett_openflow_v4_packet_queue = -1;
653 static gint ett_openflow_v4_async_config_packet_in_mask_master = -1;
654 static gint ett_openflow_v4_async_config_packet_in_mask_slave = -1;
655 static gint ett_openflow_v4_async_config_port_status_mask_master = -1;
656 static gint ett_openflow_v4_async_config_port_status_mask_slave = -1;
657 static gint ett_openflow_v4_async_config_flow_removed_mask_master = -1;
658 static gint ett_openflow_v4_async_config_flow_removed_mask_slave = -1;
659 static gint ett_openflow_v4_metermod_flags = -1;
660 
661 static expert_field ei_openflow_v4_match_undecoded = EI_INIT;
662 static expert_field ei_openflow_v4_oxm_undecoded = EI_INIT;
663 static expert_field ei_openflow_v4_action_undecoded = EI_INIT;
664 static expert_field ei_openflow_v4_instruction_undecoded = EI_INIT;
665 static expert_field ei_openflow_v4_meter_band_undecoded = EI_INIT;
666 static expert_field ei_openflow_v4_hello_element_undecoded = EI_INIT;
667 static expert_field ei_openflow_v4_error_undecoded = EI_INIT;
668 static expert_field ei_openflow_v4_experimenter_undecoded = EI_INIT;
669 static expert_field ei_openflow_v4_table_feature_prop_undecoded = EI_INIT;
670 static expert_field ei_openflow_v4_multipart_request_undecoded = EI_INIT;
671 static expert_field ei_openflow_v4_multipart_reply_undecoded = EI_INIT;
672 static expert_field ei_openflow_v4_queue_prop_undecoded = EI_INIT;
673 static expert_field ei_openflow_v4_message_undecoded = EI_INIT;
674 
675 static const value_string openflow_v4_version_values[] = {
676     { 0x04, "1.3" },
677     { 0, NULL }
678 };
679 
680 #define OFPT_HELLO                      0
681 #define OFPT_ERROR                      1
682 #define OFPT_ECHO_REQUEST               2
683 #define OFPT_ECHO_REPLY                 3
684 #define OFPT_EXPERIMENTER               4
685 #define OFPT_FEATURES_REQUEST           5
686 #define OFPT_FEATURES_REPLY             6
687 #define OFPT_GET_CONFIG_REQUEST         7
688 #define OFPT_GET_CONFIG_REPLY           8
689 #define OFPT_SET_CONFIG                 9
690 #define OFPT_PACKET_IN                 10
691 #define OFPT_FLOW_REMOVED              11
692 #define OFPT_PORT_STATUS               12
693 #define OFPT_PACKET_OUT                13
694 #define OFPT_FLOW_MOD                  14
695 #define OFPT_GROUP_MOD                 15
696 #define OFPT_PORT_MOD                  16
697 #define OFPT_TABLE_MOD                 17
698 #define OFPT_MULTIPART_REQUEST         18
699 #define OFPT_MULTIPART_REPLY           19
700 #define OFPT_BARRIER_REQUEST           20
701 #define OFPT_BARRIER_REPLY             21
702 #define OFPT_QUEUE_GET_CONFIG_REQUEST  22
703 #define OFPT_QUEUE_GET_CONFIG_REPLY    23
704 #define OFPT_ROLE_REQUEST              24
705 #define OFPT_ROLE_REPLY                25
706 #define OFPT_GET_ASYNC_REQUEST         26
707 #define OFPT_GET_ASYNC_REPLY           27
708 #define OFPT_SET_ASYNC                 28
709 #define OFPT_METER_MOD                 29
710 static const value_string openflow_v4_type_values[] = {
711     { OFPT_HELLO,                    "OFPT_HELLO" },
712     { OFPT_ERROR,                    "OFPT_ERROR" },
713     { OFPT_ECHO_REQUEST,             "OFPT_ECHO_REQUEST" },
714     { OFPT_ECHO_REPLY,               "OFPT_ECHO_REPLY" },
715     { OFPT_EXPERIMENTER,             "OFPT_EXPERIMENTER" },
716     { OFPT_FEATURES_REQUEST,         "OFPT_FEATURES_REQUEST" },
717     { OFPT_FEATURES_REPLY,           "OFPT_FEATURES_REPLY" },
718     { OFPT_GET_CONFIG_REQUEST,       "OFPT_GET_CONFIG_REQUEST" },
719     { OFPT_GET_CONFIG_REPLY,         "OFPT_GET_CONFIG_REPLY" },
720     { OFPT_SET_CONFIG,               "OFPT_SET_CONFIG" },
721     { OFPT_PACKET_IN,                "OFPT_PACKET_IN" },
722     { OFPT_FLOW_REMOVED,             "OFPT_FLOW_REMOVED" },
723     { OFPT_PORT_STATUS,              "OFPT_PORT_STATUS" },
724     { OFPT_PACKET_OUT,               "OFPT_PACKET_OUT" },
725     { OFPT_FLOW_MOD,                 "OFPT_FLOW_MOD" },
726     { OFPT_GROUP_MOD,                "OFPT_GROUP_MOD" },
727     { OFPT_PORT_MOD,                 "OFPT_PORT_MOD" },
728     { OFPT_TABLE_MOD,                "OFPT_TABLE_MOD" },
729     { OFPT_MULTIPART_REQUEST,        "OFPT_MULTIPART_REQUEST" },
730     { OFPT_MULTIPART_REPLY,          "OFPT_MULTIPART_REPLY" },
731     { OFPT_BARRIER_REQUEST,          "OFPT_BARRIER_REQUEST" },
732     { OFPT_BARRIER_REPLY,            "OFPT_BARRIER_REPLY" },
733     { OFPT_QUEUE_GET_CONFIG_REQUEST, "OFPT_QUEUE_GET_CONFIG_REQUEST" },
734     { OFPT_QUEUE_GET_CONFIG_REPLY,   "OFPT_QUEUE_GET_CONFIG_REPLY" },
735     { OFPT_ROLE_REQUEST,             "OFPT_ROLE_REQUEST" },
736     { OFPT_ROLE_REPLY,               "OFPT_ROLE_REPLY" },
737     { OFPT_GET_ASYNC_REQUEST,        "OFPT_GET_ASYNC_REQUEST" },
738     { OFPT_GET_ASYNC_REPLY,          "OFPT_GET_ASYNC_REPLY" },
739     { OFPT_SET_ASYNC,                "OFPT_SET_ASYNC" },
740     { OFPT_METER_MOD,                "OFPT_METER_MOD" },
741     { 0,                             NULL }
742 };
743 static value_string_ext openflow_v4_type_values_ext = VALUE_STRING_EXT_INIT(openflow_v4_type_values);
744 
745 static int
dissect_openflow_header_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)746 dissect_openflow_header_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
747 {
748     /* uint8_t version; */
749     proto_tree_add_item(tree, hf_openflow_v4_version, tvb, offset, 1, ENC_BIG_ENDIAN);
750     offset++;
751 
752     /* uint8_t type; */
753     proto_tree_add_item(tree, hf_openflow_v4_type, tvb, offset, 1, ENC_BIG_ENDIAN);
754     offset++;
755 
756     /* uint16_t length; */
757     proto_tree_add_item(tree, hf_openflow_v4_length, tvb, offset, 2, ENC_BIG_ENDIAN);
758     offset+=2;
759 
760     /* uint32_t xid; */
761     proto_tree_add_item(tree, hf_openflow_v4_xid, tvb, offset, 4, ENC_BIG_ENDIAN);
762     offset+=4;
763 
764     return offset;
765 }
766 
767 #define OFPP_MAX   0xffffff00  /* Last usable port number. */
768 static const value_string openflow_v4_port_reserved_values[] = {
769     { 0xfffffff8, "OFPP_IN_PORT" },
770     { 0xfffffff9, "OFPP_TABLE" },
771     { 0xfffffffa, "OFPP_NORMAL" },
772     { 0xfffffffb, "OFPP_FLOOD" },
773     { 0xfffffffc, "OFPP_ALL" },
774     { 0xfffffffd, "OFPP_CONTROLLER" },
775     { 0xfffffffe, "OFPP_LOCAL" },
776     { 0xffffffff, "OFPP_ANY" },
777     { 0,          NULL }
778 };
779 
780 #define OFPG_MAX   0xffffff00  /* Last usable group number. */
781 static const value_string openflow_v4_group_reserved_values[] = {
782     { 0xfffffffc, "OFPG_ALL" },
783     { 0xffffffff, "OFPG_ANY" },
784     { 0,          NULL }
785 };
786 
787 #define OFPTT_MAX  254    /* Last usable table number. */
788 static const value_string openflow_v4_table_reserved_values[] = {
789     { 255, "OFPTT_ALL"},
790     { 0,   NULL}
791 };
792 
793 
794 #define OFP_NO_BUFFER  0xffffffff    /* No buffering. */
795 static const value_string openflow_v4_buffer_reserved_values[] = {
796     { 0xffffffff, "OFP_NO_BUFFER" },
797     { 0,          NULL}
798 };
799 
800 #define OFPXMC_NXM_0           0x0000  /* Backward compatibility with NXM */
801 #define OFPXMC_NXM_1           0x0001  /* Backward compatibility with NXM */
802 #define OFPXMC_OPENFLOW_BASIC  0x8000  /* Basic class for OpenFlow */
803 #define OFPXMC_EXPERIMENTER    0xFFFF  /* Experimenter class */
804 static const value_string openflow_v4_oxm_class_values[] = {
805     { 0x0000, "OFPXMC_NMX_0" },
806     { 0x0001, "OFPXMC_NXM_1" },
807     { 0x8000, "OFPXMC_OPENFLOW_BASIC" },
808     { 0xFFFF, "OFPXMC_EXPERIMENTER" },
809     { 0,      NULL}
810 };
811 
812 #define OFPXMT_OFB_IN_PORT          0
813 #define OFPXMT_OFB_IN_PHY_PORT      1
814 #define OFPXMT_OFB_METADATA         2
815 #define OFPXMT_OFB_ETH_DST          3
816 #define OFPXMT_OFB_ETH_SRC          4
817 #define OFPXMT_OFB_ETH_TYPE         5
818 #define OFPXMT_OFB_VLAN_VID         6
819 #define OFPXMT_OFB_VLAN_PCP         7
820 #define OFPXMT_OFB_IP_DSCP          8
821 #define OFPXMT_OFB_IP_ECN           9
822 #define OFPXMT_OFB_IP_PROTO        10
823 #define OFPXMT_OFB_IPV4_SRC        11
824 #define OFPXMT_OFB_IPV4_DST        12
825 #define OFPXMT_OFB_TCP_SRC         13
826 #define OFPXMT_OFB_TCP_DST         14
827 #define OFPXMT_OFB_UDP_SRC         15
828 #define OFPXMT_OFB_UDP_DST         16
829 #define OFPXMT_OFB_SCTP_SRC        17
830 #define OFPXMT_OFB_SCTP_DST        18
831 #define OFPXMT_OFB_ICMPV4_TYPE     19
832 #define OFPXMT_OFB_ICMPV4_CODE     20
833 #define OFPXMT_OFB_ARP_OP          21
834 #define OFPXMT_OFB_ARP_SPA         22
835 #define OFPXMT_OFB_ARP_TPA         23
836 #define OFPXMT_OFB_ARP_SHA         24
837 #define OFPXMT_OFB_ARP_THA         25
838 #define OFPXMT_OFB_IPV6_SRC        26
839 #define OFPXMT_OFB_IPV6_DST        27
840 #define OFPXMT_OFB_IPV6_FLABEL     28
841 #define OFPXMT_OFB_ICMPV6_TYPE     29
842 #define OFPXMT_OFB_ICMPV6_CODE     30
843 #define OFPXMT_OFB_IPV6_ND_TARGET  31
844 #define OFPXMT_OFB_IPV6_ND_SLL     32
845 #define OFPXMT_OFB_IPV6_ND_TLL     33
846 #define OFPXMT_OFB_MPLS_LABEL      34
847 #define OFPXMT_OFB_MPLS_TC         35
848 #define OFPXMT_OFP_MPLS_BOS        36
849 #define OFPXMT_OFB_PBB_ISID        37
850 #define OFPXMT_OFB_TUNNEL_ID       38
851 #define OFPXMT_OFB_IPV6_EXTHDR     39
852 static const value_string openflow_v4_oxm_basic_field_values[] = {
853     {  0, "OFPXMT_OFB_IN_PORT" },
854     {  1, "OFPXMT_OFB_IN_PHY_PORT" },
855     {  2, "OFPXMT_OFB_METADATA" },
856     {  3, "OFPXMT_OFB_ETH_DST" },
857     {  4, "OFPXMT_OFB_ETH_SRC" },
858     {  5, "OFPXMT_OFB_ETH_TYPE" },
859     {  6, "OFPXMT_OFB_VLAN_VID" },
860     {  7, "OFPXMT_OFB_VLAN_PCP" },
861     {  8, "OFPXMT_OFB_IP_DSCP" },
862     {  9, "OFPXMT_OFB_IP_ECN" },
863     { 10, "OFPXMT_OFB_IP_PROTO" },
864     { 11, "OFPXMT_OFB_IPV4_SRC" },
865     { 12, "OFPXMT_OFB_IPV4_DST" },
866     { 13, "OFPXMT_OFB_TCP_SRC" },
867     { 14, "OFPXMT_OFB_TCP_DST" },
868     { 15, "OFPXMT_OFB_UDP_SRC" },
869     { 16, "OFPXMT_OFB_UDP_DST" },
870     { 17, "OFPXMT_OFB_SCTP_SRC" },
871     { 18, "OFPXMT_OFB_SCTP_DST" },
872     { 19, "OFPXMT_OFB_ICMPV4_TYPE" },
873     { 20, "OFPXMT_OFB_ICMPV4_CODE" },
874     { 21, "OFPXMT_OFB_ARP_OP" },
875     { 22, "OFPXMT_OFB_ARP_SPA" },
876     { 23, "OFPXMT_OFB_ARP_TPA" },
877     { 24, "OFPXMT_OFB_ARP_SHA" },
878     { 25, "OFPXMT_OFB_ARP_THA" },
879     { 26, "OFPXMT_OFB_IPV6_SRC" },
880     { 27, "OFPXMT_OFB_IPV6_DST" },
881     { 28, "OFPXMT_OFB_IPV6_FLABEL" },
882     { 29, "OFPXMT_OFB_ICMPV6_TYPE" },
883     { 30, "OFPXMT_OFB_ICMPV6_CODE" },
884     { 31, "OFPXMT_OFB_IPV6_ND_TARGET" },
885     { 32, "OFPXMT_OFB_IPV6_ND_SLL" },
886     { 33, "OFPXMT_OFB_IPV6_ND_TLL" },
887     { 34, "OFPXMT_OFB_MPLS_LABEL" },
888     { 35, "OFPXMT_OFB_MPLS_TC" },
889     { 36, "OFPXMT_OFP_MPLS_BOS" },
890     { 37, "OFPXMT_OFB_PBB_ISID" },
891     { 38, "OFPXMT_OFB_TUNNEL_ID" },
892     { 39, "OFPXMT_OFB_IPV6_EXTHDR" },
893     {  0, NULL }
894 };
895 static value_string_ext openflow_v4_oxm_basic_field_values_ext = VALUE_STRING_EXT_INIT(openflow_v4_oxm_basic_field_values);
896 
897 #define OXM_FIELD_MASK   0xfe
898 #define OXM_FIELD_OFFSET 1
899 #define OXM_HM_MASK      0x01
900 static int
dissect_openflow_oxm_header_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)901 dissect_openflow_oxm_header_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
902 {
903     guint16 oxm_class;
904 
905     /* oxm_class */
906     oxm_class = tvb_get_ntohs(tvb, offset);
907     proto_tree_add_item(tree, hf_openflow_v4_oxm_class, tvb, offset, 2, ENC_BIG_ENDIAN);
908     offset+=2;
909 
910     /* oxm_field */
911     if (oxm_class == OFPXMC_OPENFLOW_BASIC) {
912         proto_tree_add_bits_item(tree, hf_openflow_v4_oxm_field_basic, tvb, (offset * 8), 7, ENC_NA);
913     } else {
914         proto_tree_add_bits_item(tree, hf_openflow_v4_oxm_field, tvb, (offset * 8), 7, ENC_NA);
915     }
916 
917     /* oxm_hm */
918     proto_tree_add_bits_item(tree, hf_openflow_v4_oxm_hm, tvb, (offset * 8) + 7, 1, ENC_NA);
919     offset+=1;
920 
921     /* oxm_length */
922     proto_tree_add_item(tree, hf_openflow_v4_oxm_length, tvb, offset, 1, ENC_BIG_ENDIAN);
923     offset+=1;
924 
925     return offset;
926 }
927 
928 
929 #define OFPVID_PRESENT  0x1000
930 static int
dissect_openflow_oxm_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)931 dissect_openflow_oxm_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
932 {
933     proto_tree *oxm_tree;
934     guint16 oxm_class;
935     guint16 oxm_end;
936     guint8  oxm_field_hm;
937     guint8  oxm_hm;
938     guint8  oxm_field;
939     guint8  oxm_length;
940     guint8  field_length;
941 
942     oxm_class = tvb_get_ntohs(tvb, offset);
943     oxm_field_hm = tvb_get_guint8(tvb, offset + 2);
944     oxm_length = tvb_get_guint8(tvb, offset + 3);
945     oxm_end = offset + 4 + oxm_length;
946 
947     oxm_field = (oxm_field_hm & OXM_FIELD_MASK) >> OXM_FIELD_OFFSET;
948     oxm_hm = oxm_field_hm & OXM_HM_MASK;
949     field_length = (oxm_hm == 0) ? oxm_length : (oxm_length / 2);
950 
951     oxm_tree = proto_tree_add_subtree(tree, tvb, offset, oxm_length + 4, ett_openflow_v4_oxm, NULL, "OXM field");
952 
953     offset = dissect_openflow_oxm_header_v4(tvb, pinfo, oxm_tree, offset, length);
954 
955     if (oxm_class == OFPXMC_OPENFLOW_BASIC) {
956         switch(oxm_field) {
957         case OFPXMT_OFB_IN_PORT:
958         case OFPXMT_OFB_IN_PHY_PORT:
959             proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value_uint32, tvb, offset, 4, ENC_BIG_ENDIAN);
960             offset+=4;
961             break;
962 
963         case OFPXMT_OFB_ETH_DST:
964         case OFPXMT_OFB_ETH_SRC:
965         case OFPXMT_OFB_ARP_SHA:
966         case OFPXMT_OFB_ARP_THA:
967         case OFPXMT_OFB_IPV6_ND_SLL: /*The source link-layer address option in an IPv6 Neighbor Discovery message */
968         case OFPXMT_OFB_IPV6_ND_TLL: /*The target link-layer address option in an IPv6 Neighbor Discovery message */
969             proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value_etheraddr, tvb, offset, 6, ENC_NA);
970             offset+=6;
971             if (oxm_hm) {
972                 proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_mask_etheraddr, tvb, offset, 6, ENC_NA);
973                 offset+=6;
974             }
975             break;
976 
977         case OFPXMT_OFB_ETH_TYPE:
978             proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value_ethertype, tvb, offset, 2, ENC_BIG_ENDIAN);
979             offset+=2;
980             break;
981 
982         case OFPXMT_OFB_VLAN_VID:
983             proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value_vlan_present, tvb, offset, 2, ENC_BIG_ENDIAN);
984             proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value_vlan_vid, tvb, offset, 2, ENC_BIG_ENDIAN);
985             offset+=2;
986             if (oxm_hm) {
987                 proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_mask_vlan, tvb, offset, 2, ENC_NA);
988                 offset+=2;
989             }
990             break;
991 
992         case OFPXMT_OFB_IP_PROTO:
993             proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value_ipproto, tvb, offset, 1, ENC_BIG_ENDIAN);
994             offset+=1;
995             break;
996 
997         case OFPXMT_OFB_IPV4_SRC:
998         case OFPXMT_OFB_IPV4_DST:
999         case OFPXMT_OFB_ARP_SPA:
1000         case OFPXMT_OFB_ARP_TPA:
1001             proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value_ipv4addr, tvb, offset, 4, ENC_BIG_ENDIAN);
1002             offset+=4;
1003             if (oxm_hm) {
1004                 proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_mask_ipv4addr, tvb, offset, 4, ENC_BIG_ENDIAN);
1005                 offset+=4;
1006             }
1007             break;
1008 
1009         case OFPXMT_OFB_TCP_SRC:
1010         case OFPXMT_OFB_TCP_DST:
1011         case OFPXMT_OFB_UDP_SRC:
1012         case OFPXMT_OFB_UDP_DST:
1013         case OFPXMT_OFB_SCTP_SRC:
1014         case OFPXMT_OFB_SCTP_DST:
1015             proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value_uint16, tvb, offset, 2, ENC_BIG_ENDIAN);
1016             offset+=2;
1017             break;
1018 
1019         case OFPXMT_OFB_IPV6_SRC:
1020         case OFPXMT_OFB_IPV6_DST:
1021             proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value_ipv6addr, tvb, offset, 16, ENC_NA);
1022             offset+=16;
1023             if (oxm_hm) {
1024                 proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_mask_ipv6addr, tvb, offset, 16, ENC_NA);
1025                 offset+=16;
1026             }
1027             break;
1028 
1029         case OFPXMT_OFB_MPLS_LABEL:
1030             /* size differs in specification and header file */
1031             if (field_length == 3) {
1032                 proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value_uint24, tvb, offset, 3, ENC_BIG_ENDIAN);
1033                 offset+=3;
1034             } else if (field_length == 4) {
1035                 proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value_uint32, tvb, offset, 4, ENC_BIG_ENDIAN);
1036                 offset+=4;
1037             }
1038             break;
1039 
1040         default:
1041             /* value */
1042             if (field_length > 0) {
1043                 proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_value, tvb, offset, field_length, ENC_NA);
1044                 offset += field_length;
1045             }
1046 
1047             /* mask */
1048             if (field_length > 0 && oxm_hm != 0) {
1049                 proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_mask, tvb, offset, field_length, ENC_NA);
1050                 offset += field_length;
1051             }
1052             break;
1053         }
1054 
1055         if(oxm_end > offset){
1056             proto_tree_add_expert_format(oxm_tree, pinfo, &ei_openflow_v4_oxm_undecoded,
1057                                          tvb, offset, oxm_end-offset, "Undecoded Data");
1058             offset = oxm_end;
1059         }
1060 
1061     } else if (oxm_class == OFPXMC_EXPERIMENTER) {
1062         /* uint32_t experimenter; */
1063         proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_experimenter_experimenter, tvb, offset, 4, ENC_BIG_ENDIAN);
1064         offset+=4;
1065         proto_tree_add_item(oxm_tree, hf_openflow_v4_oxm_experimenter_value, tvb, offset, oxm_length - 4, ENC_NA);
1066         offset+=(oxm_length - 4);
1067     } else {
1068         proto_tree_add_expert_format(oxm_tree, pinfo, &ei_openflow_v4_oxm_undecoded,
1069                                      tvb, offset, oxm_length, "Unknown OXM body.");
1070         offset+=oxm_length;
1071     }
1072 
1073     return offset;
1074 }
1075 
1076 #define OFPMT_STANDARD  0  /* Standard Match. Deprecated. */
1077 #define OFPMT_OXM       1  /* OpenFlow Extensible Match */
1078 static const value_string openflow_v4_match_type_values[] = {
1079     { 0, "OFPMT_STANDARD" },
1080     { 1, "OFPMT_OXM" },
1081     { 0, NULL }
1082 };
1083 
1084 static int
dissect_openflow_match_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)1085 dissect_openflow_match_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
1086 {
1087     proto_item *ti;
1088     proto_tree *match_tree;
1089     guint16 match_type;
1090     guint16 match_length;
1091     gint32 fields_end;
1092     guint16 pad_length;
1093 
1094     match_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_openflow_v4_match, &ti, "Match");
1095 
1096     /* uint16_t type; */
1097     match_type = tvb_get_ntohs(tvb, offset);
1098     proto_tree_add_item(match_tree, hf_openflow_v4_match_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1099     offset+=2;
1100 
1101     /* uint16_t length; (excluding padding) */
1102     match_length = tvb_get_ntohs(tvb, offset);
1103     pad_length = (match_length + 7)/8*8 - match_length;
1104     proto_item_set_len(ti, match_length + pad_length);
1105     proto_tree_add_item(match_tree, hf_openflow_v4_match_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1106     offset+=2;
1107 
1108     /* body */
1109     switch (match_type) {
1110     case OFPMT_STANDARD:
1111         proto_tree_add_expert_format(match_tree, pinfo, &ei_openflow_v4_match_undecoded,
1112                                      tvb, offset, match_length - 4, "Standard match body (deprecated).");
1113         if (match_length > 4)
1114             offset+=match_length-4;
1115         break;
1116 
1117     case OFPMT_OXM:
1118         fields_end = offset + match_length - 4;
1119         while(offset < fields_end) {
1120             offset = dissect_openflow_oxm_v4(tvb, pinfo, match_tree, offset, length);
1121         }
1122         break;
1123 
1124     default:
1125         proto_tree_add_expert_format(match_tree, pinfo, &ei_openflow_v4_match_undecoded,
1126                                      tvb, offset, match_length - 4, "Unknown match body.");
1127         if (match_length > 4)
1128             offset+=match_length-4;
1129         break;
1130     }
1131 
1132     /* pad; Exactly ((length + 7)/8*8 - length) (between 0 and 7) bytes of all-zero bytes. */
1133     if (pad_length > 0) {
1134         proto_tree_add_item(match_tree, hf_openflow_v4_match_pad, tvb, offset, pad_length, ENC_NA);
1135         offset+=pad_length;
1136     }
1137 
1138     return offset;
1139 }
1140 
1141 #define OFPM_MAX   0xffffff00  /* Last usable meter number. */
1142 static const value_string openflow_v4_meter_id_reserved_values[] = {
1143     { 0xfffffffd, "OFPM_SLOWPATH" },
1144     { 0xfffffffe, "OFPM_CONTROLLER" },
1145     { 0xffffffff, "OFPM_ALL" },
1146     { 0,          NULL }
1147 };
1148 
1149 #define OFPMBT_DROP          1
1150 #define OFPMBT_DSCP_REMARK   2
1151 #define OFPMBT_EXPERIMENTER  0xFFFF
1152 static const value_string openflow_v4_meter_band_type_values[] = {
1153     { OFPMBT_DROP,         "OFPMBT_DROP" },
1154     { OFPMBT_DSCP_REMARK,  "OFPMBT_DSCP_REMARK" },
1155     { OFPMBT_EXPERIMENTER, "OFPMBT_EXPERIMENTER" },
1156     { 0,                   NULL }
1157 };
1158 
1159 #define OFPMF_KBPS   1 << 0
1160 #define OFPMF_PKTPS  1 << 1
1161 #define OFPMF_BURST  1 << 2
1162 #define OFPMF_STATS  1 << 3
1163 
1164 static int
dissect_openflow_meter_band_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)1165 dissect_openflow_meter_band_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
1166 {
1167     proto_item *ti;
1168     proto_tree *band_tree;
1169     guint16 band_type;
1170     guint16 band_len;
1171 
1172     band_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_openflow_v4_meter_band, &ti, "Meter band");
1173 
1174     /* uint16_t type; */
1175     band_type = tvb_get_ntohs(tvb, offset);
1176     proto_tree_add_item(band_tree, hf_openflow_v4_meter_band_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1177     offset+=2;
1178 
1179     /* uint16_t len; */
1180     band_len = tvb_get_ntohs(tvb, offset);
1181     proto_item_set_len(ti, band_len);
1182     proto_tree_add_item(band_tree, hf_openflow_v4_meter_band_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1183     offset+=2;
1184 
1185     /* uint32_t rate; */
1186     proto_tree_add_item(band_tree, hf_openflow_v4_meter_band_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
1187     offset+=4;
1188 
1189     /* uint32_t burst_size; */
1190     proto_tree_add_item(band_tree, hf_openflow_v4_meter_band_burst_size, tvb, offset, 4, ENC_BIG_ENDIAN);
1191     offset+=4;
1192 
1193     switch (band_type) {
1194     case OFPMBT_DROP:
1195         /* uint8_t pad[4]; */
1196         proto_tree_add_item(band_tree, hf_openflow_v4_meter_band_drop_pad, tvb, offset, 4, ENC_NA);
1197         offset+=4;
1198         break;
1199 
1200     case OFPMBT_DSCP_REMARK:
1201         /* uint8_t prec_level; */
1202         proto_tree_add_item(band_tree, hf_openflow_v4_meter_band_dscp_remark_prec_level, tvb, offset, 1, ENC_BIG_ENDIAN);
1203         offset+=1;
1204 
1205         /* uint8_t pad[3]; */
1206         proto_tree_add_item(band_tree, hf_openflow_v4_meter_band_dscp_remark_pad, tvb, offset, 3, ENC_NA);
1207         offset+=3;
1208         break;
1209 
1210     case OFPMBT_EXPERIMENTER:
1211         /* uint32_t experimenter; */
1212         proto_tree_add_item(band_tree, hf_openflow_v4_meter_band_experimenter_experimenter, tvb, offset, 4, ENC_BIG_ENDIAN);
1213         offset+=4;
1214 
1215         /* uint32_t experimenter_data[0]; */
1216         proto_tree_add_expert_format(band_tree, pinfo, &ei_openflow_v4_meter_band_undecoded,
1217                                      tvb, offset, offset - 16 + band_len, "Experimenter meter band body.");
1218         if (band_len > 16)
1219             offset+=band_len-16;
1220         break;
1221 
1222     default:
1223         proto_tree_add_expert_format(band_tree, pinfo, &ei_openflow_v4_meter_band_undecoded,
1224                                      tvb, offset, offset - 12 + band_len, "Unknown meter band body.");
1225         if (band_len > 12)
1226             offset+=band_len-12;
1227         break;
1228     }
1229 
1230     return offset;
1231 }
1232 
1233 
1234 #define OFPHET_VERSIONBITMAP  1
1235 static const value_string openflow_v4_hello_element_type_values[] = {
1236     { 1, "OFPHET_VERSIONBITMAP" },
1237     { 0, NULL }
1238 };
1239 
1240 static int
dissect_openflow_hello_element_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)1241 dissect_openflow_hello_element_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
1242 {
1243     proto_tree *elem_tree;
1244     guint16 elem_type;
1245     guint16 elem_length;
1246     guint16 pad_length;
1247 
1248     elem_tree = proto_tree_add_subtree(tree, tvb, offset, length - offset, ett_openflow_v4_hello_element, NULL, "Element");
1249 
1250     /* uint16_t type; */
1251     elem_type = tvb_get_ntohs(tvb, offset);
1252     proto_tree_add_item(elem_tree, hf_openflow_v4_hello_element_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1253     offset+=2;
1254 
1255     /* uint16_t length; */
1256     elem_length = tvb_get_ntohs(tvb, offset);
1257     pad_length = (elem_length + 7)/8*8 - elem_length;
1258     proto_tree_add_item(elem_tree, hf_openflow_v4_hello_element_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1259     offset+=2;
1260 
1261     switch (elem_type) {
1262     case OFPHET_VERSIONBITMAP:
1263         /* bitmap */
1264         proto_tree_add_item(elem_tree, hf_openflow_v4_hello_element_version_bitmap, tvb, offset, elem_length - 4, ENC_NA);
1265         if (elem_length > 4)
1266             offset += elem_length - 4;
1267         break;
1268 
1269     default:
1270         proto_tree_add_expert_format(tree, pinfo, &ei_openflow_v4_hello_element_undecoded,
1271                                      tvb, offset, elem_length - 4, "Unknown hello element body.");
1272         if (elem_length > 4)
1273             offset += elem_length - 4;
1274         break;
1275     }
1276 
1277     if (pad_length > 0) {
1278         proto_tree_add_item(tree, hf_openflow_v4_hello_element_pad, tvb, offset, pad_length, ENC_NA);
1279         offset+=pad_length;
1280     }
1281 
1282     return offset;
1283 }
1284 
1285 static void
dissect_openflow_hello_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)1286 dissect_openflow_hello_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
1287 {
1288 
1289     while (offset < length) {
1290         offset = dissect_openflow_hello_element_v4(tvb, pinfo, tree, offset, length);
1291     }
1292 }
1293 
1294 
1295 #define OFPET_HELLO_FAILED            0
1296 #define OFPET_BAD_REQUEST             1
1297 #define OFPET_BAD_ACTION              2
1298 #define OFPET_BAD_INSTRUCTION         3
1299 #define OFPET_BAD_MATCH               4
1300 #define OFPET_FLOW_MOD_FAILED         5
1301 #define OFPET_GROUP_MOD_FAILED        6
1302 #define OFPET_PORT_MOD_FAILED         7
1303 #define OFPET_TABLE_MOD_FAILED        8
1304 #define OFPET_QUEUE_OP_FAILED         9
1305 #define OFPET_SWITCH_CONFIG_FAILED   10
1306 #define OFPET_ROLE_REQUEST_FAILED    11
1307 #define OFPET_METER_MOD_FAILED       12
1308 #define OFPET_TABLE_FEATURES_FAILED  13
1309 #define OFPET_EXPERIMENTER           0xffff
1310 static const value_string openflow_v4_error_type_values[] = {
1311     {      0, "OFPET_HELLO_FAILED" },
1312     {      1, "OFPET_BAD_REQUEST" },
1313     {      2, "OFPET_BAD_ACTION" },
1314     {      3, "OFPET_BAD_INSTRUCTION" },
1315     {      4, "OFPET_BAD_MATCH" },
1316     {      5, "OFPET_FLOW_MOD_FAILED" },
1317     {      6, "OFPET_GROUP_MOD_FAILED" },
1318     {      7, "OFPET_PORT_MOD_FAILED" },
1319     {      8, "OFPET_TABLE_MOD_FAILED" },
1320     {      9, "OFPET_QUEUE_OP_FAILED" },
1321     {     10, "OFPET_SWITCH_CONFIG_FAILED" },
1322     {     11, "OFPET_ROLE_REQUEST_FAILED" },
1323     {     12, "OFPET_METER_MOD_FAILED" },
1324     {     13, "OFPET_TABLE_FEATURES_FAILED" },
1325     { 0xffff, "OFPET_EXPERIMENTER" },
1326     {      0, NULL}
1327 };
1328 
1329 static const value_string openflow_v4_error_hello_failed_code_values[] = {
1330     { 0, "OFPHFC_INCOMPATIBLE" },
1331     { 1, "OFPHFC_EPERM" },
1332     { 0, NULL }
1333 };
1334 
1335 static const value_string openflow_v4_error_bad_request_code_values[] =  {
1336     {  0, "OFPBRC_BAD_VERSION" },
1337     {  1, "OFPBRC_BAD_TYPE" },
1338     {  2, "OFPBRC_BAD_MULTIPART" },
1339     {  3, "OFPBRC_BAD_EXPERIMENTER" },
1340     {  4, "OFPBRC_BAD_EXP_TYPE" },
1341     {  5, "OFPBRC_EPERM" },
1342     {  6, "OFPBRC_BAD_LEN" },
1343     {  7, "OFPBRC_BUFFER_EMPTY" },
1344     {  8, "OFPBRC_BUFFER_UNKNOWN" },
1345     {  9, "OFPBRC_BAD_TABLE_ID" },
1346     { 10, "OFPBRC_IS_SLAVE" },
1347     { 11, "OFPBRC_BAD_PORT" },
1348     { 12, "OFPBRC_BAD_PACKET" },
1349     { 13, "OFPBRC_MULTIPART_BUFFER_OVERFLOW" },
1350     {  0, NULL }
1351 };
1352 
1353 static const value_string openflow_v4_error_bad_action_code_values[] =  {
1354     {  0, "OFPBAC_BAD_TYPE" },
1355     {  1, "OFPBAC_BAD_LEN" },
1356     {  2, "OFPBAC_BAD_EXPERIMENTER" },
1357     {  3, "OFPBAC_BAD_EXP_TYPE" },
1358     {  4, "OFPBAC_BAD_OUT_PORT" },
1359     {  5, "OFPBAC_BAD_ARGUMENT" },
1360     {  6, "OFPBAC_EPERM" },
1361     {  7, "OFPBAC_TOO_MANY" },
1362     {  8, "OFPBAC_BAD_QUEUE" },
1363     {  9, "OFPBAC_BAD_OUT_GROUP" },
1364     { 10, "OFPBAC_MATCH_INCONSISTENT" },
1365     { 11, "OFPBAC_UNSUPPORTED_ORDER" },
1366     { 12, "OFPBAC_BAD_TAG" },
1367     { 13, "OFPBAC_BAD_SET_TYPE" },
1368     { 14, "OFPBAC_BAD_SET_LEN" },
1369     { 15, "OFPBAC_BAD_SET_ARGUMENT" },
1370     {  0, NULL }
1371 };
1372 
1373 static const value_string openflow_v4_error_bad_instruction_code_values[] =  {
1374     { 0, "OFPBIC_UNKNOWN_INST" },
1375     { 1, "OFPBIC_UNSUP_INST" },
1376     { 2, "OFPBIC_BAD_TABLE_ID" },
1377     { 3, "OFPBIC_UNSUP_METADATA" },
1378     { 4, "OFPBIC_UNSUP_METADATA_MASK" },
1379     { 5, "OFPBIC_BAD_EXPERIMENTER" },
1380     { 6, "OFPBIC_BAD_EXP_TYPE" },
1381     { 7, "OFPBIC_BAD_LEN" },
1382     { 8, "OFPBIC_EPERM" },
1383     { 0, NULL }
1384 };
1385 
1386 static const value_string openflow_v4_error_bad_match_code_values[] =  {
1387     {  0, "OFPBMC_BAD_TYPE" },
1388     {  1, "OFPBMC_BAD_LEN" },
1389     {  2, "OFPBMC_BAD_TAG" },
1390     {  3, "OFPBMC_BAD_DL_ADDR_MASK" },
1391     {  4, "OFPBMC_BAD_NW_ADDR_MASK" },
1392     {  5, "OFPBMC_BAD_WILDCARDS" },
1393     {  6, "OFPBMC_BAD_FIELD" },
1394     {  7, "OFPBMC_BAD_VALUE" },
1395     {  8, "OFPBMC_BAD_MASK" },
1396     {  9, "OFPBMC_BAD_PREREQ" },
1397     { 10, "OFPBMC_DUP_FIELD" },
1398     { 11, "OFPBMC_EPERM" },
1399     {  0, NULL }
1400 };
1401 
1402 static const value_string openflow_v4_error_flow_mod_failed_code_values[] =  {
1403     { 0, "OFPFMFC_UNKNOWN" },
1404     { 1, "OFPFMFC_TABLE_FULL" },
1405     { 2, "OFPFMFC_BAD_TABLE_ID" },
1406     { 3, "OFPFMFC_OVERLAP" },
1407     { 4, "OFPFMFC_EPERM" },
1408     { 5, "OFPFMFC_BAD_TIMEOUT" },
1409     { 6, "OFPFMFC_BAD_COMMAND" },
1410     { 7, "OFPFMFC_BAD_FLAGS" },
1411     { 0, NULL }
1412 };
1413 
1414 static const value_string openflow_v4_error_group_mod_failed_code_values[] =  {
1415     {  0, "OFPGMFC_GROUP_EXISTS" },
1416     {  1, "OFPGMFC_INVALID_GROUP" },
1417     {  2, "OFPGMFC_WEIGHT_UNSUPPORTED" },
1418     {  3, "OFPGMFC_OUT_OF_GROUPS" },
1419     {  4, "OFPGMFC_OUT_OF_BUCKETS" },
1420     {  5, "OFPGMFC_CHAINING_UNSUPPORTED" },
1421     {  6, "OFPGMFC_WATCH_UNSUPPORTED" },
1422     {  7, "OFPGMFC_LOOP" },
1423     {  8, "OFPGMFC_UNKNOWN_GROUP" },
1424     {  9, "OFPGMFC_CHAINED_GROUP" },
1425     { 10, "OFPGMFC_BAD_TYPE" },
1426     { 11, "OFPGMFC_BAD_COMMAND" },
1427     { 12, "OFPGMFC_BAD_BUCKET" },
1428     { 13, "OFPGMFC_BAD_WATCH" },
1429     { 14, "OFPGMFC_EPERM" },
1430     {  0, NULL }
1431 };
1432 
1433 static const value_string openflow_v4_error_port_mod_failed_code_values[] =  {
1434     { 0, "OFPPMFC_BAD_PORT" },
1435     { 1, "OFPPMFC_BAD_HW_ADDR" },
1436     { 2, "OFPPMFC_BAD_CONFIG" },
1437     { 3, "OFPPMFC_BAD_ADVERTISE" },
1438     { 4, "OFPPMFC_EPERM" },
1439     { 0, NULL }
1440 };
1441 
1442 static const value_string openflow_v4_error_table_mod_failed_code_values[] =  {
1443     { 0, "OFPTMFC_BAD_TABLE" },
1444     { 1, "OFPTMFC_BAD_CONFIG" },
1445     { 2, "OFPTMFC_EPERM" },
1446     { 0, NULL }
1447 };
1448 
1449 static const value_string openflow_v4_error_queue_op_failed_code_values[] =  {
1450     { 0, "OFPQOFC_BAD_PORT" },
1451     { 1, "OFPQOFC_BAD_QUEUE" },
1452     { 2, "OFPQOFC_EPERM" },
1453     { 0, NULL }
1454 };
1455 
1456 static const value_string openflow_v4_error_switch_config_failed_code_values[] =  {
1457     { 0, "OFPSCFC_BAD_FLAGS" },
1458     { 1, "OFPSCFC_BAD_LEN" },
1459     { 2, "OFPQCFC_EPERM" },
1460     { 0, NULL }
1461 };
1462 
1463 static const value_string openflow_v4_error_role_request_failed_code_values[] =  {
1464     { 0, "OFPRRFC_STALE" },
1465     { 1, "OFPRRFC_UNSUP" },
1466     { 2, "OFPRRFC_BAD_ROLE" },
1467     { 0, NULL }
1468 };
1469 
1470 static const value_string openflow_v4_error_meter_mod_failed_code_values[] =  {
1471     {   0, "OFPMMFC_UNKNOWN" },
1472     {   1, "OFPMMFC_METER_EXISTS" },
1473     {   2, "OFPMMFC_INVALID_METER" },
1474     {   3, "OFPMMFC_UNKNOWN_METER" },
1475     {   4, "OFPMMFC_BAD_COMMAND" },
1476     {   5, "OFPMMFC_BAD_FLAGS" },
1477     {   6, "OFPMMFC_BAD_RATE" },
1478     {   7, "OFPMMFC_BAD_BURST" },
1479     {   8, "OFPMMFC_BAD_BAND" },
1480     {   9, "OFPMMFC_BAD_BAND_VALUE" },
1481     {  10, "OFPMMFC_OUT_OF_METERS" },
1482     {  11, "OFPMMFC_OUT_OF_BANDS" },
1483     {  0, NULL }
1484 };
1485 
1486 static const value_string openflow_v4_error_table_features_failed_code_values[] =  {
1487     { 0, "OFPTFFC_BAD_TABLE" },
1488     { 1, "OFPTFFC_BAD_METADATA" },
1489     { 2, "OFPTFFC_BAD_TYPE" },
1490     { 3, "OFPTFFC_BAD_LEN" },
1491     { 4, "OFPTFFC_BAD_ARGUMENT" },
1492     { 5, "OFPTFFC_EPERM" },
1493     { 0, NULL }
1494 };
1495 
1496 static void
dissect_openflow_error_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)1497 dissect_openflow_error_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
1498 {
1499     proto_tree *data_tree;
1500     proto_item *data_ti;
1501     guint16 error_type;
1502 
1503     /* uint16_t type; */
1504     error_type = tvb_get_ntohs(tvb, offset);
1505     proto_tree_add_item(tree, hf_openflow_v4_error_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1506     offset +=2;
1507 
1508     /* uint16_t code; */
1509     switch(error_type) {
1510     case OFPET_HELLO_FAILED:
1511         proto_tree_add_item(tree, hf_openflow_v4_error_hello_failed_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1512         break;
1513     case OFPET_BAD_REQUEST:
1514         proto_tree_add_item(tree, hf_openflow_v4_error_bad_request_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1515         break;
1516     case OFPET_BAD_ACTION:
1517         proto_tree_add_item(tree, hf_openflow_v4_error_bad_action_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1518         break;
1519     case OFPET_BAD_INSTRUCTION:
1520         proto_tree_add_item(tree, hf_openflow_v4_error_bad_instruction_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1521         break;
1522     case OFPET_BAD_MATCH:
1523         proto_tree_add_item(tree, hf_openflow_v4_error_bad_match_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1524         break;
1525     case OFPET_FLOW_MOD_FAILED:
1526         proto_tree_add_item(tree, hf_openflow_v4_error_flow_mod_failed_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1527         break;
1528     case OFPET_GROUP_MOD_FAILED:
1529         proto_tree_add_item(tree, hf_openflow_v4_error_group_mod_failed_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1530         break;
1531     case OFPET_PORT_MOD_FAILED:
1532         proto_tree_add_item(tree, hf_openflow_v4_error_port_mod_failed_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1533         break;
1534     case OFPET_TABLE_MOD_FAILED:
1535         proto_tree_add_item(tree, hf_openflow_v4_error_table_mod_failed_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1536         break;
1537     case OFPET_QUEUE_OP_FAILED:
1538         proto_tree_add_item(tree, hf_openflow_v4_error_queue_op_failed_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1539         break;
1540     case OFPET_SWITCH_CONFIG_FAILED:
1541         proto_tree_add_item(tree, hf_openflow_v4_error_switch_config_failed_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1542         break;
1543     case OFPET_ROLE_REQUEST_FAILED:
1544         proto_tree_add_item(tree, hf_openflow_v4_error_role_request_failed_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1545         break;
1546     case OFPET_METER_MOD_FAILED:
1547         proto_tree_add_item(tree, hf_openflow_v4_error_meter_mod_failed_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1548         break;
1549     case OFPET_TABLE_FEATURES_FAILED:
1550         proto_tree_add_item(tree, hf_openflow_v4_error_table_features_failed_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1551         break;
1552     case OFPET_EXPERIMENTER:
1553     default:
1554         proto_tree_add_item(tree, hf_openflow_v4_error_code, tvb, offset, 2, ENC_BIG_ENDIAN);
1555         break;
1556     }
1557     offset +=2;
1558 
1559     switch(error_type) {
1560     case OFPET_HELLO_FAILED:
1561         /* uint8_t data[0]; contains an ASCII text string */
1562         proto_tree_add_item(tree, hf_openflow_v4_error_data_text, tvb, offset, length - 12, ENC_NA|ENC_ASCII);
1563         /*offset += length - 12;*/
1564         break;
1565 
1566     case OFPET_BAD_REQUEST:
1567     case OFPET_BAD_ACTION:
1568     case OFPET_BAD_INSTRUCTION:
1569     case OFPET_BAD_MATCH:
1570     case OFPET_FLOW_MOD_FAILED:
1571     case OFPET_GROUP_MOD_FAILED:
1572     case OFPET_PORT_MOD_FAILED:
1573     case OFPET_TABLE_MOD_FAILED:
1574     case OFPET_QUEUE_OP_FAILED:
1575     case OFPET_SWITCH_CONFIG_FAILED:
1576     case OFPET_ROLE_REQUEST_FAILED:
1577     case OFPET_METER_MOD_FAILED:
1578     case OFPET_TABLE_FEATURES_FAILED: {
1579         /* uint8_t data[0]; contains at least the first 64 bytes of the failed request. */
1580         gboolean save_in_error_pkt;
1581 
1582         data_ti = proto_tree_add_item(tree, hf_openflow_v4_error_data_body, tvb, offset, length - 20, ENC_NA);
1583         data_tree = proto_item_add_subtree(data_ti, ett_openflow_v4_error_data);
1584 
1585         /* Save error pkt */
1586         save_in_error_pkt = pinfo->flags.in_error_pkt;
1587         pinfo->flags.in_error_pkt = TRUE;
1588 
1589         /* Disable update/change of column info */
1590         col_set_writable(pinfo->cinfo, -1, FALSE);
1591 
1592         dissect_openflow_message_v4(tvb, pinfo, data_tree, offset);
1593 
1594         /* Restore the "we're inside an error packet" flag. */
1595         pinfo->flags.in_error_pkt = save_in_error_pkt;
1596 
1597         /* Restore the capability of update/change column info */
1598         col_set_writable(pinfo->cinfo, -1, TRUE);
1599 
1600         /*offset += length - 12;*/
1601         }
1602         break;
1603 
1604     case OFPET_EXPERIMENTER:
1605         /* uint32_t experimenter */
1606         proto_tree_add_item(tree, hf_openflow_v4_error_experimenter, tvb, offset, 4, ENC_BIG_ENDIAN);
1607         offset+=4;
1608         /* uint8_t data[0]; */
1609         proto_tree_add_expert_format(tree, pinfo, &ei_openflow_v4_error_undecoded,
1610                                      tvb, offset, length - 16, "Experimenter error body.");
1611         /*offset += length - 16;*/
1612         break;
1613 
1614     default:
1615         /* uint8_t data[0]; */
1616         proto_tree_add_expert_format(tree, pinfo, &ei_openflow_v4_error_undecoded,
1617                                      tvb, offset, length - 12, "Unknown error body.");
1618         /*offset += length - 12;*/
1619         break;
1620     }
1621 }
1622 
1623 
1624 static void
dissect_openflow_echo_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)1625 dissect_openflow_echo_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
1626 {
1627     /* data */
1628     if (offset < length) {
1629         proto_tree_add_item(tree, hf_openflow_v4_echo_data, tvb, offset, length - offset, ENC_NA);
1630     }
1631 }
1632 
1633 
1634 static void
dissect_openflow_experimenter_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)1635 dissect_openflow_experimenter_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
1636 {
1637     /* uint32_t experimenter; */
1638     proto_tree_add_item(tree, hf_openflow_v4_experimenter_experimenter, tvb, offset, 4, ENC_BIG_ENDIAN);
1639     offset+=4;
1640 
1641     /* uint32_t exp_type; */
1642     proto_tree_add_item(tree, hf_openflow_v4_experimenter_exp_type, tvb, offset, 4, ENC_BIG_ENDIAN);
1643     offset+=4;
1644 
1645     /* data */
1646     if (offset < length) {
1647         proto_tree_add_expert_format(tree, pinfo, &ei_openflow_v4_experimenter_undecoded,
1648                                      tvb, offset, length - 16, "Experimenter body.");
1649     }
1650 }
1651 
1652 #define OFPC_FLOW_STATS    1<<0
1653 #define OFPC_TABLE_STATS   1<<1
1654 #define OFPC_PORT_STATS    1<<2
1655 #define OFPC_GROUP_STATS   1<<3
1656 #define OFPC_IP_REASM      1<<5
1657 #define OFPC_QUEUE_STATS   1<<6
1658 #define OFPC_PORT_BLOCKED  1<<8
1659 static void
dissect_openflow_switch_features_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)1660 dissect_openflow_switch_features_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
1661 {
1662     proto_item *ti;
1663     proto_tree *cap_tree;
1664 
1665     /* uint64_t datapath_id; */
1666     proto_tree_add_item(tree, hf_openflow_v4_switch_features_datapath_id, tvb, offset, 8, ENC_BIG_ENDIAN);
1667     offset+=8;
1668 
1669     /* uint32_t n_buffers; */
1670     proto_tree_add_item(tree, hf_openflow_v4_switch_features_n_buffers, tvb, offset, 4, ENC_BIG_ENDIAN);
1671     offset+=4;
1672 
1673     /* uint8_t n_tables; */
1674     proto_tree_add_item(tree, hf_openflow_v4_switch_features_n_tables, tvb, offset, 1, ENC_BIG_ENDIAN);
1675     offset++;
1676 
1677     /* uint8_t auxiliary_id; */
1678     proto_tree_add_item(tree, hf_openflow_v4_switch_features_auxiliary_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1679     offset++;
1680 
1681     /* uint8_t pad[2]; */
1682     proto_tree_add_item(tree, hf_openflow_v4_switch_features_pad, tvb, offset, 2, ENC_BIG_ENDIAN);
1683     offset+=2;
1684 
1685     /* uint32_t capabilities; */
1686     ti = proto_tree_add_item(tree, hf_openflow_v4_switch_features_capabilities, tvb, offset, 4, ENC_BIG_ENDIAN);
1687     cap_tree = proto_item_add_subtree(ti, ett_openflow_v4_switch_features_capabilities);
1688 
1689     proto_tree_add_item(cap_tree, hf_openflow_v4_switch_features_capabilities_flow_stats, tvb, offset, 4, ENC_BIG_ENDIAN);
1690     proto_tree_add_item(cap_tree, hf_openflow_v4_switch_features_capabilities_table_stats, tvb, offset, 4, ENC_BIG_ENDIAN);
1691     proto_tree_add_item(cap_tree, hf_openflow_v4_switch_features_capabilities_port_stats, tvb, offset, 4, ENC_BIG_ENDIAN);
1692     proto_tree_add_item(cap_tree, hf_openflow_v4_switch_features_capabilities_group_stats, tvb, offset, 4, ENC_BIG_ENDIAN);
1693     proto_tree_add_item(cap_tree, hf_openflow_v4_switch_features_capabilities_ip_reasm, tvb, offset, 4, ENC_BIG_ENDIAN);
1694     proto_tree_add_item(cap_tree, hf_openflow_v4_switch_features_capabilities_queue_stats, tvb, offset, 4, ENC_BIG_ENDIAN);
1695     proto_tree_add_item(cap_tree, hf_openflow_v4_switch_features_capabilities_port_blocked, tvb, offset, 4, ENC_BIG_ENDIAN);
1696     offset+=4;
1697 
1698     /* uint32_t reserved; */
1699     proto_tree_add_item(tree, hf_openflow_v4_switch_features_reserved, tvb, offset, 4, ENC_BIG_ENDIAN);
1700     /*offset+=4;*/
1701 }
1702 
1703 static const value_string openflow_v4_switch_config_fragments_values[] = {
1704     { 0, "OFPC_FRAG_NORMAL" },
1705     { 1, "OFPC_FRAG_DROP" },
1706     { 2, "OFPC_FRAG_REASM" },
1707     { 0, NULL }
1708 };
1709 
1710 #define OFPCML_MAX   0xffe5  /* Maximum max_len value. */
1711 static const value_string openflow_v4_controller_max_len_reserved_values[] = {
1712     { 0xffff, "OFPCML_NO_BUFFER" },
1713     { 0,      NULL }
1714 };
1715 
1716 static void
dissect_openflow_switch_config_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)1717 dissect_openflow_switch_config_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
1718 {
1719     proto_item *ti;
1720     proto_tree *flags_tree;
1721 
1722     /* uint16_t flags; */
1723     ti = proto_tree_add_item(tree, hf_openflow_v4_switch_config_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
1724     flags_tree = proto_item_add_subtree(ti, ett_openflow_v4_switch_config_flags);
1725 
1726     /* fragments */
1727     proto_tree_add_bits_item(flags_tree, hf_openflow_v4_switch_config_flags_fragments, tvb, (offset * 8) + 14, 2, ENC_NA);
1728     offset+=2;
1729 
1730     /* uint16_t miss_send_len; */
1731     proto_tree_add_item(tree, hf_openflow_v4_switch_config_miss_send_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1732     /*offset+=2;*/
1733 }
1734 
1735 #define OFPR_NO_MATCH     0
1736 #define OFPR_ACTION       1
1737 #define OFPR_INVALID_TTL  2
1738 static const value_string openflow_v4_packet_in_reason_values[] = {
1739     { OFPR_NO_MATCH,    "OFPR_NO_MATCH" },
1740     { OFPR_ACTION,      "OFPR_ACTION" },
1741     { OFPR_INVALID_TTL, "OFPR_INVALID_TTL" },
1742     { 0,                NULL }
1743 };
1744 
1745 static void
dissect_openflow_packet_in_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)1746 dissect_openflow_packet_in_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
1747 {
1748     proto_tree *data_tree;
1749     tvbuff_t *next_tvb;
1750     gboolean save_writable;
1751     gboolean save_in_error_pkt;
1752     address save_dl_src, save_dl_dst, save_net_src, save_net_dst, save_src, save_dst;
1753 
1754     /* uint32_t buffer_id; */
1755     proto_tree_add_item(tree, hf_openflow_v4_packet_in_buffer_id, tvb, offset, 4, ENC_BIG_ENDIAN);
1756     offset+=4;
1757 
1758     /* uint16_t total_len; */
1759     proto_tree_add_item(tree, hf_openflow_v4_packet_in_total_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1760     offset+=2;
1761 
1762     /* uint8_t reason; */
1763     proto_tree_add_item(tree, hf_openflow_v4_packet_in_reason, tvb, offset, 1, ENC_BIG_ENDIAN);
1764     offset+=1;
1765 
1766     /* uint8_t table_id; */
1767     proto_tree_add_item(tree, hf_openflow_v4_packet_in_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1768     offset+=1;
1769 
1770     /* uint64_t cookie; */
1771     proto_tree_add_item(tree, hf_openflow_v4_packet_in_cookie, tvb, offset, 8, ENC_BIG_ENDIAN);
1772     offset+=8;
1773 
1774     /* struct ofp_match match; */
1775     offset = dissect_openflow_match_v4(tvb, pinfo, tree, offset, length);
1776 
1777     /* uint8_t pad[2]; */
1778     proto_tree_add_item(tree, hf_openflow_v4_packet_in_pad, tvb, offset, 2, ENC_NA);
1779     offset+=2;
1780 
1781     /* uint8_t data[0]; */
1782     if (offset < length) {
1783         data_tree = proto_tree_add_subtree(tree, tvb, offset, length - offset, ett_openflow_v4_packet_in_data, NULL, "Data");
1784 
1785         /* save some state */
1786         save_writable = col_get_writable(pinfo->cinfo, -1);
1787         save_in_error_pkt = pinfo->flags.in_error_pkt;
1788         copy_address_shallow(&save_dl_src, &pinfo->dl_src);
1789         copy_address_shallow(&save_dl_dst, &pinfo->dl_dst);
1790         copy_address_shallow(&save_net_src, &pinfo->net_src);
1791         copy_address_shallow(&save_net_dst, &pinfo->net_dst);
1792         copy_address_shallow(&save_src, &pinfo->src);
1793         copy_address_shallow(&save_dst, &pinfo->dst);
1794 
1795         /* dissect data */
1796         col_set_writable(pinfo->cinfo, -1, FALSE);
1797         next_tvb = tvb_new_subset_length(tvb, offset, length - offset);
1798         call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, data_tree);
1799 
1800         /* restore saved state */
1801         col_set_writable(pinfo->cinfo, -1, save_writable);
1802         pinfo->flags.in_error_pkt = save_in_error_pkt;
1803         copy_address_shallow(&pinfo->dl_src, &save_dl_src);
1804         copy_address_shallow(&pinfo->dl_dst, &save_dl_dst);
1805         copy_address_shallow(&pinfo->net_src, &save_net_src);
1806         copy_address_shallow(&pinfo->net_dst, &save_net_dst);
1807         copy_address_shallow(&pinfo->src, &save_src);
1808         copy_address_shallow(&pinfo->dst, &save_dst);
1809     }
1810 }
1811 
1812 
1813 #define OFPRR_IDLE_TIMEOUT  0
1814 #define OFPRR_HARD_TIMEOUT  1
1815 #define OFPRR_DELETE        2
1816 #define OFPRR_GROUP_DELETE  3
1817 static const value_string openflow_v4_flow_removed_reason_values[] = {
1818     { OFPRR_IDLE_TIMEOUT, "OFPRR_IDLE_TIMEOUT" },
1819     { OFPRR_HARD_TIMEOUT, "OFPRR_HARD_TIMEOUT" },
1820     { OFPRR_DELETE,       "OFPRR_DELETE" },
1821     { OFPRR_GROUP_DELETE, "OFPRR_GROUP_DELETE" },
1822     { 0,                  NULL }
1823 };
1824 
1825 static void
dissect_openflow_flow_removed_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)1826 dissect_openflow_flow_removed_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
1827 {
1828     /* uint64_t cookie; */
1829     proto_tree_add_item(tree, hf_openflow_v4_flow_removed_cookie, tvb, offset, 8, ENC_BIG_ENDIAN);
1830     offset+=8;
1831 
1832     /* uint16_t priority; */
1833     proto_tree_add_item(tree, hf_openflow_v4_flow_removed_priority, tvb, offset, 2, ENC_BIG_ENDIAN);
1834     offset+=2;
1835 
1836     /* uint8_t reason; */
1837     proto_tree_add_item(tree, hf_openflow_v4_flow_removed_reason, tvb, offset, 1, ENC_BIG_ENDIAN);
1838     offset+=1;
1839 
1840     /* uint8_t table_id; */
1841     proto_tree_add_item(tree, hf_openflow_v4_flow_removed_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
1842     offset+=1;
1843 
1844     /* uint32_t duration_sec; */
1845     proto_tree_add_item(tree, hf_openflow_v4_flow_removed_duration_sec, tvb, offset, 4, ENC_BIG_ENDIAN);
1846     offset+=4;
1847 
1848     /* uint32_t duration_nsec; */
1849     proto_tree_add_item(tree, hf_openflow_v4_flow_removed_duration_nsec, tvb, offset, 4, ENC_BIG_ENDIAN);
1850     offset+=4;
1851 
1852     /* uint16_t idle_timeout; */
1853     proto_tree_add_item(tree, hf_openflow_v4_flow_removed_idle_timeout, tvb, offset, 2, ENC_BIG_ENDIAN);
1854     offset+=2;
1855 
1856     /* uint16_t hard_timeout; */
1857     proto_tree_add_item(tree, hf_openflow_v4_flow_removed_hard_timeout, tvb, offset, 2, ENC_BIG_ENDIAN);
1858     offset+=2;
1859 
1860     /* uint64_t packet_count; */
1861     proto_tree_add_item(tree, hf_openflow_v4_flow_removed_packet_count, tvb, offset, 8, ENC_BIG_ENDIAN);
1862     offset+=8;
1863 
1864     /* uint64_t byte_count; */
1865     proto_tree_add_item(tree, hf_openflow_v4_flow_removed_byte_count, tvb, offset, 8, ENC_BIG_ENDIAN);
1866     offset+=8;
1867 
1868     /* struct ofp_match match; */
1869     dissect_openflow_match_v4(tvb, pinfo, tree, offset, length);
1870 }
1871 
1872 #define OFPAT_OUTPUT         0  /* Output to switch port. */
1873 #define OFPAT_COPY_TTL_OUT  11  /* Copy TTL "outwards" */
1874 #define OFPAT_COPY_TTL_IN   12  /* Copy TTL "inwards" */
1875 #define OFPAT_SET_MPLS_TTL  15  /* MPLS TTL */
1876 #define OFPAT_DEC_MPLS_TTL  16  /* Decrement MPLS TTL */
1877 #define OFPAT_PUSH_VLAN     17  /* Push a new VLAN tag */
1878 #define OFPAT_POP_VLAN      18  /* Pop the outer VLAN tag */
1879 #define OFPAT_PUSH_MPLS     19  /* Push a new MPLS tag */
1880 #define OFPAT_POP_MPLS      20  /* Pop the outer MPLS tag */
1881 #define OFPAT_SET_QUEUE     21  /* Set queue id when outputting to a port */
1882 #define OFPAT_GROUP         22  /* Apply group. */
1883 #define OFPAT_SET_NW_TTL    23  /* IP TTL. */
1884 #define OFPAT_DEC_NW_TTL    24  /* Decrement IP TTL. */
1885 #define OFPAT_SET_FIELD     25  /* Set a header field using OXM TLV format. */
1886 #define OFPAT_PUSH_PBB      26  /* Push a new PBB service tag (I-TAG) */
1887 #define OFPAT_POP_PBB       27  /* Pop the outer PBB service tag (I-TAG) */
1888 #define OFPAT_EXPERIMENTER  0xffff
1889 
1890 static const value_string openflow_v4_action_type_values[] = {
1891     {      0, "OFPAT_OUTPUT" },
1892     {     11, "OFPAT_COPY_TTL_OUT" },
1893     {     12, "OFPAT_COPY_TTL_IN" },
1894     {     15, "OFPAT_SET_MPLS_TTL" },
1895     {     16, "OFPAT_DEC_MPLS_TTL" },
1896     {     17, "OFPAT_PUSH_VLAN" },
1897     {     18, "OFPAT_POP_VLAN" },
1898     {     19, "OFPAT_PUSH_MPLS" },
1899     {     20, "OFPAT_POP_MPLS" },
1900     {     21, "OFPAT_SET_QUEUE" },
1901     {     22, "OFPAT_GROUP" },
1902     {     23, "OFPAT_SET_NW_TTL" },
1903     {     24, "OFPAT_DEC_NW_TTL" },
1904     {     25, "OFPAT_SET_FIELD" },
1905     {     26, "OFPAT_PUSH_PBB" },
1906     {     27, "OFPAT_POP_PBB" },
1907     { 0xffff, "OFPAT_EXPERIMENTER" },
1908     { 0,      NULL}
1909 };
1910 
1911 
1912 
1913 static int
dissect_openflow_action_header_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)1914 dissect_openflow_action_header_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
1915 {
1916     guint16 act_type;
1917 
1918     /* uint16_t type; */
1919     act_type = tvb_get_ntohs(tvb, offset);
1920     proto_tree_add_item(tree, hf_openflow_v4_action_type, tvb, offset, 2, ENC_BIG_ENDIAN);
1921     offset+=2;
1922 
1923     /* uint16_t length; */
1924     proto_tree_add_item(tree, hf_openflow_v4_action_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1925     offset+=2;
1926 
1927     if (act_type == OFPAT_EXPERIMENTER) {
1928         /* uint32_t experimenter; */
1929         proto_tree_add_item(tree, hf_openflow_v4_action_experimenter_experimenter, tvb, offset, 4, ENC_BIG_ENDIAN);
1930         offset+=4;
1931     }
1932 
1933     return offset;
1934 }
1935 
1936 
1937 static int
dissect_openflow_action_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)1938 dissect_openflow_action_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
1939 {
1940     proto_tree *act_tree;
1941     guint16 act_type;
1942     guint16 act_length;
1943     gint32 act_end;
1944 
1945     act_type = tvb_get_ntohs(tvb, offset);
1946     act_length = tvb_get_ntohs(tvb, offset + 2);
1947     act_end = offset + act_length;
1948 
1949     act_tree = proto_tree_add_subtree(tree, tvb, offset, act_length, ett_openflow_v4_action, NULL, "Action");
1950 
1951     offset = dissect_openflow_action_header_v4(tvb, pinfo, act_tree, offset, length);
1952 
1953     switch (act_type) {
1954     case OFPAT_OUTPUT:
1955         /* uint32_t port; */
1956         proto_tree_add_item(act_tree, hf_openflow_v4_action_output_port, tvb, offset, 4, ENC_BIG_ENDIAN);
1957         offset+=4;
1958 
1959         /* uint16_t max_len; */
1960         proto_tree_add_item(act_tree, hf_openflow_v4_action_output_max_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1961         offset+=2;
1962 
1963         /* uint8_t pad[6]; */
1964         proto_tree_add_item(act_tree, hf_openflow_v4_action_output_pad, tvb, offset, 6, ENC_NA);
1965         offset+=6;
1966 
1967         break;
1968 
1969     case OFPAT_COPY_TTL_OUT:
1970         /* uint8_t pad[4]; */
1971         proto_tree_add_item(act_tree, hf_openflow_v4_action_copy_ttl_out_pad, tvb, offset, 4, ENC_NA);
1972         offset+=4;
1973         break;
1974 
1975     case OFPAT_COPY_TTL_IN:
1976         /* uint8_t pad[4]; */
1977         proto_tree_add_item(act_tree, hf_openflow_v4_action_copy_ttl_in_pad, tvb, offset, 4, ENC_NA);
1978         offset+=4;
1979         break;
1980 
1981     case OFPAT_SET_MPLS_TTL:
1982         /* uint8_t mpls_ttl; */
1983         proto_tree_add_item(act_tree, hf_openflow_v4_action_set_mpls_ttl_ttl, tvb, offset, 1, ENC_BIG_ENDIAN);
1984         offset+=1;
1985 
1986         /* uint8_t pad[3]; */
1987         proto_tree_add_item(act_tree, hf_openflow_v4_action_set_mpls_ttl_pad, tvb, offset, 3, ENC_NA);
1988         offset+=3;
1989         break;
1990 
1991     case OFPAT_DEC_MPLS_TTL:
1992         /* uint8_t pad[4]; */
1993         proto_tree_add_item(act_tree, hf_openflow_v4_action_dec_mpls_ttl_pad, tvb, offset, 4, ENC_NA);
1994         offset+=4;
1995         break;
1996 
1997     case OFPAT_PUSH_VLAN:
1998         /* uint16_t ethertype; */
1999         proto_tree_add_item(act_tree, hf_openflow_v4_action_push_vlan_ethertype, tvb, offset, 2, ENC_BIG_ENDIAN);
2000         offset+=2;
2001 
2002         /* uint8_t pad[2]; */
2003         proto_tree_add_item(act_tree, hf_openflow_v4_action_push_vlan_pad, tvb, offset, 2, ENC_NA);
2004         offset+=2;
2005         break;
2006 
2007     case OFPAT_POP_VLAN:
2008         /* uint8_t pad[4]; */
2009         proto_tree_add_item(act_tree, hf_openflow_v4_action_pop_vlan_pad, tvb, offset, 4, ENC_NA);
2010         offset+=4;
2011         break;
2012 
2013     case OFPAT_PUSH_MPLS:
2014         /* uint16_t ethertype; */
2015         proto_tree_add_item(act_tree, hf_openflow_v4_action_push_mpls_ethertype, tvb, offset, 2, ENC_BIG_ENDIAN);
2016         offset+=2;
2017 
2018         /* uint8_t pad[2]; */
2019         proto_tree_add_item(act_tree, hf_openflow_v4_action_push_mpls_pad, tvb, offset, 2, ENC_NA);
2020         offset+=2;
2021         break;
2022 
2023     case OFPAT_POP_MPLS:
2024         /* uint16_t ethertype; */
2025         proto_tree_add_item(act_tree, hf_openflow_v4_action_pop_mpls_ethertype, tvb, offset, 2, ENC_BIG_ENDIAN);
2026         offset+=2;
2027 
2028         /* uint8_t pad[2]; */
2029         proto_tree_add_item(act_tree, hf_openflow_v4_action_pop_mpls_pad, tvb, offset, 2, ENC_NA);
2030         offset+=2;
2031         break;
2032 
2033     case OFPAT_SET_QUEUE:
2034         /* uint32_t queue_id; */
2035         proto_tree_add_item(act_tree, hf_openflow_v4_action_set_queue_queue_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2036         offset+=4;
2037         break;
2038 
2039     case OFPAT_GROUP:
2040         /* uint32_t group_id; */
2041         proto_tree_add_item(act_tree, hf_openflow_v4_action_group_group_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2042         offset+=4;
2043         break;
2044 
2045     case OFPAT_SET_NW_TTL:
2046         /* uint8_t nw_ttl; */
2047         proto_tree_add_item(act_tree, hf_openflow_v4_action_set_nw_ttl_ttl, tvb, offset, 1, ENC_BIG_ENDIAN);
2048         offset+=1;
2049 
2050         /* uint8_t pad[3]; */
2051         proto_tree_add_item(act_tree, hf_openflow_v4_action_set_nw_ttl_pad, tvb, offset, 3, ENC_NA);
2052         offset+=3;
2053         break;
2054 
2055     case OFPAT_DEC_NW_TTL:
2056         /* uint8_t pad[4]; */
2057         proto_tree_add_item(act_tree, hf_openflow_v4_action_dec_nw_ttl_pad, tvb, offset, 4, ENC_NA);
2058         offset+=4;
2059         break;
2060 
2061     case OFPAT_SET_FIELD:
2062         offset = dissect_openflow_oxm_v4(tvb, pinfo, act_tree, offset, length);
2063 
2064         /* padded to 64 bits */
2065         if (offset < act_end) {
2066             proto_tree_add_item(act_tree, hf_openflow_v4_action_set_field_pad, tvb, offset, act_end - offset, ENC_NA);
2067             offset = act_end;
2068         }
2069         break;
2070 
2071     case OFPAT_PUSH_PBB:
2072         /* uint16_t ethertype; */
2073         proto_tree_add_item(act_tree, hf_openflow_v4_action_push_pbb_ethertype, tvb, offset, 2, ENC_BIG_ENDIAN);
2074         offset+=2;
2075 
2076         /* uint8_t pad[2]; */
2077         proto_tree_add_item(act_tree, hf_openflow_v4_action_push_pbb_pad, tvb, offset, 2, ENC_NA);
2078         offset+=2;
2079         break;
2080 
2081     case OFPAT_POP_PBB:
2082         /* uint8_t pad[4]; */
2083         proto_tree_add_item(act_tree, hf_openflow_v4_action_pop_pbb_pad, tvb, offset, 4, ENC_NA);
2084         offset+=4;
2085         break;
2086 
2087     case OFPAT_EXPERIMENTER:
2088         proto_tree_add_expert_format(act_tree, pinfo, &ei_openflow_v4_action_undecoded,
2089                                      tvb, offset, act_length - 8, "Experimenter action body.");
2090         if (act_length > 8)
2091             offset += act_length - 8;
2092         break;
2093 
2094     default:
2095         proto_tree_add_expert_format(act_tree, pinfo, &ei_openflow_v4_action_undecoded,
2096                                      tvb, offset, act_length - 4, "Unknown action body.");
2097         if (act_length > 4)
2098             offset += act_length - 4;
2099         break;
2100     }
2101 
2102     return offset;
2103 }
2104 
2105 
2106 #define OFPPC_PORT_DOWN     1 << 0
2107 #define OFPPC_NO_RECV       1 << 2
2108 #define OFPPC_NO_FWD        1 << 5
2109 #define OFPPC_NO_PACKET_IN  1 << 6
2110 
2111 #define OFPPS_LINK_DOWN  1 << 0
2112 #define OFPPS_BLOCKED    1 << 1
2113 #define OFPPS_LIVE       1 << 2
2114 
2115 #define OFPPF_10MB_HD   1 << 0
2116 #define OFPPF_10MB_FD   1 << 1
2117 #define OFPPF_100MB_HD  1 << 2
2118 #define OFPPF_100MB_FD  1 << 3
2119 #define OFPPF_1GB_HD    1 << 4
2120 #define OFPPF_1GB_FD    1 << 5
2121 #define OFPPF_10GB_FD   1 << 6
2122 #define OFPPF_40GB_FD   1 << 7
2123 #define OFPPF_100GB_FD  1 << 8
2124 #define OFPPF_1TB_FD    1 << 9
2125 #define OFPPF_OTHER     1 << 10
2126 
2127 #define OFPPF_COPPER      1 << 11
2128 #define OFPPF_FIBER       1 << 12
2129 #define OFPPF_AUTONEG     1 << 13
2130 #define OFPPF_PAUSE       1 << 14
2131 #define OFPPF_PAUSE_ASYM  1 << 15
2132 
2133 #define OFP_ETH_ALEN            6
2134 #define OFP_MAX_PORT_NAME_LEN  16
2135 static int
dissect_openflow_port_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)2136 dissect_openflow_port_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
2137 {
2138     proto_item *ti;
2139     proto_tree *port_tree, *conf_tree, *state_tree, *curr_tree, *adv_tree, *supp_tree, *peer_tree;
2140 
2141     port_tree = proto_tree_add_subtree(tree, tvb, offset, 64, ett_openflow_v4_port, NULL, "Port");
2142 
2143     /* uint32_t port_no; */
2144     proto_tree_add_item(port_tree, hf_openflow_v4_port_port_no, tvb, offset, 4, ENC_BIG_ENDIAN);
2145     offset+=4;
2146 
2147     /* uint8_t pad[4]; */
2148     proto_tree_add_item(port_tree, hf_openflow_v4_port_pad, tvb, offset, 4, ENC_NA);
2149     offset+=4;
2150 
2151     /* uint8_t hw_addr[OFP_ETH_ALEN]; */
2152     proto_tree_add_item(port_tree, hf_openflow_v4_port_hw_addr, tvb, offset, OFP_ETH_ALEN, ENC_NA);
2153     offset+=OFP_ETH_ALEN;
2154 
2155     /* uint8_t pad2[2]; */
2156     proto_tree_add_item(port_tree, hf_openflow_v4_port_pad2, tvb, offset, 2, ENC_NA);
2157     offset+=2;
2158 
2159     /* char name[OFP_MAX_PORT_NAME_LEN]; Null-terminated */
2160     proto_tree_add_item(port_tree, hf_openflow_v4_port_name, tvb, offset, OFP_MAX_PORT_NAME_LEN, ENC_ASCII|ENC_NA);
2161     offset+=OFP_MAX_PORT_NAME_LEN;
2162 
2163     /* uint32_t config; */
2164     ti = proto_tree_add_item(port_tree, hf_openflow_v4_port_config, tvb, offset, 4, ENC_BIG_ENDIAN);
2165     conf_tree = proto_item_add_subtree(ti, ett_openflow_v4_port_config);
2166 
2167     proto_tree_add_item(conf_tree, hf_openflow_v4_port_config_port_down, tvb, offset, 4, ENC_BIG_ENDIAN);
2168     proto_tree_add_item(conf_tree, hf_openflow_v4_port_config_no_recv, tvb, offset, 4, ENC_BIG_ENDIAN);
2169     proto_tree_add_item(conf_tree, hf_openflow_v4_port_config_no_fwd, tvb, offset, 4, ENC_BIG_ENDIAN);
2170     proto_tree_add_item(conf_tree, hf_openflow_v4_port_config_no_packet_in, tvb, offset, 4, ENC_BIG_ENDIAN);
2171     offset+=4;
2172 
2173     /* uint32_t state; */
2174     ti = proto_tree_add_item(port_tree, hf_openflow_v4_port_state, tvb, offset, 4, ENC_BIG_ENDIAN);
2175     state_tree = proto_item_add_subtree(ti, ett_openflow_v4_port_state);
2176 
2177     proto_tree_add_item(state_tree, hf_openflow_v4_port_state_link_down, tvb, offset, 4, ENC_BIG_ENDIAN);
2178     proto_tree_add_item(state_tree, hf_openflow_v4_port_state_blocked, tvb, offset, 4, ENC_BIG_ENDIAN);
2179     proto_tree_add_item(state_tree, hf_openflow_v4_port_state_live, tvb, offset, 4, ENC_BIG_ENDIAN);
2180     offset+=4;
2181 
2182     /* uint32_t curr; */
2183     ti = proto_tree_add_item(port_tree, hf_openflow_v4_port_current, tvb, offset, 4, ENC_BIG_ENDIAN);
2184     curr_tree = proto_item_add_subtree(ti, ett_openflow_v4_port_current);
2185 
2186     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_10mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2187     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_10mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2188     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_100mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2189     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_100mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2190     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_1gb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2191     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_1gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2192     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_10gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2193     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_40gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2194     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_100gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2195     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_1tb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2196     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_other, tvb, offset, 4, ENC_BIG_ENDIAN);
2197     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_copper, tvb, offset, 4, ENC_BIG_ENDIAN);
2198     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_fiber, tvb, offset, 4, ENC_BIG_ENDIAN);
2199     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_autoneg, tvb, offset, 4, ENC_BIG_ENDIAN);
2200     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_pause, tvb, offset, 4, ENC_BIG_ENDIAN);
2201     proto_tree_add_item(curr_tree, hf_openflow_v4_port_current_pause_asym, tvb, offset, 4, ENC_BIG_ENDIAN);
2202     offset+=4;
2203 
2204     /* uint32_t advertised; */
2205     ti = proto_tree_add_item(port_tree, hf_openflow_v4_port_advertised, tvb, offset, 4, ENC_BIG_ENDIAN);
2206     adv_tree = proto_item_add_subtree(ti, ett_openflow_v4_port_advertised);
2207 
2208     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_10mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2209     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_10mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2210     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_100mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2211     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_100mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2212     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_1gb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2213     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_1gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2214     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_10gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2215     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_40gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2216     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_100gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2217     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_1tb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2218     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_other, tvb, offset, 4, ENC_BIG_ENDIAN);
2219     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_copper, tvb, offset, 4, ENC_BIG_ENDIAN);
2220     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_fiber, tvb, offset, 4, ENC_BIG_ENDIAN);
2221     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_autoneg, tvb, offset, 4, ENC_BIG_ENDIAN);
2222     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_pause, tvb, offset, 4, ENC_BIG_ENDIAN);
2223     proto_tree_add_item(adv_tree, hf_openflow_v4_port_advertised_pause_asym, tvb, offset, 4, ENC_BIG_ENDIAN);
2224     offset+=4;
2225 
2226     /* uint32_t supported; */
2227     ti = proto_tree_add_item(port_tree, hf_openflow_v4_port_supported, tvb, offset, 4, ENC_BIG_ENDIAN);
2228     supp_tree = proto_item_add_subtree(ti, ett_openflow_v4_port_supported);
2229 
2230     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_10mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2231     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_10mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2232     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_100mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2233     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_100mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2234     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_1gb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2235     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_1gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2236     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_10gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2237     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_40gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2238     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_100gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2239     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_1tb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2240     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_other, tvb, offset, 4, ENC_BIG_ENDIAN);
2241     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_copper, tvb, offset, 4, ENC_BIG_ENDIAN);
2242     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_fiber, tvb, offset, 4, ENC_BIG_ENDIAN);
2243     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_autoneg, tvb, offset, 4, ENC_BIG_ENDIAN);
2244     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_pause, tvb, offset, 4, ENC_BIG_ENDIAN);
2245     proto_tree_add_item(supp_tree, hf_openflow_v4_port_supported_pause_asym, tvb, offset, 4, ENC_BIG_ENDIAN);
2246     offset+=4;
2247 
2248     /* uint32_t peer; */
2249     ti = proto_tree_add_item(port_tree, hf_openflow_v4_port_peer, tvb, offset, 4, ENC_BIG_ENDIAN);
2250     peer_tree = proto_item_add_subtree(ti, ett_openflow_v4_port_peer);
2251 
2252     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_10mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2253     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_10mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2254     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_100mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2255     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_100mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2256     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_1gb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2257     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_1gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2258     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_10gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2259     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_40gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2260     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_100gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2261     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_1tb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2262     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_other, tvb, offset, 4, ENC_BIG_ENDIAN);
2263     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_copper, tvb, offset, 4, ENC_BIG_ENDIAN);
2264     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_fiber, tvb, offset, 4, ENC_BIG_ENDIAN);
2265     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_autoneg, tvb, offset, 4, ENC_BIG_ENDIAN);
2266     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_pause, tvb, offset, 4, ENC_BIG_ENDIAN);
2267     proto_tree_add_item(peer_tree, hf_openflow_v4_port_peer_pause_asym, tvb, offset, 4, ENC_BIG_ENDIAN);
2268     offset+=4;
2269 
2270     /* uint32_t curr_speed; */
2271     proto_tree_add_item(port_tree, hf_openflow_v4_port_curr_speed, tvb, offset, 4, ENC_BIG_ENDIAN);
2272     offset+=4;
2273 
2274     /* uint32_t max_speed; */
2275     proto_tree_add_item(port_tree, hf_openflow_v4_port_max_speed, tvb, offset, 4, ENC_BIG_ENDIAN);
2276     offset+=4;
2277 
2278     return offset;
2279 }
2280 
2281 
2282 
2283 #define OFPPR_ADD     0
2284 #define OFPPR_DELETE  1
2285 #define OFPPR_MODIFY  2
2286 static const value_string openflow_v4_port_status_reason_values[] = {
2287     { OFPPR_ADD,    "OFPPR_ADD" },
2288     { OFPPR_DELETE, "OFPPR_DELETE" },
2289     { OFPPR_MODIFY, "OFPPR_MODIFY" },
2290     { 0,            NULL }
2291 };
2292 
2293 static void
dissect_openflow_port_status_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)2294 dissect_openflow_port_status_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
2295 {
2296     /* uint8_t reason; */
2297     proto_tree_add_item(tree, hf_openflow_v4_port_status_reason, tvb, offset, 1, ENC_BIG_ENDIAN);
2298     offset+=1;
2299 
2300     /* uint8_t pad[7]; */
2301     proto_tree_add_item(tree, hf_openflow_v4_port_status_pad, tvb, offset, 7, ENC_NA);
2302     offset+=7;
2303 
2304     /* struct ofp_port desc; */
2305     dissect_openflow_port_v4(tvb, pinfo, tree, offset, length);
2306 }
2307 
2308 
2309 static void
dissect_openflow_packet_out_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)2310 dissect_openflow_packet_out_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
2311 {
2312     proto_tree *data_tree;
2313     guint16 acts_len;
2314     gint32 acts_end;
2315     tvbuff_t *next_tvb;
2316     gboolean save_writable;
2317     gboolean save_in_error_pkt;
2318     address save_dl_src, save_dl_dst, save_net_src, save_net_dst, save_src, save_dst;
2319 
2320     /* uint32_t buffer_id; */
2321     proto_tree_add_item(tree, hf_openflow_v4_packet_out_buffer_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2322     offset+=4;
2323 
2324     /* uint32_t in_port; */
2325     proto_tree_add_item(tree, hf_openflow_v4_packet_out_in_port, tvb, offset, 4, ENC_BIG_ENDIAN);
2326     offset+=4;
2327 
2328     /* uint16_t actions_len; */
2329     acts_len = tvb_get_ntohs(tvb, offset);
2330     proto_tree_add_item(tree, hf_openflow_v4_packet_out_acts_len, tvb, offset, 2, ENC_BIG_ENDIAN);
2331     offset+=2;
2332 
2333     /* uint8_t pad[6]; */
2334     proto_tree_add_item(tree, hf_openflow_v4_packet_out_pad, tvb, offset, 6, ENC_NA);
2335     offset+=6;
2336 
2337     /* struct ofp_action_header actions[0]; */
2338     acts_end = offset + acts_len;
2339 
2340     while (offset < acts_end) {
2341         offset = dissect_openflow_action_v4(tvb, pinfo, tree, offset, length);
2342     }
2343 
2344     /* uint8_t data[0]; */
2345     if (offset < length) {
2346         data_tree = proto_tree_add_subtree(tree, tvb, offset, length - offset, ett_openflow_v4_packet_out_data, NULL, "Data");
2347 
2348         /* save some state */
2349         save_writable = col_get_writable(pinfo->cinfo, -1);
2350         save_in_error_pkt = pinfo->flags.in_error_pkt;
2351         copy_address_shallow(&save_dl_src, &pinfo->dl_src);
2352         copy_address_shallow(&save_dl_dst, &pinfo->dl_dst);
2353         copy_address_shallow(&save_net_src, &pinfo->net_src);
2354         copy_address_shallow(&save_net_dst, &pinfo->net_dst);
2355         copy_address_shallow(&save_src, &pinfo->src);
2356         copy_address_shallow(&save_dst, &pinfo->dst);
2357 
2358         /* dissect data */
2359         col_set_writable(pinfo->cinfo, -1, FALSE);
2360         next_tvb = tvb_new_subset_length(tvb, offset, length - offset);
2361         call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, data_tree);
2362 
2363         /* restore saved state */
2364         col_set_writable(pinfo->cinfo, -1, save_writable);
2365         pinfo->flags.in_error_pkt = save_in_error_pkt;
2366         copy_address_shallow(&pinfo->dl_src, &save_dl_src);
2367         copy_address_shallow(&pinfo->dl_dst, &save_dl_dst);
2368         copy_address_shallow(&pinfo->net_src, &save_net_src);
2369         copy_address_shallow(&pinfo->net_dst, &save_net_dst);
2370         copy_address_shallow(&pinfo->src, &save_src);
2371         copy_address_shallow(&pinfo->dst, &save_dst);
2372     }
2373 }
2374 
2375 
2376 #define OFPIT_GOTO_TABLE      1       /* Setup the next table in the lookup */
2377 #define OFPIT_WRITE_METADATA  2       /* Setup the metadata field for use later in */
2378 #define OFPIT_WRITE_ACTIONS   3       /* Write the action(s) onto the datapath action */
2379 #define OFPIT_APPLY_ACTIONS   4       /* Applies the action(s) immediately */
2380 #define OFPIT_CLEAR_ACTIONS   5       /* Clears all actions from the datapath */
2381 #define OFPIT_METER           6       /* Apply meter (rate limiter) */
2382 #define OFPIT_EXPERIMENTER    0xFFFF  /* Experimenter instruction */
2383 static const value_string openflow_v4_instruction_type_values[] = {
2384     { 0x0001, "OFPIT_GOTO_TABLE" },
2385     { 0x0002, "OFPIT_WRITE_METADATA" },
2386     { 0x0003, "OFPIT_WRITE_ACTIONS" },
2387     { 0x0004, "OFPIT_APPLY_ACTIONS" },
2388     { 0x0005, "OFPIT_CLEAR_ACTIONS" },
2389     { 0x0006, "OFPIT_METER" },
2390     { 0xffff, "OFPIT_EXPERIMENTER = 0xFFFF" },
2391     { 0,      NULL }
2392 };
2393 
2394 
2395 
2396 static int
dissect_openflow_instruction_header_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)2397 dissect_openflow_instruction_header_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
2398 {
2399     guint16 inst_type;
2400 
2401     /* uint16_t type; */
2402     inst_type = tvb_get_ntohs(tvb, offset);
2403     proto_tree_add_item(tree, hf_openflow_v4_instruction_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2404     offset+=2;
2405 
2406     /* uint16_t length; */
2407     proto_tree_add_item(tree, hf_openflow_v4_instruction_length, tvb, offset, 2, ENC_BIG_ENDIAN);
2408     offset+=2;
2409 
2410     if (inst_type == OFPIT_EXPERIMENTER) {
2411         /* uint32_t experimenter; */
2412         proto_tree_add_item(tree, hf_openflow_v4_instruction_experimenter_experimenter, tvb, offset, 4, ENC_BIG_ENDIAN);
2413         offset+=4;
2414     }
2415 
2416     return offset;
2417 }
2418 
2419 
2420 static int
dissect_openflow_instruction_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)2421 dissect_openflow_instruction_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
2422 {
2423     proto_tree *inst_tree;
2424     guint16 inst_type;
2425     guint16 inst_length;
2426     gint32 acts_end;
2427 
2428     inst_type = tvb_get_ntohs(tvb, offset);
2429     inst_length = tvb_get_ntohs(tvb, offset + 2);
2430 
2431     if (inst_length < 8) {
2432         inst_length = 8;
2433     }
2434 
2435     inst_tree = proto_tree_add_subtree(tree, tvb, offset, inst_length, ett_openflow_v4_instruction, NULL, "Instruction");
2436 
2437     offset = dissect_openflow_instruction_header_v4(tvb, pinfo, inst_tree, offset, length);
2438 
2439     switch (inst_type) {
2440     case OFPIT_GOTO_TABLE:
2441         /* uint8_t table_id; */
2442         proto_tree_add_item(inst_tree, hf_openflow_v4_instruction_goto_table_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2443         offset+=1;
2444 
2445         /* uint8_t pad[3]; */
2446         proto_tree_add_item(inst_tree, hf_openflow_v4_instruction_goto_table_pad, tvb, offset, 3, ENC_NA);
2447         offset+=3;
2448         break;
2449 
2450     case OFPIT_WRITE_METADATA:
2451         /* uint8_t pad[4]; */
2452         proto_tree_add_item(inst_tree, hf_openflow_v4_instruction_write_metadata_pad, tvb, offset, 4, ENC_NA);
2453         offset+=4;
2454 
2455         /* uint64_t metadata; */
2456         proto_tree_add_item(inst_tree, hf_openflow_v4_instruction_write_metadata_value, tvb, offset, 8, ENC_BIG_ENDIAN);
2457         offset+=8;
2458 
2459         /* uint64_t metadata_mask; */
2460         proto_tree_add_item(inst_tree, hf_openflow_v4_instruction_write_metadata_mask, tvb, offset, 8, ENC_BIG_ENDIAN);
2461         offset+=8;
2462         break;
2463 
2464     case OFPIT_WRITE_ACTIONS:
2465     case OFPIT_APPLY_ACTIONS:
2466     case OFPIT_CLEAR_ACTIONS:
2467         proto_tree_add_item(inst_tree, hf_openflow_v4_instruction_actions_pad, tvb, offset, 4, ENC_NA);
2468         offset+=4;
2469 
2470         acts_end = offset + inst_length - 8;
2471         while (offset < acts_end) {
2472             offset = dissect_openflow_action_v4(tvb, pinfo, inst_tree, offset, length);
2473         }
2474         break;
2475 
2476     case OFPIT_METER:
2477         /* uint32_t meter_id; */
2478         proto_tree_add_item(inst_tree, hf_openflow_v4_instruction_meter_meter_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2479         offset+=4;
2480         break;
2481 
2482     case OFPIT_EXPERIMENTER:
2483         proto_tree_add_expert_format(inst_tree, pinfo, &ei_openflow_v4_instruction_undecoded,
2484                                      tvb, offset, inst_length - 8, "Experimenter instruction body.");
2485         offset += inst_length - 8;
2486         break;
2487 
2488     default:
2489         proto_tree_add_expert_format(inst_tree, pinfo, &ei_openflow_v4_instruction_undecoded,
2490                                      tvb, offset, inst_length - 4, "Unknown instruction body.");
2491         offset += inst_length - 4;
2492         break;
2493     }
2494 
2495     return offset;
2496 }
2497 
2498 
2499 static const value_string openflow_v4_flowmod_command_values[] = {
2500     { 0, "OFPFC_ADD" },
2501     { 1, "OFPFC_MODIFY" },
2502     { 2, "OFPFC_MODIFY_STRICT" },
2503     { 3, "OFPFC_DELETE" },
2504     { 4, "OFPFC_DELETE_STRICT" },
2505     { 0, NULL }
2506 };
2507 
2508 #define OFPFF_SEND_FLOW_REM  1 << 0  /* Send flow removed message when flow expires or is deleted. */
2509 #define OFPFF_CHECK_OVERLAP  1 << 1  /* Check for overlapping entries first. */
2510 #define OFPFF_RESET_COUNTS   1 << 2  /* Reset flow packet and byte counts. */
2511 #define OFPFF_NO_PKT_COUNTS  1 << 3  /* Don't keep track of packet count. */
2512 #define OFPFF_NO_BYT_COUNTS  1 << 4  /* Don't keep track of byte count. */
2513 
2514 static void
dissect_openflow_flowmod_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)2515 dissect_openflow_flowmod_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
2516 {
2517     proto_item *ti;
2518     proto_tree *flags_tree;
2519 
2520     /* uint64_t cookie; */
2521     proto_tree_add_item(tree, hf_openflow_v4_flowmod_cookie, tvb, offset, 8, ENC_BIG_ENDIAN);
2522     offset+=8;
2523 
2524     /* uint64_t cookie_mask; */
2525     proto_tree_add_item(tree, hf_openflow_v4_flowmod_cookie_mask, tvb, offset, 8, ENC_BIG_ENDIAN);
2526     offset+=8;
2527 
2528     /* uint8_t table_id; */
2529     proto_tree_add_item(tree, hf_openflow_v4_flowmod_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2530     offset+=1;
2531 
2532     /* uint8_t command; */
2533     proto_tree_add_item(tree, hf_openflow_v4_flowmod_command, tvb, offset, 1, ENC_BIG_ENDIAN);
2534     offset+=1;
2535 
2536     /* uint16_t idle_timeout; */
2537     proto_tree_add_item(tree, hf_openflow_v4_flowmod_idle_timeout, tvb, offset, 2, ENC_BIG_ENDIAN);
2538     offset+=2;
2539 
2540     /* uint16_t hard_timeout; */
2541     proto_tree_add_item(tree, hf_openflow_v4_flowmod_hard_timeout, tvb, offset, 2, ENC_BIG_ENDIAN);
2542     offset+=2;
2543 
2544     /* uint16_t priority; */
2545     proto_tree_add_item(tree, hf_openflow_v4_flowmod_priority, tvb, offset, 2, ENC_BIG_ENDIAN);
2546     offset+=2;
2547 
2548     /* uint32_t buffer_id; */
2549     proto_tree_add_item(tree, hf_openflow_v4_flowmod_buffer_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2550     offset+=4;
2551 
2552     /* uint32_t out_port; */
2553     proto_tree_add_item(tree, hf_openflow_v4_flowmod_out_port, tvb, offset, 4, ENC_BIG_ENDIAN);
2554     offset+=4;
2555 
2556     /* uint32_t out_group; */
2557     proto_tree_add_item(tree, hf_openflow_v4_flowmod_out_group, tvb, offset, 4, ENC_BIG_ENDIAN);
2558     offset+=4;
2559 
2560     /* uint16_t flags; */
2561     ti = proto_tree_add_item(tree, hf_openflow_v4_flowmod_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
2562     flags_tree = proto_item_add_subtree(ti, ett_openflow_v4_flowmod_flags);
2563 
2564     proto_tree_add_item(flags_tree, hf_openflow_v4_flowmod_flags_send_flow_rem, tvb, offset, 2, ENC_BIG_ENDIAN);
2565     proto_tree_add_item(flags_tree, hf_openflow_v4_flowmod_flags_check_overlap, tvb, offset, 2, ENC_BIG_ENDIAN);
2566     proto_tree_add_item(flags_tree, hf_openflow_v4_flowmod_flags_reset_counts,  tvb, offset, 2, ENC_BIG_ENDIAN);
2567     proto_tree_add_item(flags_tree, hf_openflow_v4_flowmod_flags_no_packet_counts, tvb, offset, 2, ENC_BIG_ENDIAN);
2568     proto_tree_add_item(flags_tree, hf_openflow_v4_flowmod_flags_no_byte_counts, tvb, offset, 2, ENC_BIG_ENDIAN);
2569     offset+=2;
2570 
2571     /* uint8_t pad[2]; */
2572     proto_tree_add_item(tree, hf_openflow_v4_flowmod_pad, tvb, offset, 2, ENC_NA);
2573     offset+=2;
2574 
2575     /* struct ofp_match match; */
2576     offset = dissect_openflow_match_v4(tvb, pinfo, tree, offset, length);
2577 
2578     /* struct ofp_instruction instructions[0]; */
2579     while (offset < length) {
2580         offset = dissect_openflow_instruction_v4(tvb, pinfo, tree, offset, length);
2581     }
2582 }
2583 
2584 static int
dissect_openflow_bucket_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)2585 dissect_openflow_bucket_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
2586 {
2587     proto_item *ti;
2588     proto_tree *bucket_tree;
2589     guint16 bucket_length;
2590     gint32 acts_end;
2591 
2592     bucket_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_openflow_v4_bucket, &ti, "Bucket");
2593 
2594     /* uint16_t len; */
2595     bucket_length = tvb_get_ntohs(tvb, offset);
2596     proto_item_set_len(ti, bucket_length);
2597     proto_tree_add_item(bucket_tree, hf_openflow_v4_bucket_length, tvb, offset, 2, ENC_BIG_ENDIAN);
2598     offset+=2;
2599 
2600     if (bucket_length < 16) {
2601         bucket_length = 16;
2602     }
2603 
2604     /* uint16_t weight; */
2605     proto_tree_add_item(bucket_tree, hf_openflow_v4_bucket_weight, tvb, offset, 2, ENC_BIG_ENDIAN);
2606     offset+=2;
2607 
2608     /* uint32_t watch_port; */
2609     proto_tree_add_item(bucket_tree, hf_openflow_v4_bucket_watch_port, tvb, offset, 4, ENC_BIG_ENDIAN);
2610     offset+=4;
2611 
2612     /* uint32_t watch_group; */
2613     proto_tree_add_item(bucket_tree, hf_openflow_v4_bucket_watch_group, tvb, offset, 4, ENC_BIG_ENDIAN);
2614     offset+=4;
2615 
2616     /* uint8_t pad[4]; */
2617     proto_tree_add_item(bucket_tree, hf_openflow_v4_bucket_pad, tvb, offset, 4, ENC_NA);
2618     offset+=4;
2619 
2620     /*struct ofp_action_header actions[0]; */
2621     acts_end = offset + bucket_length - 16;
2622     while (offset < acts_end) {
2623         offset = dissect_openflow_action_v4(tvb, pinfo, bucket_tree, offset, length);
2624     }
2625 
2626     return offset;
2627 }
2628 
2629 
2630 static const value_string openflow_v4_groupmod_command_values[] = {
2631     { 0, "OFPGC_ADD" },
2632     { 1, "OFPGC_MODIFY" },
2633     { 2, "OFPGC_DELETE" },
2634     { 0, NULL }
2635 };
2636 
2637 #define OFPGT_ALL       0
2638 #define OFPGT_SELECT    1
2639 #define OFPGT_INDIRECT  2
2640 #define OFPGT_FF        3
2641 static const value_string openflow_v4_group_type_values[] = {
2642     { OFPGT_ALL,      "OFPGT_ALL" },
2643     { OFPGT_SELECT,   "OFPGT_SELECT" },
2644     { OFPGT_INDIRECT, "OFPGT_INDIRECT" },
2645     { OFPGT_FF,       "OFPGT_FF" },
2646     { 0,              NULL }
2647 };
2648 
2649 static void
dissect_openflow_groupmod_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)2650 dissect_openflow_groupmod_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
2651 {
2652     /* uint16_t command; */
2653     proto_tree_add_item(tree, hf_openflow_v4_groupmod_command, tvb, offset, 2, ENC_BIG_ENDIAN);
2654     offset+=2;
2655 
2656     /* uint8_t type; */
2657     proto_tree_add_item(tree, hf_openflow_v4_groupmod_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2658     offset+=1;
2659 
2660     /* uint8_t pad; */
2661     proto_tree_add_item(tree, hf_openflow_v4_groupmod_pad, tvb, offset, 1, ENC_NA);
2662     offset+=1;
2663 
2664     /* uint32_t group_id; */
2665     proto_tree_add_item(tree, hf_openflow_v4_groupmod_group_id, tvb, offset, 4, ENC_BIG_ENDIAN);
2666     offset+=4;
2667 
2668     /* struct ofp_bucket buckets[0]; */
2669     while (offset < length) {
2670         offset = dissect_openflow_bucket_v4(tvb, pinfo, tree, offset, length);
2671     }
2672 }
2673 
2674 
2675 static void
dissect_openflow_portmod_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)2676 dissect_openflow_portmod_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
2677 {
2678     proto_item *ti;
2679     proto_tree *conf_tree, *mask_tree, *adv_tree;
2680 
2681     /* uint32_t port_no; */
2682     proto_tree_add_item(tree, hf_openflow_v4_portmod_port_no, tvb, offset, 4, ENC_BIG_ENDIAN);
2683     offset+=4;
2684 
2685     /* uint8_t pad[4]; */
2686     proto_tree_add_item(tree, hf_openflow_v4_portmod_pad, tvb, offset, 4, ENC_NA);
2687     offset+=4;
2688 
2689     /* uint8_t hw_addr[OFP_ETH_ALEN]; */
2690     proto_tree_add_item(tree, hf_openflow_v4_portmod_hw_addr, tvb, offset, OFP_ETH_ALEN, ENC_NA);
2691     offset+=OFP_ETH_ALEN;
2692 
2693     /* uint8_t pad2[2]; */
2694     proto_tree_add_item(tree, hf_openflow_v4_portmod_pad2, tvb, offset, 2, ENC_NA);
2695     offset+=2;
2696 
2697     /* uint32_t config; */
2698     ti = proto_tree_add_item(tree, hf_openflow_v4_portmod_config, tvb, offset, 4, ENC_BIG_ENDIAN);
2699     conf_tree = proto_item_add_subtree(ti, ett_openflow_v4_portmod_config);
2700 
2701     proto_tree_add_item(conf_tree, hf_openflow_v4_portmod_config_port_down, tvb, offset, 4, ENC_BIG_ENDIAN);
2702     proto_tree_add_item(conf_tree, hf_openflow_v4_portmod_config_no_recv, tvb, offset, 4, ENC_BIG_ENDIAN);
2703     proto_tree_add_item(conf_tree, hf_openflow_v4_portmod_config_no_fwd, tvb, offset, 4, ENC_BIG_ENDIAN);
2704     proto_tree_add_item(conf_tree, hf_openflow_v4_portmod_config_no_packet_in, tvb, offset, 4, ENC_BIG_ENDIAN);
2705     offset+=4;
2706 
2707     /* uint32_t mask; */
2708     ti = proto_tree_add_item(tree, hf_openflow_v4_portmod_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
2709     mask_tree = proto_item_add_subtree(ti, ett_openflow_v4_portmod_mask);
2710 
2711     proto_tree_add_item(mask_tree, hf_openflow_v4_portmod_mask_port_down, tvb, offset, 4, ENC_BIG_ENDIAN);
2712     proto_tree_add_item(mask_tree, hf_openflow_v4_portmod_mask_no_recv, tvb, offset, 4, ENC_BIG_ENDIAN);
2713     proto_tree_add_item(mask_tree, hf_openflow_v4_portmod_mask_no_fwd, tvb, offset, 4, ENC_BIG_ENDIAN);
2714     proto_tree_add_item(mask_tree, hf_openflow_v4_portmod_mask_no_packet_in, tvb, offset, 4, ENC_BIG_ENDIAN);
2715     offset+=4;
2716 
2717     /* uint32_t advertise; */
2718     ti = proto_tree_add_item(tree, hf_openflow_v4_portmod_advertise, tvb, offset, 4, ENC_BIG_ENDIAN);
2719     adv_tree = proto_item_add_subtree(ti, ett_openflow_v4_portmod_advertise);
2720 
2721     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_10mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2722     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_10mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2723     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_100mb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2724     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_100mb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2725     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_1gb_hd, tvb, offset, 4, ENC_BIG_ENDIAN);
2726     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_1gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2727     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_10gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2728     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_40gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2729     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_100gb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2730     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_1tb_fd, tvb, offset, 4, ENC_BIG_ENDIAN);
2731     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_other, tvb, offset, 4, ENC_BIG_ENDIAN);
2732     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_copper, tvb, offset, 4, ENC_BIG_ENDIAN);
2733     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_fiber, tvb, offset, 4, ENC_BIG_ENDIAN);
2734     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_autoneg, tvb, offset, 4, ENC_BIG_ENDIAN);
2735     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_pause, tvb, offset, 4, ENC_BIG_ENDIAN);
2736     proto_tree_add_item(adv_tree, hf_openflow_v4_portmod_advertise_pause_asym, tvb, offset, 4, ENC_BIG_ENDIAN);
2737     offset+=4;
2738 
2739     /* uint8_t pad3[4]; */
2740     proto_tree_add_item(tree, hf_openflow_v4_portmod_pad3, tvb, offset, 4, ENC_NA);
2741     /*offset+=4;*/
2742 }
2743 
2744 
2745 static void
dissect_openflow_tablemod_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)2746 dissect_openflow_tablemod_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
2747 {
2748     /* uint8_t table_id; */
2749     proto_tree_add_item(tree, hf_openflow_v4_tablemod_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2750     offset+=1;
2751 
2752     /* uint8_t pad[3]; */
2753     proto_tree_add_item(tree, hf_openflow_v4_tablemod_pad, tvb, offset, 3, ENC_NA);
2754     offset+=3;
2755 
2756     /* uint32_t config; */
2757     proto_tree_add_item(tree, hf_openflow_v4_tablemod_config, tvb, offset, 4, ENC_NA);
2758     /*offset+=4;*/
2759 }
2760 
2761 
2762 static void
dissect_openflow_flow_stats_request_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)2763 dissect_openflow_flow_stats_request_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
2764 {
2765 
2766     /* uint8_t table_id; */
2767     proto_tree_add_item(tree, hf_openflow_v4_flow_stats_request_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2768     offset+=1;
2769 
2770     /* uint8_t pad[3]; */
2771     proto_tree_add_item(tree, hf_openflow_v4_flow_stats_request_pad, tvb, offset, 3, ENC_NA);
2772     offset+=3;
2773 
2774     /* uint32_t out_port; */
2775     proto_tree_add_item(tree, hf_openflow_v4_flow_stats_request_out_port, tvb, offset, 4, ENC_BIG_ENDIAN);
2776     offset+=4;
2777 
2778     /* uint32_t out_group; */
2779     proto_tree_add_item(tree, hf_openflow_v4_flow_stats_request_out_group, tvb, offset, 4, ENC_BIG_ENDIAN);
2780     offset+=4;
2781 
2782     /* uint8_t pad2[4]; */
2783     proto_tree_add_item(tree, hf_openflow_v4_flow_stats_request_pad2, tvb, offset, 4, ENC_NA);
2784     offset+=4;
2785 
2786     /* uint64_t cookie; */
2787     proto_tree_add_item(tree, hf_openflow_v4_flow_stats_request_cookie, tvb, offset, 8, ENC_BIG_ENDIAN);
2788     offset+=8;
2789 
2790     /* uint64_t cookie_mask; */
2791     proto_tree_add_item(tree, hf_openflow_v4_flow_stats_request_cookie_mask, tvb, offset, 8, ENC_BIG_ENDIAN);
2792     offset+=8;
2793 
2794     /* struct ofp_match match; */
2795     dissect_openflow_match_v4(tvb, pinfo, tree, offset, length);
2796 }
2797 
2798 static void
dissect_openflow_aggregate_stats_request_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)2799 dissect_openflow_aggregate_stats_request_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
2800 {
2801     /* uint8_t table_id; */
2802     proto_tree_add_item(tree, hf_openflow_v4_aggregate_stats_request_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2803     offset+=1;
2804 
2805     /* uint8_t pad[3]; */
2806     proto_tree_add_item(tree, hf_openflow_v4_aggregate_stats_request_pad, tvb, offset, 3, ENC_NA);
2807     offset+=3;
2808 
2809     /* uint32_t out_port; */
2810     proto_tree_add_item(tree, hf_openflow_v4_aggregate_stats_request_out_port, tvb, offset, 4, ENC_BIG_ENDIAN);
2811     offset+=4;
2812 
2813     /* uint32_t out_group; */
2814     proto_tree_add_item(tree, hf_openflow_v4_aggregate_stats_request_out_group, tvb, offset, 4, ENC_BIG_ENDIAN);
2815     offset+=4;
2816 
2817     /* uint8_t pad2[4]; */
2818     proto_tree_add_item(tree, hf_openflow_v4_aggregate_stats_request_pad2, tvb, offset, 4, ENC_NA);
2819     offset+=4;
2820 
2821     /* uint64_t cookie; */
2822     proto_tree_add_item(tree, hf_openflow_v4_aggregate_stats_request_cookie, tvb, offset, 8, ENC_BIG_ENDIAN);
2823     offset+=8;
2824 
2825     /* uint64_t cookie_mask; */
2826     proto_tree_add_item(tree, hf_openflow_v4_aggregate_stats_request_cookie_mask, tvb, offset, 8, ENC_BIG_ENDIAN);
2827     offset+=8;
2828 
2829     /* struct ofp_match match; */
2830     dissect_openflow_match_v4(tvb, pinfo, tree, offset, length);
2831 }
2832 
2833 
2834 #define OFPTFPT_INSTRUCTIONS          0
2835 #define OFPTFPT_INSTRUCTIONS_MISS     1
2836 #define OFPTFPT_NEXT_TABLES           2
2837 #define OFPTFPT_NEXT_TABLES_MISS      3
2838 #define OFPTFPT_WRITE_ACTIONS         4
2839 #define OFPTFPT_WRITE_ACTIONS_MISS    5
2840 #define OFPTFPT_APPLY_ACTIONS         6
2841 #define OFPTFPT_APPLY_ACTIONS_MISS    7
2842 #define OFPTFPT_MATCH                 8
2843 #define OFPTFPT_WILDCARDS            10
2844 #define OFPTFPT_WRITE_SETFIELD       12
2845 #define OFPTFPT_WRITE_SETFIELD_MISS  13
2846 #define OFPTFPT_APPLY_SETFIELD       14
2847 #define OFPTFPT_APPLY_SETFIELD_MISS  15
2848 #define OFPTFPT_EXPERIMENTER         0xFFFE
2849 #define OFPTFPT_EXPERIMENTER_MISS    0xFFFF
2850 static const value_string openflow_v4_table_feature_prop_type_values[] = {
2851     { OFPTFPT_INSTRUCTIONS,        "OFPTFPT_INSTRUCTIONS" },
2852     { OFPTFPT_INSTRUCTIONS_MISS,   "OFPTFPT_INSTRUCTIONS_MISS" },
2853     { OFPTFPT_NEXT_TABLES,         "OFPTFPT_NEXT_TABLES" },
2854     { OFPTFPT_NEXT_TABLES_MISS,    "OFPTFPT_NEXT_TABLES_MISS" },
2855     { OFPTFPT_WRITE_ACTIONS,       "OFPTFPT_WRITE_ACTIONS" },
2856     { OFPTFPT_WRITE_ACTIONS_MISS,  "OFPTFPT_WRITE_ACTIONS_MISS" },
2857     { OFPTFPT_APPLY_ACTIONS,       "OFPTFPT_APPLY_ACTIONS" },
2858     { OFPTFPT_APPLY_ACTIONS_MISS,  "OFPTFPT_APPLY_ACTIONS_MISS" },
2859     { OFPTFPT_MATCH,               "OFPTFPT_MATCH" },
2860     { OFPTFPT_WILDCARDS,           "OFPTFPT_WILDCARDS" },
2861     { OFPTFPT_WRITE_SETFIELD,      "OFPTFPT_WRITE_SETFIELD" },
2862     { OFPTFPT_WRITE_SETFIELD_MISS, "OFPTFPT_WRITE_SETFIELD_MISS" },
2863     { OFPTFPT_APPLY_SETFIELD,      "OFPTFPT_APPLY_SETFIELD" },
2864     { OFPTFPT_APPLY_SETFIELD_MISS, "OFPTFPT_APPLY_SETFIELD_MISS" },
2865     { OFPTFPT_EXPERIMENTER,        "OFPTFPT_EXPERIMENTER" },
2866     { OFPTFPT_EXPERIMENTER_MISS,   "OFPTFPT_EXPERIMENTER_MISS" },
2867     { 0,                           NULL }
2868 };
2869 
2870 
2871 static int
dissect_openflow_table_feature_prop_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)2872 dissect_openflow_table_feature_prop_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
2873 {
2874     proto_item *ti;
2875     proto_tree *prop_tree, *elem_tree;
2876     guint16 prop_type;
2877     guint16 prop_length;
2878     guint16 elem_begin;
2879     gint32 body_end;
2880     guint16 pad_length;
2881 
2882     prop_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_openflow_v4_table_feature_prop, &ti, "Table feature property");
2883 
2884     /* uint16_t type; */
2885     prop_type = tvb_get_ntohs(tvb, offset);
2886     proto_tree_add_item(prop_tree, hf_openflow_v4_table_feature_prop_type, tvb, offset, 2, ENC_BIG_ENDIAN);
2887     offset+=2;
2888 
2889     /* uint16_t length; */
2890     prop_length = tvb_get_ntohs(tvb, offset);
2891     proto_item_set_len(ti, prop_length);
2892     proto_tree_add_item(prop_tree, hf_openflow_v4_table_feature_prop_length, tvb, offset, 2, ENC_BIG_ENDIAN);
2893     offset+=2;
2894 
2895     if (prop_length < 4)
2896         return offset;
2897 
2898     body_end = offset + prop_length - 4;
2899 
2900     /* body */
2901     switch (prop_type) {
2902     case OFPTFPT_INSTRUCTIONS:
2903     case OFPTFPT_INSTRUCTIONS_MISS:
2904         while (offset < body_end) {
2905             elem_begin = offset;
2906             elem_tree = proto_tree_add_subtree(prop_tree, tvb, offset, -1,
2907                         ett_openflow_v4_table_feature_prop_instruction_id, &ti, "Instruction ID");
2908 
2909             offset = dissect_openflow_instruction_header_v4(tvb, pinfo, elem_tree, offset, length);
2910             proto_item_set_len(ti, offset - elem_begin);
2911         }
2912         break;
2913 
2914     case OFPTFPT_NEXT_TABLES:
2915     case OFPTFPT_NEXT_TABLES_MISS:
2916         while (offset < body_end) {
2917             proto_tree_add_item(prop_tree, hf_openflow_v4_table_feature_prop_next_tables_next_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
2918             offset+=1;
2919         }
2920         break;
2921 
2922     case OFPTFPT_WRITE_ACTIONS:
2923     case OFPTFPT_WRITE_ACTIONS_MISS:
2924     case OFPTFPT_APPLY_ACTIONS:
2925     case OFPTFPT_APPLY_ACTIONS_MISS:
2926         while (offset < body_end) {
2927             elem_begin = offset;
2928             elem_tree = proto_tree_add_subtree(prop_tree, tvb, offset, -1, ett_openflow_v4_table_feature_prop_action_id, &ti, "Action ID");
2929 
2930             offset = dissect_openflow_action_header_v4(tvb, pinfo, elem_tree, offset, length);
2931             proto_item_set_len(ti, offset - elem_begin);
2932         }
2933         break;
2934 
2935     case OFPTFPT_MATCH:
2936     case OFPTFPT_WILDCARDS:
2937     case OFPTFPT_WRITE_SETFIELD:
2938     case OFPTFPT_WRITE_SETFIELD_MISS:
2939     case OFPTFPT_APPLY_SETFIELD:
2940     case OFPTFPT_APPLY_SETFIELD_MISS:
2941         while (offset < body_end) {
2942             elem_begin = offset;
2943             elem_tree = proto_tree_add_subtree(prop_tree, tvb, offset, -1, ett_openflow_v4_table_feature_prop_oxm_id, &ti, "OXM ID");
2944 
2945             offset = dissect_openflow_oxm_header_v4(tvb, pinfo, elem_tree, offset, length);
2946             proto_item_set_len(ti, offset - elem_begin);
2947         }
2948         break;
2949 
2950     case OFPTFPT_EXPERIMENTER:
2951     case OFPTFPT_EXPERIMENTER_MISS:
2952         /* uint32_t experimenter; */
2953         proto_tree_add_item(prop_tree, hf_openflow_v4_table_feature_prop_experimenter_experimenter, tvb, offset, 4, ENC_BIG_ENDIAN);
2954         offset+=4;
2955 
2956         /* uint32_t exp_type; */
2957         proto_tree_add_item(prop_tree, hf_openflow_v4_table_feature_prop_experimenter_exp_type, tvb, offset, 4, ENC_BIG_ENDIAN);
2958         offset+=4;
2959 
2960         /* uint32_t experimenter_data[0]; */
2961         proto_tree_add_expert_format(prop_tree, pinfo, &ei_openflow_v4_table_feature_prop_undecoded,
2962                                      tvb, offset, body_end - offset, "Experimenter table property body.");
2963         offset = body_end;
2964         break;
2965 
2966     default:
2967         proto_tree_add_expert_format(prop_tree, pinfo, &ei_openflow_v4_table_feature_prop_undecoded,
2968                                      tvb, offset, body_end - offset, "Unknown table property body.");
2969         offset = body_end;
2970         break;
2971     };
2972 
2973     pad_length = (prop_length + 7)/8*8 - prop_length;
2974     if (pad_length > 0) {
2975         proto_tree_add_item(prop_tree, hf_openflow_v4_table_feature_prop_pad, tvb, offset, pad_length, ENC_NA);
2976         offset+=pad_length;
2977     }
2978 
2979     return offset;
2980 }
2981 
2982 
2983 #define OFP_MAX_TABLE_NAME_LEN  32
2984 static int
dissect_openflow_table_features_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)2985 dissect_openflow_table_features_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
2986 {
2987     proto_item *ti;
2988     proto_tree *feat_tree;
2989     guint16 feat_length;
2990     gint32 feat_end;
2991 
2992     feat_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_openflow_v4_table_features, &ti, "Table features");
2993 
2994     /* uint16_t length; */
2995     feat_length = tvb_get_ntohs(tvb, offset);
2996     feat_end = offset + feat_length;
2997     proto_item_set_len(ti, feat_length);
2998     proto_tree_add_item(feat_tree, hf_openflow_v4_table_features_length, tvb, offset, 2, ENC_BIG_ENDIAN);
2999     offset+=2;
3000 
3001     /* uint8_t table_id; */
3002     proto_tree_add_item(feat_tree, hf_openflow_v4_table_features_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
3003     offset+=1;
3004 
3005     /* uint8_t pad[5]; */
3006     proto_tree_add_item(feat_tree, hf_openflow_v4_table_features_pad, tvb, offset, 5, ENC_NA);
3007     offset+=5;
3008 
3009     /* char name[OFP_MAX_TABLE_NAME_LEN]; */
3010     proto_tree_add_item(feat_tree, hf_openflow_v4_table_features_name, tvb, offset, OFP_MAX_TABLE_NAME_LEN, ENC_ASCII|ENC_NA);
3011     offset+=OFP_MAX_TABLE_NAME_LEN;
3012 
3013     /* uint64_t metadata_match; */
3014     proto_tree_add_item(feat_tree, hf_openflow_v4_table_features_metadata_match, tvb, offset, 8, ENC_BIG_ENDIAN);
3015     offset+=8;
3016 
3017     /* uint64_t metadata_write; */
3018     proto_tree_add_item(feat_tree, hf_openflow_v4_table_features_metadata_write, tvb, offset, 8, ENC_BIG_ENDIAN);
3019     offset+=8;
3020 
3021     /* uint32_t config; */
3022     proto_tree_add_item(feat_tree, hf_openflow_v4_table_features_config, tvb, offset, 4, ENC_NA);
3023     offset+=4;
3024 
3025     /* uint32_t max_entries; */
3026     proto_tree_add_item(feat_tree, hf_openflow_v4_table_features_max_entries, tvb, offset, 4, ENC_BIG_ENDIAN);
3027     offset+=4;
3028 
3029     /* struct ofp_table_feature_prop_header properties[0]; */
3030     while (offset < feat_end) {
3031         offset = dissect_openflow_table_feature_prop_v4(tvb, pinfo, feat_tree, offset, length);
3032     }
3033 
3034     return offset;
3035 }
3036 
3037 
3038 static void
dissect_openflow_port_stats_request_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3039 dissect_openflow_port_stats_request_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3040 {
3041     /* uint32_t port_no; */
3042     proto_tree_add_item(tree, hf_openflow_v4_port_stats_request_port_no, tvb, offset, 4, ENC_BIG_ENDIAN);
3043     offset+=4;
3044 
3045     /* uint8_t pad[4]; */
3046     proto_tree_add_item(tree, hf_openflow_v4_port_stats_request_pad, tvb, offset, 4, ENC_NA);
3047     /*offset+=4;*/
3048 }
3049 
3050 #define OFPQ_ALL  0xffffffff
3051 static const value_string openflow_v4_queue_reserved_values[] = {
3052     { OFPQ_ALL, "OFPQ_ALL" },
3053     { 0,        NULL }
3054 };
3055 
3056 static void
dissect_openflow_queue_stats_request_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3057 dissect_openflow_queue_stats_request_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3058 {
3059     /* uint32_t port_no; */
3060     proto_tree_add_item(tree, hf_openflow_v4_queue_stats_request_port_no, tvb, offset, 4, ENC_BIG_ENDIAN);
3061     offset+=4;
3062 
3063     /* uint32_t queue_id; */
3064     proto_tree_add_item(tree, hf_openflow_v4_queue_stats_request_queue_id, tvb, offset, 4, ENC_BIG_ENDIAN);
3065     /*offset+=4;*/
3066 }
3067 
3068 
3069 static void
dissect_openflow_group_stats_request_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3070 dissect_openflow_group_stats_request_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3071 {
3072     /* uint32_t group_id; */
3073     proto_tree_add_item(tree, hf_openflow_v4_group_stats_request_group_id, tvb, offset, 4, ENC_BIG_ENDIAN);
3074     offset+=4;
3075 
3076     /* uint8_t pad[4]; */
3077     proto_tree_add_item(tree, hf_openflow_v4_group_stats_request_pad, tvb, offset, 4, ENC_NA);
3078     /*offset+=4;*/
3079 }
3080 
3081 
3082 static void
dissect_openflow_meter_stats_request_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3083 dissect_openflow_meter_stats_request_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3084 {
3085     /* uint32_t meter_id; */
3086     proto_tree_add_item(tree, hf_openflow_v4_meter_stats_request_meter_id, tvb, offset, 4, ENC_BIG_ENDIAN);
3087     offset+=4;
3088 
3089     /* uint8_t pad[4]; */
3090     proto_tree_add_item(tree, hf_openflow_v4_meter_stats_request_pad, tvb, offset, 4, ENC_NA);
3091     /*offset+=4;*/
3092 }
3093 
3094 
3095 static void
dissect_openflow_meter_config_request_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3096 dissect_openflow_meter_config_request_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3097 {
3098     /* uint32_t meter_id; */
3099     proto_tree_add_item(tree, hf_openflow_v4_meter_config_request_meter_id, tvb, offset, 4, ENC_BIG_ENDIAN);
3100     offset+=4;
3101 
3102     /* uint8_t pad[4]; */
3103     proto_tree_add_item(tree, hf_openflow_v4_meter_config_request_pad, tvb, offset, 4, ENC_NA);
3104     /*offset+=4;*/
3105 }
3106 
3107 
3108 #define OFPMP_DESC             0
3109 #define OFPMP_FLOW             1
3110 #define OFPMP_AGGREGATE        2
3111 #define OFPMP_TABLE            3
3112 #define OFPMP_PORT_STATS       4
3113 #define OFPMP_QUEUE            5
3114 #define OFPMP_GROUP            6
3115 #define OFPMP_GROUP_DESC       7
3116 #define OFPMP_GROUP_FEATURES   8
3117 #define OFPMP_METER            9
3118 #define OFPMP_METER_CONFIG    10
3119 #define OFPMP_METER_FEATURES  11
3120 #define OFPMP_TABLE_FEATURES  12
3121 #define OFPMP_PORT_DESC       13
3122 #define OFPMP_EXPERIMENTER    0xffff
3123 static const value_string openflow_v4_multipart_type_values[] = {
3124     { OFPMP_DESC,           "OFPMP_DESC" },
3125     { OFPMP_FLOW,           "OFPMP_FLOW" },
3126     { OFPMP_AGGREGATE,      "OFPMP_AGGREGATE" },
3127     { OFPMP_TABLE,          "OFPMP_TABLE" },
3128     { OFPMP_PORT_STATS,     "OFPMP_PORT_STATS" },
3129     { OFPMP_QUEUE,          "OFPMP_QUEUE" },
3130     { OFPMP_GROUP,          "OFPMP_GROUP" },
3131     { OFPMP_GROUP_DESC,     "OFPMP_GROUP_DESC" },
3132     { OFPMP_GROUP_FEATURES, "OFPMP_GROUP_FEATURES" },
3133     { OFPMP_METER,          "OFPMP_METER" },
3134     { OFPMP_METER_CONFIG,   "OFPMP_METER_CONFIG" },
3135     { OFPMP_METER_FEATURES, "OFPMP_METER_FEATURES" },
3136     { OFPMP_TABLE_FEATURES, "OFPMP_TABLE_FEATURES" },
3137     { OFPMP_PORT_DESC,      "OFPMP_PORT_DESC" },
3138     { OFPMP_EXPERIMENTER,   "OFPMP_EXPERIMENTER" },
3139     { 0, NULL }
3140 };
3141 
3142 #define OFPMPF_REQ_MORE  1 << 0
3143 static void
dissect_openflow_multipart_request_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)3144 dissect_openflow_multipart_request_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
3145 {
3146     proto_item *ti;
3147     proto_tree *flags_tree;
3148     guint16 type;
3149 
3150     /* uint16_t type; */
3151     type = tvb_get_ntohs(tvb, offset);
3152     proto_tree_add_item(tree, hf_openflow_v4_multipart_request_type , tvb, offset, 2, ENC_BIG_ENDIAN);
3153     offset+=2;
3154 
3155     col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
3156                   val_to_str_const(type, openflow_v4_multipart_type_values, "Unknown type"));
3157 
3158     /* uint16_t flags; */
3159     ti = proto_tree_add_item(tree, hf_openflow_v4_multipart_request_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
3160     flags_tree = proto_item_add_subtree(ti, ett_openflow_v4_multipart_request_flags);
3161 
3162     proto_tree_add_item(flags_tree, hf_openflow_v4_multipart_request_flags_more, tvb, offset, 2, ENC_BIG_ENDIAN);
3163     offset+=2;
3164 
3165     /* uint8_t pad[4]; */
3166     proto_tree_add_item(tree, hf_openflow_v4_multipart_request_pad, tvb, offset, 4, ENC_NA);
3167     offset+=4;
3168 
3169     /* uint8_t body[0]; */
3170     switch(type){
3171     case OFPMP_DESC:
3172         /* The request body is empty. */
3173         break;
3174     case OFPMP_FLOW:
3175         dissect_openflow_flow_stats_request_v4(tvb, pinfo, tree, offset, length);
3176         break;
3177     case OFPMP_AGGREGATE:
3178         dissect_openflow_aggregate_stats_request_v4(tvb, pinfo, tree, offset, length);
3179         break;
3180     case OFPMP_TABLE:
3181          /* The request body is empty. */
3182         break;
3183     case OFPMP_PORT_STATS:
3184         dissect_openflow_port_stats_request_v4(tvb, pinfo, tree, offset, length);
3185         break;
3186     case OFPMP_QUEUE:
3187         dissect_openflow_queue_stats_request_v4(tvb, pinfo, tree, offset, length);
3188         break;
3189     case OFPMP_GROUP:
3190         dissect_openflow_group_stats_request_v4(tvb, pinfo, tree, offset, length);
3191         break;
3192     case OFPMP_GROUP_DESC:
3193         /* The request body is empty. */
3194         break;
3195     case OFPMP_GROUP_FEATURES:
3196         /* The request body is empty. */
3197         break;
3198     case OFPMP_METER:
3199         dissect_openflow_meter_stats_request_v4(tvb, pinfo, tree, offset, length);
3200         break;
3201     case OFPMP_METER_CONFIG:
3202         dissect_openflow_meter_config_request_v4(tvb, pinfo, tree, offset, length);
3203         break;
3204     case OFPMP_METER_FEATURES:
3205         /* The request body is empty. */
3206         break;
3207     case OFPMP_TABLE_FEATURES:
3208         while (offset < length) {
3209             offset = dissect_openflow_table_features_v4(tvb, pinfo, tree, offset, length);
3210         }
3211         break;
3212     case OFPMP_PORT_DESC:
3213         /* The request body is empty. */
3214         break;
3215     case OFPMP_EXPERIMENTER:
3216         /* uint32_t experimenter; */
3217         proto_tree_add_item(tree, hf_openflow_v4_multipart_request_experimenter_experimenter, tvb, offset, 4, ENC_BIG_ENDIAN);
3218         offset+=4;
3219 
3220         /* uint32_t exp_type; */
3221         proto_tree_add_item(tree, hf_openflow_v4_multipart_request_experimenter_exp_type, tvb, offset, 4, ENC_BIG_ENDIAN);
3222         offset+=4;
3223 
3224         /* uint32_t experimenter_data[0]; */
3225         if (offset < length) {
3226             proto_tree_add_expert_format(tree, pinfo, &ei_openflow_v4_multipart_request_undecoded,
3227                                          tvb, offset, length - offset, "Experimenter multipart request body.");
3228         }
3229         break;
3230     default:
3231         proto_tree_add_expert_format(tree, pinfo, &ei_openflow_v4_multipart_request_undecoded,
3232                                      tvb, offset, length - offset, "Unknown multipart request body.");
3233         break;
3234     }
3235 }
3236 
3237 
3238 #define DESC_STR_LEN    256
3239 #define SERIAL_NUM_LEN  32
3240 static void
dissect_openflow_switch_description_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3241 dissect_openflow_switch_description_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3242 {
3243     /* char mfr_desc[DESC_STR_LEN]; */
3244     proto_tree_add_item(tree, hf_openflow_v4_switch_description_mfr_desc, tvb, offset, DESC_STR_LEN, ENC_ASCII|ENC_NA);
3245     offset+=DESC_STR_LEN;
3246 
3247     /* char hw_desc[DESC_STR_LEN]; */
3248     proto_tree_add_item(tree, hf_openflow_v4_switch_description_hw_desc, tvb, offset, DESC_STR_LEN, ENC_ASCII|ENC_NA);
3249     offset+=DESC_STR_LEN;
3250 
3251     /* char sw_desc[DESC_STR_LEN]; */
3252     proto_tree_add_item(tree, hf_openflow_v4_switch_description_sw_desc, tvb, offset, DESC_STR_LEN, ENC_ASCII|ENC_NA);
3253     offset+=DESC_STR_LEN;
3254 
3255     /* char serial_num[SERIAL_NUM_LEN]; */
3256     proto_tree_add_item(tree, hf_openflow_v4_switch_description_serial_num, tvb, offset, SERIAL_NUM_LEN, ENC_ASCII|ENC_NA);
3257     offset+=SERIAL_NUM_LEN;
3258 
3259     /* char dp_desc[DESC_STR_LEN]; */
3260     proto_tree_add_item(tree, hf_openflow_v4_switch_description_dp_desc, tvb, offset, DESC_STR_LEN, ENC_ASCII|ENC_NA);
3261     /*offset+=DESC_STR_LEN;*/
3262 }
3263 
3264 
3265 static int
dissect_openflow_flow_stats_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3266 dissect_openflow_flow_stats_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3267 {
3268     proto_item *ti;
3269     proto_tree *stats_tree, *flags_tree;
3270     guint16 stats_len;
3271     gint32 stats_end;
3272 
3273     stats_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_openflow_v4_flow_stats, &ti, "Flow stats");
3274 
3275     /* uint16_t length; */
3276     stats_len = tvb_get_ntohs(tvb, offset);
3277     stats_end = offset + stats_len;
3278     proto_item_set_len(ti, stats_len);
3279     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_length, tvb, offset, 2, ENC_BIG_ENDIAN);
3280     offset+=2;
3281 
3282     /* uint8_t table_id; */
3283     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
3284     offset+=1;
3285 
3286     /* uint8_t pad; */
3287     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_pad, tvb, offset, 1, ENC_NA);
3288     offset+=1;
3289 
3290     /* uint32_t duration_sec; */
3291     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_duration_sec, tvb, offset, 4, ENC_BIG_ENDIAN);
3292     offset+=4;
3293 
3294     /* uint32_t duration_nsec; */
3295     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_duration_nsec, tvb, offset, 4, ENC_BIG_ENDIAN);
3296     offset+=4;
3297 
3298     /* uint16_t priority; */
3299     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_priority, tvb, offset, 2, ENC_BIG_ENDIAN);
3300     offset+=2;
3301 
3302     /* uint16_t idle_timeout; */
3303     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_idle_timeout, tvb, offset, 2, ENC_BIG_ENDIAN);
3304     offset+=2;
3305 
3306     /* uint16_t hard_timeout; */
3307     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_hard_timeout, tvb, offset, 2, ENC_BIG_ENDIAN);
3308     offset+=2;
3309 
3310     /* uint16_t flags; */
3311     ti = proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
3312     flags_tree = proto_item_add_subtree(ti, ett_openflow_v4_flow_stats_flags);
3313 
3314     proto_tree_add_item(flags_tree, hf_openflow_v4_flow_stats_flags_send_flow_rem, tvb, offset, 2, ENC_BIG_ENDIAN);
3315     proto_tree_add_item(flags_tree, hf_openflow_v4_flow_stats_flags_check_overlap, tvb, offset, 2, ENC_BIG_ENDIAN);
3316     proto_tree_add_item(flags_tree, hf_openflow_v4_flow_stats_flags_reset_counts,  tvb, offset, 2, ENC_BIG_ENDIAN);
3317     proto_tree_add_item(flags_tree, hf_openflow_v4_flow_stats_flags_no_packet_counts, tvb, offset, 2, ENC_BIG_ENDIAN);
3318     proto_tree_add_item(flags_tree, hf_openflow_v4_flow_stats_flags_no_byte_counts, tvb, offset, 2, ENC_BIG_ENDIAN);
3319     offset+=2;
3320 
3321     /* uint8_t pad2[4]; */
3322     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_pad2, tvb, offset, 4, ENC_NA);
3323     offset+=4;
3324 
3325     /* uint64_t cookie; */
3326     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_cookie, tvb, offset, 8, ENC_BIG_ENDIAN);
3327     offset+=8;
3328 
3329     /* uint64_t packet_count; */
3330     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_packet_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3331     offset+=8;
3332 
3333     /* uint64_t byte_count; */
3334     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_byte_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3335     offset+=8;
3336 
3337     /* struct ofp_match match; */
3338     offset = dissect_openflow_match_v4(tvb, pinfo, stats_tree, offset, length);
3339 
3340     /* struct ofp_instruction instructions[0]; */
3341     while (offset < stats_end) {
3342         offset = dissect_openflow_instruction_v4(tvb, pinfo, stats_tree, offset, length);
3343     }
3344 
3345     return offset;
3346 }
3347 
3348 
3349 static void
dissect_openflow_aggregate_stats_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3350 dissect_openflow_aggregate_stats_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3351 {
3352     /* uint64_t packet_count; */
3353     proto_tree_add_item(tree, hf_openflow_v4_aggregate_stats_packet_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3354     offset+=8;
3355 
3356     /* uint64_t byte_count; */
3357     proto_tree_add_item(tree, hf_openflow_v4_aggregate_stats_byte_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3358     offset+=8;
3359 
3360     /* uint32_t flow_count; */
3361     proto_tree_add_item(tree, hf_openflow_v4_aggregate_stats_flow_count, tvb, offset, 4, ENC_BIG_ENDIAN);
3362     offset+=4;
3363 
3364     /* uint8_t pad[4]; */
3365     proto_tree_add_item(tree, hf_openflow_v4_aggregate_stats_pad, tvb, offset, 4, ENC_NA);
3366     /*offset+=4;*/
3367 }
3368 
3369 
3370 static int
dissect_openflow_table_stats_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3371 dissect_openflow_table_stats_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3372 {
3373     proto_tree *stats_tree;
3374 
3375     stats_tree = proto_tree_add_subtree(tree, tvb, offset, 24, ett_openflow_v4_table_stats, NULL, "Table stats");
3376 
3377     /* uint8_t table_id; */
3378     proto_tree_add_item(stats_tree, hf_openflow_v4_table_stats_table_id, tvb, offset, 1, ENC_BIG_ENDIAN);
3379     offset+=1;
3380 
3381     /* uint8_t pad[3]; */
3382     proto_tree_add_item(stats_tree, hf_openflow_v4_table_stats_pad, tvb, offset, 3, ENC_NA);
3383     offset+=3;
3384 
3385     /* uint32_t active_count; */
3386     proto_tree_add_item(stats_tree, hf_openflow_v4_table_stats_active_count, tvb, offset, 4, ENC_BIG_ENDIAN);
3387     offset+=4;
3388 
3389     /* uint64_t lookup_count; */
3390     proto_tree_add_item(stats_tree, hf_openflow_v4_table_stats_lookup_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3391     offset+=8;
3392 
3393     /* uint64_t matched_count; */
3394     proto_tree_add_item(stats_tree, hf_openflow_v4_table_stats_match_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3395     offset+=8;
3396 
3397     return offset;
3398 }
3399 
3400 
3401 static int
dissect_openflow_port_stats_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3402 dissect_openflow_port_stats_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3403 {
3404     proto_tree *stats_tree;
3405 
3406     stats_tree = proto_tree_add_subtree(tree, tvb, offset, 112, ett_openflow_v4_port_stats, NULL, "Port stats");
3407 
3408     /* uint8_t port_no; */
3409     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_port_no, tvb, offset, 4, ENC_BIG_ENDIAN);
3410     offset+=4;
3411 
3412     /* uint8_t pad[4]; */
3413     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_pad, tvb, offset, 4, ENC_NA);
3414     offset+=4;
3415 
3416     /* uint64_t rx_packets; */
3417     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_rx_packets, tvb, offset, 8, ENC_BIG_ENDIAN);
3418     offset+=8;
3419 
3420     /* uint64_t tx_packets; */
3421     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_tx_packets, tvb, offset, 8, ENC_BIG_ENDIAN);
3422     offset+=8;
3423 
3424     /* uint64_t rx_bytes; */
3425     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_rx_bytes, tvb, offset, 8, ENC_BIG_ENDIAN);
3426     offset+=8;
3427 
3428     /* uint64_t tx_bytes; */
3429     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_tx_bytes, tvb, offset, 8, ENC_BIG_ENDIAN);
3430     offset+=8;
3431 
3432     /* uint64_t rx_dropped; */
3433     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_rx_dropped, tvb, offset, 8, ENC_BIG_ENDIAN);
3434     offset+=8;
3435 
3436     /* uint64_t tx_dropped; */
3437     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_tx_dropped, tvb, offset, 8, ENC_BIG_ENDIAN);
3438     offset+=8;
3439 
3440     /* uint64_t rx_errors; */
3441     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_rx_errors, tvb, offset, 8, ENC_BIG_ENDIAN);
3442     offset+=8;
3443 
3444     /* uint64_t tx_errors; */
3445     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_tx_errors, tvb, offset, 8, ENC_BIG_ENDIAN);
3446     offset+=8;
3447 
3448     /* uint64_t rx_frame_error; */
3449     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_rx_frame_error, tvb, offset, 8, ENC_BIG_ENDIAN);
3450     offset+=8;
3451 
3452     /* uint64_t rx_over_error; */
3453     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_rx_over_error, tvb, offset, 8, ENC_BIG_ENDIAN);
3454     offset+=8;
3455 
3456     /* uint64_t rx_crc_error; */
3457     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_rx_crc_error, tvb, offset, 8, ENC_BIG_ENDIAN);
3458     offset+=8;
3459 
3460     /* uint64_t collisions; */
3461     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_collisions, tvb, offset, 8, ENC_BIG_ENDIAN);
3462     offset+=8;
3463 
3464     /* uint32_t duration_sec; */
3465     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_duration_sec, tvb, offset, 4, ENC_BIG_ENDIAN);
3466     offset+=4;
3467 
3468     /* uint32_t duration_nsec; */
3469     proto_tree_add_item(stats_tree, hf_openflow_v4_port_stats_duration_nsec, tvb, offset, 4, ENC_BIG_ENDIAN);
3470     offset+=4;
3471 
3472     return offset;
3473 }
3474 
3475 
3476 static int
dissect_openflow_queue_stats_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3477 dissect_openflow_queue_stats_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3478 {
3479     proto_tree *stats_tree;
3480 
3481     stats_tree = proto_tree_add_subtree(tree, tvb, offset, 40, ett_openflow_v4_queue_stats, NULL, "Queue stats");
3482 
3483     /* uint32_t port_no; */
3484     proto_tree_add_item(stats_tree, hf_openflow_v4_queue_stats_port_no, tvb, offset, 4, ENC_BIG_ENDIAN);
3485     offset+=4;
3486 
3487     /* uint32_t queue_id; */
3488     proto_tree_add_item(stats_tree, hf_openflow_v4_queue_stats_queue_id, tvb, offset, 4, ENC_BIG_ENDIAN);
3489     offset+=4;
3490 
3491     /* uint64_t tx_bytes; */
3492     proto_tree_add_item(stats_tree, hf_openflow_v4_queue_stats_tx_bytes, tvb, offset, 8, ENC_BIG_ENDIAN);
3493     offset+=8;
3494 
3495     /* uint64_t tx_packets; */
3496     proto_tree_add_item(stats_tree, hf_openflow_v4_queue_stats_tx_packets, tvb, offset, 8, ENC_BIG_ENDIAN);
3497     offset+=8;
3498 
3499     /* uint64_t tx_errors; */
3500     proto_tree_add_item(stats_tree, hf_openflow_v4_queue_stats_tx_errors, tvb, offset, 8, ENC_BIG_ENDIAN);
3501     offset+=8;
3502 
3503     /* uint32_t duration_sec; */
3504     proto_tree_add_item(stats_tree, hf_openflow_v4_queue_stats_duration_sec, tvb, offset, 4, ENC_BIG_ENDIAN);
3505     offset+=4;
3506 
3507     /* uint32_t duration_nsec; */
3508     proto_tree_add_item(stats_tree, hf_openflow_v4_queue_stats_duration_nsec, tvb, offset, 4, ENC_BIG_ENDIAN);
3509     offset+=4;
3510 
3511     return offset;
3512 }
3513 
3514 
3515 static int
dissect_openflow_bucket_counter_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3516 dissect_openflow_bucket_counter_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3517 {
3518     proto_tree *counter_tree;
3519 
3520     counter_tree = proto_tree_add_subtree(tree, tvb, offset, 16, ett_openflow_v4_bucket_counter, NULL, "Bucket counter");
3521 
3522     /* uint64_t packet_count; */
3523     proto_tree_add_item(counter_tree, hf_openflow_v4_bucket_counter_packet_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3524     offset+=8;
3525 
3526     /* uint64_t byte_count; */
3527     proto_tree_add_item(counter_tree, hf_openflow_v4_bucket_counter_byte_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3528     offset+=8;
3529 
3530     return offset;
3531 }
3532 
3533 
3534 static int
dissect_openflow_group_stats_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3535 dissect_openflow_group_stats_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3536 {
3537     proto_item *ti;
3538     proto_tree *stats_tree;
3539     guint16 stats_len;
3540     gint32 stats_end;
3541 
3542     stats_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_openflow_v4_group_stats, &ti, "Group stats");
3543 
3544     /* uint16_t length; */
3545     stats_len = tvb_get_ntohs(tvb, offset);
3546     stats_end = offset + stats_len;
3547     proto_item_set_len(ti, stats_len);
3548     proto_tree_add_item(stats_tree, hf_openflow_v4_group_stats_length, tvb, offset, 2, ENC_BIG_ENDIAN);
3549     offset+=2;
3550 
3551     /* uint8_t pad[2]; */
3552     proto_tree_add_item(stats_tree, hf_openflow_v4_group_stats_pad, tvb, offset, 2, ENC_NA);
3553     offset+=2;
3554 
3555     /* uint32_t group_id; */
3556     proto_tree_add_item(stats_tree, hf_openflow_v4_group_stats_group_id, tvb, offset, 4, ENC_BIG_ENDIAN);
3557     offset+=4;
3558 
3559     /* uint32_t ref_count; */
3560     proto_tree_add_item(stats_tree, hf_openflow_v4_group_stats_ref_count, tvb, offset, 4, ENC_BIG_ENDIAN);
3561     offset+=4;
3562 
3563     /* uint8_t pad2[4]; */
3564     proto_tree_add_item(stats_tree, hf_openflow_v4_group_stats_pad2, tvb, offset, 4, ENC_NA);
3565     offset+=4;
3566 
3567     /* uint64_t packet_count; */
3568     proto_tree_add_item(stats_tree, hf_openflow_v4_group_stats_packet_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3569     offset+=8;
3570 
3571     /* uint64_t byte_count; */
3572     proto_tree_add_item(stats_tree, hf_openflow_v4_group_stats_byte_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3573     offset+=8;
3574 
3575     /* uint32_t duration_sec; */
3576     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_duration_sec, tvb, offset, 4, ENC_BIG_ENDIAN);
3577     offset+=4;
3578 
3579     /* uint32_t duration_nsec; */
3580     proto_tree_add_item(stats_tree, hf_openflow_v4_flow_stats_duration_nsec, tvb, offset, 4, ENC_BIG_ENDIAN);
3581     offset+=4;
3582 
3583     /* struct ofp_bucket_counter bucket_stats[0]; */
3584     while (offset < stats_end) {
3585         offset = dissect_openflow_bucket_counter_v4(tvb, pinfo, stats_tree, offset, length);
3586     }
3587 
3588     return offset;
3589 }
3590 
3591 static int
dissect_openflow_group_desc_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)3592 dissect_openflow_group_desc_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
3593 {
3594     proto_item *ti;
3595     proto_tree *desc_tree;
3596 
3597     guint16 desc_len;
3598     gint32 desc_end;
3599 
3600     desc_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_openflow_v4_group_desc, &ti, "Group description");
3601 
3602     /* uint16_t length; */
3603     desc_len = tvb_get_ntohs(tvb, offset);
3604     desc_end = offset + desc_len;
3605     proto_item_set_len(ti, desc_len);
3606     proto_tree_add_item(desc_tree, hf_openflow_v4_group_desc_length, tvb, offset, 2, ENC_BIG_ENDIAN);
3607     offset+=2;
3608 
3609     /* uint8_t type; */
3610     proto_tree_add_item(desc_tree, hf_openflow_v4_group_desc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3611     offset+=1;
3612 
3613     /* uint8_t pad; */
3614     proto_tree_add_item(desc_tree, hf_openflow_v4_group_desc_pad, tvb, offset, 1, ENC_NA);
3615     offset+=1;
3616 
3617     /* uint32_t group_id; */
3618     proto_tree_add_item(desc_tree, hf_openflow_v4_group_desc_group_id, tvb, offset, 4, ENC_BIG_ENDIAN);
3619     offset+=4;
3620 
3621     /* struct ofp_bucket buckets[0]; */
3622     while (offset < desc_end) {
3623         offset = dissect_openflow_bucket_v4(tvb, pinfo, desc_tree, offset, length);
3624     }
3625 
3626     return offset;
3627 }
3628 
3629 
3630 #define OFPGFC_SELECT_WEIGHT    1 << 0
3631 #define OFPGFC_SELECT_LIVENESS  1 << 1
3632 #define OFPGFC_CHAINING         1 << 2
3633 #define OFPGFC_CHAINING_CHECKS  1 << 3
3634 static void
dissect_openflow_group_features_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3635 dissect_openflow_group_features_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3636 {
3637     proto_item *ti;
3638     proto_tree *types_tree, *caps_tree, *acts_tree;
3639 
3640     /* uint32_t types; */
3641     ti = proto_tree_add_item(tree, hf_openflow_v4_group_features_types, tvb, offset, 4, ENC_BIG_ENDIAN);
3642     types_tree = proto_item_add_subtree(ti, ett_openflow_v4_group_features_types);
3643 
3644     proto_tree_add_item(types_tree, hf_openflow_v4_group_features_types_all, tvb, offset, 4, ENC_BIG_ENDIAN);
3645     proto_tree_add_item(types_tree, hf_openflow_v4_group_features_types_select, tvb, offset, 4, ENC_BIG_ENDIAN);
3646     proto_tree_add_item(types_tree, hf_openflow_v4_group_features_types_indirect, tvb, offset, 4, ENC_BIG_ENDIAN);
3647     proto_tree_add_item(types_tree, hf_openflow_v4_group_features_types_ff, tvb, offset, 4, ENC_BIG_ENDIAN);
3648     offset+=4;
3649 
3650     /* uint32_t capabilities; */
3651     ti = proto_tree_add_item(tree, hf_openflow_v4_group_features_capabilities, tvb, offset, 4, ENC_BIG_ENDIAN);
3652     caps_tree = proto_item_add_subtree(ti, ett_openflow_v4_group_features_capabilities);
3653 
3654     proto_tree_add_item(caps_tree, hf_openflow_v4_group_features_capabilities_select_weight, tvb, offset, 4, ENC_BIG_ENDIAN);
3655     proto_tree_add_item(caps_tree, hf_openflow_v4_group_features_capabilities_select_liveness, tvb, offset, 4, ENC_BIG_ENDIAN);
3656     proto_tree_add_item(caps_tree, hf_openflow_v4_group_features_capabilities_chaining, tvb, offset, 4, ENC_BIG_ENDIAN);
3657     proto_tree_add_item(caps_tree, hf_openflow_v4_group_features_capabilities_chaining_checks, tvb, offset, 4, ENC_BIG_ENDIAN);
3658     offset+=4;
3659 
3660     /* max_groups[4]; */
3661     proto_tree_add_item(tree, hf_openflow_v4_group_features_max_groups_all, tvb, offset, 4, ENC_BIG_ENDIAN);
3662     offset+=4;
3663     proto_tree_add_item(tree, hf_openflow_v4_group_features_max_groups_select, tvb, offset, 4, ENC_BIG_ENDIAN);
3664     offset+=4;
3665     proto_tree_add_item(tree, hf_openflow_v4_group_features_max_groups_indirect, tvb, offset, 4, ENC_BIG_ENDIAN);
3666     offset+=4;
3667     proto_tree_add_item(tree, hf_openflow_v4_group_features_max_groups_ff, tvb, offset, 4, ENC_BIG_ENDIAN);
3668     offset+=4;
3669 
3670     /* uint32_t actions[4]; */
3671     ti = proto_tree_add_item(tree, hf_openflow_v4_group_features_actions_all, tvb, offset, 4, ENC_BIG_ENDIAN);
3672     acts_tree = proto_item_add_subtree(ti, ett_openflow_v4_group_features_actions_all);
3673 
3674     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_output, tvb, offset, 4, ENC_BIG_ENDIAN);
3675     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_copy_ttl_out, tvb, offset, 4, ENC_BIG_ENDIAN);
3676     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_copy_ttl_in, tvb, offset, 4, ENC_BIG_ENDIAN);
3677     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_set_mpls_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3678     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_dec_mpls_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3679     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_push_vlan, tvb, offset, 4, ENC_BIG_ENDIAN);
3680     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_pop_vlan, tvb, offset, 4, ENC_BIG_ENDIAN);
3681     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_push_mpls, tvb, offset, 4, ENC_BIG_ENDIAN);
3682     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_pop_mpls, tvb, offset, 4, ENC_BIG_ENDIAN);
3683     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_set_queue, tvb, offset, 4, ENC_BIG_ENDIAN);
3684     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_group, tvb, offset, 4, ENC_BIG_ENDIAN);
3685     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_set_nw_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3686     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_dec_nw_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3687     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_set_field, tvb, offset, 4, ENC_BIG_ENDIAN);
3688     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_push_pbb, tvb, offset, 4, ENC_BIG_ENDIAN);
3689     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_all_pop_pbb, tvb, offset, 4, ENC_BIG_ENDIAN);
3690     offset+=4;
3691 
3692     ti = proto_tree_add_item(tree, hf_openflow_v4_group_features_actions_select, tvb, offset, 4, ENC_BIG_ENDIAN);
3693     acts_tree = proto_item_add_subtree(ti, ett_openflow_v4_group_features_actions_select);
3694 
3695     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_output, tvb, offset, 4, ENC_BIG_ENDIAN);
3696     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_copy_ttl_out, tvb, offset, 4, ENC_BIG_ENDIAN);
3697     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_copy_ttl_in, tvb, offset, 4, ENC_BIG_ENDIAN);
3698     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_set_mpls_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3699     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_dec_mpls_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3700     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_push_vlan, tvb, offset, 4, ENC_BIG_ENDIAN);
3701     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_pop_vlan, tvb, offset, 4, ENC_BIG_ENDIAN);
3702     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_push_mpls, tvb, offset, 4, ENC_BIG_ENDIAN);
3703     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_pop_mpls, tvb, offset, 4, ENC_BIG_ENDIAN);
3704     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_set_queue, tvb, offset, 4, ENC_BIG_ENDIAN);
3705     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_group, tvb, offset, 4, ENC_BIG_ENDIAN);
3706     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_set_nw_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3707     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_dec_nw_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3708     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_set_field, tvb, offset, 4, ENC_BIG_ENDIAN);
3709     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_push_pbb, tvb, offset, 4, ENC_BIG_ENDIAN);
3710     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_select_pop_pbb, tvb, offset, 4, ENC_BIG_ENDIAN);
3711     offset+=4;
3712 
3713     ti = proto_tree_add_item(tree, hf_openflow_v4_group_features_actions_indirect, tvb, offset, 4, ENC_BIG_ENDIAN);
3714     acts_tree = proto_item_add_subtree(ti, ett_openflow_v4_group_features_actions_indirect);
3715 
3716     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_output, tvb, offset, 4, ENC_BIG_ENDIAN);
3717     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_copy_ttl_out, tvb, offset, 4, ENC_BIG_ENDIAN);
3718     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_copy_ttl_in, tvb, offset, 4, ENC_BIG_ENDIAN);
3719     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_set_mpls_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3720     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_dec_mpls_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3721     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_push_vlan, tvb, offset, 4, ENC_BIG_ENDIAN);
3722     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_pop_vlan, tvb, offset, 4, ENC_BIG_ENDIAN);
3723     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_push_mpls, tvb, offset, 4, ENC_BIG_ENDIAN);
3724     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_pop_mpls, tvb, offset, 4, ENC_BIG_ENDIAN);
3725     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_set_queue, tvb, offset, 4, ENC_BIG_ENDIAN);
3726     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_group, tvb, offset, 4, ENC_BIG_ENDIAN);
3727     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_set_nw_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3728     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_dec_nw_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3729     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_set_field, tvb, offset, 4, ENC_BIG_ENDIAN);
3730     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_push_pbb, tvb, offset, 4, ENC_BIG_ENDIAN);
3731     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_indirect_pop_pbb, tvb, offset, 4, ENC_BIG_ENDIAN);
3732     offset+=4;
3733 
3734     ti = proto_tree_add_item(tree, hf_openflow_v4_group_features_actions_ff, tvb, offset, 4, ENC_BIG_ENDIAN);
3735     acts_tree = proto_item_add_subtree(ti, ett_openflow_v4_group_features_actions_ff);
3736 
3737     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_output, tvb, offset, 4, ENC_BIG_ENDIAN);
3738     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_copy_ttl_out, tvb, offset, 4, ENC_BIG_ENDIAN);
3739     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_copy_ttl_in, tvb, offset, 4, ENC_BIG_ENDIAN);
3740     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_set_mpls_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3741     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_dec_mpls_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3742     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_push_vlan, tvb, offset, 4, ENC_BIG_ENDIAN);
3743     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_pop_vlan, tvb, offset, 4, ENC_BIG_ENDIAN);
3744     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_push_mpls, tvb, offset, 4, ENC_BIG_ENDIAN);
3745     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_pop_mpls, tvb, offset, 4, ENC_BIG_ENDIAN);
3746     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_set_queue, tvb, offset, 4, ENC_BIG_ENDIAN);
3747     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_group, tvb, offset, 4, ENC_BIG_ENDIAN);
3748     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_set_nw_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3749     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_dec_nw_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
3750     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_set_field, tvb, offset, 4, ENC_BIG_ENDIAN);
3751     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_push_pbb, tvb, offset, 4, ENC_BIG_ENDIAN);
3752     proto_tree_add_item(acts_tree, hf_openflow_v4_group_features_actions_ff_pop_pbb, tvb, offset, 4, ENC_BIG_ENDIAN);
3753     /*offset+=4;*/
3754 }
3755 
3756 
3757 static int
dissect_openflow_meter_band_stats_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3758 dissect_openflow_meter_band_stats_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3759 {
3760     proto_tree *stats_tree;
3761 
3762     stats_tree = proto_tree_add_subtree(tree, tvb, offset, 16, ett_openflow_v4_meter_band_stats, NULL, "Meter band stats");
3763 
3764     /* uint64_t packet_band_count; */
3765     proto_tree_add_item(stats_tree, hf_openflow_v4_meter_band_stats_packet_band_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3766     offset+=8;
3767 
3768     /* uint64_t byte_band_count; */
3769     proto_tree_add_item(stats_tree, hf_openflow_v4_meter_band_stats_byte_band_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3770     offset+=8;
3771 
3772     return offset;
3773 }
3774 
3775 
3776 static int
dissect_openflow_meter_stats_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3777 dissect_openflow_meter_stats_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3778 {
3779     proto_item *ti;
3780     proto_tree *stats_tree;
3781     guint16 stats_len;
3782     guint16 stats_end;
3783 
3784     stats_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_openflow_v4_meter_stats, &ti, "Meter stats");
3785 
3786     /* uint32_t meter_id; */
3787     proto_tree_add_item(stats_tree, hf_openflow_v4_meter_stats_meter_id, tvb, offset, 4, ENC_BIG_ENDIAN);
3788     offset+=4;
3789 
3790     /* uint16_t len; */
3791     stats_len = tvb_get_ntohs(tvb, offset);
3792     stats_end = offset - 4 + stats_len;
3793     proto_item_set_len(ti, stats_len);
3794     proto_tree_add_item(stats_tree, hf_openflow_v4_meter_stats_len, tvb, offset, 2, ENC_BIG_ENDIAN);
3795     offset+=2;
3796 
3797     /* uint8_t pad[6]; */
3798     proto_tree_add_item(stats_tree, hf_openflow_v4_meter_stats_pad, tvb, offset, 6, ENC_NA);
3799     offset+=6;
3800 
3801     /* uint32_t flow_count; */
3802     proto_tree_add_item(stats_tree, hf_openflow_v4_meter_stats_flow_count, tvb, offset, 4, ENC_BIG_ENDIAN);
3803     offset+=4;
3804 
3805     /* uint64_t packet_in_count; */
3806     proto_tree_add_item(stats_tree, hf_openflow_v4_meter_stats_packet_in_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3807     offset+=8;
3808 
3809     /* uint64_t byte_in_count; */
3810     proto_tree_add_item(stats_tree, hf_openflow_v4_meter_stats_byte_in_count, tvb, offset, 8, ENC_BIG_ENDIAN);
3811     offset+=8;
3812 
3813     /* uint32_t duration_sec; */
3814     proto_tree_add_item(stats_tree, hf_openflow_v4_meter_stats_duration_sec, tvb, offset, 4, ENC_BIG_ENDIAN);
3815     offset+=4;
3816 
3817     /* uint32_t duration_nsec; */
3818     proto_tree_add_item(stats_tree, hf_openflow_v4_meter_stats_duration_nsec, tvb, offset, 4, ENC_BIG_ENDIAN);
3819     offset+=4;
3820 
3821     /* struct ofp_meter_band_stats band_stats[0]; */
3822     while (offset < stats_end) {
3823         offset = dissect_openflow_meter_band_stats_v4(tvb, pinfo, stats_tree, offset, length);
3824     }
3825 
3826     return offset;
3827 }
3828 
3829 
3830 static int
dissect_openflow_meter_config_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3831 dissect_openflow_meter_config_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3832 {
3833     proto_item *ti;
3834     proto_tree *conf_tree, *flags_tree;
3835     guint16 config_len;
3836     gint32 config_end;
3837 
3838     conf_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_openflow_v4_meter_config, &ti, "Meter config");
3839 
3840     /* uint16_t len; */
3841     config_len = tvb_get_ntohs(tvb, offset);
3842     config_end = offset + config_len;
3843     proto_item_set_len(ti, config_len);
3844     proto_tree_add_item(conf_tree, hf_openflow_v4_meter_config_len, tvb, offset, 2, ENC_BIG_ENDIAN);
3845     offset+=2;
3846 
3847     /* uint16_t flags; */
3848     ti = proto_tree_add_item(conf_tree, hf_openflow_v4_meter_config_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
3849     flags_tree = proto_item_add_subtree(ti, ett_openflow_v4_meter_config_flags);
3850 
3851     proto_tree_add_item(flags_tree, hf_openflow_v4_meter_config_flags_kbps, tvb, offset, 2, ENC_BIG_ENDIAN);
3852     proto_tree_add_item(flags_tree, hf_openflow_v4_meter_config_flags_pktps, tvb, offset, 2, ENC_BIG_ENDIAN);
3853     proto_tree_add_item(flags_tree, hf_openflow_v4_meter_config_flags_burst, tvb, offset, 2, ENC_BIG_ENDIAN);
3854     proto_tree_add_item(flags_tree, hf_openflow_v4_meter_config_flags_stats, tvb, offset, 2, ENC_BIG_ENDIAN);
3855     offset+=2;
3856 
3857     /* uint32_t meter_id; */
3858     proto_tree_add_item(conf_tree, hf_openflow_v4_meter_config_meter_id, tvb, offset, 4, ENC_BIG_ENDIAN);
3859     offset+=4;
3860 
3861     /* struct ofp_meter_band_header bands[0]; */
3862     while (offset < config_end) {
3863         offset = dissect_openflow_meter_band_v4(tvb, pinfo, conf_tree, offset, length);
3864     }
3865 
3866     return offset;
3867 }
3868 
3869 
3870 #define OFPMF_KBPS   1 << 0
3871 #define OFPMF_PKTPS  1 << 1
3872 #define OFPMF_BURST  1 << 2
3873 #define OFPMF_STATS  1 << 3
3874 static void
dissect_openflow_meter_features_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)3875 dissect_openflow_meter_features_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
3876 {
3877     proto_item *ti;
3878     proto_tree *bands_tree, *caps_tree;
3879 
3880     /* uint32_t max_meter; */
3881     proto_tree_add_item(tree, hf_openflow_v4_meter_features_max_meter, tvb, offset, 4, ENC_BIG_ENDIAN);
3882     offset+=4;
3883 
3884     /* uint32_t band_types; */
3885     ti = proto_tree_add_item(tree, hf_openflow_v4_meter_features_band_types, tvb, offset, 4, ENC_BIG_ENDIAN);
3886     bands_tree = proto_item_add_subtree(ti, ett_openflow_v4_meter_features_band_types);
3887 
3888     proto_tree_add_item(bands_tree, hf_openflow_v4_meter_features_band_types_drop, tvb, offset, 4, ENC_BIG_ENDIAN);
3889     proto_tree_add_item(bands_tree, hf_openflow_v4_meter_features_band_types_dscp_remark, tvb, offset, 4, ENC_BIG_ENDIAN);
3890     offset+=4;
3891 
3892     /* uint32_t capabilities; */
3893     ti = proto_tree_add_item(tree, hf_openflow_v4_meter_features_capabilities, tvb, offset, 4, ENC_BIG_ENDIAN);
3894     caps_tree = proto_item_add_subtree(ti, ett_openflow_v4_meter_features_capabilities);
3895 
3896     proto_tree_add_item(caps_tree, hf_openflow_v4_meter_features_capabilities_kbps, tvb, offset, 4, ENC_BIG_ENDIAN);
3897     proto_tree_add_item(caps_tree, hf_openflow_v4_meter_features_capabilities_pktps, tvb, offset, 4, ENC_BIG_ENDIAN);
3898     proto_tree_add_item(caps_tree, hf_openflow_v4_meter_features_capabilities_burst, tvb, offset, 4, ENC_BIG_ENDIAN);
3899     proto_tree_add_item(caps_tree, hf_openflow_v4_meter_features_capabilities_stats, tvb, offset, 4, ENC_BIG_ENDIAN);
3900     offset+=4;
3901 
3902     /* uint8_t max_bands; */
3903     proto_tree_add_item(tree, hf_openflow_v4_meter_features_max_bands, tvb, offset, 1, ENC_BIG_ENDIAN);
3904     offset+=1;
3905 
3906     /* uint8_t max_color; */
3907     proto_tree_add_item(tree, hf_openflow_v4_meter_features_max_color, tvb, offset, 1, ENC_BIG_ENDIAN);
3908     offset+=1;
3909 
3910     /* uint8_t pad[2]; */
3911     proto_tree_add_item(tree, hf_openflow_v4_meter_features_pad, tvb, offset, 2, ENC_NA);
3912     /*offset+=2;*/
3913 }
3914 
3915 
3916 #define OFPMPF_REPLY_MORE  1 << 0
3917 static void
dissect_openflow_multipart_reply_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)3918 dissect_openflow_multipart_reply_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
3919 {
3920     proto_item *ti;
3921     proto_tree *flags_tree;
3922     guint16 type;
3923 
3924     /* uint16_t type; */
3925     type = tvb_get_ntohs(tvb, offset);
3926     proto_tree_add_item(tree, hf_openflow_v4_multipart_reply_type, tvb, offset, 2, ENC_BIG_ENDIAN);
3927     offset+=2;
3928 
3929     col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
3930                   val_to_str_const(type, openflow_v4_multipart_type_values, "Unknown type"));
3931 
3932     /* uint16_t flags; */
3933     ti = proto_tree_add_item(tree, hf_openflow_v4_multipart_reply_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
3934     flags_tree = proto_item_add_subtree(ti, ett_openflow_v4_multipart_reply_flags);
3935 
3936     proto_tree_add_item(flags_tree, hf_openflow_v4_multipart_reply_flags_more, tvb, offset, 2, ENC_BIG_ENDIAN);
3937     offset+=2;
3938 
3939     /* uint8_t pad[4]; */
3940     proto_tree_add_item(tree, hf_openflow_v4_multipart_reply_pad, tvb, offset, 4, ENC_NA);
3941     offset+=4;
3942 
3943     switch(type){
3944     case OFPMP_DESC:
3945         dissect_openflow_switch_description_v4(tvb, pinfo, tree, offset, length);
3946         break;
3947     case OFPMP_FLOW:
3948         while (offset < length) {
3949             offset = dissect_openflow_flow_stats_v4(tvb, pinfo, tree, offset, length);
3950         }
3951         break;
3952     case OFPMP_AGGREGATE:
3953         dissect_openflow_aggregate_stats_v4(tvb, pinfo, tree, offset, length);
3954         break;
3955     case OFPMP_TABLE:
3956         while (offset < length) {
3957             offset = dissect_openflow_table_stats_v4(tvb, pinfo, tree, offset, length);
3958         }
3959         break;
3960     case OFPMP_PORT_STATS:
3961         while (offset < length) {
3962             offset = dissect_openflow_port_stats_v4(tvb, pinfo, tree, offset, length);
3963         }
3964         break;
3965     case OFPMP_QUEUE:
3966         while (offset < length) {
3967             offset = dissect_openflow_queue_stats_v4(tvb, pinfo, tree, offset, length);
3968         }
3969         break;
3970     case OFPMP_GROUP:
3971         while (offset < length) {
3972             offset = dissect_openflow_group_stats_v4(tvb, pinfo, tree, offset, length);
3973         }
3974         break;
3975     case OFPMP_GROUP_DESC:
3976         while (offset < length) {
3977             offset = dissect_openflow_group_desc_v4(tvb, pinfo, tree, offset, length);
3978         }
3979         break;
3980     case OFPMP_GROUP_FEATURES:
3981         dissect_openflow_group_features_v4(tvb, pinfo, tree, offset, length);
3982         break;
3983     case OFPMP_METER:
3984         while (offset < length) {
3985             offset = dissect_openflow_meter_stats_v4(tvb, pinfo, tree, offset, length);
3986         }
3987         break;
3988     case OFPMP_METER_CONFIG:
3989         while (offset < length) {
3990             offset = dissect_openflow_meter_config_v4(tvb, pinfo, tree, offset, length);
3991         }
3992         break;
3993     case OFPMP_METER_FEATURES:
3994         dissect_openflow_meter_features_v4(tvb, pinfo, tree, offset, length);
3995         break;
3996     case OFPMP_TABLE_FEATURES:
3997         while (offset < length) {
3998             offset = dissect_openflow_table_features_v4(tvb, pinfo, tree, offset, length);
3999         }
4000         break;
4001     case OFPMP_PORT_DESC:
4002         while (offset < length) {
4003             offset = dissect_openflow_port_v4(tvb, pinfo, tree, offset, length);
4004         }
4005         break;
4006 
4007     case OFPMP_EXPERIMENTER:
4008         /* uint32_t experimenter; */
4009         proto_tree_add_item(tree, hf_openflow_v4_multipart_reply_experimenter_experimenter, tvb, offset, 4, ENC_BIG_ENDIAN);
4010         offset+=4;
4011 
4012         /* uint32_t exp_type; */
4013         proto_tree_add_item(tree, hf_openflow_v4_multipart_reply_experimenter_exp_type, tvb, offset, 4, ENC_BIG_ENDIAN);
4014         offset+=4;
4015 
4016         /* uint32_t experimenter_data[0]; */
4017         proto_tree_add_expert_format(tree, pinfo, &ei_openflow_v4_multipart_reply_undecoded,
4018                                      tvb, offset, length - 16, "Experimenter multipart reply body.");
4019 
4020         break;
4021     default:
4022         proto_tree_add_expert_format(tree, pinfo, &ei_openflow_v4_multipart_reply_undecoded,
4023                                      tvb, offset, length - 8, "Unknown multipart reply body.");
4024         break;
4025     }
4026 }
4027 
4028 
4029 
4030 static void
dissect_openflow_queue_get_config_request_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)4031 dissect_openflow_queue_get_config_request_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
4032 {
4033     /* uint32_t port; */
4034     proto_tree_add_item(tree, hf_openflow_v4_queue_get_config_request_port, tvb, offset, 4, ENC_BIG_ENDIAN);
4035     offset+=4;
4036 
4037     /* uint8_t pad[4]; */
4038     proto_tree_add_item(tree, hf_openflow_v4_queue_get_config_request_pad, tvb, offset, 4, ENC_NA);
4039     /*offset+=4;*/
4040 }
4041 
4042 
4043 
4044 #define OFPQ_MIN_RATE_MAX  1000
4045 static const value_string openflow_v4_queue_prop_min_rate_reserved_values[] = {
4046     { 0xffff, "OFPQ_MIN_RATE_UNCFG" },
4047     { 0,        NULL }
4048 };
4049 
4050 #define OFPQ_MAX_RATE_MAX  1000
4051 static const value_string openflow_v4_queue_prop_max_rate_reserved_values[] = {
4052     { 0xffff, "OFPQ_MAX_RATE_UNCFG" },
4053     { 0,        NULL }
4054 };
4055 
4056 #define OFPQT_MIN_RATE      1
4057 #define OFPQT_MAX_RATE      2
4058 #define OFPQT_EXPERIMENTER  0xffff
4059 static const value_string openflow_v4_queue_prop_property_values[] = {
4060     { OFPQT_MIN_RATE,     "OFPQT_MIN_RATE" },
4061     { OFPQT_MAX_RATE,     "OFPQT_MAX_RATE" },
4062     { OFPQT_EXPERIMENTER, "OFPQT_EXPERIMENTER" },
4063     { 0,                  NULL },
4064 };
4065 
4066 static int
dissect_openflow_queue_prop_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)4067 dissect_openflow_queue_prop_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
4068 {
4069     proto_item *ti;
4070     proto_tree *prop_tree;
4071     guint16 prop_type;
4072     guint16 prop_len;
4073 
4074     prop_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_openflow_v4_queue_prop, &ti, "Queue property");
4075 
4076     /* uint16_t property; */
4077     prop_type = tvb_get_ntohs(tvb, offset);
4078     proto_tree_add_item(prop_tree, hf_openflow_v4_queue_prop_property, tvb, offset, 2, ENC_BIG_ENDIAN);
4079     offset+=2;
4080 
4081     /* uint16_t len; */
4082     prop_len = tvb_get_ntohs(tvb, offset);
4083     proto_item_set_len(ti, prop_len);
4084     proto_tree_add_item(prop_tree, hf_openflow_v4_queue_prop_len, tvb, offset, 2, ENC_BIG_ENDIAN);
4085     offset+=2;
4086 
4087     /* uint8_t pad[4]; */
4088     proto_tree_add_item(prop_tree, hf_openflow_v4_queue_prop_pad, tvb, offset, 4, ENC_NA);
4089     offset+=4;
4090 
4091     switch (prop_type) {
4092     case OFPQT_MIN_RATE:
4093         /* uint16_t rate; */
4094         proto_tree_add_item(prop_tree, hf_openflow_v4_queue_prop_min_rate_rate, tvb, offset, 2, ENC_BIG_ENDIAN);
4095 
4096         offset+=2;
4097 
4098         /* uint8_t pad[6]; */
4099         proto_tree_add_item(prop_tree, hf_openflow_v4_queue_prop_min_rate_pad, tvb, offset, 6, ENC_NA);
4100         offset+=6;
4101         break;
4102 
4103     case OFPQT_MAX_RATE:
4104         /* uint16_t rate; */
4105         proto_tree_add_item(prop_tree, hf_openflow_v4_queue_prop_max_rate_rate, tvb, offset, 2, ENC_BIG_ENDIAN);
4106         offset+=2;
4107 
4108         /* uint8_t pad[6]; */
4109         proto_tree_add_item(prop_tree, hf_openflow_v4_queue_prop_max_rate_pad, tvb, offset, 6, ENC_NA);
4110         offset+=6;
4111         break;
4112 
4113     case OFPQT_EXPERIMENTER:
4114         /* uint32_t experimenter; */
4115         proto_tree_add_item(prop_tree, hf_openflow_v4_queue_prop_experimenter_experimenter, tvb, offset, 4, ENC_BIG_ENDIAN);
4116         offset+=4;
4117 
4118         /* uint8_t pad[4]; */
4119         proto_tree_add_item(prop_tree, hf_openflow_v4_queue_prop_experimenter_pad, tvb, offset, 4, ENC_NA);
4120         offset+=4;
4121 
4122         /* uint8_t data[0]; */
4123         proto_tree_add_expert_format(prop_tree, pinfo, &ei_openflow_v4_queue_prop_undecoded,
4124                                      tvb, offset, prop_len - 16, "Experimenter queue property body.");
4125         if (prop_len > 16)
4126             offset+=prop_len-16;
4127         break;
4128 
4129     default:
4130         proto_tree_add_expert_format(prop_tree, pinfo, &ei_openflow_v4_queue_prop_undecoded,
4131                                      tvb, offset, prop_len - 8, "Unknown queue property body.");
4132         if (prop_len > 8)
4133             offset+=prop_len-8;
4134         break;
4135     }
4136 
4137     return offset;
4138 }
4139 
4140 
4141 #define OFPQ_ALL  0xffffffff
4142 static const value_string openflow_v4_queue_id_reserved_values[] = {
4143     { OFPQ_ALL, "OFPQ_ALL" },
4144     { 0,        NULL }
4145 };
4146 
4147 static int
dissect_openflow_packet_queue_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)4148 dissect_openflow_packet_queue_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
4149 {
4150     proto_item *ti;
4151     proto_tree *queue_tree;
4152     guint16 queue_len;
4153     guint16 queue_end;
4154 
4155     queue_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_openflow_v4_packet_queue, &ti, "Queue");
4156 
4157     /* uint32_t queue_id; */
4158     proto_tree_add_item(queue_tree, hf_openflow_v4_packet_queue_queue_id, tvb, offset, 4, ENC_BIG_ENDIAN);
4159     offset+=4;
4160 
4161     /* uint32_t port; */
4162     proto_tree_add_item(queue_tree, hf_openflow_v4_packet_queue_port, tvb, offset, 4, ENC_BIG_ENDIAN);
4163     offset+=4;
4164 
4165     /* uint16_t len; */
4166     queue_len = tvb_get_ntohs(tvb, offset);
4167     queue_end = offset - 8 + queue_len;
4168     proto_item_set_len(ti, queue_len);
4169     proto_tree_add_item(queue_tree, hf_openflow_v4_packet_queue_len, tvb, offset, 2, ENC_BIG_ENDIAN);
4170     offset+=2;
4171 
4172     /* uint8_t pad[6]; */
4173     proto_tree_add_item(queue_tree, hf_openflow_v4_packet_queue_pad, tvb, offset, 6, ENC_NA);
4174     offset+=6;
4175 
4176     /* struct ofp_queue_prop_header properties[0]; */
4177     while (offset < queue_end) {
4178         offset = dissect_openflow_queue_prop_v4(tvb, pinfo, queue_tree, offset, length);
4179     }
4180 
4181     return offset;
4182 }
4183 
4184 static void
dissect_openflow_queue_get_config_reply_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length)4185 dissect_openflow_queue_get_config_reply_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length)
4186 {
4187     /* uint32_t port; */
4188     proto_tree_add_item(tree, hf_openflow_v4_queue_get_config_reply_port, tvb, offset, 4, ENC_BIG_ENDIAN);
4189     offset+=4;
4190 
4191     /* uint8_t pad[4]; */
4192     proto_tree_add_item(tree, hf_openflow_v4_queue_get_config_reply_pad, tvb, offset, 4, ENC_NA);
4193     offset+=4;
4194 
4195     /* struct ofp_packet_queue queues[0]; */
4196     while (offset < length) {
4197         offset = dissect_openflow_packet_queue_v4(tvb, pinfo, tree, offset, length);
4198     }
4199 }
4200 
4201 static const value_string openflow_v4_controller_role_values[] = {
4202     { 0, "OFPCR_ROLE_NOCHANGE" },
4203     { 1, "OFPCR_ROLE_EQUAL" },
4204     { 2, "OFPCR_ROLE_MASTER" },
4205     { 3, "OFPCR_ROLE_SLAVE" },
4206     { 0, NULL }
4207 };
4208 
4209 static void
dissect_openflow_role_request_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)4210 dissect_openflow_role_request_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
4211 {
4212     /* uint32_t role; */
4213     proto_tree_add_item(tree, hf_openflow_v4_role_request_role, tvb, offset, 4, ENC_BIG_ENDIAN);
4214     offset+=4;
4215 
4216     /* uint8_t pad[4]; */
4217     proto_tree_add_item(tree, hf_openflow_v4_role_request_pad, tvb, offset, 4, ENC_NA);
4218     offset+=4;
4219 
4220     /* uint64_t generation_id; */
4221     proto_tree_add_item(tree, hf_openflow_v4_role_request_generation_id, tvb, offset, 8, ENC_BIG_ENDIAN);
4222     /*offset+=8;*/
4223 }
4224 
4225 
4226 static void
dissect_openflow_role_reply_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)4227 dissect_openflow_role_reply_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
4228 {
4229     /* uint32_t role; */
4230     proto_tree_add_item(tree, hf_openflow_v4_role_reply_role, tvb, offset, 4, ENC_BIG_ENDIAN);
4231     offset+=4;
4232 
4233     /* uint8_t pad[4]; */
4234     proto_tree_add_item(tree, hf_openflow_v4_role_reply_pad, tvb, offset, 4, ENC_NA);
4235     offset+=4;
4236 
4237     /* uint64_t generation_id; */
4238     proto_tree_add_item(tree, hf_openflow_v4_role_reply_generation_id, tvb, offset, 8, ENC_BIG_ENDIAN);
4239     /*offset+=8;*/
4240 }
4241 
4242 
4243 static void
dissect_openflow_async_config_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)4244 dissect_openflow_async_config_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
4245 {
4246     proto_item *ti;
4247     proto_tree *pimm_tree, *psmm_tree, *frmm_tree;
4248     proto_tree *pims_tree, *psms_tree, *frms_tree;
4249 
4250     /* uint32_t packet_in_mask[2]; */
4251     ti = proto_tree_add_item(tree, hf_openflow_v4_async_config_packet_in_mask_master, tvb, offset, 4, ENC_BIG_ENDIAN);
4252     pimm_tree = proto_item_add_subtree(ti, ett_openflow_v4_async_config_packet_in_mask_master);
4253 
4254     proto_tree_add_item(pimm_tree, hf_openflow_v4_async_config_packet_in_mask_master_no_match, tvb, offset, 4, ENC_BIG_ENDIAN);
4255     proto_tree_add_item(pimm_tree, hf_openflow_v4_async_config_packet_in_mask_master_action, tvb, offset, 4, ENC_BIG_ENDIAN);
4256     proto_tree_add_item(pimm_tree, hf_openflow_v4_async_config_packet_in_mask_master_invalid_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
4257     offset+=4;
4258 
4259     ti = proto_tree_add_item(tree, hf_openflow_v4_async_config_packet_in_mask_slave, tvb, offset, 4, ENC_BIG_ENDIAN);
4260     pims_tree = proto_item_add_subtree(ti, ett_openflow_v4_async_config_packet_in_mask_slave);
4261 
4262     proto_tree_add_item(pims_tree, hf_openflow_v4_async_config_packet_in_mask_slave_no_match, tvb, offset, 4, ENC_BIG_ENDIAN);
4263     proto_tree_add_item(pims_tree, hf_openflow_v4_async_config_packet_in_mask_slave_action, tvb, offset, 4, ENC_BIG_ENDIAN);
4264     proto_tree_add_item(pims_tree, hf_openflow_v4_async_config_packet_in_mask_slave_invalid_ttl, tvb, offset, 4, ENC_BIG_ENDIAN);
4265     offset+=4;
4266 
4267     /* uint32_t port_status_mask[2]; */
4268     ti = proto_tree_add_item(tree, hf_openflow_v4_async_config_port_status_mask_master, tvb, offset, 4, ENC_BIG_ENDIAN);
4269     psmm_tree = proto_item_add_subtree(ti, ett_openflow_v4_async_config_port_status_mask_master);
4270 
4271     proto_tree_add_item(psmm_tree, hf_openflow_v4_async_config_port_status_mask_master_add, tvb, offset, 4, ENC_BIG_ENDIAN);
4272     proto_tree_add_item(psmm_tree, hf_openflow_v4_async_config_port_status_mask_master_delete, tvb, offset, 4, ENC_BIG_ENDIAN);
4273     proto_tree_add_item(psmm_tree, hf_openflow_v4_async_config_port_status_mask_master_modify, tvb, offset, 4, ENC_BIG_ENDIAN);
4274     offset+=4;
4275 
4276     ti = proto_tree_add_item(tree, hf_openflow_v4_async_config_port_status_mask_slave, tvb, offset, 4, ENC_BIG_ENDIAN);
4277     psms_tree = proto_item_add_subtree(ti, ett_openflow_v4_async_config_port_status_mask_slave);
4278 
4279     proto_tree_add_item(psms_tree, hf_openflow_v4_async_config_port_status_mask_slave_add, tvb, offset, 4, ENC_BIG_ENDIAN);
4280     proto_tree_add_item(psms_tree, hf_openflow_v4_async_config_port_status_mask_slave_delete, tvb, offset, 4, ENC_BIG_ENDIAN);
4281     proto_tree_add_item(psms_tree, hf_openflow_v4_async_config_port_status_mask_slave_modify, tvb, offset, 4, ENC_BIG_ENDIAN);
4282     offset+=4;
4283 
4284     /* uint32_t flow_removed_mask[2]; */
4285     ti = proto_tree_add_item(tree, hf_openflow_v4_async_config_flow_removed_mask_master, tvb, offset, 4, ENC_BIG_ENDIAN);
4286     frmm_tree = proto_item_add_subtree(ti, ett_openflow_v4_async_config_flow_removed_mask_master);
4287 
4288     proto_tree_add_item(frmm_tree, hf_openflow_v4_async_config_flow_removed_mask_master_idle_timeout, tvb, offset, 4, ENC_BIG_ENDIAN);
4289     proto_tree_add_item(frmm_tree, hf_openflow_v4_async_config_flow_removed_mask_master_hard_timeout, tvb, offset, 4, ENC_BIG_ENDIAN);
4290     proto_tree_add_item(frmm_tree, hf_openflow_v4_async_config_flow_removed_mask_master_delete, tvb, offset, 4, ENC_BIG_ENDIAN);
4291     proto_tree_add_item(frmm_tree, hf_openflow_v4_async_config_flow_removed_mask_master_group_delete, tvb, offset, 4, ENC_BIG_ENDIAN);
4292     offset+=4;
4293 
4294     ti = proto_tree_add_item(tree, hf_openflow_v4_async_config_flow_removed_mask_slave, tvb, offset, 4, ENC_BIG_ENDIAN);
4295     frms_tree = proto_item_add_subtree(ti, ett_openflow_v4_async_config_flow_removed_mask_slave);
4296 
4297     proto_tree_add_item(frms_tree, hf_openflow_v4_async_config_flow_removed_mask_slave_idle_timeout, tvb, offset, 4, ENC_BIG_ENDIAN);
4298     proto_tree_add_item(frms_tree, hf_openflow_v4_async_config_flow_removed_mask_slave_hard_timeout, tvb, offset, 4, ENC_BIG_ENDIAN);
4299     proto_tree_add_item(frms_tree, hf_openflow_v4_async_config_flow_removed_mask_slave_delete, tvb, offset, 4, ENC_BIG_ENDIAN);
4300     proto_tree_add_item(frms_tree, hf_openflow_v4_async_config_flow_removed_mask_slave_group_delete, tvb, offset, 4, ENC_BIG_ENDIAN);
4301     /*offset+=4;*/
4302 }
4303 
4304 
4305 
4306 static const value_string openflow_v4_metermod_command_values[] = {
4307     { 0, "OFPMC_ADD" },
4308     { 1, "OFPMC_MODIFY" },
4309     { 2, "OFPMC_DELETE" },
4310     { 0, NULL }
4311 };
4312 
4313 static void
dissect_openflow_metermod_v4(tvbuff_t * tvb,packet_info * pinfo _U_,proto_tree * tree,int offset,guint16 length _U_)4314 dissect_openflow_metermod_v4(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 length _U_)
4315 {
4316     proto_item *ti;
4317     proto_tree *flags_tree;
4318 
4319     /* uint16_t command; */
4320     proto_tree_add_item(tree, hf_openflow_v4_metermod_command, tvb, offset, 2, ENC_BIG_ENDIAN);
4321     offset+=2;
4322 
4323     /* uint16_t flags; */
4324     ti = proto_tree_add_item(tree, hf_openflow_v4_metermod_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
4325     flags_tree = proto_item_add_subtree(ti, ett_openflow_v4_metermod_flags);
4326 
4327     proto_tree_add_item(flags_tree, hf_openflow_v4_metermod_flags_kbps, tvb, offset, 2, ENC_BIG_ENDIAN);
4328     proto_tree_add_item(flags_tree, hf_openflow_v4_metermod_flags_pktps, tvb, offset, 2, ENC_BIG_ENDIAN);
4329     proto_tree_add_item(flags_tree, hf_openflow_v4_metermod_flags_burst, tvb, offset, 2, ENC_BIG_ENDIAN);
4330     proto_tree_add_item(flags_tree, hf_openflow_v4_metermod_flags_stats, tvb, offset, 2, ENC_BIG_ENDIAN);
4331     offset+=2;
4332 
4333     /* uint32_t meter_id; */
4334     proto_tree_add_item(tree, hf_openflow_v4_metermod_meter_id, tvb, offset, 4, ENC_BIG_ENDIAN);
4335     offset+=4;
4336 
4337     /* struct ofp_meter_band_header bands[0]; */
4338     while (offset < length) {
4339         offset = dissect_openflow_meter_band_v4(tvb, pinfo, tree, offset, length);
4340     }
4341 }
4342 
4343 
4344 static int
dissect_openflow_message_v4(tvbuff_t * tvb,packet_info * pinfo,proto_tree * openflow_tree,int offset)4345 dissect_openflow_message_v4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *openflow_tree, int offset)
4346 {
4347 
4348     guint8 type;
4349     guint16 length;
4350     gint32 msg_end;
4351 
4352     type = tvb_get_guint8(tvb, offset + 1);
4353     length = tvb_get_ntohs(tvb, offset + 2);
4354     msg_end = offset + length;
4355 
4356     offset = dissect_openflow_header_v4(tvb, pinfo, openflow_tree, offset, length);
4357 
4358     switch(type){
4359     case OFPT_HELLO:
4360         dissect_openflow_hello_v4(tvb, pinfo, openflow_tree, offset, length);
4361         break;
4362     case OFPT_ERROR:
4363         dissect_openflow_error_v4(tvb, pinfo, openflow_tree, offset, length);
4364         break;
4365     case OFPT_ECHO_REQUEST:
4366     case OFPT_ECHO_REPLY:
4367         dissect_openflow_echo_v4(tvb, pinfo, openflow_tree, offset, length);
4368         break;
4369     case OFPT_EXPERIMENTER:
4370         dissect_openflow_experimenter_v4(tvb, pinfo, openflow_tree, offset, length);
4371         break;
4372     case OFPT_FEATURES_REQUEST:
4373         /* message has no body */
4374         break;
4375     case OFPT_FEATURES_REPLY:
4376         dissect_openflow_switch_features_v4(tvb, pinfo, openflow_tree, offset, length);
4377         break;
4378     case OFPT_GET_CONFIG_REQUEST:
4379         /* message has no body */
4380         break;
4381     case OFPT_GET_CONFIG_REPLY:
4382     case OFPT_SET_CONFIG:
4383         dissect_openflow_switch_config_v4(tvb, pinfo, openflow_tree, offset, length);
4384         break;
4385     case OFPT_PACKET_IN:
4386         dissect_openflow_packet_in_v4(tvb, pinfo, openflow_tree, offset, length);
4387         break;
4388     case OFPT_FLOW_REMOVED:
4389         dissect_openflow_flow_removed_v4(tvb, pinfo, openflow_tree, offset, length);
4390         break;
4391     case OFPT_PORT_STATUS:
4392         dissect_openflow_port_status_v4(tvb, pinfo, openflow_tree, offset, length);
4393         break;
4394     case OFPT_PACKET_OUT:
4395         dissect_openflow_packet_out_v4(tvb, pinfo, openflow_tree, offset, length);
4396         break;
4397     case OFPT_FLOW_MOD:
4398         dissect_openflow_flowmod_v4(tvb, pinfo, openflow_tree, offset, length);
4399         break;
4400     case OFPT_GROUP_MOD:
4401         dissect_openflow_groupmod_v4(tvb, pinfo, openflow_tree, offset, length);
4402         break;
4403     case OFPT_PORT_MOD:
4404         dissect_openflow_portmod_v4(tvb, pinfo, openflow_tree, offset, length);
4405         break;
4406     case OFPT_TABLE_MOD:
4407         dissect_openflow_tablemod_v4(tvb, pinfo, openflow_tree, offset, length);
4408         break;
4409     case OFPT_MULTIPART_REQUEST:
4410         dissect_openflow_multipart_request_v4(tvb, pinfo, openflow_tree, offset, length);
4411         break;
4412     case OFPT_MULTIPART_REPLY:
4413         dissect_openflow_multipart_reply_v4(tvb, pinfo, openflow_tree, offset, length);
4414         break;
4415     case OFPT_BARRIER_REQUEST:
4416     case OFPT_BARRIER_REPLY:
4417         /* message has no body */
4418         break;
4419     case OFPT_QUEUE_GET_CONFIG_REQUEST:
4420         dissect_openflow_queue_get_config_request_v4(tvb, pinfo, openflow_tree, offset, length);
4421         break;
4422     case OFPT_QUEUE_GET_CONFIG_REPLY:
4423         dissect_openflow_queue_get_config_reply_v4(tvb, pinfo, openflow_tree, offset, length);
4424         break;
4425     case OFPT_ROLE_REQUEST:
4426         dissect_openflow_role_request_v4(tvb, pinfo, openflow_tree, offset, length);
4427         break;
4428     case OFPT_ROLE_REPLY:
4429         dissect_openflow_role_reply_v4(tvb, pinfo, openflow_tree, offset, length);
4430         break;
4431     case OFPT_GET_ASYNC_REQUEST:
4432         /* message has no body */
4433         break;
4434     case OFPT_GET_ASYNC_REPLY:
4435     case OFPT_SET_ASYNC:
4436         dissect_openflow_async_config_v4(tvb, pinfo, openflow_tree, offset, length);
4437         break;
4438     case OFPT_METER_MOD:
4439         dissect_openflow_metermod_v4(tvb, pinfo, openflow_tree, offset, length);
4440         break;
4441 
4442      default:
4443          if (length > 8) {
4444             proto_tree_add_expert_format(openflow_tree, pinfo, &ei_openflow_v4_message_undecoded,
4445                                      tvb, offset, length - 8, "Unknown message body.");
4446         }
4447         break;
4448     }
4449 
4450     return msg_end;
4451 }
4452 
4453 static int
dissect_openflow_v4(tvbuff_t * tvb,packet_info * pinfo,proto_tree * tree,void * data _U_)4454 dissect_openflow_v4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
4455 {
4456     proto_item *ti;
4457     proto_tree *openflow_tree;
4458     guint offset = 0;
4459     guint8 type;
4460 
4461     type   = tvb_get_guint8(tvb, 1);
4462 
4463     col_append_fstr(pinfo->cinfo, COL_INFO, "Type: %s",
4464                   val_to_str_ext_const(type, &openflow_v4_type_values_ext, "Unknown message type"));
4465 
4466     /* Create display subtree for the protocol */
4467     ti = proto_tree_add_item(tree, proto_openflow_v4, tvb, 0, -1, ENC_NA);
4468     openflow_tree = proto_item_add_subtree(ti, ett_openflow_v4);
4469 
4470     dissect_openflow_message_v4(tvb, pinfo, openflow_tree, offset);
4471 
4472     return tvb_reported_length(tvb);
4473 }
4474 
4475 /*
4476  * Register the protocol with Wireshark.
4477  */
4478 void
proto_register_openflow_v4(void)4479 proto_register_openflow_v4(void)
4480 {
4481 
4482     static hf_register_info hf[] = {
4483         { &hf_openflow_v4_version,
4484             { "Version", "openflow_v4.version",
4485                FT_UINT8, BASE_HEX, VALS(openflow_v4_version_values), 0x0,
4486                NULL, HFILL }
4487         },
4488         { &hf_openflow_v4_type,
4489             { "Type", "openflow_v4.type",
4490                FT_UINT8, BASE_DEC | BASE_EXT_STRING, &openflow_v4_type_values_ext, 0x0,
4491                NULL, HFILL }
4492         },
4493         { &hf_openflow_v4_xid,
4494             { "Transaction ID", "openflow_v4.xid",
4495                FT_UINT32, BASE_DEC, NULL, 0x0,
4496                NULL, HFILL }
4497         },
4498         { &hf_openflow_v4_length,
4499             { "Length", "openflow_v4.length",
4500                FT_UINT16, BASE_DEC, NULL, 0x0,
4501                NULL, HFILL }
4502         },
4503         { &hf_openflow_v4_oxm_class,
4504             { "Class", "openflow_v4.oxm.class",
4505                FT_UINT16, BASE_HEX, VALS(openflow_v4_oxm_class_values), 0x0,
4506                NULL, HFILL }
4507         },
4508         { &hf_openflow_v4_oxm_field,
4509             { "Field", "openflow_v4.oxm.field",
4510                FT_UINT8, BASE_DEC, NULL, 0x0,
4511                NULL, HFILL }
4512         },
4513         { &hf_openflow_v4_oxm_field_basic,
4514             { "Field", "openflow_v4.oxm.field",
4515                FT_UINT8, BASE_DEC | BASE_EXT_STRING, &openflow_v4_oxm_basic_field_values_ext, 0x0,
4516                NULL, HFILL }
4517         },
4518         { &hf_openflow_v4_oxm_hm,
4519             { "Has mask", "openflow_v4.oxm.hm",
4520                FT_BOOLEAN, BASE_NONE, NULL, 0x0,
4521                NULL, HFILL }
4522         },
4523         { &hf_openflow_v4_oxm_length,
4524             { "Length", "openflow_v4.oxm.length",
4525                FT_UINT8, BASE_DEC, NULL, 0x0,
4526                NULL, HFILL }
4527         },
4528         { &hf_openflow_v4_oxm_experimenter_experimenter,
4529             { "Experimenter", "openflow_v4.oxm_experimenter.experimenter",
4530                FT_UINT32, BASE_HEX, NULL, 0x0,
4531                NULL, HFILL }
4532         },
4533         { &hf_openflow_v4_oxm_experimenter_value,
4534             { "Experimenter Value", "openflow_v4.oxm_experimenter.value",
4535                FT_BYTES, BASE_NONE, NULL, 0x0,
4536                NULL, HFILL }
4537         },
4538         { &hf_openflow_v4_oxm_value,
4539             { "Value", "openflow_v4.oxm.value",
4540                FT_BYTES, BASE_NONE, NULL, 0x0,
4541                NULL, HFILL }
4542         },
4543         { &hf_openflow_v4_oxm_value_etheraddr,
4544             { "Value", "openflow_v4.oxm.value_etheraddr",
4545                FT_ETHER, BASE_NONE, NULL, 0x0,
4546                NULL, HFILL }
4547         },
4548         { &hf_openflow_v4_oxm_value_ethertype,
4549             { "Value", "openflow_v4.oxm.value_ethertype",
4550                FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
4551                NULL, HFILL }
4552         },
4553         { &hf_openflow_v4_oxm_value_vlan_present,
4554             { "OFPVID_PRESENT", "openflow_v4.oxm.value_vlan_present",
4555                FT_BOOLEAN, 16, NULL, OFPVID_PRESENT,
4556                NULL, HFILL }
4557         },
4558         { &hf_openflow_v4_oxm_value_vlan_vid,
4559             { "Value", "openflow_v4.oxm.value_vlan_vid",
4560                FT_UINT16, BASE_DEC, NULL, 0x0fff,
4561                NULL, HFILL }
4562         },
4563         { &hf_openflow_v4_oxm_value_ipv4addr,
4564             { "Value", "openflow_v4.oxm.value_ipv4addr",
4565                FT_IPv4, BASE_NONE, NULL, 0x0,
4566                NULL, HFILL }
4567         },
4568         { &hf_openflow_v4_oxm_value_ipv6addr,
4569             { "Value", "openflow_v4.oxm.value_ipv6addr",
4570                FT_IPv6, BASE_NONE, NULL, 0x0,
4571                NULL, HFILL }
4572         },
4573         { &hf_openflow_v4_oxm_value_ipproto,
4574             { "Value", "openflow_v4.oxm.value_ipproto",
4575                FT_UINT8, BASE_DEC|BASE_EXT_STRING, &ipproto_val_ext, 0x0,
4576                NULL, HFILL }
4577         },
4578         { &hf_openflow_v4_oxm_value_uint16,
4579             { "Value", "openflow_v4.oxm.value_uint16",
4580                FT_UINT16, BASE_DEC, NULL, 0x0,
4581                NULL, HFILL }
4582         },
4583         { &hf_openflow_v4_oxm_value_uint24,
4584             { "Value", "openflow_v4.oxm.value_uint24",
4585                FT_UINT24, BASE_DEC, NULL, 0x0,
4586                NULL, HFILL }
4587         },
4588         { &hf_openflow_v4_oxm_value_uint32,
4589             { "Value", "openflow_v4.oxm.value_uint32",
4590                FT_UINT32, BASE_DEC, NULL, 0x0,
4591                NULL, HFILL }
4592         },
4593         { &hf_openflow_v4_oxm_mask,
4594             { "Mask", "openflow_v4.oxm.mask",
4595                FT_BYTES, BASE_NONE, NULL, 0x0,
4596                NULL, HFILL }
4597         },
4598         { &hf_openflow_v4_oxm_mask_etheraddr,
4599             { "Mask", "openflow_v4.oxm.ether_mask",
4600                FT_ETHER, BASE_NONE, NULL, 0x0,
4601                NULL, HFILL }
4602         },
4603         { &hf_openflow_v4_oxm_mask_ipv4addr,
4604             { "Mask", "openflow_v4.oxm.ipv4_mask",
4605                FT_IPv4, BASE_NONE, NULL, 0x0,
4606                NULL, HFILL }
4607         },
4608         { &hf_openflow_v4_oxm_mask_ipv6addr,
4609             { "Mask", "openflow_v4.oxm.ipv6_mask",
4610                FT_IPv6, BASE_NONE, NULL, 0x0,
4611                NULL, HFILL }
4612         },
4613         { &hf_openflow_v4_oxm_mask_vlan,
4614             { "Mask", "openflow_v4.oxm.vlan_mask",
4615                FT_UINT16, BASE_HEX, NULL, 0x0,
4616                NULL, HFILL }
4617         },
4618         { &hf_openflow_v4_match_type,
4619             { "Type", "openflow_v4.match.type",
4620                FT_UINT16, BASE_DEC, VALS(openflow_v4_match_type_values), 0x0,
4621                NULL, HFILL }
4622         },
4623         { &hf_openflow_v4_match_length,
4624             { "Length", "openflow_v4.match.length",
4625                FT_UINT16, BASE_DEC, NULL, 0x0,
4626                NULL, HFILL }
4627         },
4628         { &hf_openflow_v4_match_pad,
4629             { "Pad", "openflow_v4.match.pad",
4630                FT_BYTES, BASE_NONE, NULL, 0x0,
4631                NULL, HFILL }
4632         },
4633         { &hf_openflow_v4_action_type,
4634             { "Type", "openflow_v4.action.type",
4635                FT_UINT16, BASE_DEC, VALS(openflow_v4_action_type_values), 0x0,
4636                NULL, HFILL }
4637         },
4638         { &hf_openflow_v4_action_length,
4639             { "Length", "openflow_v4.action.length",
4640                FT_UINT16, BASE_DEC, NULL, 0x0,
4641                NULL, HFILL }
4642         },
4643         { &hf_openflow_v4_action_experimenter_experimenter,
4644             { "Experimenter", "openflow_v4.action_experimenter.experimenter",
4645                FT_UINT32, BASE_HEX, NULL, 0x0,
4646                NULL, HFILL }
4647         },
4648         { &hf_openflow_v4_action_output_port,
4649             { "Port", "openflow_v4.action.output.port",
4650                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
4651                NULL, HFILL }
4652         },
4653         { &hf_openflow_v4_action_output_max_len,
4654             { "Max length", "openflow_v4.action.output.max_len",
4655                FT_UINT16, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_controller_max_len_reserved_values), 0x0,
4656                NULL, HFILL }
4657         },
4658         { &hf_openflow_v4_action_output_pad,
4659             { "Pad", "openflow_v4.action.output.pad",
4660                FT_BYTES, BASE_NONE, NULL, 0x0,
4661                NULL, HFILL }
4662         },
4663         { &hf_openflow_v4_action_copy_ttl_out_pad,
4664             { "Pad", "openflow_v4.action.copy_ttl_out.pad",
4665                FT_BYTES, BASE_NONE, NULL, 0x0,
4666                NULL, HFILL }
4667         },
4668         { &hf_openflow_v4_action_copy_ttl_in_pad,
4669             { "Pad", "openflow_v4.action.copy_ttl_in.pad",
4670                FT_BYTES, BASE_NONE, NULL, 0x0,
4671                NULL, HFILL }
4672         },
4673         { &hf_openflow_v4_action_set_mpls_ttl_ttl,
4674             { "TTL", "openflow_v4.action.set_mpls_ttl.ttl",
4675                FT_UINT8, BASE_DEC, NULL, 0x0,
4676                NULL, HFILL }
4677         },
4678         { &hf_openflow_v4_action_set_mpls_ttl_pad,
4679             { "Pad", "openflow_v4.action.set_mpls_ttl.pad",
4680                FT_BYTES, BASE_NONE, NULL, 0x0,
4681                NULL, HFILL }
4682         },
4683         { &hf_openflow_v4_action_dec_mpls_ttl_pad,
4684             { "Pad", "openflow_v4.action.dec_mpls_ttl.pad",
4685                FT_BYTES, BASE_NONE, NULL, 0x0,
4686                NULL, HFILL }
4687         },
4688         { &hf_openflow_v4_action_push_vlan_ethertype,
4689             { "Ethertype", "openflow_v4.action.push_vlan.ethertype",
4690                FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
4691                NULL, HFILL }
4692         },
4693         { &hf_openflow_v4_action_push_vlan_pad,
4694             { "Pad", "openflow_v4.action.push_vlan.pad",
4695                FT_BYTES, BASE_NONE, NULL, 0x0,
4696                NULL, HFILL }
4697         },
4698         { &hf_openflow_v4_action_pop_vlan_pad,
4699             { "Pad", "openflow_v4.action.pop_vlan.pad",
4700                FT_BYTES, BASE_NONE, NULL, 0x0,
4701                NULL, HFILL }
4702         },
4703         { &hf_openflow_v4_action_push_mpls_ethertype,
4704             { "Ethertype", "openflow_v4.action.push_mpls.ethertype",
4705                FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
4706                NULL, HFILL }
4707         },
4708         { &hf_openflow_v4_action_push_mpls_pad,
4709             { "Pad", "openflow_v4.action.push_mpls.pad",
4710                FT_BYTES, BASE_NONE, NULL, 0x0,
4711                NULL, HFILL }
4712         },
4713         { &hf_openflow_v4_action_pop_mpls_ethertype,
4714             { "Ethertype", "openflow_v4.action.pop_mpls.ethertype",
4715                FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
4716                NULL, HFILL }
4717         },
4718         { &hf_openflow_v4_action_pop_mpls_pad,
4719             { "Pad", "openflow_v4.action.pop_mpls.pad",
4720                FT_BYTES, BASE_NONE, NULL, 0x0,
4721                NULL, HFILL }
4722         },
4723         { &hf_openflow_v4_action_set_queue_queue_id,
4724             { "Queue ID", "openflow_v4.action.set_queue.queue_id",
4725                FT_UINT32, BASE_DEC, NULL, 0x0,
4726                NULL, HFILL }
4727         },
4728         { &hf_openflow_v4_action_group_group_id,
4729             { "Group ID", "openflow_v4.action.group.group_id",
4730                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
4731                NULL, HFILL }
4732         },
4733         { &hf_openflow_v4_action_set_nw_ttl_ttl,
4734             { "TTL", "openflow_v4.action.set_nw_ttl.ttl",
4735                FT_UINT8, BASE_DEC, NULL, 0x0,
4736                NULL, HFILL }
4737         },
4738         { &hf_openflow_v4_action_set_nw_ttl_pad,
4739             { "Pad", "openflow_v4.action.set_nw_ttl.pad",
4740                FT_BYTES, BASE_NONE, NULL, 0x0,
4741                NULL, HFILL }
4742         },
4743         { &hf_openflow_v4_action_dec_nw_ttl_pad,
4744             { "Pad", "openflow_v4.action.dec_nw_ttl.pad",
4745                FT_BYTES, BASE_NONE, NULL, 0x0,
4746                NULL, HFILL }
4747         },
4748         { &hf_openflow_v4_action_set_field_pad,
4749             { "Pad", "openflow_v4.action.set_field.pad",
4750                FT_BYTES, BASE_NONE, NULL, 0x0,
4751                NULL, HFILL }
4752         },
4753         { &hf_openflow_v4_action_push_pbb_ethertype,
4754             { "Ethertype", "openflow_v4.action.push_pbb.ethertype",
4755                FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0,
4756                NULL, HFILL }
4757         },
4758         { &hf_openflow_v4_action_push_pbb_pad,
4759             { "Pad", "openflow_v4.action.push_pbb.pad",
4760                FT_BYTES, BASE_NONE, NULL, 0x0,
4761                NULL, HFILL }
4762         },
4763         { &hf_openflow_v4_action_pop_pbb_pad,
4764             { "Pad", "openflow_v4.action.pop_pbb.pad",
4765                FT_BYTES, BASE_NONE, NULL, 0x0,
4766                NULL, HFILL }
4767         },
4768         { &hf_openflow_v4_instruction_type,
4769             { "Type", "openflow_v4.instruction.type",
4770                FT_UINT16, BASE_DEC, VALS(openflow_v4_instruction_type_values), 0x0,
4771                NULL, HFILL }
4772         },
4773         { &hf_openflow_v4_instruction_length,
4774             { "Length", "openflow_v4.instruction.length",
4775                FT_UINT16, BASE_DEC, NULL, 0x0,
4776                NULL, HFILL }
4777         },
4778         { &hf_openflow_v4_instruction_experimenter_experimenter,
4779             { "Experimenter", "openflow_v4.instruction_experimenter.experimenter",
4780                FT_UINT32, BASE_HEX, NULL, 0x0,
4781                NULL, HFILL }
4782         },
4783         { &hf_openflow_v4_instruction_goto_table_table_id,
4784             { "Table ID", "openflow_v4.instruction.goto_table.table_id",
4785                FT_UINT8, BASE_DEC, NULL, 0x0,
4786                NULL, HFILL }
4787         },
4788         { &hf_openflow_v4_instruction_goto_table_pad,
4789             { "Pad", "openflow_v4.instruction.goto_table.pad",
4790                FT_BYTES, BASE_NONE, NULL, 0x0,
4791                NULL, HFILL }
4792         },
4793         { &hf_openflow_v4_instruction_write_metadata_pad,
4794             { "Pad", "openflow_v4.instruction.write_metadata.pad",
4795                FT_BYTES, BASE_NONE, NULL, 0x0,
4796                NULL, HFILL }
4797         },
4798         { &hf_openflow_v4_instruction_write_metadata_value,
4799             { "Value", "openflow_v4.instruction.write_metadata.value",
4800                FT_UINT64, BASE_HEX, NULL, 0x0,
4801                NULL, HFILL }
4802         },
4803         { &hf_openflow_v4_instruction_write_metadata_mask,
4804             { "Mask", "openflow_v4.instruction.write_metadata.mask",
4805                FT_UINT64, BASE_HEX, NULL, 0x0,
4806                NULL, HFILL }
4807         },
4808         { &hf_openflow_v4_instruction_actions_pad,
4809             { "Pad", "openflow_v4.instruction.actions.pad",
4810                FT_BYTES, BASE_NONE, NULL, 0x0,
4811                NULL, HFILL }
4812         },
4813         { &hf_openflow_v4_instruction_meter_meter_id,
4814             { "Meter ID", "openflow_v4.instruction.meter.meter_id",
4815                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_meter_id_reserved_values), 0x0,
4816                NULL, HFILL }
4817         },
4818         { &hf_openflow_v4_port_port_no,
4819             { "Port no", "openflow_v4.port.port_no",
4820                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
4821                NULL, HFILL }
4822         },
4823         { &hf_openflow_v4_port_pad,
4824             { "Pad", "openflow_v4.port.pad",
4825                FT_BYTES, BASE_NONE, NULL, 0x0,
4826                NULL, HFILL }
4827         },
4828         { &hf_openflow_v4_port_hw_addr,
4829             { "Hw addr", "openflow_v4.port.hw_addr",
4830                FT_ETHER, BASE_NONE, NULL, 0x0,
4831                NULL, HFILL }
4832         },
4833         { &hf_openflow_v4_port_pad2,
4834             { "Pad", "openflow_v4.port.pad2",
4835                FT_BYTES, BASE_NONE, NULL, 0x0,
4836                NULL, HFILL }
4837         },
4838         { &hf_openflow_v4_port_name,
4839             { "Name", "openflow_v4.port.name",
4840                FT_STRING, BASE_NONE, NULL, 0x0,
4841                NULL, HFILL }
4842         },
4843         { &hf_openflow_v4_port_config,
4844             { "Config", "openflow_v4.port.config",
4845                FT_UINT32, BASE_HEX, NULL, 0x0,
4846                NULL, HFILL }
4847         },
4848         { &hf_openflow_v4_port_config_port_down,
4849             { "OFPPC_PORT_DOWN", "openflow_v4.port.config.port_down",
4850                FT_BOOLEAN, 32, NULL, OFPPC_PORT_DOWN,
4851                NULL, HFILL }
4852         },
4853         { &hf_openflow_v4_port_config_no_recv,
4854             { "OFPPC_NO_RECV", "openflow_v4.port.config.no_recv",
4855                FT_BOOLEAN, 32, NULL, OFPPC_NO_RECV,
4856                NULL, HFILL }
4857         },
4858         { &hf_openflow_v4_port_config_no_fwd,
4859             { "OFPPC_NO_FWD", "openflow_v4.port.config.no_fwd",
4860                FT_BOOLEAN, 32, NULL, OFPPC_NO_FWD,
4861                NULL, HFILL }
4862         },
4863         { &hf_openflow_v4_port_config_no_packet_in,
4864             { "OFPPC_NO_PACKET_IN", "openflow_v4.port.config.no_packet_in",
4865                FT_BOOLEAN, 32, NULL, OFPPC_NO_PACKET_IN,
4866                NULL, HFILL }
4867         },
4868         { &hf_openflow_v4_port_state,
4869             { "State", "openflow_v4.port.sate",
4870                FT_UINT32, BASE_HEX, NULL, 0x0,
4871                NULL, HFILL }
4872         },
4873         { &hf_openflow_v4_port_state_link_down,
4874             { "OFPPS_LINK_DOWN", "openflow_v4.port.state.link_down",
4875                FT_BOOLEAN, 32, NULL, OFPPS_LINK_DOWN,
4876                NULL, HFILL }
4877         },
4878         { &hf_openflow_v4_port_state_blocked,
4879             { "OFPPS_BLOCKED", "openflow_v4.port.state.blocked",
4880                FT_BOOLEAN, 32, NULL, OFPPS_BLOCKED,
4881                NULL, HFILL }
4882         },
4883         { &hf_openflow_v4_port_state_live,
4884             { "OFPPS_LIVE", "openflow_v4.port.state.live",
4885                FT_BOOLEAN, 32, NULL, OFPPS_LIVE,
4886                NULL, HFILL }
4887         },
4888         { &hf_openflow_v4_port_current,
4889             { "Current", "openflow_v4.port.current",
4890                FT_UINT32, BASE_HEX, NULL, 0x0,
4891                NULL, HFILL }
4892         },
4893         { &hf_openflow_v4_port_current_10mb_hd,
4894             { "OFPPF_10MB_HD", "openflow_v4.port.current.10mb_hd",
4895                FT_BOOLEAN, 32, NULL, OFPPF_10MB_HD,
4896                NULL, HFILL }
4897         },
4898         { &hf_openflow_v4_port_current_10mb_fd,
4899             { "OFPPF_10MB_FD", "openflow_v4.port.current.10mb_fd",
4900                FT_BOOLEAN, 32, NULL, OFPPF_10MB_FD,
4901                NULL, HFILL }
4902         },
4903         { &hf_openflow_v4_port_current_100mb_hd,
4904             { "OFPPF_100MB_HD", "openflow_v4.port.current.100mb_hd",
4905                FT_BOOLEAN, 32, NULL, OFPPF_100MB_HD,
4906                NULL, HFILL }
4907         },
4908         { &hf_openflow_v4_port_current_100mb_fd,
4909             { "OFPPF_100MB_FD", "openflow_v4.port.current.100mb_fd",
4910                FT_BOOLEAN, 32, NULL, OFPPF_100MB_FD,
4911                NULL, HFILL }
4912         },
4913         { &hf_openflow_v4_port_current_1gb_hd,
4914             { "OFPPF_1GB_HD", "openflow_v4.port.current.1gb_hd",
4915                FT_BOOLEAN, 32, NULL, OFPPF_1GB_HD,
4916                NULL, HFILL }
4917         },
4918         { &hf_openflow_v4_port_current_1gb_fd,
4919             { "OFPPF_1GB_FD", "openflow_v4.port.current.1gb_fd",
4920                FT_BOOLEAN, 32, NULL, OFPPF_1GB_FD,
4921                NULL, HFILL }
4922         },
4923         { &hf_openflow_v4_port_current_10gb_fd,
4924             { "OFPPF_10_GB_FD", "openflow_v4.port.current.10gb_fd",
4925                FT_BOOLEAN, 32, NULL, OFPPF_10GB_FD,
4926                NULL, HFILL }
4927         },
4928         { &hf_openflow_v4_port_current_40gb_fd,
4929             { "OFPPF_40GB_FD", "openflow_v4.port.current.40gb_fd",
4930                FT_BOOLEAN, 32, NULL, OFPPF_40GB_FD,
4931                NULL, HFILL }
4932         },
4933         { &hf_openflow_v4_port_current_100gb_fd,
4934             { "OFPPF_100_GB_FD", "openflow_v4.port.current.100_gb_fd",
4935                FT_BOOLEAN, 32, NULL, OFPPF_100GB_FD,
4936                NULL, HFILL }
4937         },
4938         { &hf_openflow_v4_port_current_1tb_fd,
4939             { "OFPPF_1TB_FD", "openflow_v4.port.current.1tb_fd",
4940                FT_BOOLEAN, 32, NULL, OFPPF_1TB_FD,
4941                NULL, HFILL }
4942         },
4943         { &hf_openflow_v4_port_current_other,
4944             { "OFPPF_OTHER", "openflow_v4.port.current.other",
4945                FT_BOOLEAN, 32, NULL, OFPPF_OTHER,
4946                NULL, HFILL }
4947         },
4948         { &hf_openflow_v4_port_current_copper,
4949             { "OFPPF_COPPER", "openflow_v4.port.current.copper",
4950                FT_BOOLEAN, 32, NULL, OFPPF_COPPER,
4951                NULL, HFILL }
4952         },
4953         { &hf_openflow_v4_port_current_fiber,
4954             { "OFPPF_FIBER", "openflow_v4.port.current.fiber",
4955                FT_BOOLEAN, 32, NULL, OFPPF_FIBER,
4956                NULL, HFILL }
4957         },
4958         { &hf_openflow_v4_port_current_autoneg,
4959             { "OFPPF_AUTONEG", "openflow_v4.port.current.autoneg",
4960                FT_BOOLEAN, 32, NULL, OFPPF_AUTONEG,
4961                NULL, HFILL }
4962         },
4963         { &hf_openflow_v4_port_current_pause,
4964             { "OFPPF_PAUSE", "openflow_v4.port.current.pause",
4965                FT_BOOLEAN, 32, NULL, OFPPF_PAUSE,
4966                NULL, HFILL }
4967         },
4968         { &hf_openflow_v4_port_current_pause_asym,
4969             { "OFPPF_PAUSE_ASYM", "openflow_v4.port.current.pause_asym",
4970                FT_BOOLEAN, 32, NULL, OFPPF_PAUSE_ASYM,
4971                NULL, HFILL }
4972         },
4973         { &hf_openflow_v4_port_advertised,
4974             { "Advertised", "openflow_v4.port.advertised",
4975                FT_UINT32, BASE_HEX, NULL, 0x0,
4976                NULL, HFILL }
4977         },
4978         { &hf_openflow_v4_port_advertised_10mb_hd,
4979             { "OFPPF_10MB_HD", "openflow_v4.port.advertised.10mb_hd",
4980                FT_BOOLEAN, 32, NULL, OFPPF_10MB_HD,
4981                NULL, HFILL }
4982         },
4983         { &hf_openflow_v4_port_advertised_10mb_fd,
4984             { "OFPPF_10MB_FD", "openflow_v4.port.advertised.10mb_fd",
4985                FT_BOOLEAN, 32, NULL, OFPPF_10MB_FD,
4986                NULL, HFILL }
4987         },
4988         { &hf_openflow_v4_port_advertised_100mb_hd,
4989             { "OFPPF_100MB_HD", "openflow_v4.port.advertised.100mb_hd",
4990                FT_BOOLEAN, 32, NULL, OFPPF_100MB_HD,
4991                NULL, HFILL }
4992         },
4993         { &hf_openflow_v4_port_advertised_100mb_fd,
4994             { "OFPPF_100MB_FD", "openflow_v4.port.advertised.100mb_fd",
4995                FT_BOOLEAN, 32, NULL, OFPPF_100MB_FD,
4996                NULL, HFILL }
4997         },
4998         { &hf_openflow_v4_port_advertised_1gb_hd,
4999             { "OFPPF_1GB_HD", "openflow_v4.port.advertised.1gb_hd",
5000                FT_BOOLEAN, 32, NULL, OFPPF_1GB_HD,
5001                NULL, HFILL }
5002         },
5003         { &hf_openflow_v4_port_advertised_1gb_fd,
5004             { "OFPPF_1GB_FD", "openflow_v4.port.advertised.1gb_fd",
5005                FT_BOOLEAN, 32, NULL, OFPPF_1GB_FD,
5006                NULL, HFILL }
5007         },
5008         { &hf_openflow_v4_port_advertised_10gb_fd,
5009             { "OFPPF_10_GB_FD", "openflow_v4.port.advertised.10gb_fd",
5010                FT_BOOLEAN, 32, NULL, OFPPF_10GB_FD,
5011                NULL, HFILL }
5012         },
5013         { &hf_openflow_v4_port_advertised_40gb_fd,
5014             { "OFPPF_40GB_FD", "openflow_v4.port.advertised.40gb_fd",
5015                FT_BOOLEAN, 32, NULL, OFPPF_40GB_FD,
5016                NULL, HFILL }
5017         },
5018         { &hf_openflow_v4_port_advertised_100gb_fd,
5019             { "OFPPF_100GB_FD", "openflow_v4.port.advertised.100gb_fd",
5020                FT_BOOLEAN, 32, NULL, OFPPF_100GB_FD,
5021                NULL, HFILL }
5022         },
5023         { &hf_openflow_v4_port_advertised_1tb_fd,
5024             { "OFPPF_1TB_FD", "openflow_v4.port.advertised.1tb_fd",
5025                FT_BOOLEAN, 32, NULL, OFPPF_1TB_FD,
5026                NULL, HFILL }
5027         },
5028         { &hf_openflow_v4_port_advertised_other,
5029             { "OFPPF_OTHER", "openflow_v4.port.advertised.other",
5030                FT_BOOLEAN, 32, NULL, OFPPF_OTHER,
5031                NULL, HFILL }
5032         },
5033         { &hf_openflow_v4_port_advertised_copper,
5034             { "OFPPF_COPPER", "openflow_v4.port.advertised.copper",
5035                FT_BOOLEAN, 32, NULL, OFPPF_COPPER,
5036                NULL, HFILL }
5037         },
5038         { &hf_openflow_v4_port_advertised_fiber,
5039             { "OFPPF_FIBER", "openflow_v4.port.advertised.fiber",
5040                FT_BOOLEAN, 32, NULL, OFPPF_FIBER,
5041                NULL, HFILL }
5042         },
5043         { &hf_openflow_v4_port_advertised_autoneg,
5044             { "OFPPF_AUTONEG", "openflow_v4.port.advertised.autoneg",
5045                FT_BOOLEAN, 32, NULL, OFPPF_AUTONEG,
5046                NULL, HFILL }
5047         },
5048         { &hf_openflow_v4_port_advertised_pause,
5049             { "OFPPF_PAUSE", "openflow_v4.port.advertised.pause",
5050                FT_BOOLEAN, 32, NULL, OFPPF_PAUSE,
5051                NULL, HFILL }
5052         },
5053         { &hf_openflow_v4_port_advertised_pause_asym,
5054             { "OFPPF_PAUSE_ASYM", "openflow_v4.port.advertised.pause_asym",
5055                FT_BOOLEAN, 32, NULL, OFPPF_PAUSE_ASYM,
5056                NULL, HFILL }
5057         },
5058         { &hf_openflow_v4_port_supported,
5059             { "Supported", "openflow_v4.port.supported",
5060                FT_UINT32, BASE_HEX, NULL, 0x0,
5061                NULL, HFILL }
5062         },
5063         { &hf_openflow_v4_port_supported_10mb_hd,
5064             { "OFPPF_10MB_HD", "openflow_v4.port.supported.10mb_hd",
5065                FT_BOOLEAN, 32, NULL, OFPPF_10MB_HD,
5066                NULL, HFILL }
5067         },
5068         { &hf_openflow_v4_port_supported_10mb_fd,
5069             { "OFPPF_10MB_FD", "openflow_v4.port.supported.10mb_fd",
5070                FT_BOOLEAN, 32, NULL, OFPPF_10MB_FD,
5071                NULL, HFILL }
5072         },
5073         { &hf_openflow_v4_port_supported_100mb_hd,
5074             { "OFPPF_100MB_HD", "openflow_v4.port.supported.100mb_hd",
5075                FT_BOOLEAN, 32, NULL, OFPPF_100MB_HD,
5076                NULL, HFILL }
5077         },
5078         { &hf_openflow_v4_port_supported_100mb_fd,
5079             { "OFPPF_100MB_FD", "openflow_v4.port.supported.100mb_fd",
5080                FT_BOOLEAN, 32, NULL, OFPPF_100MB_FD,
5081                NULL, HFILL }
5082         },
5083         { &hf_openflow_v4_port_supported_1gb_hd,
5084             { "OFPPF_1GB_HD", "openflow_v4.port.supported.1gb_hd",
5085                FT_BOOLEAN, 32, NULL, OFPPF_1GB_HD,
5086                NULL, HFILL }
5087         },
5088         { &hf_openflow_v4_port_supported_1gb_fd,
5089             { "OFPPF_1GB_FD", "openflow_v4.port.supported.1gb_fd",
5090                FT_BOOLEAN, 32, NULL, OFPPF_1GB_FD,
5091                NULL, HFILL }
5092         },
5093         { &hf_openflow_v4_port_supported_10gb_fd,
5094             { "OFPPF_10_GB_FD", "openflow_v4.port.supported.10gb_fd",
5095                FT_BOOLEAN, 32, NULL, OFPPF_10GB_FD,
5096                NULL, HFILL }
5097         },
5098         { &hf_openflow_v4_port_supported_40gb_fd,
5099             { "OFPPF_40GB_FD", "openflow_v4.port.supported.40gb_fd",
5100                FT_BOOLEAN, 32, NULL, OFPPF_40GB_FD,
5101                NULL, HFILL }
5102         },
5103         { &hf_openflow_v4_port_supported_100gb_fd,
5104             { "OFPPF_100GB_FD", "openflow_v4.port.supported.100gb_fd",
5105                FT_BOOLEAN, 32, NULL, OFPPF_100GB_FD,
5106                NULL, HFILL }
5107         },
5108         { &hf_openflow_v4_port_supported_1tb_fd,
5109             { "OFPPF_1TB_FD", "openflow_v4.port.supported.1tb_fd",
5110                FT_BOOLEAN, 32, NULL, OFPPF_1TB_FD,
5111                NULL, HFILL }
5112         },
5113         { &hf_openflow_v4_port_supported_other,
5114             { "OFPPF_OTHER", "openflow_v4.port.supported.other",
5115                FT_BOOLEAN, 32, NULL, OFPPF_OTHER,
5116                NULL, HFILL }
5117         },
5118         { &hf_openflow_v4_port_supported_copper,
5119             { "OFPPF_COPPER", "openflow_v4.port.supported.copper",
5120                FT_BOOLEAN, 32, NULL, OFPPF_COPPER,
5121                NULL, HFILL }
5122         },
5123         { &hf_openflow_v4_port_supported_fiber,
5124             { "OFPPF_FIBER", "openflow_v4.port.supported.fiber",
5125                FT_BOOLEAN, 32, NULL, OFPPF_FIBER,
5126                NULL, HFILL }
5127         },
5128         { &hf_openflow_v4_port_supported_autoneg,
5129             { "OFPPF_AUTONEG", "openflow_v4.port.supported.autoneg",
5130                FT_BOOLEAN, 32, NULL, OFPPF_AUTONEG,
5131                NULL, HFILL }
5132         },
5133         { &hf_openflow_v4_port_supported_pause,
5134             { "OFPPF_PAUSE", "openflow_v4.port.supported.pause",
5135                FT_BOOLEAN, 32, NULL, OFPPF_PAUSE,
5136                NULL, HFILL }
5137         },
5138         { &hf_openflow_v4_port_supported_pause_asym,
5139             { "OFPPF_PAUSE_ASYM", "openflow_v4.port.supported.pause_asym",
5140                FT_BOOLEAN, 32, NULL, OFPPF_PAUSE_ASYM,
5141                NULL, HFILL }
5142         },
5143         { &hf_openflow_v4_port_peer,
5144             { "Peer", "openflow_v4.port.peer",
5145                FT_UINT32, BASE_HEX, NULL, 0x0,
5146                NULL, HFILL }
5147         },
5148         { &hf_openflow_v4_port_peer_10mb_hd,
5149             { "OFPPF_10MB_HD", "openflow_v4.port.peer.10mb_hd",
5150                FT_BOOLEAN, 32, NULL, OFPPF_10MB_HD,
5151                NULL, HFILL }
5152         },
5153         { &hf_openflow_v4_port_peer_10mb_fd,
5154             { "OFPPF_10MB_FD", "openflow_v4.port.peer.10mb_fd",
5155                FT_BOOLEAN, 32, NULL, OFPPF_10MB_FD,
5156                NULL, HFILL }
5157         },
5158         { &hf_openflow_v4_port_peer_100mb_hd,
5159             { "OFPPF_100MB_HD", "openflow_v4.port.peer.100mb_hd",
5160                FT_BOOLEAN, 32, NULL, OFPPF_100MB_HD,
5161                NULL, HFILL }
5162         },
5163         { &hf_openflow_v4_port_peer_100mb_fd,
5164             { "OFPPF_100MB_FD", "openflow_v4.port.peer.100mb_fd",
5165                FT_BOOLEAN, 32, NULL, OFPPF_100MB_FD,
5166                NULL, HFILL }
5167         },
5168         { &hf_openflow_v4_port_peer_1gb_hd,
5169             { "OFPPF_1GB_HD", "openflow_v4.port.peer.1gb_hd",
5170                FT_BOOLEAN, 32, NULL, OFPPF_1GB_HD,
5171                NULL, HFILL }
5172         },
5173         { &hf_openflow_v4_port_peer_1gb_fd,
5174             { "OFPPF_1GB_FD", "openflow_v4.port.peer.1gb_fd",
5175                FT_BOOLEAN, 32, NULL, OFPPF_1GB_FD,
5176                NULL, HFILL }
5177         },
5178         { &hf_openflow_v4_port_peer_10gb_fd,
5179             { "OFPPF_10_GB_FD", "openflow_v4.port.peer.10gb_fd",
5180                FT_BOOLEAN, 32, NULL, OFPPF_10GB_FD,
5181                NULL, HFILL }
5182         },
5183         { &hf_openflow_v4_port_peer_40gb_fd,
5184             { "OFPPF_40GB_FD", "openflow_v4.port.peer.40gb_fd",
5185                FT_BOOLEAN, 32, NULL, OFPPF_40GB_FD,
5186                NULL, HFILL }
5187         },
5188         { &hf_openflow_v4_port_peer_100gb_fd,
5189             { "OFPPF_100GB_FD", "openflow_v4.port.peer.100gb_fd",
5190                FT_BOOLEAN, 32, NULL, OFPPF_100GB_FD,
5191                NULL, HFILL }
5192         },
5193         { &hf_openflow_v4_port_peer_1tb_fd,
5194             { "OFPPF_1TB_FD", "openflow_v4.port.peer.1tb_fd",
5195                FT_BOOLEAN, 32, NULL, OFPPF_1TB_FD,
5196                NULL, HFILL }
5197         },
5198         { &hf_openflow_v4_port_peer_other,
5199             { "OFPPF_OTHER", "openflow_v4.port.peer.other",
5200                FT_BOOLEAN, 32, NULL, OFPPF_OTHER,
5201                NULL, HFILL }
5202         },
5203         { &hf_openflow_v4_port_peer_copper,
5204             { "OFPPF_COPPER", "openflow_v4.port.peer.copper",
5205                FT_BOOLEAN, 32, NULL, OFPPF_COPPER,
5206                NULL, HFILL }
5207         },
5208         { &hf_openflow_v4_port_peer_fiber,
5209             { "OFPPF_FIBER", "openflow_v4.port.peer.fiber",
5210                FT_BOOLEAN, 32, NULL, OFPPF_FIBER,
5211                NULL, HFILL }
5212         },
5213         { &hf_openflow_v4_port_peer_autoneg,
5214             { "OFPPF_AUTONEG", "openflow_v4.port.peer.autoneg",
5215                FT_BOOLEAN, 32, NULL, OFPPF_AUTONEG,
5216                NULL, HFILL }
5217         },
5218         { &hf_openflow_v4_port_peer_pause,
5219             { "OFPPF_PAUSE", "openflow_v4.port.peer.pause",
5220                FT_BOOLEAN, 32, NULL, OFPPF_PAUSE,
5221                NULL, HFILL }
5222         },
5223         { &hf_openflow_v4_port_peer_pause_asym,
5224             { "OFPPF_PAUSE_ASYM", "openflow_v4.port.peer.pause_asym",
5225                FT_BOOLEAN, 32, NULL, OFPPF_PAUSE_ASYM,
5226                NULL, HFILL }
5227         },
5228         { &hf_openflow_v4_port_curr_speed,
5229             { "Curr speed", "openflow_v4.port.curr_speed",
5230                FT_UINT32, BASE_DEC, NULL, 0x0,
5231                NULL, HFILL }
5232         },
5233         { &hf_openflow_v4_port_max_speed,
5234             { "Max speed", "openflow_v4.port.max_speed",
5235                FT_UINT32, BASE_DEC, NULL, 0x0,
5236                NULL, HFILL }
5237         },
5238         { &hf_openflow_v4_meter_band_type,
5239             { "Type", "openflow_v4.meter_band.type",
5240                FT_UINT16, BASE_DEC, VALS(openflow_v4_meter_band_type_values), 0x0,
5241                NULL, HFILL }
5242         },
5243         { &hf_openflow_v4_meter_band_len,
5244             { "Length", "openflow_v4.meter_band.length",
5245                FT_UINT16, BASE_DEC, NULL, 0x0,
5246                NULL, HFILL }
5247         },
5248         { &hf_openflow_v4_meter_band_rate,
5249             { "Rate", "openflow_v4.meter_band.rate",
5250                FT_UINT32, BASE_DEC, NULL, 0x0,
5251                NULL, HFILL }
5252         },
5253         { &hf_openflow_v4_meter_band_burst_size,
5254             { "Burst size", "openflow_v4.meter_band.burst_size",
5255                FT_UINT32, BASE_DEC, NULL, 0x0,
5256                NULL, HFILL }
5257         },
5258         { &hf_openflow_v4_meter_band_drop_pad,
5259             { "Pad", "openflow_v4.meter_band.drop.pad",
5260                FT_BYTES, BASE_NONE, NULL, 0x0,
5261                NULL, HFILL }
5262         },
5263         { &hf_openflow_v4_meter_band_dscp_remark_prec_level,
5264             { "Precedence level", "openflow_v4.meter_band.dscp_remark.prec_level",
5265                FT_UINT8, BASE_DEC, NULL, 0x0,
5266                NULL, HFILL }
5267         },
5268         { &hf_openflow_v4_meter_band_dscp_remark_pad,
5269             { "Pad", "openflow_v4.meter_band.dscp_remark.pad",
5270                FT_BYTES, BASE_NONE, NULL, 0x0,
5271                NULL, HFILL }
5272         },
5273         { &hf_openflow_v4_meter_band_experimenter_experimenter,
5274             { "Experimenter", "openflow_v4.meter_band.experimenter.experimenter",
5275                FT_UINT32, BASE_DEC, NULL, 0x0,
5276                NULL, HFILL }
5277         },
5278         { &hf_openflow_v4_hello_element_type,
5279             { "Type", "openflow_v4.hello_element.type",
5280                FT_UINT16, BASE_DEC, VALS(openflow_v4_hello_element_type_values), 0x0,
5281                NULL, HFILL }
5282         },
5283         { &hf_openflow_v4_hello_element_length,
5284             { "Length", "openflow_v4.hello_element.length",
5285                FT_UINT16, BASE_DEC, NULL, 0x0,
5286                NULL, HFILL }
5287         },
5288         { &hf_openflow_v4_hello_element_version_bitmap,
5289             { "Bitmap", "openflow_v4.hello_element.version.bitmap",
5290                FT_BYTES, BASE_NONE, NULL, 0x0,
5291                NULL, HFILL }
5292         },
5293         { &hf_openflow_v4_hello_element_pad,
5294             { "Pad", "openflow_v4.hello_element.pad",
5295                FT_BYTES, BASE_NONE, NULL, 0x0,
5296                NULL, HFILL }
5297         },
5298         { &hf_openflow_v4_error_type,
5299             { "Type", "openflow_v4.error.type",
5300                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_type_values), 0x0,
5301                NULL, HFILL }
5302         },
5303         { &hf_openflow_v4_error_hello_failed_code,
5304             { "Code", "openflow_v4.error.code",
5305                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_hello_failed_code_values), 0x0,
5306                NULL, HFILL }
5307         },
5308         { &hf_openflow_v4_error_bad_request_code,
5309             { "Code", "openflow_v4.error.code",
5310                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_bad_request_code_values), 0x0,
5311                NULL, HFILL }
5312         },
5313         { &hf_openflow_v4_error_bad_action_code,
5314             { "Code", "openflow_v4.error.code",
5315                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_bad_action_code_values), 0x0,
5316                NULL, HFILL }
5317         },
5318         { &hf_openflow_v4_error_bad_instruction_code,
5319             { "Code", "openflow_v4.error.code",
5320                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_bad_instruction_code_values), 0x0,
5321                NULL, HFILL }
5322         },
5323         { &hf_openflow_v4_error_bad_match_code,
5324             { "Code", "openflow_v4.error.code",
5325                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_bad_match_code_values), 0x0,
5326                NULL, HFILL }
5327         },
5328         { &hf_openflow_v4_error_flow_mod_failed_code,
5329             { "Code", "openflow_v4.error.code",
5330                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_flow_mod_failed_code_values), 0x0,
5331                NULL, HFILL }
5332         },
5333         { &hf_openflow_v4_error_group_mod_failed_code,
5334             { "Code", "openflow_v4.error.code",
5335                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_group_mod_failed_code_values), 0x0,
5336                NULL, HFILL }
5337         },
5338         { &hf_openflow_v4_error_port_mod_failed_code,
5339             { "Code", "openflow_v4.error.code",
5340                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_port_mod_failed_code_values), 0x0,
5341                NULL, HFILL }
5342         },
5343         { &hf_openflow_v4_error_table_mod_failed_code,
5344             { "Code", "openflow_v4.error.code",
5345                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_table_mod_failed_code_values), 0x0,
5346                NULL, HFILL }
5347         },
5348         { &hf_openflow_v4_error_queue_op_failed_code,
5349             { "Code", "openflow_v4.error.code",
5350                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_queue_op_failed_code_values), 0x0,
5351                NULL, HFILL }
5352         },
5353         { &hf_openflow_v4_error_switch_config_failed_code,
5354             { "Code", "openflow_v4.error.code",
5355                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_switch_config_failed_code_values), 0x0,
5356                NULL, HFILL }
5357         },
5358         { &hf_openflow_v4_error_role_request_failed_code,
5359             { "Code", "openflow_v4.error.code",
5360                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_role_request_failed_code_values), 0x0,
5361                NULL, HFILL }
5362         },
5363         { &hf_openflow_v4_error_meter_mod_failed_code,
5364             { "Code", "openflow_v4.error.code",
5365                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_meter_mod_failed_code_values), 0x0,
5366                NULL, HFILL }
5367         },
5368         { &hf_openflow_v4_error_table_features_failed_code,
5369             { "Code", "openflow_v4.error.code",
5370                FT_UINT16, BASE_DEC, VALS(openflow_v4_error_table_features_failed_code_values), 0x0,
5371                NULL, HFILL }
5372         },
5373         { &hf_openflow_v4_error_code,
5374             { "Code", "openflow_v4.error.code",
5375                FT_UINT16, BASE_DEC, NULL, 0x0,
5376                NULL, HFILL }
5377         },
5378         { &hf_openflow_v4_error_data_text,
5379             { "Data", "openflow_v4.error.data",
5380                FT_STRING, BASE_NONE, NULL, 0x0,
5381                NULL, HFILL }
5382         },
5383         { &hf_openflow_v4_echo_data,
5384             { "Data", "openflow_v4.echo.data",
5385                FT_BYTES, BASE_NONE, NULL, 0x0,
5386                NULL, HFILL }
5387         },
5388         { &hf_openflow_v4_error_data_body,
5389             { "Body", "openflow_v4.error.data.body",
5390                FT_BYTES, BASE_NONE, NULL, 0x0,
5391                NULL, HFILL }
5392         },
5393         { &hf_openflow_v4_error_experimenter,
5394             { "Experimenter", "openflow_v4.error.experimenter",
5395                FT_UINT32, BASE_HEX, NULL, 0x0,
5396                NULL, HFILL }
5397         },
5398         { &hf_openflow_v4_experimenter_experimenter,
5399             { "Experimenter", "openflow_v4.experimenter.experimenter",
5400                FT_UINT32, BASE_HEX, NULL, 0x0,
5401                NULL, HFILL }
5402         },
5403         { &hf_openflow_v4_experimenter_exp_type,
5404             { "Experimenter type", "openflow_v4.experimenter.exp_type",
5405                FT_UINT32, BASE_DEC, NULL, 0x0,
5406                NULL, HFILL }
5407         },
5408         { &hf_openflow_v4_switch_features_datapath_id,
5409             { "datapath_id", "openflow_v4.switch_features.datapath_id",
5410                FT_UINT64, BASE_HEX, NULL, 0x0,
5411                NULL, HFILL }
5412         },
5413         { &hf_openflow_v4_switch_features_n_buffers,
5414             { "n_buffers", "openflow_v4.switch_features.n_buffers",
5415                FT_UINT32, BASE_DEC, NULL, 0x0,
5416                NULL, HFILL }
5417         },
5418         { &hf_openflow_v4_switch_features_n_tables,
5419             { "n_tables", "openflow_v4.switch_features.n_tables",
5420                FT_UINT8, BASE_DEC, NULL, 0x0,
5421                NULL, HFILL }
5422         },
5423         { &hf_openflow_v4_switch_features_auxiliary_id,
5424             { "auxiliary_id", "openflow_v4.switch_features.auxiliary_id",
5425                FT_UINT8, BASE_DEC, NULL, 0x0,
5426                NULL, HFILL }
5427         },
5428         { &hf_openflow_v4_switch_features_pad,
5429             { "Pad", "openflow_v4.switch_features.pad",
5430                FT_UINT16, BASE_DEC, NULL, 0x0,
5431                NULL, HFILL }
5432         },
5433         { &hf_openflow_v4_switch_features_capabilities,
5434             { "capabilities", "openflow_v4.switch_features.capabilities",
5435                FT_UINT32, BASE_HEX, NULL, 0x0,
5436                NULL, HFILL }
5437         },
5438         { &hf_openflow_v4_switch_features_capabilities_flow_stats,
5439             { "OFPC_FLOW_STATS", "openflow_v4.switch_features.capabilities.flow_stats",
5440                FT_BOOLEAN, 32, NULL, OFPC_FLOW_STATS,
5441                NULL, HFILL }
5442         },
5443         { &hf_openflow_v4_switch_features_capabilities_table_stats,
5444             { "OFPC_TABLE_STATS", "openflow_v4.switch_features.capabilities.table_stats",
5445                FT_BOOLEAN, 32, NULL, OFPC_TABLE_STATS,
5446                NULL, HFILL }
5447         },
5448         { &hf_openflow_v4_switch_features_capabilities_port_stats,
5449             { "OFPC_PORT_STATS", "openflow_v4.switch_features.capabilities.port_stats",
5450                FT_BOOLEAN, 32, NULL,  OFPC_PORT_STATS,
5451                NULL, HFILL }
5452         },
5453         { &hf_openflow_v4_switch_features_capabilities_group_stats,
5454             { "OFPC_GROUP_STATS", "openflow_v4.switch_features.capabilities.group_stats",
5455                FT_BOOLEAN, 32, NULL, OFPC_GROUP_STATS,
5456                NULL, HFILL }
5457         },
5458         { &hf_openflow_v4_switch_features_capabilities_ip_reasm,
5459             { "OFPC_IP_REASM", "openflow_v4.switch_features.capabilities.ip_reasm",
5460                FT_BOOLEAN, 32, NULL, OFPC_IP_REASM,
5461                NULL, HFILL }
5462         },
5463         { &hf_openflow_v4_switch_features_capabilities_queue_stats,
5464             { "OFPC_QUEUE_STATS", "openflow_v4.switch_features.capabilities.queue_stats",
5465                FT_BOOLEAN, 32, NULL, OFPC_QUEUE_STATS,
5466                NULL, HFILL }
5467         },
5468         { &hf_openflow_v4_switch_features_capabilities_port_blocked,
5469             { "OFPC_PORT_BLOCKED", "openflow_v4.switch_features.capabilities.port_blocked",
5470                FT_BOOLEAN, 32, NULL, OFPC_PORT_BLOCKED,
5471                NULL, HFILL }
5472         },
5473         { &hf_openflow_v4_switch_features_reserved,
5474             { "Reserved", "openflow_v4.switch_features_reserved",
5475                FT_UINT32, BASE_HEX, NULL, 0x0,
5476                NULL, HFILL }
5477         },
5478         { &hf_openflow_v4_switch_config_flags,
5479             { "Flags", "openflow_v4.switch_config.flags",
5480                FT_UINT16, BASE_HEX, NULL, 0x0,
5481                NULL, HFILL }
5482         },
5483         { &hf_openflow_v4_switch_config_flags_fragments,
5484             { "IP Fragments", "openflow_v4.switch_config.flags.fragments",
5485                FT_UINT16, BASE_DEC, VALS(openflow_v4_switch_config_fragments_values), 0x0,
5486                NULL, HFILL }
5487         },
5488         { &hf_openflow_v4_switch_config_miss_send_len,
5489             { "Miss send length", "openflow_v4.switch_config.miss_send_len",
5490                FT_UINT16, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_controller_max_len_reserved_values), 0x0,
5491                NULL, HFILL }
5492         },
5493         { &hf_openflow_v4_packet_in_buffer_id,
5494             { "Buffer ID", "openflow_v4.packet_in.buffer_id",
5495                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_buffer_reserved_values), 0x0,
5496                NULL, HFILL }
5497             },
5498         { &hf_openflow_v4_packet_in_total_len,
5499             { "Total length", "openflow_v4.packet_in.total_len",
5500                FT_UINT16, BASE_DEC, NULL, 0x0,
5501                NULL, HFILL }
5502         },
5503         { &hf_openflow_v4_packet_in_reason,
5504             { "Reason", "openflow_v4.packet_in.reason",
5505                FT_UINT8, BASE_DEC, VALS(openflow_v4_packet_in_reason_values), 0x0,
5506                NULL, HFILL }
5507         },
5508         { &hf_openflow_v4_packet_in_table_id,
5509             { "Table ID", "openflow_v4.packet_in.table_id",
5510                FT_UINT8, BASE_DEC, NULL, 0x0,
5511                NULL, HFILL }
5512         },
5513         { &hf_openflow_v4_packet_in_cookie,
5514             { "Cookie", "openflow_v4.packet_in.cookie",
5515                FT_UINT64, BASE_HEX, NULL, 0x0,
5516                NULL, HFILL }
5517         },
5518         { &hf_openflow_v4_packet_in_pad,
5519             { "Pad", "openflow_v4.packet_in.pad",
5520                FT_BYTES, BASE_NONE, NULL, 0x0,
5521                NULL, HFILL }
5522         },
5523         { &hf_openflow_v4_flow_removed_cookie,
5524             { "Cookie", "openflow_v4.flow_removed.cookie",
5525                FT_UINT64, BASE_HEX, NULL, 0x0,
5526                NULL, HFILL }
5527         },
5528         { &hf_openflow_v4_flow_removed_priority,
5529             { "Priority", "openflow_v4.flow_removed.priority",
5530                FT_UINT16, BASE_DEC, NULL, 0x0,
5531                NULL, HFILL }
5532         },
5533         { &hf_openflow_v4_flow_removed_reason,
5534             { "Reason", "openflow_v4.flow_removed.reason",
5535                FT_UINT8, BASE_DEC, VALS(openflow_v4_flow_removed_reason_values), 0x0,
5536                NULL, HFILL }
5537         },
5538         { &hf_openflow_v4_flow_removed_table_id,
5539             { "Table ID", "openflow_v4.flow_removed.table_id",
5540                FT_UINT8, BASE_DEC, NULL, 0x0,
5541                NULL, HFILL }
5542         },
5543         { &hf_openflow_v4_flow_removed_duration_sec,
5544             { "Duration sec", "openflow_v4.flow_removed.duration_sec",
5545                FT_UINT32, BASE_DEC, NULL, 0x0,
5546                NULL, HFILL }
5547         },
5548         { &hf_openflow_v4_flow_removed_duration_nsec,
5549             { "Duration nsec", "openflow_v4.flow_removed.duration_nsec",
5550                FT_UINT32, BASE_DEC, NULL, 0x0,
5551                NULL, HFILL }
5552         },
5553         { &hf_openflow_v4_flow_removed_idle_timeout,
5554             { "Idle timeout", "openflow_v4.flow_removed.idle_timeout",
5555                FT_UINT16, BASE_DEC, NULL, 0x0,
5556                NULL, HFILL }
5557         },
5558         { &hf_openflow_v4_flow_removed_hard_timeout,
5559             { "Hard timeout", "openflow_v4.flow_removed.hard_timeout",
5560                FT_UINT16, BASE_DEC, NULL, 0x0,
5561                NULL, HFILL }
5562         },
5563         { &hf_openflow_v4_flow_removed_packet_count,
5564             { "Packet count", "openflow_v4.flow_removed.packet_count",
5565                FT_UINT64, BASE_DEC, NULL, 0x0,
5566                NULL, HFILL }
5567         },
5568         { &hf_openflow_v4_flow_removed_byte_count,
5569             { "Byte count", "openflow_v4.flow_removed.byte_count",
5570                FT_UINT64, BASE_DEC, NULL, 0x0,
5571                NULL, HFILL }
5572         },
5573         { &hf_openflow_v4_port_status_reason,
5574             { "Reason", "openflow_v4.port_status.reason",
5575                FT_UINT8, BASE_DEC, VALS(openflow_v4_port_status_reason_values), 0x0,
5576                NULL, HFILL }
5577         },
5578         { &hf_openflow_v4_port_status_pad,
5579             { "Pad", "openflow_v4.port_status.pad",
5580                FT_BYTES, BASE_NONE, NULL, 0x0,
5581                NULL, HFILL }
5582         },
5583         { &hf_openflow_v4_packet_out_buffer_id,
5584             { "Buffer ID", "openflow_v4.packet_out.buffer_id",
5585                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_buffer_reserved_values), 0x0,
5586                NULL, HFILL }
5587             },
5588         { &hf_openflow_v4_packet_out_in_port,
5589             { "In port", "openflow_v4.packet_out.in_port",
5590                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
5591                NULL, HFILL }
5592         },
5593         { &hf_openflow_v4_packet_out_acts_len,
5594             { "Actions length", "openflow_v4.packet_out.acts_len",
5595                FT_UINT16, BASE_DEC, NULL, 0x0,
5596                NULL, HFILL }
5597         },
5598         { &hf_openflow_v4_packet_out_pad,
5599             { "Pad", "openflow_v4.packet_out.pad",
5600                FT_BYTES, BASE_NONE, NULL, 0x0,
5601                NULL, HFILL }
5602         },
5603         { &hf_openflow_v4_flowmod_cookie,
5604             { "Cookie", "openflow_v4.flowmod.cookie",
5605                FT_UINT64, BASE_HEX, NULL, 0x0,
5606                NULL, HFILL }
5607         },
5608         { &hf_openflow_v4_flowmod_cookie_mask,
5609             { "Cookie mask", "openflow_v4.flowmod.cookie_mask",
5610                FT_UINT64, BASE_HEX, NULL, 0x0,
5611                NULL, HFILL }
5612         },
5613         { &hf_openflow_v4_flowmod_table_id,
5614             { "Table ID", "openflow_v4.flowmod.table_id",
5615                FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_table_reserved_values), 0x0,
5616                NULL, HFILL }
5617         },
5618         { &hf_openflow_v4_flowmod_command,
5619             { "Command", "openflow_v4.flowmod.command",
5620                FT_UINT8, BASE_DEC, VALS(openflow_v4_flowmod_command_values), 0x0,
5621                NULL, HFILL }
5622         },
5623         { &hf_openflow_v4_flowmod_idle_timeout,
5624             { "Idle timeout", "openflow_v4.flowmod.idle_timeout",
5625                FT_UINT16, BASE_DEC, NULL, 0x0,
5626                NULL, HFILL }
5627         },
5628         { &hf_openflow_v4_flowmod_hard_timeout,
5629             { "Hard timeout", "openflow_v4.flowmod.hard_timeout",
5630                FT_UINT16, BASE_DEC, NULL, 0x0,
5631                NULL, HFILL }
5632         },
5633         { &hf_openflow_v4_flowmod_priority,
5634             { "Priority", "openflow_v4.flowmod.priority",
5635                FT_UINT16, BASE_DEC, NULL, 0x0,
5636                NULL, HFILL }
5637         },
5638         { &hf_openflow_v4_flowmod_buffer_id,
5639             { "Buffer ID", "openflow_v4.flowmod.buffer_id",
5640                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_buffer_reserved_values), 0x0,
5641                NULL, HFILL }
5642         },
5643         { &hf_openflow_v4_flowmod_out_port,
5644             { "Out port", "openflow_v4.flowmod.out_port",
5645                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
5646                NULL, HFILL }
5647         },
5648         { &hf_openflow_v4_flowmod_out_group,
5649             { "Out group", "openflow_v4.flowmod.out_group",
5650                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_group_reserved_values), 0x0,
5651                NULL, HFILL }
5652         },
5653         { &hf_openflow_v4_flowmod_flags,
5654             { "Flags", "openflow_v4.flowmod.flags",
5655                FT_UINT16, BASE_HEX, NULL, 0x0,
5656                NULL, HFILL }
5657         },
5658         { &hf_openflow_v4_flowmod_flags_send_flow_rem,
5659             { "Send flow removed", "openflow_v4.flowmod.flags.send_flow_rem",
5660                FT_BOOLEAN, 16, NULL, OFPFF_SEND_FLOW_REM,
5661                NULL, HFILL }
5662         },
5663         { &hf_openflow_v4_flowmod_flags_check_overlap,
5664             { "Check overlap", "openflow_v4.flowmod.flags.check_overlap",
5665                FT_BOOLEAN, 16, NULL, OFPFF_CHECK_OVERLAP,
5666                NULL, HFILL }
5667         },
5668         { &hf_openflow_v4_flowmod_flags_reset_counts,
5669             { "Reset counts", "openflow_v4.flowmod.flags.reset_counts",
5670                FT_BOOLEAN, 16, NULL, OFPFF_RESET_COUNTS,
5671                NULL, HFILL }
5672         },
5673         { &hf_openflow_v4_flowmod_flags_no_packet_counts,
5674             { "Don't count packets", "openflow_v4.flowmod.flags.no_packet_counts",
5675                FT_BOOLEAN, 16, NULL, OFPFF_NO_PKT_COUNTS,
5676                NULL, HFILL }
5677         },
5678         { &hf_openflow_v4_flowmod_flags_no_byte_counts,
5679             { "Don't count bytes", "openflow_v4.flowmod.flags.no_byte_counts",
5680                FT_BOOLEAN, 16, NULL, OFPFF_NO_BYT_COUNTS,
5681                NULL, HFILL }
5682         },
5683         { &hf_openflow_v4_flowmod_pad,
5684             { "Pad", "openflow_v4.flowmod.pad",
5685                FT_BYTES, BASE_NONE, NULL, 0x0,
5686                NULL, HFILL }
5687         },
5688         { &hf_openflow_v4_bucket_length,
5689             { "Length", "openflow_v4.bucket.length",
5690                FT_UINT16, BASE_DEC, NULL, 0x0,
5691                NULL, HFILL }
5692         },
5693         { &hf_openflow_v4_bucket_weight,
5694             { "Weight", "openflow_v4.bucket.weight",
5695                FT_UINT16, BASE_DEC, NULL, 0x0,
5696                NULL, HFILL }
5697         },
5698         { &hf_openflow_v4_bucket_watch_port,
5699             { "Watch port", "openflow_v4.bucket.watch_port",
5700                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
5701                NULL, HFILL }
5702         },
5703         { &hf_openflow_v4_bucket_watch_group,
5704             { "Watch group", "openflow_v4.bucket.watch_group",
5705                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_group_reserved_values), 0x0,
5706                NULL, HFILL }
5707         },
5708         { &hf_openflow_v4_bucket_pad,
5709             { "Pad", "openflow_v4.bucket.pad",
5710                FT_BYTES, BASE_NONE, NULL, 0x0,
5711                NULL, HFILL }
5712         },
5713         { &hf_openflow_v4_groupmod_command,
5714             { "Command", "openflow_v4.groupmod.command",
5715                FT_UINT16, BASE_DEC, VALS(openflow_v4_groupmod_command_values), 0x0,
5716                NULL, HFILL }
5717         },
5718         { &hf_openflow_v4_groupmod_type,
5719             { "Type", "openflow_v4.groupmod.type",
5720                FT_UINT8, BASE_DEC, VALS(openflow_v4_group_type_values), 0x0,
5721                NULL, HFILL }
5722         },
5723         { &hf_openflow_v4_groupmod_pad,
5724             { "Pad", "openflow_v4.groupmod.pad",
5725                FT_BYTES, BASE_NONE, NULL, 0x0,
5726                NULL, HFILL }
5727         },
5728         { &hf_openflow_v4_groupmod_group_id,
5729             { "Group ID", "openflow_v4.groupmod.group_id",
5730                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_group_reserved_values), 0x0,
5731                NULL, HFILL }
5732         },
5733         { &hf_openflow_v4_portmod_port_no,
5734             { "Port no", "openflow_v4.portmod.port_no",
5735                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
5736                NULL, HFILL }
5737         },
5738         { &hf_openflow_v4_portmod_pad,
5739             { "Pad", "openflow_v4.portmod.pad",
5740                FT_BYTES, BASE_NONE, NULL, 0x0,
5741                NULL, HFILL }
5742         },
5743         { &hf_openflow_v4_portmod_hw_addr,
5744             { "Hw addr", "openflow_v4.portmod.hw_addr",
5745                FT_ETHER, BASE_NONE, NULL, 0x0,
5746                NULL, HFILL }
5747         },
5748         { &hf_openflow_v4_portmod_pad2,
5749             { "Pad", "openflow_v4.portmod.pad2",
5750                FT_BYTES, BASE_NONE, NULL, 0x0,
5751                NULL, HFILL }
5752         },
5753         { &hf_openflow_v4_portmod_config,
5754             { "Config", "openflow_v4.portmod.config",
5755                FT_UINT32, BASE_HEX, NULL, 0x0,
5756                NULL, HFILL }
5757         },
5758         { &hf_openflow_v4_portmod_config_port_down,
5759             { "OFPPC_PORT_DOWN", "openflow_v4.portmod.config.port_down",
5760                FT_BOOLEAN, 32, NULL, OFPPC_PORT_DOWN,
5761                NULL, HFILL }
5762         },
5763         { &hf_openflow_v4_portmod_config_no_recv,
5764             { "OFPPC_NO_RECV", "openflow_v4.portmod.config.no_recv",
5765                FT_BOOLEAN, 32, NULL, OFPPC_NO_RECV,
5766                NULL, HFILL }
5767         },
5768         { &hf_openflow_v4_portmod_config_no_fwd,
5769             { "OFPPC_NO_FWD", "openflow_v4.portmod.config.no_fwd",
5770                FT_BOOLEAN, 32, NULL, OFPPC_NO_FWD,
5771                NULL, HFILL }
5772         },
5773         { &hf_openflow_v4_portmod_config_no_packet_in,
5774             { "OFPPC_NO_PACKET_IN", "openflow_v4.portmod.config.no_packet_in",
5775                FT_BOOLEAN, 32, NULL, OFPPC_NO_PACKET_IN,
5776                NULL, HFILL }
5777         },
5778         { &hf_openflow_v4_portmod_mask,
5779             { "Mask", "openflow_v4.portmod.mask",
5780                FT_UINT32, BASE_HEX, NULL, 0x0,
5781                NULL, HFILL }
5782         },
5783         { &hf_openflow_v4_portmod_mask_port_down,
5784             { "OFPPC_PORT_DOWN", "openflow_v4.portmod.mask.port_down",
5785                FT_BOOLEAN, 32, NULL, OFPPC_PORT_DOWN,
5786                NULL, HFILL }
5787         },
5788         { &hf_openflow_v4_portmod_mask_no_recv,
5789             { "OFPPC_NO_RECV", "openflow_v4.portmod.mask.no_recv",
5790                FT_BOOLEAN, 32, NULL, OFPPC_NO_RECV,
5791                NULL, HFILL }
5792         },
5793         { &hf_openflow_v4_portmod_mask_no_fwd,
5794             { "OFPPC_NO_FWD", "openflow_v4.portmod.mask.no_fwd",
5795                FT_BOOLEAN, 32, NULL, OFPPC_NO_FWD,
5796                NULL, HFILL }
5797         },
5798         { &hf_openflow_v4_portmod_mask_no_packet_in,
5799             { "OFPPC_NO_PACKET_IN", "openflow_v4.portmod.mask.no_packet_in",
5800                FT_BOOLEAN, 32, NULL, OFPPC_NO_PACKET_IN,
5801                NULL, HFILL }
5802         },
5803         { &hf_openflow_v4_portmod_advertise,
5804             { "Advertise", "openflow_v4.portmod.advertise",
5805                FT_UINT32, BASE_HEX, NULL, 0x0,
5806                NULL, HFILL }
5807         },
5808         { &hf_openflow_v4_portmod_advertise_10mb_hd,
5809             { "OFPPF_10MB_HD", "openflow_v4.portmod.advertise.10mb_hd",
5810                FT_BOOLEAN, 32, NULL, OFPPF_10MB_HD,
5811                NULL, HFILL }
5812         },
5813         { &hf_openflow_v4_portmod_advertise_10mb_fd,
5814             { "OFPPF_10MB_FD", "openflow_v4.portmod.advertise.10mb_fd",
5815                FT_BOOLEAN, 32, NULL, OFPPF_10MB_FD,
5816                NULL, HFILL }
5817         },
5818         { &hf_openflow_v4_portmod_advertise_100mb_hd,
5819             { "OFPPF_100MB_HD", "openflow_v4.portmod.advertise.100mb_hd",
5820                FT_BOOLEAN, 32, NULL, OFPPF_100MB_HD,
5821                NULL, HFILL }
5822         },
5823         { &hf_openflow_v4_portmod_advertise_100mb_fd,
5824             { "OFPPF_100MB_FD", "openflow_v4.portmod.advertise.100mb_fd",
5825                FT_BOOLEAN, 32, NULL, OFPPF_100MB_FD,
5826                NULL, HFILL }
5827         },
5828         { &hf_openflow_v4_portmod_advertise_1gb_hd,
5829             { "OFPPF_1GB_HD", "openflow_v4.portmod.advertise.1gb_hd",
5830                FT_BOOLEAN, 32, NULL, OFPPF_1GB_HD,
5831                NULL, HFILL }
5832         },
5833         { &hf_openflow_v4_portmod_advertise_1gb_fd,
5834             { "OFPPF_1GB_FD", "openflow_v4.portmod.advertise.1gb_fd",
5835                FT_BOOLEAN, 32, NULL, OFPPF_1GB_FD,
5836                NULL, HFILL }
5837         },
5838         { &hf_openflow_v4_portmod_advertise_10gb_fd,
5839             { "OFPPF_10_GB_FD", "openflow_v4.portmod.advertise.10gb_fd",
5840                FT_BOOLEAN, 32, NULL, OFPPF_10GB_FD,
5841                NULL, HFILL }
5842         },
5843         { &hf_openflow_v4_portmod_advertise_40gb_fd,
5844             { "OFPPF_40GB_FD", "openflow_v4.portmod.advertise.40gb_fd",
5845                FT_BOOLEAN, 32, NULL, OFPPF_40GB_FD,
5846                NULL, HFILL }
5847         },
5848         { &hf_openflow_v4_portmod_advertise_100gb_fd,
5849             { "OFPPF_100_GB_FD", "openflow_v4.portmod.advertise.100_gb_fd",
5850                FT_BOOLEAN, 32, NULL, OFPPF_100GB_FD,
5851                NULL, HFILL }
5852         },
5853         { &hf_openflow_v4_portmod_advertise_1tb_fd,
5854             { "OFPPF_1TB_FD", "openflow_v4.portmod.advertise.1tb_fd",
5855                FT_BOOLEAN, 32, NULL, OFPPF_1TB_FD,
5856                NULL, HFILL }
5857         },
5858         { &hf_openflow_v4_portmod_advertise_other,
5859             { "OFPPF_OTHER", "openflow_v4.portmod.advertise.other",
5860                FT_BOOLEAN, 32, NULL, OFPPF_OTHER,
5861                NULL, HFILL }
5862         },
5863         { &hf_openflow_v4_portmod_advertise_copper,
5864             { "OFPPF_COPPER", "openflow_v4.portmod.advertise.copper",
5865                FT_BOOLEAN, 32, NULL, OFPPF_COPPER,
5866                NULL, HFILL }
5867         },
5868         { &hf_openflow_v4_portmod_advertise_fiber,
5869             { "OFPPF_FIBER", "openflow_v4.portmod.advertise.fiber",
5870                FT_BOOLEAN, 32, NULL, OFPPF_FIBER,
5871                NULL, HFILL }
5872         },
5873         { &hf_openflow_v4_portmod_advertise_autoneg,
5874             { "OFPPF_AUTONEG", "openflow_v4.portmod.advertise.autoneg",
5875                FT_BOOLEAN, 32, NULL, OFPPF_AUTONEG,
5876                NULL, HFILL }
5877         },
5878         { &hf_openflow_v4_portmod_advertise_pause,
5879             { "OFPPF_PAUSE", "openflow_v4.portmod.advertise.pause",
5880                FT_BOOLEAN, 32, NULL, OFPPF_PAUSE,
5881                NULL, HFILL }
5882         },
5883         { &hf_openflow_v4_portmod_advertise_pause_asym,
5884             { "OFPPF_PAUSE_ASYM", "openflow_v4.portmod.advertise.pause_asym",
5885                FT_BOOLEAN, 32, NULL, OFPPF_PAUSE_ASYM,
5886                NULL, HFILL }
5887         },
5888         { &hf_openflow_v4_portmod_pad3,
5889             { "Pad", "openflow_v4.portmod.pad3",
5890                FT_BYTES, BASE_NONE, NULL, 0x0,
5891                NULL, HFILL }
5892         },
5893         { &hf_openflow_v4_tablemod_table_id,
5894             { "Table ID", "openflow_v4.tablemod.table_id",
5895                FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_table_reserved_values), 0x0,
5896                NULL, HFILL }
5897         },
5898         { &hf_openflow_v4_tablemod_pad,
5899             { "Pad", "openflow_v4.tablemod.pad",
5900                FT_BYTES, BASE_NONE, NULL, 0x0,
5901                NULL, HFILL }
5902         },
5903         { &hf_openflow_v4_tablemod_config,
5904             { "Config", "openflow_v4.tablemod.config",
5905                FT_BYTES, BASE_NONE, NULL, 0x0,
5906                NULL, HFILL }
5907         },
5908         { &hf_openflow_v4_flow_stats_request_table_id,
5909             { "Table ID", "openflow_v4.flow_stats_request.table_id",
5910                FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_table_reserved_values), 0x0,
5911                NULL, HFILL }
5912         },
5913         { &hf_openflow_v4_flow_stats_request_pad,
5914             { "Pad", "openflow_v4.flow_stats_request.pad",
5915                FT_BYTES, BASE_NONE, NULL, 0x0,
5916                NULL, HFILL }
5917         },
5918         { &hf_openflow_v4_flow_stats_request_out_port,
5919             { "Out port", "openflow_v4.flow_stats_request.out_port",
5920                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
5921                NULL, HFILL }
5922         },
5923         { &hf_openflow_v4_flow_stats_request_out_group,
5924             { "Out group", "openflow_v4.flow_stats_request.out_group",
5925                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_group_reserved_values), 0x0,
5926                NULL, HFILL }
5927         },
5928         { &hf_openflow_v4_flow_stats_request_pad2,
5929             { "Pad", "openflow_v4.flow_stats_request.pad2",
5930                FT_BYTES, BASE_NONE, NULL, 0x0,
5931                NULL, HFILL }
5932         },
5933         { &hf_openflow_v4_flow_stats_request_cookie,
5934             { "Cookie", "openflow_v4.flow_stats_request.cookie",
5935                FT_UINT64, BASE_HEX, NULL, 0x0,
5936                NULL, HFILL }
5937         },
5938         { &hf_openflow_v4_flow_stats_request_cookie_mask,
5939             { "Cookie mask", "openflow_v4.flow_stats_request.cookie_mask",
5940                FT_UINT64, BASE_HEX, NULL, 0x0,
5941                NULL, HFILL }
5942         },
5943         { &hf_openflow_v4_aggregate_stats_request_table_id,
5944             { "Table ID", "openflow_v4.aggregate_stats_request.table_id",
5945                FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_table_reserved_values), 0x0,
5946                NULL, HFILL }
5947         },
5948         { &hf_openflow_v4_aggregate_stats_request_pad,
5949             { "Pad", "openflow_v4.aggregate_stats_request.pad",
5950                FT_BYTES, BASE_NONE, NULL, 0x0,
5951                NULL, HFILL }
5952         },
5953         { &hf_openflow_v4_aggregate_stats_request_out_port,
5954             { "Out port", "openflow_v4.aggregate_stats_request.out_port",
5955                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
5956                NULL, HFILL }
5957         },
5958         { &hf_openflow_v4_aggregate_stats_request_out_group,
5959             { "Out group", "openflow_v4.aggregate_stats_request.out_group",
5960                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_group_reserved_values), 0x0,
5961                NULL, HFILL }
5962         },
5963         { &hf_openflow_v4_aggregate_stats_request_pad2,
5964             { "Pad", "openflow_v4.aggregate_stats_request.pad2",
5965                FT_BYTES, BASE_NONE, NULL, 0x0,
5966                NULL, HFILL }
5967         },
5968         { &hf_openflow_v4_aggregate_stats_request_cookie,
5969             { "Cookie", "openflow_v4.aggregate_stats_request.cookie",
5970                FT_UINT64, BASE_HEX, NULL, 0x0,
5971                NULL, HFILL }
5972         },
5973         { &hf_openflow_v4_aggregate_stats_request_cookie_mask,
5974             { "Cookie mask", "openflow_v4.aggregate_stats_request.cookie_mask",
5975                FT_UINT64, BASE_HEX, NULL, 0x0,
5976                NULL, HFILL }
5977         },
5978         { &hf_openflow_v4_table_feature_prop_type,
5979             { "Type", "openflow_v4.table_feature_prop.type",
5980                FT_UINT16, BASE_DEC, VALS(openflow_v4_table_feature_prop_type_values), 0x0,
5981                NULL, HFILL }
5982         },
5983         { &hf_openflow_v4_table_feature_prop_length,
5984             { "Length", "openflow_v4.table_feature_prop.length",
5985                FT_UINT16, BASE_DEC, NULL, 0x0,
5986                NULL, HFILL }
5987         },
5988         { &hf_openflow_v4_table_feature_prop_next_tables_next_table_id,
5989             { "Next table ID", "openflow_v4.table_feature_prop.next_tables.next_table_id",
5990                FT_UINT8, BASE_DEC, NULL, 0x0,
5991                NULL, HFILL }
5992         },
5993         { &hf_openflow_v4_table_feature_prop_experimenter_experimenter,
5994             { "Experimenter", "openflow_v4.table_feature_prop.experimenter.experimenter",
5995                FT_UINT32, BASE_HEX, NULL, 0x0,
5996                NULL, HFILL }
5997         },
5998         { &hf_openflow_v4_table_feature_prop_experimenter_exp_type,
5999             { "Experimenter type", "openflow_v4.table_feature_prop.experimenter.exp_type",
6000                FT_UINT32, BASE_DEC, NULL, 0x0,
6001                NULL, HFILL }
6002         },
6003         { &hf_openflow_v4_table_feature_prop_pad,
6004             { "Pad", "openflow_v4.table_feature_prop.pad",
6005                FT_BYTES, BASE_NONE, NULL, 0x0,
6006                NULL, HFILL }
6007         },
6008         { &hf_openflow_v4_table_features_length,
6009             { "Length", "openflow_v4.table_features.length",
6010                FT_UINT16, BASE_DEC, NULL, 0x0,
6011                NULL, HFILL }
6012         },
6013         { &hf_openflow_v4_table_features_table_id,
6014             { "Table ID", "openflow_v4.table_features.table_id",
6015                FT_UINT8, BASE_DEC, NULL, 0x0,
6016                NULL, HFILL }
6017         },
6018         { &hf_openflow_v4_table_features_pad,
6019             { "Pad", "openflow_v4.table_features.pad",
6020                FT_BYTES, BASE_NONE, NULL, 0x0,
6021                NULL, HFILL }
6022         },
6023         { &hf_openflow_v4_table_features_name,
6024             { "Name", "openflow_v4.table_features.name",
6025                FT_STRING, BASE_NONE, NULL, 0x0,
6026                NULL, HFILL }
6027         },
6028         { &hf_openflow_v4_table_features_metadata_match,
6029             { "Metadata match", "openflow_v4.table_features.metadata_match",
6030                FT_UINT64, BASE_HEX, NULL, 0x0,
6031                NULL, HFILL }
6032         },
6033         { &hf_openflow_v4_table_features_metadata_write,
6034             { "Metadata write", "openflow_v4.table_features.metadata_write",
6035                FT_UINT64, BASE_HEX, NULL, 0x0,
6036                NULL, HFILL }
6037         },
6038         { &hf_openflow_v4_table_features_config,
6039             { "Config", "openflow_v4.table_features.config",
6040                FT_BYTES, BASE_NONE, NULL, 0x0,
6041                NULL, HFILL }
6042         },
6043         { &hf_openflow_v4_table_features_max_entries,
6044             { "Max entries", "openflow_v4.table_features.max_entries",
6045                FT_UINT32, BASE_DEC, NULL, 0x0,
6046                NULL, HFILL }
6047         },
6048         { &hf_openflow_v4_port_stats_request_port_no,
6049             { "Port number", "openflow_v4.port_stats_request.port_no",
6050                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
6051                NULL, HFILL }
6052         },
6053         { &hf_openflow_v4_port_stats_request_pad,
6054             { "Pad", "openflow_v4.port_stats_request.pad",
6055                FT_BYTES, BASE_NONE, NULL, 0x0,
6056                NULL, HFILL }
6057         },
6058         { &hf_openflow_v4_queue_stats_request_port_no,
6059             { "Port number", "openflow_v4.queue_stats_request.port_no",
6060                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
6061                NULL, HFILL }
6062         },
6063         { &hf_openflow_v4_queue_stats_request_queue_id,
6064             { "Queue ID", "openflow_v4.queue_stats_request.queue_id",
6065                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_queue_reserved_values), 0x0,
6066                NULL, HFILL }
6067         },
6068         { &hf_openflow_v4_group_stats_request_group_id,
6069             { "Group ID", "openflow_v4.group_stats_request.group_id",
6070                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_group_reserved_values), 0x0,
6071                NULL, HFILL }
6072         },
6073         { &hf_openflow_v4_group_stats_request_pad,
6074             { "Pad", "openflow_v4.group_stats_request.pad",
6075                FT_BYTES, BASE_NONE, NULL, 0x0,
6076                NULL, HFILL }
6077         },
6078         { &hf_openflow_v4_meter_stats_request_meter_id,
6079             { "Meter ID", "openflow_v4.meter_stats_request.meter_id",
6080                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_meter_id_reserved_values), 0x0,
6081                NULL, HFILL }
6082         },
6083         { &hf_openflow_v4_meter_stats_request_pad,
6084             { "Pad", "openflow_v4.meter_stats_request.pad",
6085                FT_BYTES, BASE_NONE, NULL, 0x0,
6086                NULL, HFILL }
6087         },
6088         { &hf_openflow_v4_meter_config_request_meter_id,
6089             { "Meter ID", "openflow_v4.meter_config_request.meter_id",
6090                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_meter_id_reserved_values), 0x0,
6091                NULL, HFILL }
6092         },
6093         { &hf_openflow_v4_meter_config_request_pad,
6094             { "Pad", "openflow_v4.meter_config_request.pad",
6095                FT_BYTES, BASE_NONE, NULL, 0x0,
6096                NULL, HFILL }
6097         },
6098         { &hf_openflow_v4_multipart_request_type ,
6099             { "Type", "openflow_v4.multipart_request.type",
6100                FT_UINT16, BASE_DEC, VALS(openflow_v4_multipart_type_values), 0x0,
6101                NULL, HFILL }
6102         },
6103         { &hf_openflow_v4_multipart_request_flags,
6104             { "Flags", "openflow_v4.multipart_request.flags",
6105                FT_UINT16, BASE_HEX, NULL, 0x0,
6106                NULL, HFILL }
6107         },
6108         { &hf_openflow_v4_multipart_request_flags_more,
6109             { "OFPMPF_REQ_MORE", "openflow_v4.multipart_request.flags.more",
6110                FT_UINT16, BASE_HEX, NULL, OFPMPF_REQ_MORE,
6111                NULL, HFILL }
6112         },
6113         { &hf_openflow_v4_multipart_request_pad,
6114             { "Pad", "openflow_v4.multipart_request.pad",
6115                FT_BYTES, BASE_NONE, NULL, 0x0,
6116                NULL, HFILL }
6117         },
6118         { &hf_openflow_v4_multipart_request_experimenter_experimenter,
6119             { "Experimenter", "openflow_v4.multipart_request.experimenter.experimenter",
6120                FT_UINT32, BASE_HEX, NULL, 0x0,
6121                NULL, HFILL }
6122         },
6123         { &hf_openflow_v4_multipart_request_experimenter_exp_type,
6124             { "Experimenter type", "openflow_v4.multipart_request.experimenter.exp_type",
6125                FT_UINT32, BASE_DEC, NULL, 0x0,
6126                NULL, HFILL }
6127         },
6128         { &hf_openflow_v4_switch_description_mfr_desc,
6129             { "Manufacturer desc.", "openflow_v4.switch_description.mfr_desc",
6130                FT_STRING, BASE_NONE, NULL, 0x0,
6131                NULL, HFILL }
6132         },
6133         { &hf_openflow_v4_switch_description_hw_desc,
6134             { "Hardware desc.", "openflow_v4.switch_description.hw_desc",
6135                FT_STRING, BASE_NONE, NULL, 0x0,
6136                NULL, HFILL }
6137         },
6138         { &hf_openflow_v4_switch_description_sw_desc,
6139             { "Software desc.", "openflow_v4.switch_description.sw_desc",
6140                FT_STRING, BASE_NONE, NULL, 0x0,
6141                NULL, HFILL }
6142         },
6143         { &hf_openflow_v4_switch_description_serial_num,
6144             { "Serial no.", "openflow_v4.switch_description.serial_num",
6145                FT_STRING, BASE_NONE, NULL, 0x0,
6146                NULL, HFILL }
6147         },
6148         { &hf_openflow_v4_switch_description_dp_desc,
6149             { "Datapath desc.", "openflow_v4.switch_description.dp_desc",
6150                FT_STRING, BASE_NONE, NULL, 0x0,
6151                NULL, HFILL }
6152         },
6153         { &hf_openflow_v4_flow_stats_length,
6154             { "Length", "openflow_v4.flow_stats.length",
6155                FT_UINT16, BASE_DEC, NULL, 0x0,
6156                NULL, HFILL }
6157         },
6158         { &hf_openflow_v4_flow_stats_table_id,
6159             { "Table ID", "openflow_v4.flow_stats.table_id",
6160                FT_UINT8, BASE_DEC, NULL, 0x0,
6161                NULL, HFILL }
6162         },
6163         { &hf_openflow_v4_flow_stats_pad,
6164             { "Pad", "openflow_v4.flow_stats.pad",
6165                FT_BYTES, BASE_NONE, NULL, 0x0,
6166                NULL, HFILL }
6167         },
6168         { &hf_openflow_v4_flow_stats_duration_sec,
6169             { "Duration sec", "openflow_v4.flow_stats.duration_sec",
6170                FT_UINT32, BASE_DEC, NULL, 0x0,
6171                NULL, HFILL }
6172         },
6173         { &hf_openflow_v4_flow_stats_duration_nsec,
6174             { "Duration nsec", "openflow_v4.flow_stats.duration_nsec",
6175                FT_UINT32, BASE_DEC, NULL, 0x0,
6176                NULL, HFILL }
6177         },
6178         { &hf_openflow_v4_flow_stats_priority,
6179             { "Priority", "openflow_v4.flow_stats.priority",
6180                FT_UINT16, BASE_DEC, NULL, 0x0,
6181                NULL, HFILL }
6182         },
6183         { &hf_openflow_v4_flow_stats_idle_timeout,
6184             { "Idle timeout", "openflow_v4.flow_stats.idle_timeout",
6185                FT_UINT16, BASE_DEC, NULL, 0x0,
6186                NULL, HFILL }
6187         },
6188         { &hf_openflow_v4_flow_stats_hard_timeout,
6189             { "Hard timeout", "openflow_v4.flow_stats.hard_timeout",
6190                FT_UINT16, BASE_DEC, NULL, 0x0,
6191                NULL, HFILL }
6192         },
6193         { &hf_openflow_v4_flow_stats_flags,
6194             { "Flags", "openflow_v4.flow_stats.flags",
6195                FT_UINT16, BASE_HEX, NULL, 0x0,
6196                NULL, HFILL }
6197         },
6198         { &hf_openflow_v4_flow_stats_flags_send_flow_rem,
6199             { "Send flow removed", "openflow_v4.flow_stats.flags.send_flow_rem",
6200                FT_BOOLEAN, 16, NULL, OFPFF_SEND_FLOW_REM,
6201                NULL, HFILL }
6202         },
6203         { &hf_openflow_v4_flow_stats_flags_check_overlap,
6204             { "Check overlap", "openflow_v4.flow_stats.flags.check_overlap",
6205                FT_BOOLEAN, 16, NULL, OFPFF_CHECK_OVERLAP,
6206                NULL, HFILL }
6207         },
6208         { &hf_openflow_v4_flow_stats_flags_reset_counts,
6209             { "Reset counts", "openflow_v4.flow_stats.flags.reset_counts",
6210                FT_BOOLEAN, 16, NULL, OFPFF_RESET_COUNTS,
6211                NULL, HFILL }
6212         },
6213         { &hf_openflow_v4_flow_stats_flags_no_packet_counts,
6214             { "Don't count packets", "openflow_v4.flow_stats.flags.no_packet_counts",
6215                FT_BOOLEAN, 16, NULL, OFPFF_NO_PKT_COUNTS,
6216                NULL, HFILL }
6217         },
6218         { &hf_openflow_v4_flow_stats_flags_no_byte_counts,
6219             { "Don't count bytes", "openflow_v4.flow_stats.flags.no_byte_counts",
6220                FT_BOOLEAN, 16, NULL, OFPFF_NO_BYT_COUNTS,
6221                NULL, HFILL }
6222         },
6223         { &hf_openflow_v4_flow_stats_pad2,
6224             { "Pad", "openflow_v4.flow_stats.pad2",
6225                FT_BYTES, BASE_NONE, NULL, 0x0,
6226                NULL, HFILL }
6227         },
6228         { &hf_openflow_v4_flow_stats_cookie,
6229             { "Cookie", "openflow_v4.flow_stats.cookie",
6230                FT_UINT64, BASE_HEX, NULL, 0x0,
6231                NULL, HFILL }
6232         },
6233         { &hf_openflow_v4_flow_stats_packet_count,
6234             { "Packet count", "openflow_v4.flow_stats.packet_count",
6235                FT_UINT64, BASE_DEC, NULL, 0x0,
6236                NULL, HFILL }
6237         },
6238         { &hf_openflow_v4_flow_stats_byte_count,
6239             { "Byte count", "openflow_v4.flow_stats.byte_count",
6240                FT_UINT64, BASE_DEC, NULL, 0x0,
6241                NULL, HFILL }
6242         },
6243         { &hf_openflow_v4_aggregate_stats_packet_count,
6244             { "Packet count", "openflow_v4.aggregate_stats.packet_count",
6245                FT_UINT64, BASE_DEC, NULL, 0x0,
6246                NULL, HFILL }
6247         },
6248         { &hf_openflow_v4_aggregate_stats_byte_count,
6249             { "Byte count", "openflow_v4.aggregate_stats.byte_count",
6250                FT_UINT64, BASE_DEC, NULL, 0x0,
6251                NULL, HFILL }
6252         },
6253         { &hf_openflow_v4_aggregate_stats_flow_count,
6254             { "Flow count", "openflow_v4.aggregate_stats.flow_count",
6255                FT_UINT64, BASE_DEC, NULL, 0x0,
6256                NULL, HFILL }
6257         },
6258         { &hf_openflow_v4_aggregate_stats_pad,
6259             { "Pad", "openflow_v4.aggregate_stats.pad",
6260                FT_BYTES, BASE_NONE, NULL, 0x0,
6261                NULL, HFILL }
6262         },
6263         { &hf_openflow_v4_table_stats_table_id,
6264             { "Table ID", "openflow_v4.table_stats.table_id",
6265                FT_UINT8, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_table_reserved_values), 0x0,
6266                NULL, HFILL }
6267         },
6268         { &hf_openflow_v4_table_stats_pad,
6269             { "Pad", "openflow_v4.table_stats.pad",
6270                FT_BYTES, BASE_NONE, NULL, 0x0,
6271                NULL, HFILL }
6272         },
6273         { &hf_openflow_v4_table_stats_active_count,
6274             { "Active count", "openflow_v4.table_stats.active_count",
6275                FT_UINT32, BASE_DEC, NULL, 0x0,
6276                NULL, HFILL }
6277         },
6278         { &hf_openflow_v4_table_stats_lookup_count,
6279             { "Lookup count", "openflow_v4.table_stats.lookup_count",
6280                FT_UINT64, BASE_DEC, NULL, 0x0,
6281                NULL, HFILL }
6282         },
6283         { &hf_openflow_v4_table_stats_match_count,
6284             { "Match count", "openflow_v4.table_stats.match_count",
6285                FT_UINT64, BASE_DEC, NULL, 0x0,
6286                NULL, HFILL }
6287         },
6288         { &hf_openflow_v4_port_stats_port_no,
6289             { "Port number", "openflow_v4.port_stats.port_no",
6290                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
6291                NULL, HFILL }
6292         },
6293         { &hf_openflow_v4_port_stats_pad,
6294             { "Pad", "openflow_v4.port_stats.pad",
6295                FT_BYTES, BASE_NONE, NULL, 0x0,
6296                NULL, HFILL }
6297         },
6298         { &hf_openflow_v4_port_stats_rx_packets,
6299             { "Rx packets", "openflow_v4.port_stats.rx_packets",
6300                FT_UINT64, BASE_DEC, NULL, 0x0,
6301                NULL, HFILL }
6302         },
6303         { &hf_openflow_v4_port_stats_tx_packets,
6304             { "Tx packets", "openflow_v4.port_stats.tx_packets",
6305                FT_UINT64, BASE_DEC, NULL, 0x0,
6306                NULL, HFILL }
6307         },
6308         { &hf_openflow_v4_port_stats_rx_bytes,
6309             { "Rx bytes", "openflow_v4.port_stats.rx_bytes",
6310                FT_UINT64, BASE_DEC, NULL, 0x0,
6311                NULL, HFILL }
6312         },
6313         { &hf_openflow_v4_port_stats_tx_bytes,
6314             { "Tx bytes", "openflow_v4.port_stats.tx_bytes",
6315                FT_UINT64, BASE_DEC, NULL, 0x0,
6316                NULL, HFILL }
6317         },
6318         { &hf_openflow_v4_port_stats_rx_dropped,
6319             { "Rx dropped", "openflow_v4.port_stats.rx_dropped",
6320                FT_UINT64, BASE_DEC, NULL, 0x0,
6321                NULL, HFILL }
6322         },
6323         { &hf_openflow_v4_port_stats_tx_dropped,
6324             { "Tx dropped", "openflow_v4.port_stats.tx_dropped",
6325                FT_UINT64, BASE_DEC, NULL, 0x0,
6326                NULL, HFILL }
6327         },
6328         { &hf_openflow_v4_port_stats_rx_errors,
6329             { "Rx errors", "openflow_v4.port_stats.rx_errors",
6330                FT_UINT64, BASE_DEC, NULL, 0x0,
6331                NULL, HFILL }
6332         },
6333         { &hf_openflow_v4_port_stats_tx_errors,
6334             { "Tx errors", "openflow_v4.port_stats.tx_errors",
6335                FT_UINT64, BASE_DEC, NULL, 0x0,
6336                NULL, HFILL }
6337         },
6338         { &hf_openflow_v4_port_stats_rx_frame_error,
6339             { "Rx frame errors", "openflow_v4.port_stats.rx_frame_error",
6340                FT_UINT64, BASE_DEC, NULL, 0x0,
6341                NULL, HFILL }
6342         },
6343         { &hf_openflow_v4_port_stats_rx_over_error,
6344             { "Rx overrun errors", "openflow_v4.port_stats.rx_over_error",
6345                FT_UINT64, BASE_DEC, NULL, 0x0,
6346                NULL, HFILL }
6347         },
6348         { &hf_openflow_v4_port_stats_rx_crc_error,
6349             { "Rx CRC errors", "openflow_v4.port_stats.rx_crc_error",
6350                FT_UINT64, BASE_DEC, NULL, 0x0,
6351                NULL, HFILL }
6352         },
6353         { &hf_openflow_v4_port_stats_collisions,
6354             { "Collisions", "openflow_v4.port_stats.collisions",
6355                FT_UINT64, BASE_DEC, NULL, 0x0,
6356                NULL, HFILL }
6357         },
6358         { &hf_openflow_v4_port_stats_duration_sec,
6359             { "Duration sec", "openflow_v4.port_stats.duration_sec",
6360                FT_UINT32, BASE_DEC, NULL, 0x0,
6361                NULL, HFILL }
6362         },
6363         { &hf_openflow_v4_port_stats_duration_nsec,
6364             { "Duration nsec", "openflow_v4.port_stats.duration_nsec",
6365                FT_UINT32, BASE_DEC, NULL, 0x0,
6366                NULL, HFILL }
6367         },
6368         { &hf_openflow_v4_queue_stats_port_no,
6369             { "Port number", "openflow_v4.queue_stats.port_no",
6370                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
6371                NULL, HFILL }
6372         },
6373         { &hf_openflow_v4_queue_stats_queue_id,
6374             { "Queue ID", "openflow_v4.queue_stats.queue_id",
6375                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_queue_reserved_values), 0x0,
6376                NULL, HFILL }
6377         },
6378         { &hf_openflow_v4_queue_stats_tx_bytes,
6379             { "Tx bytes", "openflow_v4.queue_stats.tx_bytes",
6380                FT_UINT64, BASE_DEC, NULL, 0x0,
6381                NULL, HFILL }
6382         },
6383         { &hf_openflow_v4_queue_stats_tx_packets,
6384             { "Tx packets", "openflow_v4.quee_stats.tx_packets",
6385                FT_UINT64, BASE_DEC, NULL, 0x0,
6386                NULL, HFILL }
6387         },
6388         { &hf_openflow_v4_queue_stats_tx_errors,
6389             { "Tx errors", "openflow_v4.port_stats.tx_errors",
6390                FT_UINT64, BASE_DEC, NULL, 0x0,
6391                NULL, HFILL }
6392         },
6393         { &hf_openflow_v4_queue_stats_duration_sec,
6394             { "Duration sec", "openflow_v4.queue_stats.duration_sec",
6395                FT_UINT32, BASE_DEC, NULL, 0x0,
6396                NULL, HFILL }
6397         },
6398         { &hf_openflow_v4_queue_stats_duration_nsec,
6399             { "Duration nsec", "openflow_v4.queue_stats.duration_nsec",
6400                FT_UINT32, BASE_DEC, NULL, 0x0,
6401                NULL, HFILL }
6402         },
6403         { &hf_openflow_v4_bucket_counter_packet_count,
6404             { "Packet count", "openflow_v4.bucket_counter.packet_count",
6405                FT_UINT64, BASE_DEC, NULL, 0x0,
6406                NULL, HFILL }
6407         },
6408         { &hf_openflow_v4_bucket_counter_byte_count,
6409             { "Byte count", "openflow_v4.bucket_counter.byte_count",
6410                FT_UINT64, BASE_DEC, NULL, 0x0,
6411                NULL, HFILL }
6412         },
6413         { &hf_openflow_v4_group_stats_length,
6414             { "Length", "openflow_v4.group_stats.length",
6415                FT_UINT16, BASE_DEC, NULL, 0x0,
6416                NULL, HFILL }
6417         },
6418         { &hf_openflow_v4_group_stats_pad,
6419             { "Pad", "openflow_v4.group_stats.pad",
6420                FT_BYTES, BASE_NONE, NULL, 0x0,
6421                NULL, HFILL }
6422         },
6423         { &hf_openflow_v4_group_stats_group_id,
6424             { "Group ID", "openflow_v4.group_stats.group_id",
6425                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_group_reserved_values), 0x0,
6426                NULL, HFILL }
6427         },
6428         { &hf_openflow_v4_group_stats_ref_count,
6429             { "Ref. count", "openflow_v4.group_stats.ref_count",
6430                FT_UINT32, BASE_DEC, NULL, 0x0,
6431                NULL, HFILL }
6432         },
6433         { &hf_openflow_v4_group_stats_pad2,
6434             { "Pad", "openflow_v4.group_stats.pad2",
6435                FT_BYTES, BASE_NONE, NULL, 0x0,
6436                NULL, HFILL }
6437         },
6438         { &hf_openflow_v4_group_stats_packet_count,
6439             { "Packet count", "openflow_v4.group_stats.packet_count",
6440                FT_UINT64, BASE_DEC, NULL, 0x0,
6441                NULL, HFILL }
6442         },
6443         { &hf_openflow_v4_group_stats_byte_count,
6444             { "Byte count", "openflow_v4.group_stats.byte_count",
6445                FT_UINT64, BASE_DEC, NULL, 0x0,
6446                NULL, HFILL }
6447         },
6448         { &hf_openflow_v4_group_desc_length,
6449             { "Length", "openflow_v4.group_desc.length",
6450                FT_UINT16, BASE_DEC, NULL, 0x0,
6451                NULL, HFILL }
6452         },
6453         { &hf_openflow_v4_group_desc_type,
6454             { "Type", "openflow_v4.group_desc.type",
6455                FT_UINT8, BASE_DEC, VALS(openflow_v4_group_type_values), 0x0,
6456                NULL, HFILL }
6457         },
6458         { &hf_openflow_v4_group_desc_pad,
6459             { "Pad", "openflow_v4.group_desc.pad2",
6460                FT_BYTES, BASE_NONE, NULL, 0x0,
6461                NULL, HFILL }
6462         },
6463         { &hf_openflow_v4_group_desc_group_id,
6464             { "Group ID", "openflow_v4.group_desc.group_id",
6465                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_group_reserved_values), 0x0,
6466                NULL, HFILL }
6467         },
6468         { &hf_openflow_v4_group_features_types,
6469             { "Types", "openflow_v4.group_features.types",
6470                FT_UINT32, BASE_HEX, NULL, 0x0,
6471                NULL, HFILL }
6472         },
6473         { &hf_openflow_v4_group_features_types_all,
6474             { "OFPGT_ALL", "openflow_v4.group_features.types.all",
6475                FT_BOOLEAN, 32, NULL, 1 << OFPGT_ALL,
6476                NULL, HFILL }
6477         },
6478         { &hf_openflow_v4_group_features_types_select,
6479             { "OFPGT_SELECT", "openflow_v4.group_features.types.select",
6480                FT_BOOLEAN, 32, NULL, 1 << OFPGT_SELECT,
6481                NULL, HFILL }
6482         },
6483         { &hf_openflow_v4_group_features_types_indirect,
6484             { "OFPGT_INDIRECT", "openflow_v4.group_features.types.indirect",
6485                FT_BOOLEAN, 32, NULL, 1 << OFPGT_INDIRECT,
6486                NULL, HFILL }
6487         },
6488         { &hf_openflow_v4_group_features_types_ff,
6489             { "OFPGT_FF", "openflow_v4.group_features.types.ff",
6490                FT_BOOLEAN, 32, NULL, 1 << OFPGT_FF,
6491                NULL, HFILL }
6492         },
6493         { &hf_openflow_v4_group_features_capabilities,
6494             { "Capabilities", "openflow_v4.group_features.capabilities",
6495                FT_UINT32, BASE_HEX, NULL, 0x0,
6496                NULL, HFILL }
6497         },
6498         { &hf_openflow_v4_group_features_capabilities_select_weight,
6499             { "OFPGFC_SELECT_WEIGHT", "openflow_v4.group_features.capabilities.select_weight",
6500                FT_BOOLEAN, 32, NULL, OFPGFC_SELECT_WEIGHT,
6501                NULL, HFILL }
6502         },
6503         { &hf_openflow_v4_group_features_capabilities_select_liveness,
6504             { "OFPGFC_SELECT_LIVENESS", "openflow_v4.group_features.capabilities.select_liveness",
6505                FT_BOOLEAN, 32, NULL, OFPGFC_SELECT_LIVENESS,
6506                NULL, HFILL }
6507         },
6508         { &hf_openflow_v4_group_features_capabilities_chaining,
6509             { "OFPGFC_CHAINING", "openflow_v4.group_features.capabilities.chaining",
6510                FT_BOOLEAN, 32, NULL, OFPGFC_CHAINING,
6511                NULL, HFILL }
6512         },
6513         { &hf_openflow_v4_group_features_capabilities_chaining_checks,
6514             { "OFPGFC_CHAINING_CHECKS", "openflow_v4.group_features.capabilities.chaining_checks",
6515                FT_BOOLEAN, 32, NULL, OFPGFC_CHAINING_CHECKS,
6516                NULL, HFILL }
6517         },
6518         { &hf_openflow_v4_group_features_max_groups_all,
6519             { "Max groups (all)", "openflow_v4.group_stats.max_groups.all",
6520                FT_UINT32, BASE_DEC, NULL, 0x0,
6521                NULL, HFILL }
6522         },
6523         { &hf_openflow_v4_group_features_max_groups_select,
6524             { "Max groups (select)", "openflow_v4.group_stats.max_groups.select",
6525                FT_UINT32, BASE_DEC, NULL, 0x0,
6526                NULL, HFILL }
6527         },
6528         { &hf_openflow_v4_group_features_max_groups_indirect,
6529             { "Max groups (indirect)", "openflow_v4.group_stats.max_groups.indirect",
6530                FT_UINT32, BASE_DEC, NULL, 0x0,
6531                NULL, HFILL }
6532         },
6533         { &hf_openflow_v4_group_features_max_groups_ff,
6534             { "Max groups (ff)", "openflow_v4.group_stats.max_groups.ff",
6535                FT_UINT32, BASE_DEC, NULL, 0x0,
6536                NULL, HFILL }
6537         },
6538         { &hf_openflow_v4_group_features_actions_all,
6539             { "Actions (all)", "openflow_v4.group_features.actions.all",
6540                FT_UINT32, BASE_HEX, NULL, 0x0,
6541                NULL, HFILL }
6542         },
6543         { &hf_openflow_v4_group_features_actions_all_output,
6544             { "OFPAT_OUTPUT", "openflow_v4.group_features.actions.all.output",
6545                FT_BOOLEAN, 32, NULL, 1 << OFPAT_OUTPUT,
6546                NULL, HFILL }
6547         },
6548         { &hf_openflow_v4_group_features_actions_all_copy_ttl_out,
6549             { "OFPAT_COPY_TTL_OUT", "openflow_v4.group_features.actions.all.copy_ttl_out",
6550                FT_BOOLEAN, 32, NULL, 1 << OFPAT_COPY_TTL_OUT,
6551                NULL, HFILL }
6552         },
6553         { &hf_openflow_v4_group_features_actions_all_copy_ttl_in,
6554             { "OFPAT_COPY_TTL_IN", "openflow_v4.group_features.actions.all.copy_ttl_in",
6555                FT_BOOLEAN, 32, NULL, 1 << OFPAT_COPY_TTL_IN,
6556                NULL, HFILL }
6557         },
6558         { &hf_openflow_v4_group_features_actions_all_set_mpls_ttl,
6559             { "OFPAT_SET_MPLS_TTL", "openflow_v4.group_features.actions.all.set_mpls_ttl",
6560                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_MPLS_TTL,
6561                NULL, HFILL }
6562         },
6563         { &hf_openflow_v4_group_features_actions_all_dec_mpls_ttl,
6564             { "OFPAT_DEC_MPLS_TTL", "openflow_v4.group_features.actions.all.dec_mpls_ttl",
6565                FT_BOOLEAN, 32, NULL, 1 << OFPAT_DEC_MPLS_TTL,
6566                NULL, HFILL }
6567         },
6568         { &hf_openflow_v4_group_features_actions_all_push_vlan,
6569             { "OFPAT_PUSH_VLAN", "openflow_v4.group_features.actions.all.push_vlan",
6570                FT_BOOLEAN, 32, NULL, 1 << OFPAT_PUSH_VLAN,
6571                NULL, HFILL }
6572         },
6573         { &hf_openflow_v4_group_features_actions_all_pop_vlan,
6574             { "OFPAT_POP_VLAN", "openflow_v4.group_features.actions.all.pop_vlan",
6575                FT_BOOLEAN, 32, NULL, 1 << OFPAT_POP_VLAN,
6576                NULL, HFILL }
6577         },
6578         { &hf_openflow_v4_group_features_actions_all_push_mpls,
6579             { "OFPAT_PUSH_MPLS", "openflow_v4.group_features.actions.all.push_mpls",
6580                FT_BOOLEAN, 32, NULL, 1 << OFPAT_PUSH_MPLS,
6581                NULL, HFILL }
6582         },
6583         { &hf_openflow_v4_group_features_actions_all_pop_mpls,
6584             { "OFPAT_POP_MPLS", "openflow_v4.group_features.actions.all.pop_mpls",
6585                FT_BOOLEAN, 32, NULL, 1 << OFPAT_POP_MPLS,
6586                NULL, HFILL }
6587         },
6588         { &hf_openflow_v4_group_features_actions_all_set_queue,
6589             { "OFPAT_SET_QUEUE", "openflow_v4.group_features.actions.all.set_queue",
6590                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_QUEUE,
6591                NULL, HFILL }
6592         },
6593         { &hf_openflow_v4_group_features_actions_all_group,
6594             { "OFPAT_GROUP", "openflow_v4.group_features.actions.all.group",
6595                FT_BOOLEAN, 32, NULL, 1 << OFPAT_GROUP,
6596                NULL, HFILL }
6597         },
6598         { &hf_openflow_v4_group_features_actions_all_set_nw_ttl,
6599             { "OFPAT_SET_NW_TTL", "openflow_v4.group_features.actions.all.set_nw_ttl",
6600                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_NW_TTL,
6601                NULL, HFILL }
6602         },
6603         { &hf_openflow_v4_group_features_actions_all_dec_nw_ttl,
6604             { "OFPAT_DEC_NW_TTL", "openflow_v4.group_features.actions.all.dec_nw_ttl",
6605                FT_BOOLEAN, 32, NULL, 1 << OFPAT_DEC_NW_TTL,
6606                NULL, HFILL }
6607         },
6608         { &hf_openflow_v4_group_features_actions_all_set_field,
6609             { "OFPAT_SET_FIELD", "openflow_v4.group_features.actions.all.set_field",
6610                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_FIELD,
6611                NULL, HFILL }
6612         },
6613         { &hf_openflow_v4_group_features_actions_all_push_pbb,
6614             { "OFPAT_PUSH_PBB", "openflow_v4.group_features.actions.all.push_pbb",
6615                FT_BOOLEAN, 32, NULL, 1 << OFPAT_PUSH_PBB,
6616                NULL, HFILL }
6617         },
6618         { &hf_openflow_v4_group_features_actions_all_pop_pbb,
6619             { "OFPAT_POP_PBB", "openflow_v4.group_features.actions.all.pop_pbb",
6620                FT_BOOLEAN, 32, NULL, 1 << OFPAT_POP_PBB,
6621                NULL, HFILL }
6622         },
6623         { &hf_openflow_v4_group_features_actions_select,
6624             { "Actions (select)", "openflow_v4.group_features.actions.select",
6625                FT_UINT32, BASE_HEX, NULL, 0x0,
6626                NULL, HFILL }
6627         },
6628         { &hf_openflow_v4_group_features_actions_select_output,
6629             { "OFPAT_OUTPUT", "openflow_v4.group_features.actions.select.output",
6630                FT_BOOLEAN, 32, NULL, 1 << OFPAT_OUTPUT,
6631                NULL, HFILL }
6632         },
6633         { &hf_openflow_v4_group_features_actions_select_copy_ttl_out,
6634             { "OFPAT_COPY_TTL_OUT", "openflow_v4.group_features.actions.select.copy_ttl_out",
6635                FT_BOOLEAN, 32, NULL, 1 << OFPAT_COPY_TTL_OUT,
6636                NULL, HFILL }
6637         },
6638         { &hf_openflow_v4_group_features_actions_select_copy_ttl_in,
6639             { "OFPAT_COPY_TTL_IN", "openflow_v4.group_features.actions.select.copy_ttl_in",
6640                FT_BOOLEAN, 32, NULL, 1 << OFPAT_COPY_TTL_IN,
6641                NULL, HFILL }
6642         },
6643         { &hf_openflow_v4_group_features_actions_select_set_mpls_ttl,
6644             { "OFPAT_SET_MPLS_TTL", "openflow_v4.group_features.actions.select.set_mpls_ttl",
6645                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_MPLS_TTL,
6646                NULL, HFILL }
6647         },
6648         { &hf_openflow_v4_group_features_actions_select_dec_mpls_ttl,
6649             { "OFPAT_DEC_MPLS_TTL", "openflow_v4.group_features.actions.select.dec_mpls_ttl",
6650                FT_BOOLEAN, 32, NULL, 1 << OFPAT_DEC_MPLS_TTL,
6651                NULL, HFILL }
6652         },
6653         { &hf_openflow_v4_group_features_actions_select_push_vlan,
6654             { "OFPAT_PUSH_VLAN", "openflow_v4.group_features.actions.select.push_vlan",
6655                FT_BOOLEAN, 32, NULL, 1 << OFPAT_PUSH_VLAN,
6656                NULL, HFILL }
6657         },
6658         { &hf_openflow_v4_group_features_actions_select_pop_vlan,
6659             { "OFPAT_POP_VLAN", "openflow_v4.group_features.actions.select.pop_vlan",
6660                FT_BOOLEAN, 32, NULL, 1 << OFPAT_POP_VLAN,
6661                NULL, HFILL }
6662         },
6663         { &hf_openflow_v4_group_features_actions_select_push_mpls,
6664             { "OFPAT_PUSH_MPLS", "openflow_v4.group_features.actions.select.push_mpls",
6665                FT_BOOLEAN, 32, NULL, 1 << OFPAT_PUSH_MPLS,
6666                NULL, HFILL }
6667         },
6668         { &hf_openflow_v4_group_features_actions_select_pop_mpls,
6669             { "OFPAT_POP_MPLS", "openflow_v4.group_features.actions.select.pop_mpls",
6670                FT_BOOLEAN, 32, NULL, 1 << OFPAT_POP_MPLS,
6671                NULL, HFILL }
6672         },
6673         { &hf_openflow_v4_group_features_actions_select_set_queue,
6674             { "OFPAT_SET_QUEUE", "openflow_v4.group_features.actions.select.set_queue",
6675                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_QUEUE,
6676                NULL, HFILL }
6677         },
6678         { &hf_openflow_v4_group_features_actions_select_group,
6679             { "OFPAT_GROUP", "openflow_v4.group_features.actions.select.group",
6680                FT_BOOLEAN, 32, NULL, 1 << OFPAT_GROUP,
6681                NULL, HFILL }
6682         },
6683         { &hf_openflow_v4_group_features_actions_select_set_nw_ttl,
6684             { "OFPAT_SET_NW_TTL", "openflow_v4.group_features.actions.select.set_nw_ttl",
6685                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_NW_TTL,
6686                NULL, HFILL }
6687         },
6688         { &hf_openflow_v4_group_features_actions_select_dec_nw_ttl,
6689             { "OFPAT_DEC_NW_TTL", "openflow_v4.group_features.actions.select.dec_nw_ttl",
6690                FT_BOOLEAN, 32, NULL, 1 << OFPAT_DEC_NW_TTL,
6691                NULL, HFILL }
6692         },
6693         { &hf_openflow_v4_group_features_actions_select_set_field,
6694             { "OFPAT_SET_FIELD", "openflow_v4.group_features.actions.select.set_field",
6695                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_FIELD,
6696                NULL, HFILL }
6697         },
6698         { &hf_openflow_v4_group_features_actions_select_push_pbb,
6699             { "OFPAT_PUSH_PBB", "openflow_v4.group_features.actions.select.push_pbb",
6700                FT_BOOLEAN, 32, NULL, 1 << OFPAT_PUSH_PBB,
6701                NULL, HFILL }
6702         },
6703         { &hf_openflow_v4_group_features_actions_select_pop_pbb,
6704             { "OFPAT_POP_PBB", "openflow_v4.group_features.actions.select.pop_pbb",
6705                FT_BOOLEAN, 32, NULL, 1 << OFPAT_POP_PBB,
6706                NULL, HFILL }
6707         },
6708         { &hf_openflow_v4_group_features_actions_indirect,
6709             { "Actions (indirect)", "openflow_v4.group_features.actions.indirect",
6710                FT_UINT32, BASE_HEX, NULL, 0x0,
6711                NULL, HFILL }
6712         },
6713         { &hf_openflow_v4_group_features_actions_indirect_output,
6714             { "OFPAT_OUTPUT", "openflow_v4.group_features.actions.indirect.output",
6715                FT_BOOLEAN, 32, NULL, 1 << OFPAT_OUTPUT,
6716                NULL, HFILL }
6717         },
6718         { &hf_openflow_v4_group_features_actions_indirect_copy_ttl_out,
6719             { "OFPAT_COPY_TTL_OUT", "openflow_v4.group_features.actions.indirect.copy_ttl_out",
6720                FT_BOOLEAN, 32, NULL, 1 << OFPAT_COPY_TTL_OUT,
6721                NULL, HFILL }
6722         },
6723         { &hf_openflow_v4_group_features_actions_indirect_copy_ttl_in,
6724             { "OFPAT_COPY_TTL_IN", "openflow_v4.group_features.actions.indirect.copy_ttl_in",
6725                FT_BOOLEAN, 32, NULL, 1 << OFPAT_COPY_TTL_IN,
6726                NULL, HFILL }
6727         },
6728         { &hf_openflow_v4_group_features_actions_indirect_set_mpls_ttl,
6729             { "OFPAT_SET_MPLS_TTL", "openflow_v4.group_features.actions.indirect.set_mpls_ttl",
6730                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_MPLS_TTL,
6731                NULL, HFILL }
6732         },
6733         { &hf_openflow_v4_group_features_actions_indirect_dec_mpls_ttl,
6734             { "OFPAT_DEC_MPLS_TTL", "openflow_v4.group_features.actions.indirect.dec_mpls_ttl",
6735                FT_BOOLEAN, 32, NULL, 1 << OFPAT_DEC_MPLS_TTL,
6736                NULL, HFILL }
6737         },
6738         { &hf_openflow_v4_group_features_actions_indirect_push_vlan,
6739             { "OFPAT_PUSH_VLAN", "openflow_v4.group_features.actions.indirect.push_vlan",
6740                FT_BOOLEAN, 32, NULL, 1 << OFPAT_PUSH_VLAN,
6741                NULL, HFILL }
6742         },
6743         { &hf_openflow_v4_group_features_actions_indirect_pop_vlan,
6744             { "OFPAT_POP_VLAN", "openflow_v4.group_features.actions.indirect.pop_vlan",
6745                FT_BOOLEAN, 32, NULL, 1 << OFPAT_POP_VLAN,
6746                NULL, HFILL }
6747         },
6748         { &hf_openflow_v4_group_features_actions_indirect_push_mpls,
6749             { "OFPAT_PUSH_MPLS", "openflow_v4.group_features.actions.indirect.push_mpls",
6750                FT_BOOLEAN, 32, NULL, 1 << OFPAT_PUSH_MPLS,
6751                NULL, HFILL }
6752         },
6753         { &hf_openflow_v4_group_features_actions_indirect_pop_mpls,
6754             { "OFPAT_POP_MPLS", "openflow_v4.group_features.actions.indirect.pop_mpls",
6755                FT_BOOLEAN, 32, NULL, 1 << OFPAT_POP_MPLS,
6756                NULL, HFILL }
6757         },
6758         { &hf_openflow_v4_group_features_actions_indirect_set_queue,
6759             { "OFPAT_SET_QUEUE", "openflow_v4.group_features.actions.indirect.set_queue",
6760                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_QUEUE,
6761                NULL, HFILL }
6762         },
6763         { &hf_openflow_v4_group_features_actions_indirect_group,
6764             { "OFPAT_GROUP", "openflow_v4.group_features.actions.indirect.group",
6765                FT_BOOLEAN, 32, NULL, 1 << OFPAT_GROUP,
6766                NULL, HFILL }
6767         },
6768         { &hf_openflow_v4_group_features_actions_indirect_set_nw_ttl,
6769             { "OFPAT_SET_NW_TTL", "openflow_v4.group_features.actions.indirect.set_nw_ttl",
6770                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_NW_TTL,
6771                NULL, HFILL }
6772         },
6773         { &hf_openflow_v4_group_features_actions_indirect_dec_nw_ttl,
6774             { "OFPAT_DEC_NW_TTL", "openflow_v4.group_features.actions.indirect.dec_nw_ttl",
6775                FT_BOOLEAN, 32, NULL, 1 << OFPAT_DEC_NW_TTL,
6776                NULL, HFILL }
6777         },
6778         { &hf_openflow_v4_group_features_actions_indirect_set_field,
6779             { "OFPAT_SET_FIELD", "openflow_v4.group_features.actions.indirect.set_field",
6780                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_FIELD,
6781                NULL, HFILL }
6782         },
6783         { &hf_openflow_v4_group_features_actions_indirect_push_pbb,
6784             { "OFPAT_PUSH_PBB", "openflow_v4.group_features.actions.indirect.push_pbb",
6785                FT_BOOLEAN, 32, NULL, 1 << OFPAT_PUSH_PBB,
6786                NULL, HFILL }
6787         },
6788         { &hf_openflow_v4_group_features_actions_indirect_pop_pbb,
6789             { "OFPAT_POP_PBB", "openflow_v4.group_features.actions.indirect.pop_pbb",
6790                FT_BOOLEAN, 32, NULL, 1 << OFPAT_POP_PBB,
6791                NULL, HFILL }
6792         },
6793         { &hf_openflow_v4_group_features_actions_ff,
6794             { "Actions (ff)", "openflow_v4.group_features.actions.ff",
6795                FT_UINT32, BASE_HEX, NULL, 0x0,
6796                NULL, HFILL }
6797         },
6798         { &hf_openflow_v4_group_features_actions_ff_output,
6799             { "OFPAT_OUTPUT", "openflow_v4.group_features.actions.ff.output",
6800                FT_BOOLEAN, 32, NULL, 1 << OFPAT_OUTPUT,
6801                NULL, HFILL }
6802         },
6803         { &hf_openflow_v4_group_features_actions_ff_copy_ttl_out,
6804             { "OFPAT_COPY_TTL_OUT", "openflow_v4.group_features.actions.ff.copy_ttl_out",
6805                FT_BOOLEAN, 32, NULL, 1 << OFPAT_COPY_TTL_OUT,
6806                NULL, HFILL }
6807         },
6808         { &hf_openflow_v4_group_features_actions_ff_copy_ttl_in,
6809             { "OFPAT_COPY_TTL_IN", "openflow_v4.group_features.actions.ff.copy_ttl_in",
6810                FT_BOOLEAN, 32, NULL, 1 << OFPAT_COPY_TTL_IN,
6811                NULL, HFILL }
6812         },
6813         { &hf_openflow_v4_group_features_actions_ff_set_mpls_ttl,
6814             { "OFPAT_SET_MPLS_TTL", "openflow_v4.group_features.actions.ff.set_mpls_ttl",
6815                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_MPLS_TTL,
6816                NULL, HFILL }
6817         },
6818         { &hf_openflow_v4_group_features_actions_ff_dec_mpls_ttl,
6819             { "OFPAT_DEC_MPLS_TTL", "openflow_v4.group_features.actions.ff.dec_mpls_ttl",
6820                FT_BOOLEAN, 32, NULL, 1 << OFPAT_DEC_MPLS_TTL,
6821                NULL, HFILL }
6822         },
6823         { &hf_openflow_v4_group_features_actions_ff_push_vlan,
6824             { "OFPAT_PUSH_VLAN", "openflow_v4.group_features.actions.ff.push_vlan",
6825                FT_BOOLEAN, 32, NULL, 1 << OFPAT_PUSH_VLAN,
6826                NULL, HFILL }
6827         },
6828         { &hf_openflow_v4_group_features_actions_ff_pop_vlan,
6829             { "OFPAT_POP_VLAN", "openflow_v4.group_features.actions.ff.pop_vlan",
6830                FT_BOOLEAN, 32, NULL, 1 << OFPAT_POP_VLAN,
6831                NULL, HFILL }
6832         },
6833         { &hf_openflow_v4_group_features_actions_ff_push_mpls,
6834             { "OFPAT_PUSH_MPLS", "openflow_v4.group_features.actions.ff.push_mpls",
6835                FT_BOOLEAN, 32, NULL, 1 << OFPAT_PUSH_MPLS,
6836                NULL, HFILL }
6837         },
6838         { &hf_openflow_v4_group_features_actions_ff_pop_mpls,
6839             { "OFPAT_POP_MPLS", "openflow_v4.group_features.actions.ff.pop_mpls",
6840                FT_BOOLEAN, 32, NULL, 1 << OFPAT_POP_MPLS,
6841                NULL, HFILL }
6842         },
6843         { &hf_openflow_v4_group_features_actions_ff_set_queue,
6844             { "OFPAT_SET_QUEUE", "openflow_v4.group_features.actions.ff.set_queue",
6845                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_QUEUE,
6846                NULL, HFILL }
6847         },
6848         { &hf_openflow_v4_group_features_actions_ff_group,
6849             { "OFPAT_GROUP", "openflow_v4.group_features.actions.ff.group",
6850                FT_BOOLEAN, 32, NULL, 1 << OFPAT_GROUP,
6851                NULL, HFILL }
6852         },
6853         { &hf_openflow_v4_group_features_actions_ff_set_nw_ttl,
6854             { "OFPAT_SET_NW_TTL", "openflow_v4.group_features.actions.ff.set_nw_ttl",
6855                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_NW_TTL,
6856                NULL, HFILL }
6857         },
6858         { &hf_openflow_v4_group_features_actions_ff_dec_nw_ttl,
6859             { "OFPAT_DEC_NW_TTL", "openflow_v4.group_features.actions.ff.dec_nw_ttl",
6860                FT_BOOLEAN, 32, NULL, 1 << OFPAT_DEC_NW_TTL,
6861                NULL, HFILL }
6862         },
6863         { &hf_openflow_v4_group_features_actions_ff_set_field,
6864             { "OFPAT_SET_FIELD", "openflow_v4.group_features.actions.ff.set_field",
6865                FT_BOOLEAN, 32, NULL, 1 << OFPAT_SET_FIELD,
6866                NULL, HFILL }
6867         },
6868         { &hf_openflow_v4_group_features_actions_ff_push_pbb,
6869             { "OFPAT_PUSH_PBB", "openflow_v4.group_features.actions.ff.push_pbb",
6870                FT_BOOLEAN, 32, NULL, 1 << OFPAT_PUSH_PBB,
6871                NULL, HFILL }
6872         },
6873         { &hf_openflow_v4_group_features_actions_ff_pop_pbb,
6874             { "OFPAT_POP_PBB", "openflow_v4.group_features.actions.ff.pop_pbb",
6875                FT_BOOLEAN, 32, NULL, 1 << OFPAT_POP_PBB,
6876                NULL, HFILL }
6877         },
6878         { &hf_openflow_v4_meter_band_stats_packet_band_count,
6879             { "Packet count", "openflow_v4.meter_band_stats.packet_band_count",
6880                FT_UINT64, BASE_DEC, NULL, 0x0,
6881                NULL, HFILL }
6882         },
6883         { &hf_openflow_v4_meter_band_stats_byte_band_count,
6884             { "Byte count", "openflow_v4.meter_band_stats.byte_band_count",
6885                FT_UINT64, BASE_DEC, NULL, 0x0,
6886                NULL, HFILL }
6887         },
6888         { &hf_openflow_v4_meter_stats_meter_id,
6889             { "Meter ID", "openflow_v4.meter_stats.meter_id",
6890                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_meter_id_reserved_values), 0x0,
6891                NULL, HFILL }
6892         },
6893         { &hf_openflow_v4_meter_stats_len,
6894             { "Length", "openflow_v4.meter_stats.length",
6895                FT_UINT16, BASE_DEC, NULL, 0x0,
6896                NULL, HFILL }
6897         },
6898         { &hf_openflow_v4_meter_stats_pad,
6899             { "Pad", "openflow_v4.meter_stats.pad",
6900                FT_BYTES, BASE_NONE, NULL, 0x0,
6901                NULL, HFILL }
6902         },
6903         { &hf_openflow_v4_meter_stats_flow_count,
6904             { "Flow count", "openflow_v4.meter_stats.flow_count",
6905                FT_UINT32, BASE_DEC, NULL, 0x0,
6906                NULL, HFILL }
6907         },
6908         { &hf_openflow_v4_meter_stats_packet_in_count,
6909             { "Packet in count", "openflow_v4.meter_stats.packet_in_count",
6910                FT_UINT64, BASE_DEC, NULL, 0x0,
6911                NULL, HFILL }
6912         },
6913         { &hf_openflow_v4_meter_stats_byte_in_count,
6914             { "Byte in count", "openflow_v4.meter_stats.byte_in_count",
6915                FT_UINT64, BASE_DEC, NULL, 0x0,
6916                NULL, HFILL }
6917         },
6918         { &hf_openflow_v4_meter_stats_duration_sec,
6919             { "Duration sec", "openflow_v4.meter_stats.duration_sec",
6920                FT_UINT32, BASE_DEC, NULL, 0x0,
6921                NULL, HFILL }
6922         },
6923         { &hf_openflow_v4_meter_stats_duration_nsec,
6924             { "Duration nsec", "openflow_v4.meter_stats.duration_nsec",
6925                FT_UINT32, BASE_DEC, NULL, 0x0,
6926                NULL, HFILL }
6927         },
6928         { &hf_openflow_v4_meter_config_len,
6929             { "Length", "openflow_v4.meter_config.len",
6930                FT_UINT16, BASE_DEC, NULL, 0x0,
6931                NULL, HFILL }
6932         },
6933         { &hf_openflow_v4_meter_config_flags,
6934             { "Flags", "openflow_v4.meter_config.flags",
6935                FT_UINT32, BASE_HEX, NULL, 0x0,
6936                NULL, HFILL }
6937         },
6938         { &hf_openflow_v4_meter_config_flags_kbps,
6939             { "OFPMF_KBPS", "openflow_v4.meter_config.flags.kbps",
6940                FT_BOOLEAN, 32, NULL, OFPMF_KBPS,
6941                NULL, HFILL }
6942         },
6943         { &hf_openflow_v4_meter_config_flags_pktps,
6944             { "OFPMF_PKTPS", "openflow_v4.meter_config.flags.ptkps",
6945                FT_BOOLEAN, 32, NULL, OFPMF_PKTPS,
6946                NULL, HFILL }
6947         },
6948         { &hf_openflow_v4_meter_config_flags_burst,
6949             { "OFPMF_BURST", "openflow_v4.meter_config.flags.burst",
6950                FT_BOOLEAN, 32, NULL, OFPMF_BURST,
6951                NULL, HFILL }
6952         },
6953         { &hf_openflow_v4_meter_config_flags_stats,
6954             { "OFPMF_STATS", "openflow_v4.meter_config.flags.stats",
6955                FT_BOOLEAN, 32, NULL, OFPMF_STATS,
6956                NULL, HFILL }
6957         },
6958         { &hf_openflow_v4_meter_config_meter_id,
6959             { "Meter ID", "openflow_v4.meter_config.meter_id",
6960                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_meter_id_reserved_values), 0x0,
6961                NULL, HFILL }
6962         },
6963         { &hf_openflow_v4_meter_features_max_meter,
6964             { "Max meters", "openflow_v4.meter_features.max_meter",
6965                FT_UINT32, BASE_DEC, NULL, 0x0,
6966                NULL, HFILL }
6967         },
6968         { &hf_openflow_v4_meter_features_band_types,
6969             { "Band types", "openflow_v4.features.band_types",
6970                FT_UINT32, BASE_HEX, NULL, 0x0,
6971                NULL, HFILL }
6972         },
6973         { &hf_openflow_v4_meter_features_band_types_drop,
6974             { "OFPMBT_DROP", "openflow_v4.meter_features.band_types.drop",
6975                FT_BOOLEAN, 32, NULL, 1 << OFPMBT_DROP,
6976                NULL, HFILL }
6977         },
6978         { &hf_openflow_v4_meter_features_band_types_dscp_remark,
6979             { "OFPMBT_DSCP_REMARK", "openflow_v4.meter_features.band_types.dscp_remark",
6980                FT_BOOLEAN, 32, NULL, 1 << OFPMBT_DSCP_REMARK,
6981                NULL, HFILL }
6982         },
6983         { &hf_openflow_v4_meter_features_capabilities,
6984             { "Capabilities", "openflow_v4.meter_features.capabilities",
6985                FT_UINT32, BASE_HEX, NULL, 0x0,
6986                NULL, HFILL }
6987         },
6988         { &hf_openflow_v4_meter_features_capabilities_kbps,
6989             { "OFPMF_KBPS", "openflow_v4.meter_features.capabilities.kbps",
6990                FT_BOOLEAN, 32, NULL, OFPMF_KBPS,
6991                NULL, HFILL }
6992         },
6993         { &hf_openflow_v4_meter_features_capabilities_pktps,
6994             { "OFPMF_PKTPS", "openflow_v4.meter_features.capabilities.ptkps",
6995                FT_BOOLEAN, 32, NULL, OFPMF_PKTPS,
6996                NULL, HFILL }
6997         },
6998         { &hf_openflow_v4_meter_features_capabilities_burst,
6999             { "OFPMF_BURST", "openflow_v4.meter_features.capabilities.burst",
7000                FT_BOOLEAN, 32, NULL, OFPMF_BURST,
7001                NULL, HFILL }
7002         },
7003         { &hf_openflow_v4_meter_features_capabilities_stats,
7004             { "OFPMF_STATS", "openflow_v4.meter_features.capabilities.stats",
7005                FT_BOOLEAN, 32, NULL, OFPMF_STATS,
7006                NULL, HFILL }
7007         },
7008         { &hf_openflow_v4_meter_features_max_bands,
7009             { "Max bands", "openflow_v4.meter_features.max_bands",
7010                FT_UINT8, BASE_DEC, NULL, 0x0,
7011                NULL, HFILL }
7012         },
7013         { &hf_openflow_v4_meter_features_max_color,
7014             { "Max colors", "openflow_v4.meter_features.max_color",
7015                FT_UINT8, BASE_DEC, NULL, 0x0,
7016                NULL, HFILL }
7017         },
7018         { &hf_openflow_v4_meter_features_pad,
7019             { "Pad", "openflow_v4.meter_features.pad",
7020                FT_BYTES, BASE_NONE, NULL, 0x0,
7021                NULL, HFILL }
7022         },
7023         { &hf_openflow_v4_multipart_reply_type ,
7024             { "Type", "openflow_v4.multipart_reply.type",
7025                FT_UINT16, BASE_DEC, VALS(openflow_v4_multipart_type_values), 0x0,
7026                NULL, HFILL }
7027         },
7028         { &hf_openflow_v4_multipart_reply_flags,
7029             { "Flags", "openflow_v4.multipart_reply.flags",
7030                FT_UINT16, BASE_HEX, NULL, 0x0,
7031                NULL, HFILL }
7032         },
7033         { &hf_openflow_v4_multipart_reply_flags_more,
7034             { "OFPMPF_REPLY_MORE", "openflow_v4.multipart_reply.flags.more",
7035                FT_UINT16, BASE_HEX, NULL, OFPMPF_REPLY_MORE,
7036                NULL, HFILL }
7037         },
7038         { &hf_openflow_v4_multipart_reply_pad,
7039             { "Pad", "openflow_v4.multipart_reply.pad",
7040                FT_BYTES, BASE_NONE, NULL, 0x0,
7041                NULL, HFILL }
7042         },
7043         { &hf_openflow_v4_multipart_reply_experimenter_experimenter,
7044             { "Experimenter", "openflow_v4.multipart_reply.experimenter.experimenter",
7045                FT_UINT32, BASE_HEX, NULL, 0x0,
7046                NULL, HFILL }
7047         },
7048         { &hf_openflow_v4_multipart_reply_experimenter_exp_type,
7049             { "Experimenter type", "openflow_v4.multipart_reply.experimenter.exp_type",
7050                FT_UINT32, BASE_DEC, NULL, 0x0,
7051                NULL, HFILL }
7052         },
7053         { &hf_openflow_v4_queue_get_config_request_port,
7054             { "Port", "openflow_v4.queue_get_config_request.port",
7055                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
7056                NULL, HFILL }
7057         },
7058         { &hf_openflow_v4_queue_get_config_request_pad,
7059             { "Pad", "openflow_v4.queue_get_config_request.pad",
7060                FT_BYTES, BASE_NONE, NULL, 0x0,
7061                NULL, HFILL }
7062         },
7063         { &hf_openflow_v4_queue_prop_property,
7064             { "Property", "openflow_v4.queue_prop.property",
7065                FT_UINT16, BASE_DEC, VALS(openflow_v4_queue_prop_property_values), 0x0,
7066                NULL, HFILL }
7067         },
7068         { &hf_openflow_v4_queue_prop_len,
7069             { "Length", "openflow_v4.queue_prop.len",
7070                FT_UINT16, BASE_DEC, NULL, 0x0,
7071                NULL, HFILL }
7072         },
7073         { &hf_openflow_v4_queue_prop_pad,
7074             { "Pad", "openflow_v4.queue_prop.pad",
7075                FT_BYTES, BASE_NONE, NULL, 0x0,
7076                NULL, HFILL }
7077         },
7078         { &hf_openflow_v4_queue_prop_min_rate_rate,
7079             { "Rate", "openflow_v4.queue_prop.min_rate.rate",
7080                FT_UINT16, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_queue_prop_min_rate_reserved_values), 0x0,
7081                NULL, HFILL }
7082         },
7083         { &hf_openflow_v4_queue_prop_min_rate_pad,
7084             { "Pad", "openflow_v4.queue_prop.min_rate.pad",
7085                FT_BYTES, BASE_NONE, NULL, 0x0,
7086                NULL, HFILL }
7087         },
7088         { &hf_openflow_v4_queue_prop_max_rate_rate,
7089             { "Rate", "openflow_v4.queue_prop.max_rate.rate",
7090                FT_UINT16, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_queue_prop_max_rate_reserved_values), 0x0,
7091                NULL, HFILL }
7092         },
7093         { &hf_openflow_v4_queue_prop_max_rate_pad,
7094             { "Pad", "openflow_v4.queue_prop.max_rate.pad",
7095                FT_BYTES, BASE_NONE, NULL, 0x0,
7096                NULL, HFILL }
7097         },
7098         { &hf_openflow_v4_queue_prop_experimenter_experimenter,
7099             { "Experimenter", "openflow_v4.queue_prop.experimenter.experimenter",
7100                FT_UINT32, BASE_DEC, NULL, 0x0,
7101                NULL, HFILL }
7102         },
7103         { &hf_openflow_v4_queue_prop_experimenter_pad,
7104             { "Pad", "openflow_v4.queue_prop.experimenter.pad",
7105                FT_BYTES, BASE_NONE, NULL, 0x0,
7106                NULL, HFILL }
7107         },
7108         { &hf_openflow_v4_packet_queue_queue_id,
7109             { "Queue ID", "openflow_v4.packet_queue.queue_id",
7110                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_queue_id_reserved_values), 0x0,
7111                NULL, HFILL }
7112         },
7113         { &hf_openflow_v4_packet_queue_port,
7114             { "Port", "openflow_v4.packet_queue.port",
7115                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
7116                NULL, HFILL }
7117         },
7118         { &hf_openflow_v4_packet_queue_len,
7119             { "Length", "openflow_v4.packet_queue.len",
7120                FT_UINT16, BASE_DEC, NULL, 0x0,
7121                NULL, HFILL }
7122         },
7123         { &hf_openflow_v4_packet_queue_pad,
7124             { "Pad", "openflow_v4.packet_queue.pad",
7125                FT_BYTES, BASE_NONE, NULL, 0x0,
7126                NULL, HFILL }
7127         },
7128         { &hf_openflow_v4_queue_get_config_reply_port,
7129             { "Port", "openflow_v4.queue_get_config_reply.port",
7130                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_port_reserved_values), 0x0,
7131                NULL, HFILL }
7132         },
7133         { &hf_openflow_v4_queue_get_config_reply_pad,
7134             { "Pad", "openflow_v4.queue_get_config_reply.pad",
7135                FT_BYTES, BASE_NONE, NULL, 0x0,
7136                NULL, HFILL }
7137         },
7138         { &hf_openflow_v4_role_request_role,
7139             { "Role", "openflow_v4.role_request.role",
7140                FT_UINT32, BASE_HEX, VALS(openflow_v4_controller_role_values), 0x0,
7141                NULL, HFILL }
7142         },
7143         { &hf_openflow_v4_role_request_pad,
7144             { "Pad", "openflow_v4.role_request.pad",
7145                FT_BYTES, BASE_NONE, NULL, 0x0,
7146                NULL, HFILL }
7147         },
7148         { &hf_openflow_v4_role_request_generation_id,
7149             { "Generation ID", "openflow_v4.role_request.generation_id",
7150                FT_UINT64, BASE_HEX, NULL, 0x0,
7151                NULL, HFILL }
7152         },
7153         { &hf_openflow_v4_role_reply_role,
7154             { "Role", "openflow_v4.role_reply.role",
7155                FT_UINT32, BASE_HEX, VALS(openflow_v4_controller_role_values), 0x0,
7156                NULL, HFILL }
7157         },
7158         { &hf_openflow_v4_role_reply_pad,
7159             { "Pad", "openflow_v4.role_reply.pad",
7160                FT_BYTES, BASE_NONE, NULL, 0x0,
7161                NULL, HFILL }
7162         },
7163         { &hf_openflow_v4_role_reply_generation_id,
7164             { "Generation ID", "openflow_v4.role_reply.generation_id",
7165                FT_UINT64, BASE_HEX, NULL, 0x0,
7166                NULL, HFILL }
7167         },
7168         { &hf_openflow_v4_async_config_packet_in_mask_master,
7169             { "Packet_in mask (master)", "openflow_v4.async_config.packet_in_mask.master",
7170                FT_UINT32, BASE_HEX, NULL, 0x0,
7171                NULL, HFILL }
7172         },
7173         { &hf_openflow_v4_async_config_packet_in_mask_master_no_match,
7174             { "OFPR_NO_MATCH", "openflow_v4.async_config.packet_in_mask.master.no_match",
7175                FT_BOOLEAN, 32, NULL, 1 << OFPR_NO_MATCH,
7176                NULL, HFILL }
7177         },
7178         { &hf_openflow_v4_async_config_packet_in_mask_master_action,
7179             { "OFPR_ACTION", "openflow_v4.async_config.packet_in_mask.master.action",
7180                FT_BOOLEAN, 32, NULL, 1 << OFPR_ACTION,
7181                NULL, HFILL }
7182         },
7183         { &hf_openflow_v4_async_config_packet_in_mask_master_invalid_ttl,
7184             { "OFPR_INVALID_TTL", "openflow_v4.async_config.packet_in_mask.master.invalid_ttl",
7185                FT_BOOLEAN, 32, NULL, 1 << OFPR_INVALID_TTL,
7186                NULL, HFILL }
7187         },
7188         { &hf_openflow_v4_async_config_packet_in_mask_slave,
7189             { "Packet_in mask (slave)", "openflow_v4.async_config.packet_in_mask.slave",
7190                FT_UINT32, BASE_HEX, NULL, 0x0,
7191                NULL, HFILL }
7192         },
7193         { &hf_openflow_v4_async_config_packet_in_mask_slave_no_match,
7194             { "OFPR_NO_MATCH", "openflow_v4.async_config.packet_in_mask.slave.no_match",
7195                FT_BOOLEAN, 32, NULL, 1 << OFPR_NO_MATCH,
7196                NULL, HFILL }
7197         },
7198         { &hf_openflow_v4_async_config_packet_in_mask_slave_action,
7199             { "OFPR_ACTION", "openflow_v4.async_config.packet_in_mask.slave.action",
7200                FT_BOOLEAN, 32, NULL, 1 << OFPR_ACTION,
7201                NULL, HFILL }
7202         },
7203         { &hf_openflow_v4_async_config_packet_in_mask_slave_invalid_ttl,
7204             { "OFPR_INVALID_TTL", "openflow_v4.async_config.packet_in_mask.slave.invalid_ttl",
7205                FT_BOOLEAN, 32, NULL, 1 << OFPR_INVALID_TTL,
7206                NULL, HFILL }
7207         },
7208         { &hf_openflow_v4_async_config_port_status_mask_master,
7209             { "Port status mask (master)", "openflow_v4.async_config.port_status_mask.master",
7210                FT_UINT32, BASE_HEX, NULL, 0x0,
7211                NULL, HFILL }
7212         },
7213         { &hf_openflow_v4_async_config_port_status_mask_master_add,
7214             { "OFPPR_ADD", "openflow_v4.async_config.port_status_mask.master.add",
7215                FT_BOOLEAN, 32, NULL, 1 << OFPPR_ADD,
7216                NULL, HFILL }
7217         },
7218         { &hf_openflow_v4_async_config_port_status_mask_master_delete,
7219             { "OFPPR_DELETE", "openflow_v4.async_config.port_status_mask.master.delete",
7220                FT_BOOLEAN, 32, NULL, 1 << OFPPR_DELETE,
7221                NULL, HFILL }
7222         },
7223         { &hf_openflow_v4_async_config_port_status_mask_master_modify,
7224             { "OFPPR_MODIFY", "openflow_v4.async_config.port_status_mask.master.modify",
7225                FT_BOOLEAN, 32, NULL, 1 << OFPPR_MODIFY,
7226                NULL, HFILL }
7227         },
7228         { &hf_openflow_v4_async_config_port_status_mask_slave,
7229             { "Port status mask (slave)", "openflow_v4.async_config.port_status_mask.slave",
7230                FT_UINT32, BASE_HEX, NULL, 0x0,
7231                NULL, HFILL }
7232         },
7233         { &hf_openflow_v4_async_config_port_status_mask_slave_add,
7234             { "OFPPR_ADD", "openflow_v4.async_config.port_status_mask.slave.add",
7235                FT_BOOLEAN, 32, NULL, 1 << OFPPR_ADD,
7236                NULL, HFILL }
7237         },
7238         { &hf_openflow_v4_async_config_port_status_mask_slave_delete,
7239             { "OFPPR_DELETE", "openflow_v4.async_config.port_status_mask.slave.delete",
7240                FT_BOOLEAN, 32, NULL, 1 << OFPPR_DELETE,
7241                NULL, HFILL }
7242         },
7243         { &hf_openflow_v4_async_config_port_status_mask_slave_modify,
7244             { "OFPPR_MODIFY", "openflow_v4.async_config.port_status_mask.slave.modify",
7245                FT_BOOLEAN, 32, NULL, 1 << OFPPR_MODIFY,
7246                NULL, HFILL }
7247         },
7248         { &hf_openflow_v4_async_config_flow_removed_mask_master,
7249             { "Flow removed mask (master)", "openflow_v4.async_config.flow_removed_mask.master",
7250                FT_UINT32, BASE_HEX, NULL, 0x0,
7251                NULL, HFILL }
7252         },
7253         { &hf_openflow_v4_async_config_flow_removed_mask_master_idle_timeout,
7254             { "OFPRR_IDLE_TIMEOUT", "openflow_v4.async_config.flow_removed_mask.master.idle_timeout",
7255                FT_BOOLEAN, 32, NULL, 1 << OFPRR_IDLE_TIMEOUT,
7256                NULL, HFILL }
7257         },
7258         { &hf_openflow_v4_async_config_flow_removed_mask_master_hard_timeout,
7259             { "OFPRR_HARD_TIMEOUT", "openflow_v4.async_config.flow_removed_mask.master.hard_timeout",
7260                FT_BOOLEAN, 32, NULL, 1 << OFPRR_HARD_TIMEOUT,
7261                NULL, HFILL }
7262         },
7263         { &hf_openflow_v4_async_config_flow_removed_mask_master_delete,
7264             { "OFPRR_DELETE", "openflow_v4.async_config.flow_removed_mask.master.delete",
7265                FT_BOOLEAN, 32, NULL, 1 << OFPRR_DELETE,
7266                NULL, HFILL }
7267         },
7268         { &hf_openflow_v4_async_config_flow_removed_mask_master_group_delete,
7269             { "OFPRR_GROUP_DELETE", "openflow_v4.async_config.flow_removed_mask.master.group_delete",
7270                FT_BOOLEAN, 32, NULL, 1 << OFPRR_GROUP_DELETE,
7271                NULL, HFILL }
7272         },
7273         { &hf_openflow_v4_async_config_flow_removed_mask_slave,
7274             { "Flow removed mask (slave)", "openflow_v4.async_config.flow_removed_mask.slave",
7275                FT_UINT32, BASE_HEX, NULL, 0x0,
7276                NULL, HFILL }
7277         },
7278         { &hf_openflow_v4_async_config_flow_removed_mask_slave_idle_timeout,
7279             { "OFPRR_IDLE_TIMEOUT", "openflow_v4.async_config.flow_removed_mask.slave.idle_timeout",
7280                FT_BOOLEAN, 32, NULL, 1 << OFPRR_IDLE_TIMEOUT,
7281                NULL, HFILL }
7282         },
7283         { &hf_openflow_v4_async_config_flow_removed_mask_slave_hard_timeout,
7284             { "OFPRR_HARD_TIMEOUT", "openflow_v4.async_config.flow_removed_mask.slave.hard_timeout",
7285                FT_BOOLEAN, 32, NULL, 1 << OFPRR_HARD_TIMEOUT,
7286                NULL, HFILL }
7287         },
7288         { &hf_openflow_v4_async_config_flow_removed_mask_slave_delete,
7289             { "OFPRR_DELETE", "openflow_v4.async_config.flow_removed_mask.slave.delete",
7290                FT_BOOLEAN, 32, NULL, 1 << OFPRR_DELETE,
7291                NULL, HFILL }
7292         },
7293         { &hf_openflow_v4_async_config_flow_removed_mask_slave_group_delete,
7294             { "OFPRR_GROUP_DELETE", "openflow_v4.async_config.flow_removed_mask.slave.group_delete",
7295                FT_BOOLEAN, 32, NULL, 1 << OFPRR_GROUP_DELETE,
7296                NULL, HFILL }
7297         },
7298         { &hf_openflow_v4_metermod_command,
7299             { "Command", "openflow_v4.metermod.command",
7300                FT_UINT16, BASE_DEC, VALS(openflow_v4_metermod_command_values), 0x0,
7301                NULL, HFILL }
7302         },
7303         { &hf_openflow_v4_metermod_flags,
7304             { "Flags", "openflow_v4.metermod.flags",
7305                FT_UINT32, BASE_HEX, NULL, 0x0,
7306                NULL, HFILL }
7307         },
7308         { &hf_openflow_v4_metermod_flags_kbps,
7309             { "OFPMF_KBPS", "openflow_v4.metermod.flags.kbps",
7310                FT_BOOLEAN, 32, NULL, OFPMF_KBPS,
7311                NULL, HFILL }
7312         },
7313         { &hf_openflow_v4_metermod_flags_pktps,
7314             { "OFPMF_PKTPS", "openflow_v4.metermod.flags.ptkps",
7315                FT_BOOLEAN, 32, NULL, OFPMF_PKTPS,
7316                NULL, HFILL }
7317         },
7318         { &hf_openflow_v4_metermod_flags_burst,
7319             { "OFPMF_BURST", "openflow_v4.metermod.flags.burst",
7320                FT_BOOLEAN, 32, NULL, OFPMF_BURST,
7321                NULL, HFILL }
7322         },
7323         { &hf_openflow_v4_metermod_flags_stats,
7324             { "OFPMF_STATS", "openflow_v4.metermod.flags.stats",
7325                FT_BOOLEAN, 32, NULL, OFPMF_STATS,
7326                NULL, HFILL }
7327         },
7328         { &hf_openflow_v4_metermod_meter_id,
7329             { "Meter ID", "openflow_v4.metermod.meter_id",
7330                FT_UINT32, BASE_DEC|BASE_SPECIAL_VALS, VALS(openflow_v4_meter_id_reserved_values), 0x0,
7331                NULL, HFILL }
7332         }
7333     };
7334 
7335     static gint *ett[] = {
7336         &ett_openflow_v4,
7337         &ett_openflow_v4_flowmod_flags,
7338         &ett_openflow_v4_bucket,
7339         &ett_openflow_v4_oxm,
7340         &ett_openflow_v4_match,
7341         &ett_openflow_v4_action,
7342         &ett_openflow_v4_instruction,
7343         &ett_openflow_v4_port,
7344         &ett_openflow_v4_port_config,
7345         &ett_openflow_v4_port_state,
7346         &ett_openflow_v4_port_current,
7347         &ett_openflow_v4_port_advertised,
7348         &ett_openflow_v4_port_supported,
7349         &ett_openflow_v4_port_peer,
7350         &ett_openflow_v4_meter_band,
7351         &ett_openflow_v4_hello_element,
7352         &ett_openflow_v4_error_data,
7353         &ett_openflow_v4_switch_features_capabilities,
7354         &ett_openflow_v4_switch_config_flags,
7355         &ett_openflow_v4_packet_in_data,
7356         &ett_openflow_v4_packet_out_data,
7357         &ett_openflow_v4_portmod_config,
7358         &ett_openflow_v4_portmod_mask,
7359         &ett_openflow_v4_portmod_advertise,
7360         &ett_openflow_v4_table_features,
7361         &ett_openflow_v4_table_feature_prop,
7362         &ett_openflow_v4_table_feature_prop_instruction_id,
7363         &ett_openflow_v4_table_feature_prop_action_id,
7364         &ett_openflow_v4_table_feature_prop_oxm_id,
7365         &ett_openflow_v4_multipart_request_flags,
7366         &ett_openflow_v4_flow_stats,
7367         &ett_openflow_v4_flow_stats_flags,
7368         &ett_openflow_v4_table_stats,
7369         &ett_openflow_v4_port_stats,
7370         &ett_openflow_v4_queue_stats,
7371         &ett_openflow_v4_bucket_counter,
7372         &ett_openflow_v4_group_stats,
7373         &ett_openflow_v4_group_desc,
7374         &ett_openflow_v4_group_features_types,
7375         &ett_openflow_v4_group_features_capabilities,
7376         &ett_openflow_v4_group_features_actions_all,
7377         &ett_openflow_v4_group_features_actions_select,
7378         &ett_openflow_v4_group_features_actions_indirect,
7379         &ett_openflow_v4_group_features_actions_ff,
7380         &ett_openflow_v4_meter_band_stats,
7381         &ett_openflow_v4_meter_stats,
7382         &ett_openflow_v4_meter_config,
7383         &ett_openflow_v4_meter_config_flags,
7384         &ett_openflow_v4_meter_features_band_types,
7385         &ett_openflow_v4_meter_features_capabilities,
7386         &ett_openflow_v4_multipart_reply_flags,
7387         &ett_openflow_v4_queue_prop,
7388         &ett_openflow_v4_packet_queue,
7389         &ett_openflow_v4_async_config_packet_in_mask_master,
7390         &ett_openflow_v4_async_config_packet_in_mask_slave,
7391         &ett_openflow_v4_async_config_port_status_mask_master,
7392         &ett_openflow_v4_async_config_port_status_mask_slave,
7393         &ett_openflow_v4_async_config_flow_removed_mask_master,
7394         &ett_openflow_v4_async_config_flow_removed_mask_slave,
7395         &ett_openflow_v4_metermod_flags
7396     };
7397 
7398     static ei_register_info ei[] = {
7399         { &ei_openflow_v4_oxm_undecoded,
7400             { "openflow_v4.oxm.undecoded", PI_UNDECODED, PI_NOTE,
7401               "Unknown OMX body.", EXPFILL }
7402         },
7403         { &ei_openflow_v4_match_undecoded,
7404             { "openflow_v4.match.undecoded", PI_UNDECODED, PI_NOTE,
7405               "Unknown match body.", EXPFILL }
7406         },
7407         { &ei_openflow_v4_action_undecoded,
7408             { "openflow_v4.action.undecoded", PI_UNDECODED, PI_NOTE,
7409               "Unknown action body.", EXPFILL }
7410         },
7411         { &ei_openflow_v4_instruction_undecoded,
7412             { "openflow_v4.instruction.undecoded", PI_UNDECODED, PI_NOTE,
7413               "Unknown instruction body.", EXPFILL }
7414         },
7415         { &ei_openflow_v4_meter_band_undecoded,
7416             { "openflow_v4.meter_band.undecoded", PI_UNDECODED, PI_NOTE,
7417               "Unknown meter band body.", EXPFILL }
7418         },
7419         { &ei_openflow_v4_hello_element_undecoded,
7420             { "openflow_v4.hello_element.undecoded", PI_UNDECODED, PI_NOTE,
7421               "Unknown hello element body.", EXPFILL }
7422         },
7423         { &ei_openflow_v4_error_undecoded,
7424             { "openflow_v4.error.undecoded", PI_UNDECODED, PI_NOTE,
7425               "Unknown error data.", EXPFILL }
7426         },
7427         { &ei_openflow_v4_experimenter_undecoded,
7428             { "openflow_v4.experimenter.undecoded", PI_UNDECODED, PI_NOTE,
7429               "Unknown experimenter body.", EXPFILL }
7430         },
7431         { &ei_openflow_v4_table_feature_prop_undecoded,
7432             { "openflow_v4.table_feature_prop.undecoded", PI_UNDECODED, PI_NOTE,
7433               "Unknown table feature property body.", EXPFILL }
7434         },
7435         { &ei_openflow_v4_multipart_request_undecoded,
7436             { "openflow_v4.multipart_request.undecoded", PI_UNDECODED, PI_NOTE,
7437               "Unknown multipart request body.", EXPFILL }
7438         },
7439         { &ei_openflow_v4_multipart_reply_undecoded,
7440             { "openflow_v4.multipart_reply.undecoded", PI_UNDECODED, PI_NOTE,
7441               "Unknown multipart reply body.", EXPFILL }
7442         },
7443         { &ei_openflow_v4_queue_prop_undecoded,
7444             { "openflow_v4.queue_prop.undecoded", PI_UNDECODED, PI_NOTE,
7445               "Unknown queue property body.", EXPFILL }
7446         },
7447         {&ei_openflow_v4_message_undecoded,
7448             { "openflow_v4.message.undecoded", PI_UNDECODED, PI_NOTE,
7449               "Unknown message body.", EXPFILL }
7450         }
7451     };
7452 
7453     expert_module_t *expert_openflow_v4;
7454 
7455     /* Register the protocol name and description */
7456     proto_openflow_v4 = proto_register_protocol("OpenFlow 1.3",
7457             "openflow_v4", "openflow_v4");
7458 
7459     register_dissector("openflow_v4", dissect_openflow_v4, proto_openflow_v4);
7460 
7461     /* Required function calls to register the header fields and subtrees */
7462     proto_register_field_array(proto_openflow_v4, hf, array_length(hf));
7463     proto_register_subtree_array(ett, array_length(ett));
7464     expert_openflow_v4 = expert_register_protocol(proto_openflow_v4);
7465     expert_register_field_array(expert_openflow_v4, ei, array_length(ei));
7466 }
7467 
7468 void
proto_reg_handoff_openflow_v4(void)7469 proto_reg_handoff_openflow_v4(void)
7470 {
7471     eth_withoutfcs_handle = find_dissector_add_dependency("eth_withoutfcs", proto_openflow_v4);
7472 }
7473 
7474 /*
7475  * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
7476  *
7477  * Local variables:
7478  * c-basic-offset: 4
7479  * tab-width: 8
7480  * indent-tabs-mode: nil
7481  * End:
7482  *
7483  * vi: set shiftwidth=4 tabstop=8 expandtab:
7484  * :indentSize=4:tabSize=8:noTabs=true:
7485  */
7486