HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / packet-nasdaq-itch.c
blob7df432d6850d63f135062ae0e563d1702d876885
1 /* packet-nasdaq-itch.c
2 * Routines for NASDAQ TotalView-ITCH version 2.00/3.00 (with Chi-X extension) Protocol dissection
3 * Copyright 2007,2008 Didier Gautheron <dgautheron@magic.fr>
5 * $Id$
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 * Documentation:
26 * http://www.nasdaqtrader.com/Trader.aspx?id=DPSpecs
27 * ex:
28 * http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/tv-itch2a.pdf
29 * http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/tvitch-v3.pdf
31 * Chi-X
32 * http://www.chi-x.com/docs/Chi-X%20CHIXMD.pdf
36 #include "config.h"
38 #include <stdlib.h>
39 #include <string.h>
41 #include <glib.h>
43 #include <epan/packet.h>
44 #include <epan/prefs.h>
45 #include <epan/wmem/wmem.h>
46 #include <wsutil/type_util.h>
48 /* Chi-X version */
49 static gboolean nasdaq_itch_chi_x = TRUE;
51 static const value_string message_types_val[] = {
52 { 'A', "Add Order " },
53 { 'X', "Order Cancel " },
54 { 'M', "Milliseconds " },
55 { 'E', "Order Executed " },
56 { 'T', "Second " },
57 { 'P', "Trade Message Identifier " },
58 { 'C', "Order Executed With Price " },
59 { 'D', "Order Delete " },
60 { 'Q', "Cross Trade " },
61 { 'S', "System Event " },
62 { 'R' , "Stock Directory " },
63 { 'H', "Stock Trading Action " },
64 { 'F', "Add Order (MPID) " },
65 { 'I', "Net Order Imbalance Indicator (NOII) " },
66 { 'B', "Broken Trade " },
67 /* Chi-X msg with big size,price */
68 { 'a', "Add Order (big)" },
69 { 'p', "Trade Message Identifier (big)" },
70 { 'e', "Order Executed (big)" },
71 { 'x', "Order Cancel (big)" },
72 { 0, NULL }
75 static char chix_msg[] = "apex";
77 static const value_string system_event_val[] = {
78 { 'O', "Start of Messages" },
79 { 'S', "Start of System hours" },
80 { 'Q', "Start of Market hours" },
81 { 'M', "End of Market hours" },
82 { 'E', "End of System hours" },
83 { 'C', "End of Messages" },
84 { 0, NULL }
87 static const value_string market_category_val[] = {
88 { 'T', "CQS (NYSE, Amex or regional exchange)" },
89 { 'Q', "NASDAQ Global Select MarketSM" },
90 { 'G', "NASDAQ Global MarketSM" },
91 { 'S', "NASDAQ Capital Market" },
92 { ' ', "Not available" },
93 { 0, NULL }
96 static const value_string financial_status_val[] = {
97 { 'D', "Deficient" },
98 { 'E', "Delinquent" },
99 { 'Q', "Bankrupt" },
100 { 'S', "Suspended" },
101 { 'G', "Deficient and Bankrupt" },
102 { 'H', "Deficient and Delinquent" },
103 { 'J', "Delinquent and Bankrupt" },
104 { 'K', "Deficient, Delinquent and Bankrupt" },
105 { ' ', "Company is in compliance" },
106 { 0, NULL }
109 static const value_string round_lots_only_val[] = {
110 { 'Y', "only round lots are accepted in this stock" },
111 { 'N', "odd/mixed lots are allowed" },
112 { 0, NULL }
115 /* Initialize the protocol and registered fields */
116 static int proto_nasdaq_itch = -1;
118 /* Initialize the subtree pointers */
119 static gint ett_nasdaq_itch = -1;
121 static int hf_nasdaq_itch_version = -1;
123 static int hf_nasdaq_itch_message_type = -1;
124 static int hf_nasdaq_itch_market_category = -1;
125 static int hf_nasdaq_itch_financial_status = -1;
126 static int hf_nasdaq_itch_stock = -1;
127 static int hf_nasdaq_itch_round_lot_size = -1;
128 static int hf_nasdaq_itch_round_lots_only = -1;
130 static int hf_nasdaq_itch_system_event = -1;
131 static int hf_nasdaq_itch_second = -1;
132 static int hf_nasdaq_itch_millisecond = -1;
134 static int hf_nasdaq_itch_message = -1;
136 static int hf_nasdaq_itch_trading_state = -1;
137 static int hf_nasdaq_itch_reserved = -1;
138 static int hf_nasdaq_itch_reason = -1;
139 static int hf_nasdaq_itch_order_reference = -1;
140 static int hf_nasdaq_itch_buy_sell = -1;
141 static int hf_nasdaq_itch_shares = -1;
142 static int hf_nasdaq_itch_price = -1;
143 static int hf_nasdaq_itch_attribution = -1;
144 static int hf_nasdaq_itch_executed = -1;
145 static int hf_nasdaq_itch_match = -1;
146 static int hf_nasdaq_itch_printable = -1;
147 static int hf_nasdaq_itch_execution_price = -1;
148 static int hf_nasdaq_itch_canceled = -1;
149 static int hf_nasdaq_itch_cross = -1;
151 /* ---------------------- */
152 static int
153 order_ref_number(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int offset)
155 const char *str_value = tvb_get_string(wmem_packet_scope(), tvb, offset, 9);
156 guint32 value = (guint32)strtoul(str_value, NULL, 10);
158 proto_tree_add_uint(nasdaq_itch_tree, hf_nasdaq_itch_order_reference, tvb, offset, 9, value);
159 col_append_fstr(pinfo->cinfo, COL_INFO, "%u ", value);
161 return offset+9;
164 /* -------------------------- */
165 static int
166 time_stamp(tvbuff_t *tvb, proto_tree *nasdaq_itch_tree, int id, int offset, int size)
169 if (nasdaq_itch_tree) {
170 guint32 ms, val;
171 const char *display = "";
172 const char *str_value = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
174 ms = val = (guint32)strtoul(str_value, NULL, 10);
175 switch (size) {
176 case 3:
177 display = wmem_strdup_printf(wmem_packet_scope(), " %03u" , val);
178 break;
179 case 5:
180 ms = val *1000;
181 case 8: /* 0 86 400 000 */
182 display = wmem_strdup_printf(wmem_packet_scope(), " %u (%02u:%02u:%02u.%03u)", val,
183 ms/3600000, (ms % 3600000)/60000, (ms % 60000)/1000, ms %1000);
184 break;
186 proto_tree_add_uint_format_value(nasdaq_itch_tree, id, tvb, offset, size, val, "%s", display);
188 return offset+size;
191 /* -------------------------- */
192 static int
193 number_of_shares(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int id, int offset, int big)
195 gint size = (big)?10:6;
196 const char *str_value = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
198 guint32 value = (guint32)strtoul(str_value, NULL, 10);
200 proto_tree_add_uint(nasdaq_itch_tree, id, tvb, offset, size, value);
201 col_append_fstr(pinfo->cinfo, COL_INFO, "qty %u ", value);
203 return offset +size;
206 /* -------------------------- */
207 static int
208 price(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int id, int offset, int big)
210 gint size = (big)?19:10;
212 const char *str_value = tvb_get_string(wmem_packet_scope(), tvb, offset, size);
213 gdouble value = guint64_to_gdouble(g_ascii_strtoull(str_value, NULL, 10))/((big)?1000000.0:10000.0);
215 proto_tree_add_double(nasdaq_itch_tree, id, tvb, offset, size, value);
216 col_append_fstr(pinfo->cinfo, COL_INFO, "price %g ", value);
218 return offset+size;
221 /* -------------------------- */
222 static int
223 stock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int offset)
225 char *stock_p = tvb_get_string(wmem_packet_scope(), tvb, offset, 6);
227 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_stock, tvb, offset, 6, ENC_ASCII|ENC_NA);
228 col_append_fstr(pinfo->cinfo, COL_INFO, "<%s> ", stock_p);
230 return offset+6;
233 /* -------------------------- */
234 static int
235 order(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int offset, int big)
237 guint8 value;
239 offset = order_ref_number(tvb, pinfo, nasdaq_itch_tree, offset);
241 value = tvb_get_guint8(tvb, offset);
243 col_append_fstr(pinfo->cinfo, COL_INFO, "%c ", value);
244 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_buy_sell, tvb, offset, 1, ENC_ASCII|ENC_NA);
245 offset += 1;
247 offset = number_of_shares(tvb, pinfo, nasdaq_itch_tree, hf_nasdaq_itch_shares, offset, big);
249 offset = stock(tvb, pinfo, nasdaq_itch_tree, offset);
251 offset = price(tvb, pinfo, nasdaq_itch_tree, hf_nasdaq_itch_price, offset, big);
252 return offset;
255 /* -------------------------- */
256 static int
257 executed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int offset, int big)
259 offset = order_ref_number(tvb, pinfo, nasdaq_itch_tree, offset);
261 offset = number_of_shares(tvb, pinfo, nasdaq_itch_tree, hf_nasdaq_itch_executed, offset, big);
263 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_match, tvb, offset, 9, ENC_ASCII|ENC_NA);
264 offset += 9;
265 return offset;
268 /* ---------------------------- */
269 static void
270 dissect_nasdaq_itch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
272 proto_item *ti;
273 proto_tree *nasdaq_itch_tree = NULL;
274 guint8 nasdaq_itch_type;
275 int offset = 0;
276 int version = 3;
277 int big = 0;
278 const gchar *rep;
280 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Nasdaq-ITCH");
282 nasdaq_itch_type = tvb_get_guint8(tvb, offset);
283 if (nasdaq_itch_type >= '0' && nasdaq_itch_type <= '9') {
284 version = 2;
285 nasdaq_itch_type = tvb_get_guint8(tvb, offset +8);
288 if ((!nasdaq_itch_chi_x || version == 3) && strchr(chix_msg, nasdaq_itch_type)) {
289 nasdaq_itch_type = 0; /* unknown */
292 rep = val_to_str(nasdaq_itch_type, message_types_val, "Unknown packet type (0x%02x) ");
293 col_add_str(pinfo->cinfo, COL_INFO, rep);
295 if (tree) {
296 proto_item *item;
298 ti = proto_tree_add_protocol_format(tree, proto_nasdaq_itch, tvb, offset, -1, "Nasdaq TotalView-ITCH %s, %s",
299 version == 2?"2.0":"3.0", rep);
301 nasdaq_itch_tree = proto_item_add_subtree(ti, ett_nasdaq_itch);
303 item=proto_tree_add_uint(nasdaq_itch_tree, hf_nasdaq_itch_version, tvb, 0, 0, version);
304 PROTO_ITEM_SET_GENERATED(item);
307 if (version == 2) {
308 offset = time_stamp (tvb, nasdaq_itch_tree, hf_nasdaq_itch_millisecond, offset, 8);
311 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
312 offset++;
314 if (version == 3) {
315 switch (nasdaq_itch_type) {
316 case 'T': /* seconds */
317 /*offset =*/ time_stamp (tvb, nasdaq_itch_tree, hf_nasdaq_itch_second, offset, 5);
318 return;
320 case 'M': /* milliseconds */
321 /*offset =*/ time_stamp (tvb, nasdaq_itch_tree, hf_nasdaq_itch_millisecond, offset, 3);
322 return;
326 switch (nasdaq_itch_type) {
327 case 'S': /* system event */
328 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_system_event, tvb, offset, 1, ENC_BIG_ENDIAN);
329 offset++;
330 break;
332 case 'R': /* Stock Directory */
333 offset = stock(tvb, pinfo, nasdaq_itch_tree, offset);
335 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_market_category, tvb, offset, 1, ENC_BIG_ENDIAN);
336 offset += 1;
337 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_financial_status, tvb, offset, 1, ENC_BIG_ENDIAN);
338 offset += 1;
339 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_round_lot_size, tvb, offset, 6, ENC_ASCII|ENC_NA);
340 offset += 6;
341 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_round_lots_only, tvb, offset, 1, ENC_BIG_ENDIAN);
342 /*offset += 1;*/
343 break;
345 case 'H': /* Stock trading action */
346 offset = stock(tvb, pinfo, nasdaq_itch_tree, offset);
348 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_trading_state, tvb, offset, 1, ENC_ASCII|ENC_NA);
349 offset += 1;
350 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_reserved, tvb, offset, 1, ENC_ASCII|ENC_NA);
351 offset += 1;
352 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_reason, tvb, offset, 4, ENC_ASCII|ENC_NA);
353 /*offset += 4;*/
354 break;
356 case 'a' :
357 big = 1;
358 case 'A': /* Add order, no MPID */
359 offset = order(tvb, pinfo, nasdaq_itch_tree, offset, big);
360 if (version == 2) {
361 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_printable, tvb, offset, 1, ENC_ASCII|ENC_NA);
362 /*offset += 1;*/
364 break;
366 case 'F': /* Add order, MPID */
367 offset = order(tvb, pinfo, nasdaq_itch_tree, offset, big);
368 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_attribution, tvb, offset, 4, ENC_ASCII|ENC_NA);
369 /*offset += 4;*/
370 break;
372 case 'e' :
373 big = 1;
374 case 'E' : /* Order executed */
375 /*offset =*/ executed(tvb, pinfo, nasdaq_itch_tree, offset, big);
376 break;
378 case 'C' : /* Order executed with price */
379 offset = executed(tvb, pinfo, nasdaq_itch_tree, offset, big);
380 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_printable, tvb, offset, 1, ENC_ASCII|ENC_NA);
381 offset += 1;
383 /*offset = */price(tvb, pinfo, nasdaq_itch_tree, hf_nasdaq_itch_execution_price, offset, big);
384 break;
386 case 'x' :
387 big = 1;
388 case 'X' : /* Order cancel */
389 offset = order_ref_number(tvb, pinfo, nasdaq_itch_tree, offset);
390 /*offset = */number_of_shares(tvb, pinfo, nasdaq_itch_tree, hf_nasdaq_itch_canceled, offset, big);
391 break;
393 case 'D' : /* Order delete */
394 /*offset = */order_ref_number(tvb, pinfo, nasdaq_itch_tree, offset);
395 /*offset += 9;*/
396 break;
398 case 'p' :
399 big = 1;
400 case 'P' : /* Trade identifier */
401 offset = order(tvb, pinfo, nasdaq_itch_tree, offset, big);
402 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_match, tvb, offset, 9, ENC_ASCII|ENC_NA);
403 /*offset += 9;*/
404 break;
406 case 'Q' : /* Cross Trade */
407 offset = number_of_shares(tvb, pinfo, nasdaq_itch_tree, hf_nasdaq_itch_shares, offset, big);
409 offset = stock(tvb, pinfo, nasdaq_itch_tree, offset);
411 offset = price(tvb, pinfo, nasdaq_itch_tree, hf_nasdaq_itch_price, offset, big);
413 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_match, tvb, offset, 9, ENC_ASCII|ENC_NA);
414 offset += 9;
415 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_cross, tvb, offset, 1, ENC_ASCII|ENC_NA);
416 /*offset += 1;*/
417 break;
419 case 'B' : /* Broken Trade */
420 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_match, tvb, offset, 9, ENC_ASCII|ENC_NA);
421 /*offset += 9;*/
422 break;
424 case 'I': /* NOII, FIXME */
425 offset = stock(tvb, pinfo, nasdaq_itch_tree, offset);
427 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_cross, tvb, offset, 1, ENC_ASCII|ENC_NA);
428 /*offset += 1;*/
429 break;
431 default:
432 /* unknown */
433 proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_message, tvb, offset, -1, ENC_ASCII|ENC_NA);
434 /*offset += 5-1;*/
435 break;
439 /* Register the protocol with Wireshark */
441 void
442 proto_register_nasdaq_itch(void)
445 /* Setup list of header fields See Section 1.6.1 for details*/
446 static hf_register_info hf[] = {
447 { &hf_nasdaq_itch_version,
448 { "Version", "nasdaq-itch.version",
449 FT_UINT8, BASE_DEC, NULL, 0x0,
450 NULL, HFILL }},
452 { &hf_nasdaq_itch_message_type,
453 { "Message Type", "nasdaq-itch.message_type",
454 FT_UINT8, BASE_DEC, VALS(message_types_val), 0x0,
455 NULL, HFILL }},
457 { &hf_nasdaq_itch_second,
458 { "Second", "nasdaq-itch.second",
459 FT_UINT32, BASE_DEC, NULL, 0x0,
460 NULL, HFILL }},
462 { &hf_nasdaq_itch_millisecond,
463 { "Millisecond", "nasdaq-itch.millisecond",
464 FT_UINT32, BASE_DEC, NULL, 0x0,
465 NULL, HFILL }},
467 { &hf_nasdaq_itch_system_event,
468 { "System Event", "nasdaq-itch.system_event",
469 FT_UINT8, BASE_DEC, VALS(system_event_val), 0x0,
470 NULL, HFILL }},
472 { &hf_nasdaq_itch_market_category,
473 { "Market Category", "nasdaq-itch.market_category",
474 FT_UINT8, BASE_DEC, VALS(market_category_val), 0x0,
475 NULL, HFILL }},
477 { &hf_nasdaq_itch_financial_status,
478 { "Financial Status Indicator", "nasdaq-itch.financial_status",
479 FT_UINT8, BASE_DEC, VALS(financial_status_val), 0x0,
480 NULL, HFILL }},
482 { &hf_nasdaq_itch_stock,
483 { "Stock", "nasdaq-itch.stock",
484 FT_STRING, BASE_NONE, NULL, 0x0,
485 NULL, HFILL }},
487 { &hf_nasdaq_itch_round_lot_size,
488 { "Round Lot Size", "nasdaq-itch.round_lot_size",
489 FT_STRING, BASE_NONE, NULL, 0x0,
490 NULL, HFILL }},
492 { &hf_nasdaq_itch_round_lots_only,
493 { "Round Lots Only", "nasdaq-itch.round_lots_only",
494 FT_UINT8, BASE_DEC, VALS(round_lots_only_val), 0x0,
495 NULL, HFILL }},
497 { &hf_nasdaq_itch_trading_state,
498 { "Trading State", "nasdaq-itch.trading_state",
499 FT_STRING, BASE_NONE, NULL, 0x0,
500 NULL, HFILL }},
502 { &hf_nasdaq_itch_reserved,
503 { "Reserved", "nasdaq-itch.reserved",
504 FT_STRING, BASE_NONE, NULL, 0x0,
505 NULL, HFILL }},
507 { &hf_nasdaq_itch_reason,
508 { "Reason", "nasdaq-itch.reason",
509 FT_STRING, BASE_NONE, NULL, 0x0,
510 NULL, HFILL }},
512 { &hf_nasdaq_itch_order_reference,
513 { "Order Reference", "nasdaq-itch.order_reference",
514 FT_UINT32, BASE_DEC, NULL, 0x0,
515 "Order reference number", HFILL }},
517 { &hf_nasdaq_itch_buy_sell,
518 { "Buy/Sell", "nasdaq-itch.buy_sell",
519 FT_STRING, BASE_NONE, NULL, 0x0,
520 "Buy/Sell indicator", HFILL }},
522 { &hf_nasdaq_itch_shares,
523 { "Shares", "nasdaq-itch.shares",
524 FT_UINT32, BASE_DEC, NULL, 0x0,
525 "Number of shares", HFILL }},
527 { &hf_nasdaq_itch_price,
528 { "Price", "nasdaq-itch.price",
529 FT_DOUBLE, BASE_NONE, NULL, 0x0,
530 NULL, HFILL }},
532 { &hf_nasdaq_itch_attribution,
533 { "Attribution", "nasdaq-itch.attribution",
534 FT_STRING, BASE_NONE, NULL, 0x0,
535 "Market participant identifier", HFILL }},
537 { &hf_nasdaq_itch_executed,
538 { "Executed Shares", "nasdaq-itch.executed",
539 FT_UINT32, BASE_DEC, NULL, 0x0,
540 "Number of shares executed", HFILL }},
542 { &hf_nasdaq_itch_match,
543 { "Matched", "nasdaq-itch.match",
544 FT_STRING, BASE_NONE, NULL, 0x0,
545 "Match number", HFILL }},
547 { &hf_nasdaq_itch_printable,
548 { "Printable", "nasdaq-itch.printable",
549 FT_STRING, BASE_NONE, NULL, 0x0,
550 NULL, HFILL }},
552 { &hf_nasdaq_itch_execution_price,
553 { "Execution Price", "nasdaq-itch.execution_price",
554 FT_DOUBLE, BASE_NONE, NULL, 0x0,
555 NULL, HFILL }},
557 { &hf_nasdaq_itch_canceled,
558 { "Canceled Shares", "nasdaq-itch.canceled",
559 FT_UINT32, BASE_DEC, NULL, 0x0,
560 "Number of shares to be removed", HFILL }},
562 { &hf_nasdaq_itch_cross,
563 { "Cross Type", "nasdaq-itch.cross",
564 FT_STRING, BASE_NONE, NULL, 0x0,
565 "Cross trade type", HFILL }},
567 { &hf_nasdaq_itch_message,
568 { "Message", "nasdaq-itch.message",
569 FT_STRING, BASE_NONE, NULL, 0x0,
570 NULL, HFILL }}
573 /* Setup protocol subtree array */
574 static gint *ett[] = {
575 &ett_nasdaq_itch
578 module_t *nasdaq_itch_module;
580 /* Register the protocol name and description */
581 proto_nasdaq_itch = proto_register_protocol("Nasdaq TotalView-ITCH", "NASDAQ-ITCH", "nasdaq_itch");
583 /* Required function calls to register the header fields and subtrees used */
584 proto_register_field_array(proto_nasdaq_itch, hf, array_length(hf));
585 proto_register_subtree_array(ett, array_length(ett));
587 nasdaq_itch_module = prefs_register_protocol(proto_nasdaq_itch, NULL);
588 prefs_register_bool_preference(nasdaq_itch_module, "chi_x", "Decode Chi X extensions",
589 "Whether the Nasdaq ITCH dissector should decode Chi X extensions.",
590 &nasdaq_itch_chi_x);
592 register_dissector("nasdaq-itch", dissect_nasdaq_itch, proto_nasdaq_itch);
596 /* If this dissector uses sub-dissector registration add a registration routine.
597 This format is required because a script is used to find these routines and
598 create the code that calls these routines.
600 void
601 proto_reg_handoff_nasdaq_itch(void)