2 * Routines for Quake packet dissection
4 * Uwe Girlich <uwe@planetquake.com>
5 * http://www.idsoftware.com/q1source/q1source.zip
7 * $Id: packet-quake.c,v 1.28 2002/08/28 21:00:26 jmayer Exp $
9 * Ethereal - Network traffic analyzer
10 * By Gerald Combs <gerald@ethereal.com>
11 * Copyright 1998 Gerald Combs
13 * Copied from packet-tftp.c
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
35 #include <epan/packet.h>
36 #include <epan/conversation.h>
39 static int proto_quake = -1;
40 static int hf_quake_header_flags = -1;
41 static int hf_quake_header_length = -1;
42 static int hf_quake_header_sequence = -1;
43 static int hf_quake_control_command = -1;
45 static int hf_quake_CCREQ_CONNECT_game = -1;
46 static int hf_quake_CCREQ_CONNECT_version = -1;
47 static int hf_quake_CCREQ_SERVER_INFO_game = -1;
48 static int hf_quake_CCREQ_SERVER_INFO_version = -1;
49 static int hf_quake_CCREQ_PLAYER_INFO_player = -1;
50 static int hf_quake_CCREQ_RULE_INFO_lastrule = -1;
52 static int hf_quake_CCREP_ACCEPT_port = -1;
53 static int hf_quake_CCREP_REJECT_reason = -1;
54 static int hf_quake_CCREP_SERVER_INFO_address = -1;
55 static int hf_quake_CCREP_SERVER_INFO_server = -1;
56 static int hf_quake_CCREP_SERVER_INFO_map = -1;
57 static int hf_quake_CCREP_SERVER_INFO_num_player = -1;
58 static int hf_quake_CCREP_SERVER_INFO_max_player = -1;
59 static int hf_quake_CCREP_PLAYER_INFO_name = -1;
60 static int hf_quake_CCREP_PLAYER_INFO_colors = -1;
61 static int hf_quake_CCREP_PLAYER_INFO_colors_shirt = -1;
62 static int hf_quake_CCREP_PLAYER_INFO_colors_pants = -1;
63 static int hf_quake_CCREP_PLAYER_INFO_frags = -1;
64 static int hf_quake_CCREP_PLAYER_INFO_connect_time = -1;
65 static int hf_quake_CCREP_PLAYER_INFO_address = -1;
66 static int hf_quake_CCREP_RULE_INFO_rule = -1;
67 static int hf_quake_CCREP_RULE_INFO_value = -1;
70 static gint ett_quake = -1;
71 static gint ett_quake_control = -1;
72 static gint ett_quake_control_colors = -1;
73 static gint ett_quake_flags = -1;
75 static dissector_handle_t quake_handle;
76 static dissector_handle_t data_handle;
78 /* I took these names directly out of the Q1 source. */
79 #define NETFLAG_LENGTH_MASK 0x0000ffff
80 #define NET_HEADERSIZE 8
81 #define DEFAULTnet_hostport 26000
82 static unsigned int gbl_quakeServerPort=DEFAULTnet_hostport;
84 #define NETFLAG_LENGTH_MASK 0x0000ffff
85 #define NETFLAG_DATA 0x00010000
86 #define NETFLAG_ACK 0x00020000
87 #define NETFLAG_NAK 0x00040000
88 #define NETFLAG_EOM 0x00080000
89 #define NETFLAG_UNRELIABLE 0x00100000
90 #define NETFLAG_CTL 0x80000000
93 #define CCREQ_CONNECT 0x01
94 #define CCREQ_SERVER_INFO 0x02
95 #define CCREQ_PLAYER_INFO 0x03
96 #define CCREQ_RULE_INFO 0x04
98 #define CCREP_ACCEPT 0x81
99 #define CCREP_REJECT 0x82
100 #define CCREP_SERVER_INFO 0x83
101 #define CCREP_PLAYER_INFO 0x84
102 #define CCREP_RULE_INFO 0x85
104 static const value_string names_control_command[] = {
105 { CCREQ_CONNECT, "connect" },
106 { CCREQ_SERVER_INFO, "server_info" },
107 { CCREQ_PLAYER_INFO, "player_info" },
108 { CCREQ_RULE_INFO, "rule_info" },
109 { CCREP_ACCEPT, "accept" },
110 { CCREP_REJECT, "reject" },
111 { CCREP_SERVER_INFO, "server_info" },
112 { CCREP_PLAYER_INFO, "player_info" },
113 { CCREP_RULE_INFO, "rule_info" },
120 #define QUAKE_MAXSTRING 0x800
122 static const value_string names_control_direction[] = {
123 { CCREQ, "Request" },
129 static const value_string names_colors[] = {
150 static void dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
155 dissect_quake_CCREQ_CONNECT
156 (tvbuff_t *tvb, proto_tree *tree)
159 char game[QUAKE_MAXSTRING];
163 maxbufsize = MIN(sizeof(game), tvb_length(tvb));
164 len = tvb_get_nstringz0(tvb, 0, maxbufsize, game);
165 version = tvb_get_guint8(tvb, len + 1);
168 proto_tree_add_string(tree, hf_quake_CCREQ_CONNECT_game,
169 tvb, 0, len + 1, game);
170 proto_tree_add_uint(tree, hf_quake_CCREQ_CONNECT_version,
171 tvb, len + 1, 1, version);
177 dissect_quake_CCREQ_SERVER_INFO
178 (tvbuff_t *tvb, proto_tree *tree)
181 char game[QUAKE_MAXSTRING];
185 maxbufsize = MIN(sizeof(game), tvb_length(tvb));
186 len = tvb_get_nstringz0(tvb, 0, maxbufsize, game);
187 version = tvb_get_guint8(tvb, len + 1);
190 proto_tree_add_string(tree, hf_quake_CCREQ_SERVER_INFO_game,
191 tvb, 0, len + 1, game);
192 proto_tree_add_uint(tree, hf_quake_CCREQ_SERVER_INFO_version,
193 tvb, len + 1, 1, version);
199 dissect_quake_CCREQ_PLAYER_INFO
200 (tvbuff_t *tvb, proto_tree *tree)
204 player = tvb_get_guint8(tvb, 0);
206 proto_tree_add_uint(tree, hf_quake_CCREQ_PLAYER_INFO_player,
213 dissect_quake_CCREQ_RULE_INFO
214 (tvbuff_t *tvb, proto_tree *tree)
216 char rule[QUAKE_MAXSTRING];
220 maxbufsize = MIN(sizeof(rule), tvb_length(tvb));
221 len = tvb_get_nstringz0(tvb, 0, maxbufsize, rule);
223 proto_tree_add_string(tree, hf_quake_CCREQ_RULE_INFO_lastrule,
224 tvb, 0, len + 1, rule);
230 dissect_quake_CCREP_ACCEPT
231 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
236 port = tvb_get_letohl(tvb, 0);
237 c = conversation_new( &pinfo->src, &pinfo->dst, PT_UDP, port,
240 conversation_set_dissector(c, quake_handle);
243 proto_tree_add_uint(tree, hf_quake_CCREP_ACCEPT_port,
250 dissect_quake_CCREP_REJECT
251 (tvbuff_t *tvb, proto_tree *tree)
254 char reason[QUAKE_MAXSTRING];
257 maxbufsize = MIN(sizeof(reason), tvb_length(tvb));
258 len = tvb_get_nstringz0(tvb, 0, maxbufsize, reason);
261 proto_tree_add_string(tree, hf_quake_CCREP_REJECT_reason,
262 tvb, 0, len + 1, reason);
268 dissect_quake_CCREP_SERVER_INFO
269 (tvbuff_t *tvb, proto_tree *tree)
274 char address[QUAKE_MAXSTRING];
275 char server[QUAKE_MAXSTRING];
276 char map[QUAKE_MAXSTRING];
284 maxbufsize = MIN((int)sizeof(address), tvb_length_remaining(tvb, offset));
285 len = tvb_get_nstringz0(tvb, offset, maxbufsize, address);
287 proto_tree_add_string(tree, hf_quake_CCREP_SERVER_INFO_address,
288 tvb, offset, len + 1, address);
292 maxbufsize = MIN((int)sizeof(server), tvb_length_remaining(tvb, offset));
293 len = tvb_get_nstringz0(tvb, offset, maxbufsize, server);
295 proto_tree_add_string(tree, hf_quake_CCREP_SERVER_INFO_server,
296 tvb, offset, len + 1, server);
300 maxbufsize = MIN((int)sizeof(map), tvb_length_remaining(tvb, offset));
301 len = tvb_get_nstringz0(tvb, offset, maxbufsize, map);
303 proto_tree_add_string(tree, hf_quake_CCREP_SERVER_INFO_map,
304 tvb, offset, len + 1, map);
308 num_player = tvb_get_guint8(tvb, offset + 0);
309 max_player = tvb_get_guint8(tvb, offset + 1);
310 version = tvb_get_guint8(tvb, offset + 2);
313 proto_tree_add_uint(tree, hf_quake_CCREP_SERVER_INFO_num_player,
314 tvb, offset + 0, 1, num_player);
315 proto_tree_add_uint(tree, hf_quake_CCREP_SERVER_INFO_max_player,
316 tvb, offset + 1, 1, max_player);
317 proto_tree_add_uint(tree, hf_quake_CCREQ_SERVER_INFO_version,
318 tvb, offset + 2, 1, version);
324 dissect_quake_CCREP_PLAYER_INFO
325 (tvbuff_t *tvb, proto_tree *tree)
331 char name[QUAKE_MAXSTRING];
336 guint32 connect_time;
337 char address[QUAKE_MAXSTRING];
341 player = tvb_get_guint8(tvb, offset);
343 proto_tree_add_uint(tree, hf_quake_CCREQ_PLAYER_INFO_player,
344 tvb, offset, 1, player);
348 maxbufsize = MIN((int)sizeof(name), tvb_length_remaining(tvb, offset));
349 len = tvb_get_nstringz0(tvb, offset, maxbufsize, name);
351 proto_tree_add_string(tree, hf_quake_CCREP_PLAYER_INFO_name,
352 tvb, offset, len + 1, name);
356 colors = tvb_get_letohl(tvb, offset + 0);
357 color_shirt = (colors >> 4) & 0x0f;
358 color_pants = (colors ) & 0x0f;
359 frags = tvb_get_letohl(tvb, offset + 4);
360 connect_time = tvb_get_letohl(tvb, offset + 8);
362 proto_item *colors_item;
363 proto_tree *colors_tree;
365 colors_item = proto_tree_add_uint(tree,
366 hf_quake_CCREP_PLAYER_INFO_colors,
367 tvb, offset + 0, 4, colors);
369 colors_tree = proto_item_add_subtree(colors_item,
370 ett_quake_control_colors);
371 proto_tree_add_uint(colors_tree,
372 hf_quake_CCREP_PLAYER_INFO_colors_shirt,
373 tvb, offset + 0, 1, color_shirt);
374 proto_tree_add_uint(colors_tree,
375 hf_quake_CCREP_PLAYER_INFO_colors_pants,
376 tvb, offset + 0, 1, color_pants);
378 proto_tree_add_uint(tree, hf_quake_CCREP_PLAYER_INFO_frags,
379 tvb, offset + 4, 4, frags);
380 proto_tree_add_uint(tree, hf_quake_CCREP_PLAYER_INFO_connect_time,
381 tvb, offset + 8, 4, connect_time);
385 maxbufsize = MIN((int)sizeof(address), tvb_length_remaining(tvb, offset));
386 len = tvb_get_nstringz0(tvb, offset, maxbufsize, address);
388 proto_tree_add_string(tree, hf_quake_CCREP_PLAYER_INFO_address,
389 tvb, offset, len + 1, address);
396 dissect_quake_CCREP_RULE_INFO
397 (tvbuff_t *tvb, proto_tree *tree)
399 char rule[QUAKE_MAXSTRING];
400 char value[QUAKE_MAXSTRING];
405 if (tvb_length(tvb) == 0) return;
409 maxbufsize = MIN((int)sizeof(rule), tvb_length_remaining(tvb, offset));
410 len = tvb_get_nstringz0(tvb, offset, maxbufsize, rule);
412 proto_tree_add_string(tree, hf_quake_CCREP_RULE_INFO_rule,
413 tvb, offset, len + 1, rule);
417 maxbufsize = MIN((int)sizeof(value), tvb_length_remaining(tvb, offset));
418 len = tvb_get_nstringz0(tvb, offset, maxbufsize, value);
420 proto_tree_add_string(tree, hf_quake_CCREP_RULE_INFO_value,
421 tvb, offset, len + 1, value);
428 dissect_quake_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
432 proto_item *control_item = NULL;
433 proto_tree *control_tree = NULL;
437 command = tvb_get_guint8(tvb, 0);
438 direction = (command & 0x80) ? CCREP : CCREQ;
440 if (check_col(pinfo->cinfo, COL_INFO)) {
441 col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
442 val_to_str(command,names_control_command, "%u"),
443 val_to_str(direction,names_control_direction,"%u"));
447 control_item = proto_tree_add_text(tree, tvb,
448 0, -1, "Control %s: %s",
449 val_to_str(direction, names_control_direction, "%u"),
450 val_to_str(command, names_control_command, "%u"));
452 control_tree = proto_item_add_subtree(control_item,
454 proto_tree_add_uint(control_tree, hf_quake_control_command,
458 rest_length = tvb_reported_length(tvb) - 1;
459 next_tvb = tvb_new_subset(tvb, 1, rest_length , rest_length);
462 dissect_quake_CCREQ_CONNECT
463 (next_tvb, control_tree);
465 case CCREQ_SERVER_INFO:
466 dissect_quake_CCREQ_SERVER_INFO
467 (next_tvb, control_tree);
469 case CCREQ_PLAYER_INFO:
470 dissect_quake_CCREQ_PLAYER_INFO
471 (next_tvb, control_tree);
473 case CCREQ_RULE_INFO:
474 dissect_quake_CCREQ_RULE_INFO
475 (next_tvb, control_tree);
478 dissect_quake_CCREP_ACCEPT
479 (next_tvb, pinfo, control_tree);
482 dissect_quake_CCREP_REJECT
483 (next_tvb, control_tree);
485 case CCREP_SERVER_INFO:
486 dissect_quake_CCREP_SERVER_INFO
487 (next_tvb, control_tree);
489 case CCREP_PLAYER_INFO:
490 dissect_quake_CCREP_PLAYER_INFO
491 (next_tvb, control_tree);
493 case CCREP_RULE_INFO:
494 dissect_quake_CCREP_RULE_INFO
495 (next_tvb, control_tree);
498 call_dissector(data_handle,next_tvb, pinfo, control_tree);
505 dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
507 proto_tree *quake_tree = NULL;
508 proto_item *quake_item = NULL;
511 guint32 sequence = 0;
515 if (check_col(pinfo->cinfo, COL_PROTOCOL))
516 col_set_str(pinfo->cinfo, COL_PROTOCOL, "QUAKE");
517 if (check_col(pinfo->cinfo, COL_INFO))
518 col_clear(pinfo->cinfo, COL_INFO);
520 length = tvb_get_ntohl(tvb, 0);
521 flags = length & (~NETFLAG_LENGTH_MASK);
522 length &= NETFLAG_LENGTH_MASK;
525 quake_item = proto_tree_add_item(tree, proto_quake,
528 quake_tree = proto_item_add_subtree(quake_item, ett_quake);
532 proto_item* flags_item = NULL;
533 proto_tree* flags_tree = NULL;
535 flags_item = proto_tree_add_uint(quake_tree, hf_quake_header_flags,
538 flags_tree = proto_item_add_subtree(flags_item, ett_quake_flags);
542 proto_tree_add_text(flags_tree, tvb, 0, 2,
543 decode_boolean_bitfield(flags, NETFLAG_DATA, 32,
545 proto_tree_add_text(flags_tree, tvb, 0, 2,
546 decode_boolean_bitfield(flags, NETFLAG_ACK, 32,
547 "Acknowledgment","-"));
548 proto_tree_add_text(flags_tree, tvb, 0, 2,
549 decode_boolean_bitfield(flags, NETFLAG_NAK, 32,
550 "No Acknowledgment","-"));
551 proto_tree_add_text(flags_tree, tvb, 0, 2,
552 decode_boolean_bitfield(flags, NETFLAG_EOM, 32,
553 "End Of Message","-"));
554 proto_tree_add_text(flags_tree, tvb, 0, 2,
555 decode_boolean_bitfield(flags, NETFLAG_UNRELIABLE, 32,
557 proto_tree_add_text(flags_tree, tvb, 0, 2,
558 decode_boolean_bitfield(flags, NETFLAG_CTL, 32,
561 proto_tree_add_uint(quake_tree, hf_quake_header_length,
565 if (flags == NETFLAG_CTL) {
566 rest_length = tvb_reported_length(tvb) - 4;
567 next_tvb = tvb_new_subset(tvb, 4, rest_length , rest_length);
568 dissect_quake_control(next_tvb, pinfo, quake_tree);
572 sequence = tvb_get_ntohl(tvb, 4);
573 if (check_col(pinfo->cinfo, COL_INFO)) {
574 col_add_fstr(pinfo->cinfo, COL_INFO, "seq 0x%x", sequence);
577 proto_tree_add_uint(quake_tree, hf_quake_header_sequence,
578 tvb, 4, 4, sequence);
581 rest_length = tvb_reported_length(tvb) - 8;
582 next_tvb = tvb_new_subset(tvb, 8, rest_length , rest_length);
583 call_dissector(data_handle,next_tvb, pinfo, quake_tree);
588 proto_reg_handoff_quake(void)
590 static int Initialized=FALSE;
591 static int ServerPort=0;
594 dissector_delete("udp.port", ServerPort, quake_handle);
599 /* set port for future deletes */
600 ServerPort=gbl_quakeServerPort;
602 dissector_add("udp.port", gbl_quakeServerPort, quake_handle);
603 data_handle = find_dissector("data");
608 proto_register_quake(void)
610 static hf_register_info hf[] = {
611 { &hf_quake_header_flags,
612 { "Flags", "quake.header.flags",
613 FT_UINT16, BASE_HEX, NULL, 0x0,
615 { &hf_quake_header_length,
616 { "Length", "quake.header.length",
617 FT_UINT16, BASE_DEC, NULL, 0x0,
618 "full data length", HFILL }},
619 { &hf_quake_header_sequence,
620 { "Sequence", "quake.header.sequence",
621 FT_UINT32, BASE_HEX, NULL, 0x0,
622 "Sequence Number", HFILL }},
623 { &hf_quake_control_command,
624 { "Command", "quake.control.command",
625 FT_UINT8, BASE_HEX, VALS(names_control_command), 0x0,
626 "Control Command", HFILL }},
627 { &hf_quake_CCREQ_CONNECT_game,
628 { "Game", "quake.control.connect.game",
629 FT_STRING, BASE_DEC, NULL, 0x0,
630 "Game Name", HFILL }},
631 { &hf_quake_CCREQ_CONNECT_version,
632 { "Version", "quake.control.connect.version",
633 FT_UINT8, BASE_DEC, NULL, 0x0,
634 "Game Protocol Version Number", HFILL }},
635 { &hf_quake_CCREQ_SERVER_INFO_game,
636 { "Game", "quake.control.server_info.game",
637 FT_STRING, BASE_DEC, NULL, 0x0,
638 "Game Name", HFILL }},
639 { &hf_quake_CCREQ_SERVER_INFO_version,
640 { "Version", "quake.control.server_info.version",
641 FT_UINT8, BASE_DEC, NULL, 0x0,
642 "Game Protocol Version Number", HFILL }},
643 { &hf_quake_CCREQ_PLAYER_INFO_player,
644 { "Player", "quake.control.player_info.player",
645 FT_UINT8, BASE_DEC, NULL, 0x0,
647 { &hf_quake_CCREQ_RULE_INFO_lastrule,
648 { "Last Rule", "quake.control.rule_info.lastrule",
649 FT_STRING, BASE_DEC, NULL, 0x0,
650 "Last Rule Name", HFILL }},
651 { &hf_quake_CCREP_ACCEPT_port,
652 { "Port", "quake.control.accept.port",
653 FT_UINT32, BASE_DEC, NULL, 0x0,
654 "Game Data Port", HFILL }},
655 { &hf_quake_CCREP_REJECT_reason,
656 { "Reason", "quake.control.reject.reason",
657 FT_STRING, BASE_DEC, NULL, 0x0,
658 "Reject Reason", HFILL }},
659 { &hf_quake_CCREP_SERVER_INFO_address,
660 { "Address", "quake.control.server_info.address",
661 FT_STRING, BASE_DEC, NULL, 0x0,
662 "Server Address", HFILL }},
663 { &hf_quake_CCREP_SERVER_INFO_server,
664 { "Server", "quake.control.server_info.server",
665 FT_STRING, BASE_DEC, NULL, 0x0,
666 "Server Name", HFILL }},
667 { &hf_quake_CCREP_SERVER_INFO_map,
668 { "Map", "quake.control.server_info.map",
669 FT_STRING, BASE_DEC, NULL, 0x0,
670 "Map Name", HFILL }},
671 { &hf_quake_CCREP_SERVER_INFO_num_player,
672 { "Number of Players", "quake.control.server_info.num_player",
673 FT_UINT8, BASE_DEC, NULL, 0x0,
674 "Current Number of Players", HFILL }},
675 { &hf_quake_CCREP_SERVER_INFO_max_player,
676 { "Maximal Number of Players", "quake.control.server_info.max_player",
677 FT_UINT8, BASE_DEC, NULL, 0x0,
678 "Maximal Number of Players", HFILL }},
679 { &hf_quake_CCREP_PLAYER_INFO_name,
680 { "Name", "quake.control.player_info.name",
681 FT_STRING, BASE_DEC, NULL, 0x0,
682 "Player Name", HFILL }},
683 { &hf_quake_CCREP_PLAYER_INFO_colors,
684 { "Colors", "quake.control.player_info.colors",
685 FT_UINT32, BASE_HEX, NULL, 0x0,
686 "Player Colors", HFILL }},
687 { &hf_quake_CCREP_PLAYER_INFO_colors_shirt,
688 { "Shirt", "quake.control.player_info.colors.shirt",
689 FT_UINT8, BASE_DEC, VALS(names_colors), 0x0,
690 "Shirt Color", HFILL }},
691 { &hf_quake_CCREP_PLAYER_INFO_colors_pants,
692 { "Pants", "quake.control.player_info.colors.pants",
693 FT_UINT8, BASE_DEC, VALS(names_colors), 0x0,
694 "Pants Color", HFILL }},
695 { &hf_quake_CCREP_PLAYER_INFO_frags,
696 { "Frags", "quake.control.player_info.frags",
697 FT_UINT32, BASE_DEC, NULL, 0x0,
698 "Player Frags", HFILL }},
699 { &hf_quake_CCREP_PLAYER_INFO_connect_time,
700 { "Connect Time", "quake.control.player_info.connect_time",
701 FT_UINT32, BASE_DEC, NULL, 0x0,
702 "Player Connect Time", HFILL }},
703 { &hf_quake_CCREP_PLAYER_INFO_address,
704 { "Address", "quake.control.player_info.address",
705 FT_STRING, BASE_DEC, NULL, 0x0,
706 "Player Address", HFILL }},
707 { &hf_quake_CCREP_RULE_INFO_rule,
708 { "Rule", "quake.control.rule_info.rule",
709 FT_STRING, BASE_DEC, NULL, 0x0,
710 "Rule Name", HFILL }},
711 { &hf_quake_CCREP_RULE_INFO_value,
712 { "Value", "quake.control.rule_info.value",
713 FT_STRING, BASE_DEC, NULL, 0x0,
714 "Rule Value", HFILL }},
716 static gint *ett[] = {
719 &ett_quake_control_colors,
722 module_t *quake_module;
724 proto_quake = proto_register_protocol("Quake Network Protocol",
726 proto_register_field_array(proto_quake, hf, array_length(hf));
727 proto_register_subtree_array(ett, array_length(ett));
729 quake_handle = create_dissector_handle(dissect_quake, proto_quake);
731 /* Register a configuration option for port */
732 quake_module = prefs_register_protocol(proto_quake,
733 proto_reg_handoff_quake);
734 prefs_register_uint_preference(quake_module, "udp.port",
735 "Quake Server UDP Port",
736 "Set the UDP port for the Quake Server",
737 10, &gbl_quakeServerPort);