MSWSP: add two more Property Sets
[wireshark-wip.git] / epan / dissectors / packet-csm-encaps.c
blob6fda273998e053810947069afb1d38488b13ea2c
1 /* packet-csm-encaps.c
2 * Routines for CSM_ENCAPS dissection
3 * Copyright 2005, Angelo Bannack <angelo.bannack@siemens.com>
4 * $Id$
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 2003 Gerald Combs
10 * Copied from packet-ans.c
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include "config.h"
30 #include <glib.h>
32 #include <epan/packet.h>
33 #include <epan/tap.h>
34 #include <epan/wmem/wmem.h>
35 #include <epan/etypes.h>
38 #define OPCODE_NOOP 0x0000
39 #define OPCODE_CONTROL_PACKET 0x0001
40 #define OPCODE_RELIABLE_DATA 0x0002
43 #define CSM_ENCAPS_CTRL_ACK 0x80
44 #define CSM_ENCAPS_CTRL_ACK_SUPPRESS 0x40
45 #define CSM_ENCAPS_CTRL_ACK_TO_HOST 0x20
46 #define CSM_ENCAPS_CTRL_ENDIAN 0x01
50 #define CSM_ENCAPS_TYPE_CHANGE 0x00
51 #define CSM_ENCAPS_TYPE_QUERY 0x01
52 #define CSM_ENCAPS_TYPE_RESPONSE 0x02
53 #define CSM_ENCAPS_TYPE_INDICATION 0x03
54 #define CSM_ENCAPS_TYPE_QUERY_RESPONSE 0x04
55 #define CSM_ENCAPS_TYPE_INDICATION_RESPONSE 0x05
57 void proto_register_csm_encaps(void);
58 void proto_reg_handoff_csm_encaps(void);
60 static const value_string opcode_vals[] = {
61 { OPCODE_NOOP, "No Operation" },
62 { OPCODE_CONTROL_PACKET, "Control Packet" },
63 { OPCODE_RELIABLE_DATA, "Reliable Data Transfer" },
64 { 0, NULL }
67 static const value_string function_code_vals[] = {
68 {0x0000, " "},
69 { 0, NULL }
73 static const value_string class_type_vals[] = {
74 { 0, NULL }
79 static const value_string exclusive_to_host_vals[] = {
80 { 0, NULL }
83 static const value_string exclusive_to_host_ct_vals[] = {
84 { 0, NULL }
88 static const value_string error_vals[] = {
89 { 0, NULL }
94 /* Initialize the protocol and registered fields */
95 static int proto_csm_encaps = -1;
97 static int hf_csm_encaps_opcode = -1;
98 static int hf_csm_encaps_seq = -1;
99 static int hf_csm_encaps_ctrl = -1;
100 static int hf_csm_encaps_ctrl_endian = -1;
101 static int hf_csm_encaps_ctrl_ack = -1;
102 static int hf_csm_encaps_ctrl_ack_suppress = -1;
103 static int hf_csm_encaps_channel = -1;
104 static int hf_csm_encaps_index = -1;
105 static int hf_csm_encaps_length = -1;
106 static int hf_csm_encaps_class = -1;
107 static int hf_csm_encaps_type = -1;
108 static int hf_csm_encaps_function_code = -1;
109 static int hf_csm_encaps_reserved = -1;
110 static int hf_csm_encaps_param_error = -1;
111 static int hf_csm_encaps_param1 = -1;
112 static int hf_csm_encaps_param2 = -1;
113 static int hf_csm_encaps_param3 = -1;
114 static int hf_csm_encaps_param4 = -1;
115 static int hf_csm_encaps_param5 = -1;
116 static int hf_csm_encaps_param6 = -1;
117 static int hf_csm_encaps_param7 = -1;
118 static int hf_csm_encaps_param8 = -1;
119 static int hf_csm_encaps_param9 = -1;
120 static int hf_csm_encaps_param10 = -1;
121 static int hf_csm_encaps_param11 = -1;
122 static int hf_csm_encaps_param12 = -1;
123 static int hf_csm_encaps_param13 = -1;
124 static int hf_csm_encaps_param14 = -1;
125 static int hf_csm_encaps_param15 = -1;
126 static int hf_csm_encaps_param16 = -1;
127 static int hf_csm_encaps_param17 = -1;
128 static int hf_csm_encaps_param18 = -1;
129 static int hf_csm_encaps_param19 = -1;
130 static int hf_csm_encaps_param20 = -1;
131 static int hf_csm_encaps_param21 = -1;
132 static int hf_csm_encaps_param22 = -1;
133 static int hf_csm_encaps_param23 = -1;
134 static int hf_csm_encaps_param24 = -1;
135 static int hf_csm_encaps_param25 = -1;
136 static int hf_csm_encaps_param26 = -1;
137 static int hf_csm_encaps_param27 = -1;
138 static int hf_csm_encaps_param28 = -1;
139 static int hf_csm_encaps_param29 = -1;
140 static int hf_csm_encaps_param30 = -1;
141 static int hf_csm_encaps_param31 = -1;
142 static int hf_csm_encaps_param32 = -1;
143 static int hf_csm_encaps_param33 = -1;
144 static int hf_csm_encaps_param34 = -1;
145 static int hf_csm_encaps_param35 = -1;
146 static int hf_csm_encaps_param36 = -1;
147 static int hf_csm_encaps_param37 = -1;
148 static int hf_csm_encaps_param38 = -1;
149 static int hf_csm_encaps_param39 = -1;
150 static int hf_csm_encaps_param40 = -1;
151 static int hf_csm_encaps_param = -1;
154 /* Initialize the subtree pointers */
155 static gint ett_csm_encaps = -1;
156 static gint ett_csm_encaps_control = -1;
159 /* returns the command name */
160 static const gchar *
161 csm_fc(guint16 fc, guint16 ct)
163 if (fc == 0x0000) {
164 return wmem_strdup(wmem_packet_scope(),
165 val_to_str(ct, class_type_vals, "0x%04x"));
166 } else {
167 return wmem_strdup(wmem_packet_scope(),
168 val_to_str(fc, function_code_vals, "0x%04x"));
174 /* check to see if the message is an exclusive message send to host */
175 static gboolean
176 csm_to_host(guint16 fc, guint16 ct)
178 if (fc == 0x0000)
180 return (try_val_to_str(ct, exclusive_to_host_ct_vals) != NULL);
182 else
184 return (try_val_to_str(fc, exclusive_to_host_vals) != NULL);
190 /* Code to actually dissect the packets */
191 static void
192 dissect_csm_encaps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
194 proto_item *ti, *subitem;
195 proto_tree *csm_encaps_tree = NULL;
196 proto_tree *csm_encaps_control_tree = NULL;
197 guint16 function_code, channel, class_type;
198 guint control, type, sequence, length;
199 guint i;
200 gboolean show_error_param= FALSE;
201 const gchar *str_function_name;
204 function_code = tvb_get_letohs(tvb, 10);
205 control = tvb_get_guint8(tvb, 3);
207 class_type = tvb_get_guint8(tvb, 9);
208 class_type = class_type<<8;
209 class_type|= tvb_get_guint8(tvb, 8);
211 type = tvb_get_guint8(tvb, 8);
212 sequence = tvb_get_guint8(tvb, 2);
213 length = tvb_get_guint8(tvb, 6);
214 channel = tvb_get_ntohs(tvb, 4);
217 if (CSM_ENCAPS_CTRL_ACK&control)
218 show_error_param= FALSE;
219 else
221 if (csm_to_host(function_code, class_type)) /* exclusive messages to host */
222 show_error_param= FALSE;
223 else
225 if (type == CSM_ENCAPS_TYPE_RESPONSE)
226 show_error_param= TRUE;
227 else
228 show_error_param= FALSE;
233 col_set_str(pinfo->cinfo, COL_PROTOCOL, "CSM_ENCAPS");
235 col_clear(pinfo->cinfo, COL_INFO);
238 if (CSM_ENCAPS_CTRL_ACK&control)
240 if (CSM_ENCAPS_CTRL_ACK_TO_HOST&control)
241 col_append_fstr(pinfo->cinfo, COL_INFO,
242 "<-- ACK Ch: 0x%04X, Seq: %2d (To Host)",
243 channel, sequence);
244 else
245 col_append_fstr(pinfo->cinfo, COL_INFO,
246 "--> ACK Ch: 0x%04X, Seq: %2d (From Host)",
247 channel, sequence);
249 else
251 str_function_name= csm_fc(function_code, class_type);
252 if ((type == CSM_ENCAPS_TYPE_RESPONSE) || (csm_to_host(function_code, class_type)))
253 col_append_fstr(pinfo->cinfo, COL_INFO,
254 "<-- %-35s Ch: 0x%04X, Seq: %2d (To Host)",
255 str_function_name, channel, sequence);
256 else
257 col_append_fstr(pinfo->cinfo, COL_INFO,
258 "--> %-35s Ch: 0x%04X, Seq: %2d (From Host)",
259 str_function_name, channel, sequence);
263 if (tree) {
264 ti = proto_tree_add_item(tree, proto_csm_encaps, tvb, 0, -1, ENC_NA);
265 csm_encaps_tree = proto_item_add_subtree(ti, ett_csm_encaps);
270 proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_opcode, tvb, 0, 2, ENC_BIG_ENDIAN);
271 proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_seq, tvb, 2, 1, ENC_BIG_ENDIAN);
273 subitem = proto_tree_add_uint(csm_encaps_tree, hf_csm_encaps_ctrl, tvb, 3, 1, control);
274 csm_encaps_control_tree = proto_item_add_subtree(subitem, ett_csm_encaps_control);
276 proto_tree_add_boolean(csm_encaps_control_tree, hf_csm_encaps_ctrl_ack, tvb, 3, 1, control);
277 proto_tree_add_boolean(csm_encaps_control_tree, hf_csm_encaps_ctrl_ack_suppress, tvb, 3, 1, control);
278 proto_tree_add_boolean(csm_encaps_control_tree, hf_csm_encaps_ctrl_endian, tvb, 3, 1, control);
280 proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_channel, tvb, 4, 2, ENC_BIG_ENDIAN);
281 proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_length, tvb, 6, 1, ENC_BIG_ENDIAN);
282 proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_index, tvb, 7, 1, ENC_BIG_ENDIAN);
283 proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_class, tvb, 9, 1, ENC_BIG_ENDIAN);
284 proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_type, tvb, 8, 1, ENC_BIG_ENDIAN);
285 proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_function_code, tvb, 10, 2, ENC_LITTLE_ENDIAN);
287 i=6;
289 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_reserved, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
290 if (i<length)
292 if (show_error_param)
293 proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param_error, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN);
294 else
295 proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param1, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN);
296 i+=2;
298 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param2, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
299 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param3, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
300 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param4, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
301 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param5, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
302 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param6, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
303 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param7, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
304 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param8, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
305 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param9, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
306 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param10, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
307 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param11, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
308 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param12, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
309 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param13, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
310 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param14, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
311 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param15, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
312 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param16, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
313 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param17, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
314 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param18, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
315 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param19, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
316 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param20, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
317 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param21, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
318 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param22, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
319 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param23, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
320 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param24, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
321 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param25, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
322 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param26, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
323 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param27, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
324 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param28, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
325 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param29, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
326 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param30, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
327 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param31, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
328 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param32, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
329 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param33, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
330 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param34, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
331 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param35, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
332 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param36, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
333 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param37, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
334 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param38, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
335 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param39, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
336 if (i<length) proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param40, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN); i+=2;
338 for (; i<length; i+=2)
339 proto_tree_add_item(csm_encaps_tree, hf_csm_encaps_param, tvb, 12 + i-6, 2, ENC_LITTLE_ENDIAN);
344 void
345 proto_register_csm_encaps(void)
347 static struct true_false_string control_endian_bit = {"Little Endian","Big Endian"};
348 static struct true_false_string control_ack_bit = {"ACK Packet", "Message Packet"};
349 static struct true_false_string control_ack_suppress_bit = {"ACK Suppressed", "ACK Required"};
352 static hf_register_info hf[] = {
353 { &hf_csm_encaps_opcode,
354 { "Opcode", "csm_encaps.opcode",
355 FT_UINT16, BASE_HEX, VALS(opcode_vals), 0,
356 "CSM_ENCAPS Opcode", HFILL }
358 { &hf_csm_encaps_seq,
359 { "Sequence Number", "csm_encaps.seq_num",
360 FT_UINT8, BASE_DEC, NULL, 0,
361 "CSM_ENCAPS Sequence Number", HFILL }
364 { &hf_csm_encaps_ctrl,
365 { "Control", "csm_encaps.ctrl",
366 FT_UINT8, BASE_HEX, NULL, 0,
367 "CSM_ENCAPS Control", HFILL }
370 { &hf_csm_encaps_ctrl_ack,
371 { "Packet Bit", "csm_encaps.ctrl.ack",
372 FT_BOOLEAN, 8, TFS(&control_ack_bit), CSM_ENCAPS_CTRL_ACK,
373 "Message Packet/ACK Packet", HFILL }
375 { &hf_csm_encaps_ctrl_ack_suppress,
376 { "ACK Suppress Bit", "csm_encaps.ctrl.ack_suppress",
377 FT_BOOLEAN, 8, TFS(&control_ack_suppress_bit), CSM_ENCAPS_CTRL_ACK_SUPPRESS,
378 "ACK Required/ACK Suppressed", HFILL }
380 { &hf_csm_encaps_ctrl_endian,
381 { "Endian Bit", "csm_encaps.ctrl.endian",
382 FT_BOOLEAN, 8, TFS(&control_endian_bit), CSM_ENCAPS_CTRL_ENDIAN,
383 "Little Endian/Big Endian", HFILL }
387 { &hf_csm_encaps_channel,
388 { "Channel Number", "csm_encaps.channel",
389 FT_UINT16, BASE_HEX, NULL, 0,
390 "CSM_ENCAPS Channel Number", HFILL }
392 { &hf_csm_encaps_index,
393 { "Index", "csm_encaps.index",
394 FT_UINT8, BASE_DEC, NULL, 0,
395 "CSM_ENCAPS Index", HFILL }
397 { &hf_csm_encaps_length,
398 { "Length", "csm_encaps.length",
399 FT_UINT8, BASE_DEC, NULL, 0,
400 "CSM_ENCAPS Length", HFILL }
402 { &hf_csm_encaps_class,
403 { "Class", "csm_encaps.class",
404 FT_UINT8, BASE_DEC, NULL, 0,
405 "CSM_ENCAPS Class", HFILL }
407 { &hf_csm_encaps_type,
408 { "Type", "csm_encaps.type",
409 FT_UINT8, BASE_DEC, NULL, 0,
410 "CSM_ENCAPS Type", HFILL }
412 { &hf_csm_encaps_function_code,
413 { "Function Code", "csm_encaps.function_code",
414 FT_UINT16, BASE_HEX, VALS(function_code_vals), 0,
415 "CSM_ENCAPS Function Code", HFILL }
417 { &hf_csm_encaps_reserved,
418 { "Reserved", "csm_encaps.reserved",
419 FT_UINT16, BASE_HEX, NULL, 0,
420 "CSM_ENCAPS Reserved", HFILL }
422 { &hf_csm_encaps_param_error,
423 { "Parameter 1", "csm_encaps.param1",
424 FT_UINT16, BASE_HEX, VALS(error_vals), 0,
425 "CSM_ENCAPS Parameter 1", HFILL }
427 { &hf_csm_encaps_param1,
428 { "Parameter 1", "csm_encaps.param1",
429 FT_UINT16, BASE_HEX, NULL, 0,
430 "CSM_ENCAPS Parameter 1", HFILL }
432 { &hf_csm_encaps_param2,
433 { "Parameter 2", "csm_encaps.param2",
434 FT_UINT16, BASE_HEX, NULL, 0,
435 "CSM_ENCAPS Parameter 2", HFILL }
437 { &hf_csm_encaps_param3,
438 { "Parameter 3", "csm_encaps.param3",
439 FT_UINT16, BASE_HEX, NULL, 0,
440 "CSM_ENCAPS Parameter 3", HFILL }
442 { &hf_csm_encaps_param4,
443 { "Parameter 4", "csm_encaps.param4",
444 FT_UINT16, BASE_HEX, NULL, 0,
445 "CSM_ENCAPS Parameter 4", HFILL }
447 { &hf_csm_encaps_param5,
448 { "Parameter 5", "csm_encaps.param5",
449 FT_UINT16, BASE_HEX, NULL, 0,
450 "CSM_ENCAPS Parameter 5", HFILL }
452 { &hf_csm_encaps_param6,
453 { "Parameter 6", "csm_encaps.param6",
454 FT_UINT16, BASE_HEX, NULL, 0,
455 "CSM_ENCAPS Parameter 6", HFILL }
457 { &hf_csm_encaps_param7,
458 { "Parameter 7", "csm_encaps.param7",
459 FT_UINT16, BASE_HEX, NULL, 0,
460 "CSM_ENCAPS Parameter 7", HFILL }
462 { &hf_csm_encaps_param8,
463 { "Parameter 8", "csm_encaps.param8",
464 FT_UINT16, BASE_HEX, NULL, 0,
465 "CSM_ENCAPS Parameter 8", HFILL }
467 { &hf_csm_encaps_param9,
468 { "Parameter 9", "csm_encaps.param9",
469 FT_UINT16, BASE_HEX, NULL, 0,
470 "CSM_ENCAPS Parameter 9", HFILL }
472 { &hf_csm_encaps_param10,
473 { "Parameter 10", "csm_encaps.param10",
474 FT_UINT16, BASE_HEX, NULL, 0,
475 "CSM_ENCAPS Parameter 10", HFILL }
477 { &hf_csm_encaps_param11,
478 { "Parameter 11", "csm_encaps.param11",
479 FT_UINT16, BASE_HEX, NULL, 0,
480 "CSM_ENCAPS Parameter 11", HFILL }
482 { &hf_csm_encaps_param12,
483 { "Parameter 12", "csm_encaps.param12",
484 FT_UINT16, BASE_HEX, NULL, 0,
485 "CSM_ENCAPS Parameter 12", HFILL }
487 { &hf_csm_encaps_param13,
488 { "Parameter 13", "csm_encaps.param13",
489 FT_UINT16, BASE_HEX, NULL, 0,
490 "CSM_ENCAPS Parameter 13", HFILL }
492 { &hf_csm_encaps_param14,
493 { "Parameter 14", "csm_encaps.param14",
494 FT_UINT16, BASE_HEX, NULL, 0,
495 "CSM_ENCAPS Parameter 14", HFILL }
497 { &hf_csm_encaps_param15,
498 { "Parameter 15", "csm_encaps.param15",
499 FT_UINT16, BASE_HEX, NULL, 0,
500 "CSM_ENCAPS Parameter 15", HFILL }
502 { &hf_csm_encaps_param16,
503 { "Parameter 16", "csm_encaps.param16",
504 FT_UINT16, BASE_HEX, NULL, 0,
505 "CSM_ENCAPS Parameter 16", HFILL }
507 { &hf_csm_encaps_param17,
508 { "Parameter 17", "csm_encaps.param17",
509 FT_UINT16, BASE_HEX, NULL, 0,
510 "CSM_ENCAPS Parameter 17", HFILL }
512 { &hf_csm_encaps_param18,
513 { "Parameter 18", "csm_encaps.param18",
514 FT_UINT16, BASE_HEX, NULL, 0,
515 "CSM_ENCAPS Parameter 18", HFILL }
517 { &hf_csm_encaps_param19,
518 { "Parameter 19", "csm_encaps.param19",
519 FT_UINT16, BASE_HEX, NULL, 0,
520 "CSM_ENCAPS Parameter 19", HFILL }
522 { &hf_csm_encaps_param20,
523 { "Parameter 20", "csm_encaps.param20",
524 FT_UINT16, BASE_HEX, NULL, 0,
525 "CSM_ENCAPS Parameter 20", HFILL }
527 { &hf_csm_encaps_param21,
528 { "Parameter 21", "csm_encaps.param21",
529 FT_UINT16, BASE_HEX, NULL, 0,
530 "CSM_ENCAPS Parameter 21", HFILL }
532 { &hf_csm_encaps_param22,
533 { "Parameter 22", "csm_encaps.param22",
534 FT_UINT16, BASE_HEX, NULL, 0,
535 "CSM_ENCAPS Parameter 22", HFILL }
537 { &hf_csm_encaps_param23,
538 { "Parameter 23", "csm_encaps.param23",
539 FT_UINT16, BASE_HEX, NULL, 0,
540 "CSM_ENCAPS Parameter 23", HFILL }
542 { &hf_csm_encaps_param24,
543 { "Parameter 24", "csm_encaps.param24",
544 FT_UINT16, BASE_HEX, NULL, 0,
545 "CSM_ENCAPS Parameter 24", HFILL }
547 { &hf_csm_encaps_param25,
548 { "Parameter 25", "csm_encaps.param25",
549 FT_UINT16, BASE_HEX, NULL, 0,
550 "CSM_ENCAPS Parameter 25", HFILL }
552 { &hf_csm_encaps_param26,
553 { "Parameter 26", "csm_encaps.param26",
554 FT_UINT16, BASE_HEX, NULL, 0,
555 "CSM_ENCAPS Parameter 26", HFILL }
557 { &hf_csm_encaps_param27,
558 { "Parameter 27", "csm_encaps.param27",
559 FT_UINT16, BASE_HEX, NULL, 0,
560 "CSM_ENCAPS Parameter 27", HFILL }
562 { &hf_csm_encaps_param28,
563 { "Parameter 28", "csm_encaps.param28",
564 FT_UINT16, BASE_HEX, NULL, 0,
565 "CSM_ENCAPS Parameter 28", HFILL }
567 { &hf_csm_encaps_param29,
568 { "Parameter 29", "csm_encaps.param29",
569 FT_UINT16, BASE_HEX, NULL, 0,
570 "CSM_ENCAPS Parameter 29", HFILL }
572 { &hf_csm_encaps_param30,
573 { "Parameter 30", "csm_encaps.param30",
574 FT_UINT16, BASE_HEX, NULL, 0,
575 "CSM_ENCAPS Parameter 30", HFILL }
577 { &hf_csm_encaps_param31,
578 { "Parameter 31", "csm_encaps.param31",
579 FT_UINT16, BASE_HEX, NULL, 0,
580 "CSM_ENCAPS Parameter 31", HFILL }
582 { &hf_csm_encaps_param32,
583 { "Parameter 32", "csm_encaps.param32",
584 FT_UINT16, BASE_HEX, NULL, 0,
585 "CSM_ENCAPS Parameter 32", HFILL }
587 { &hf_csm_encaps_param33,
588 { "Parameter 33", "csm_encaps.param33",
589 FT_UINT16, BASE_HEX, NULL, 0,
590 "CSM_ENCAPS Parameter 33", HFILL }
592 { &hf_csm_encaps_param34,
593 { "Parameter 34", "csm_encaps.param34",
594 FT_UINT16, BASE_HEX, NULL, 0,
595 "CSM_ENCAPS Parameter 34", HFILL }
597 { &hf_csm_encaps_param35,
598 { "Parameter 35", "csm_encaps.param35",
599 FT_UINT16, BASE_HEX, NULL, 0,
600 "CSM_ENCAPS Parameter 35", HFILL }
602 { &hf_csm_encaps_param36,
603 { "Parameter 36", "csm_encaps.param36",
604 FT_UINT16, BASE_HEX, NULL, 0,
605 "CSM_ENCAPS Parameter 36", HFILL }
607 { &hf_csm_encaps_param37,
608 { "Parameter 37", "csm_encaps.param37",
609 FT_UINT16, BASE_HEX, NULL, 0,
610 "CSM_ENCAPS Parameter 37", HFILL }
612 { &hf_csm_encaps_param38,
613 { "Parameter 38", "csm_encaps.param38",
614 FT_UINT16, BASE_HEX, NULL, 0,
615 "CSM_ENCAPS Parameter 38", HFILL }
617 { &hf_csm_encaps_param39,
618 { "Parameter 39", "csm_encaps.param39",
619 FT_UINT16, BASE_HEX, NULL, 0,
620 "CSM_ENCAPS Parameter 39", HFILL }
622 { &hf_csm_encaps_param40,
623 { "Parameter 40", "csm_encaps.param40",
624 FT_UINT16, BASE_HEX, NULL, 0,
625 "CSM_ENCAPS Parameter 40", HFILL }
627 { &hf_csm_encaps_param,
628 { "Parameter", "csm_encaps.param",
629 FT_UINT16, BASE_HEX, NULL, 0,
630 "CSM_ENCAPS Parameter", HFILL }
634 static gint *ett[] = {
635 &ett_csm_encaps,
636 &ett_csm_encaps_control
639 proto_csm_encaps = proto_register_protocol("CSM_ENCAPS", "CSM_ENCAPS", "csm_encaps");
640 proto_register_field_array(proto_csm_encaps, hf, array_length(hf));
641 proto_register_subtree_array(ett, array_length(ett));
646 void
647 proto_reg_handoff_csm_encaps(void)
649 dissector_handle_t csm_encaps_handle;
651 csm_encaps_handle = create_dissector_handle(dissect_csm_encaps, proto_csm_encaps);
652 dissector_add_uint("ethertype", ETHERTYPE_CSM_ENCAPS, csm_encaps_handle);