2 * Routines for TeamSpeak2 protocol packet disassembly
3 * By brooss <brooss.teambb@gmail.com>
4 * Copyright 2008 brooss
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
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.
31 #include <epan/packet.h>
32 #include <wsutil/crc32.h>
33 #include <epan/crc32-tvb.h>
34 #include <epan/wmem/wmem.h>
35 #include <epan/reassemble.h>
36 #include <epan/conversation.h>
39 #define TS2C_STANDARD 0xbef0
40 #define TS2C_ACK 0xbef1
41 #define TS2C_CLIENT_VOICE 0xbef2
42 #define TS2C_SERVER_VOICE 0xbef3
43 #define TS2C_CONNECTION 0xbef4
46 #define TS2T_PING 0x0001
47 #define TS2T_PINGREPLY 0x0002
48 #define TS2T_LOGINREQUEST 0x0003
49 #define TS2T_LOGINREPLY 0x0004
50 #define TS2T_LOGINPART2 0x0005
51 #define TS2T_CHANNELLIST 0x0006
52 #define TS2T_PLAYERLIST 0x0007
53 #define TS2T_LOGINEND 0x0008
55 #define TS2T_TEXTMESSAGE 0x0082
56 #define TS2T_CHANNEL_PLAYERLIST 0x006c
57 #define TS2T_CHANNELCHANGE 0x0067
58 #define TS2T_CHANNELLISTUPDATE 0x006e
59 #define TS2T_PLAYERKICKED 0x0066
60 #define TS2T_PLAYERLEFT 0x0065
61 #define TS2T_NEWPLAYERJOINED 0x0064
62 #define TS2T_KNOWNPLAYERUPDATE 0x0068
63 #define TS2T_CHANNELDELETED 0x0073
64 #define TS2T_CHANNELNAMECHANGED 0x006f
65 #define TS2T_CHANNELTOPICCHANGED 0x0070
66 #define TS2T_CHANNELPASSWORDCHANGED 0x0071
67 #define TS2T_CREATECHANNEL 0x00c9
68 #define TS2T_DISCONNECT 0x012c
69 #define TS2T_SWITCHCHANNEL 0x012f
70 #define TS2T_CHANGESTATUS 0x0130
71 #define TS2T_CHATMESSAGEBOUNCE 0xfc0f
73 #define TS2T_VOICE_DATA_CELP_5_1 0x0000
74 #define TS2T_VOICE_DATA_CELP_6_3 0x0100
75 #define TS2T_VOICE_DATA_GSM_14_8 0x0200
76 #define TS2T_VOICE_DATA_GSM_16_4 0x0300
77 #define TS2T_VOICE_DATA_CELP_WINDOWS_5_2 0x0400
78 #define TS2T_VOICE_DATA_SPEEX_3_4 0x0500
79 #define TS2T_VOICE_DATA_SPEEX_5_2 0x0600
80 #define TS2T_VOICE_DATA_SPEEX_7_2 0x0700
81 #define TS2T_VOICE_DATA_SPEEX_9_3 0x0800
82 #define TS2T_VOICE_DATA_SPEEX_12_3 0x0900
83 #define TS2T_VOICE_DATA_SPEEX_16_3 0x0a00
84 #define TS2T_VOICE_DATA_SPEEX_19_5 0x0b00
85 #define TS2T_VOICE_DATA_SPEEX_25_9 0x0c00
88 #define TS2T_CODEC_CELP_5_1 0x0000
89 #define TS2T_CODEC_CELP_6_3 0x0001
90 #define TS2T_CODEC_GSM_14_8 0x0002
91 #define TS2T_CODEC_GSM_16_4 0x0003
92 #define TS2T_CODEC_CELP_WINDOWS_5_2 0x0004
93 #define TS2T_CODEC_SPEEX_3_4 0x0005
94 #define TS2T_CODEC_SPEEX_5_2 0x0006
95 #define TS2T_CODEC_SPEEX_7_2 0x0007
96 #define TS2T_CODEC_SPEEX_9_3 0x0008
97 #define TS2T_CODEC_SPEEX_12_3 0x0009
98 #define TS2T_CODEC_SPEEX_16_3 0x000a
99 #define TS2T_CODEC_SPEEX_19_5 0x000b
100 #define TS2T_CODEC_SPEEX_25_9 0x000c
102 /* Player Status Flags */
103 #define TS2_STATUS_CHANNELCOMMANDER 1
104 #define TS2_STATUS_BLOCKWHISPERS 4
105 #define TS2_STATUS_AWAY 8
106 #define TS2_STATUS_MUTEMICROPHONE 16
107 #define TS2_STATUS_MUTE 32
110 static int hf_msg_fragments
= -1;
111 static int hf_msg_fragment
= -1;
112 static int hf_msg_fragment_overlap
= -1;
113 static int hf_msg_fragment_overlap_conflicts
= -1;
114 static int hf_msg_fragment_multiple_tails
= -1;
115 static int hf_msg_fragment_too_long_fragment
= -1;
116 static int hf_msg_fragment_error
= -1;
117 static int hf_msg_fragment_count
= -1;
118 static int hf_msg_reassembled_in
= -1;
119 static int hf_msg_reassembled_length
= -1;
121 static gint ett_msg_fragment
= -1;
122 static gint ett_msg_fragments
= -1;
124 static const fragment_items msg_frag_items
= {
125 /* Fragment subtrees */
128 /* Fragment fields */
131 &hf_msg_fragment_overlap
,
132 &hf_msg_fragment_overlap_conflicts
,
133 &hf_msg_fragment_multiple_tails
,
134 &hf_msg_fragment_too_long_fragment
,
135 &hf_msg_fragment_error
,
136 &hf_msg_fragment_count
,
137 /* Reassembled in field */
138 &hf_msg_reassembled_in
,
139 /* Reassembled length field */
140 &hf_msg_reassembled_length
,
141 /* Reassembled data field */
148 static const value_string classnames
[] =
150 { TS2C_CONNECTION
, "Connection" },
152 { TS2C_STANDARD
, "Standard (reliable)"},
153 { TS2C_SERVER_VOICE
, "Voice"},
154 { TS2C_CLIENT_VOICE
, "Voice"},
159 static const value_string typenames
[] = {
160 { TS2T_PING
, "Ping" },
161 { TS2T_PINGREPLY
, "Ping Reply" },
162 { TS2T_LOGINREQUEST
, "Login Request" },
163 { TS2T_LOGINREPLY
, "Login Reply" },
164 { TS2T_LOGINPART2
, "Login Part 2" },
165 { TS2T_CHANNELLIST
, "Channel List" },
166 { TS2T_PLAYERLIST
, "Player List" },
167 { TS2T_LOGINEND
, "Login End" },
168 { TS2T_TEXTMESSAGE
, "Text Message" },
171 { TS2T_CHANNEL_PLAYERLIST
, "Channel Player List" },
172 { TS2T_CHANNELCHANGE
, "Channel Change" },
174 { TS2T_CHANNELLISTUPDATE
, "Channel List Update" },
175 { TS2T_PLAYERKICKED
, "Player Kicked" },
176 { TS2T_PLAYERLEFT
, "Player Left" },
177 { TS2T_NEWPLAYERJOINED
, "New Player Joined" },
178 { TS2T_KNOWNPLAYERUPDATE
, "Known Player Update" },
179 { TS2T_CHANNELDELETED
, "Channel Deleted" },
180 { TS2T_CHANNELNAMECHANGED
, "Channel Name Change" },
181 { TS2T_CHANNELTOPICCHANGED
, "Channel Topic Change" },
182 { TS2T_CHANNELPASSWORDCHANGED
, "Channel Password Change" },
183 { TS2T_CREATECHANNEL
, "Create Channel" },
184 { TS2T_DISCONNECT
, "Disconnect" },
185 { TS2T_SWITCHCHANNEL
, "Switch Channel"},
186 { TS2T_CHANGESTATUS
, "Change Status" },
188 { TS2T_CHATMESSAGEBOUNCE
, "Chat Message Bounce" },
190 { TS2T_VOICE_DATA_CELP_5_1
, "TS2T_VOICE_DATA_CELP_5_1" },
191 { TS2T_VOICE_DATA_CELP_6_3
, "TS2T_VOICE_DATA_CELP_6_3" },
192 { TS2T_VOICE_DATA_GSM_14_8
, "TS2T_VOICE_DATA_GSM_14_8" },
193 { TS2T_VOICE_DATA_GSM_16_4
, "TS2T_VOICE_DATA_GSM_16_4" },
194 { TS2T_VOICE_DATA_CELP_WINDOWS_5_2
, "TS2T_VOICE_DATA_CELP_WINDOWS_5_2" },
195 { TS2T_VOICE_DATA_SPEEX_3_4
, "TS2T_VOICE_DATA_SPEEX_3_4" },
196 { TS2T_VOICE_DATA_SPEEX_5_2
, "TS2T_VOICE_DATA_SPEEX_5_2" },
197 { TS2T_VOICE_DATA_SPEEX_7_2
, "TS2T_VOICE_DATA_SPEEX_7_2" },
198 { TS2T_VOICE_DATA_SPEEX_9_3
, "TS2T_VOICE_DATA_SPEEX_9_3" },
199 { TS2T_VOICE_DATA_SPEEX_12_3
, "TS2T_VOICE_DATA_SPEEX_12_3" },
200 { TS2T_VOICE_DATA_SPEEX_16_3
, "TS2T_VOICE_DATA_SPEEX_16_3" },
201 { TS2T_VOICE_DATA_SPEEX_19_5
, "TS2T_VOICE_DATA_SPEEX_19_5" },
202 { TS2T_VOICE_DATA_SPEEX_25_9
, "TS2T_VOICE_DATA_SPEEX_25_9" },
208 static const value_string codecnames
[] =
210 { TS2T_CODEC_CELP_5_1
, "CELP 5.1" },
211 { TS2T_CODEC_CELP_6_3
, "CELP 6.3" },
212 { TS2T_CODEC_GSM_14_8
, "GSM 14.8" },
213 { TS2T_CODEC_GSM_16_4
, "GSM 16.4" },
214 { TS2T_CODEC_CELP_WINDOWS_5_2
, "CELP Windows 5.2" },
215 { TS2T_CODEC_SPEEX_3_4
, "Speex 3.4" },
216 { TS2T_CODEC_SPEEX_5_2
, "Speex 5.2" },
217 { TS2T_CODEC_SPEEX_7_2
, "Speex 7.2" },
218 { TS2T_CODEC_SPEEX_9_3
, "Speex 9.3" },
219 { TS2T_CODEC_SPEEX_12_3
, "Speex 12.3" },
220 { TS2T_CODEC_SPEEX_16_3
, "Speex 16.3" },
221 { TS2T_CODEC_SPEEX_19_5
, "Speex 19.5" },
222 { TS2T_CODEC_SPEEX_25_9
, "Speex 25.9" },
226 #define TS2_PORT 8767
228 static int proto_ts2
= -1;
230 static int hf_ts2_type
= -1;
231 static int hf_ts2_class
= -1;
232 static int hf_ts2_clientid
= -1;
233 static int hf_ts2_sessionkey
= -1;
234 static int hf_ts2_crc32
= -1;
235 static int hf_ts2_ackto
= -1;
236 static int hf_ts2_seqnum
= -1;
237 static int hf_ts2_protocol_string
= -1;
238 /* static int hf_ts2_string = -1; */
239 static int hf_ts2_registeredlogin
= -1;
240 static int hf_ts2_name
= -1;
241 static int hf_ts2_password
= -1;
242 static int hf_ts2_nick
= -1;
243 static int hf_ts2_badlogin
= -1;
244 static int hf_ts2_unknown
= -1;
245 static int hf_ts2_channel
= -1;
246 static int hf_ts2_subchannel
= -1;
247 static int hf_ts2_channelpassword
= -1;
248 static int hf_ts2_emptyspace
= -1;
249 static int hf_ts2_fragmentnumber
= -1;
250 static int hf_ts2_platform_string
= -1;
251 static int hf_ts2_server_name
= -1;
252 static int hf_ts2_server_welcome_message
= -1;
253 static int hf_ts2_parent_channel_id
= -1;
254 static int hf_ts2_codec
= -1;
255 static int hf_ts2_channel_flags
= -1;
256 static int hf_ts2_channel_id
= -1;
257 static int hf_ts2_channel_name
= -1;
258 static int hf_ts2_channel_topic
= -1;
259 static int hf_ts2_channel_description
= -1;
260 static int hf_ts2_player_id
= -1;
261 static int hf_ts2_player_status_flags
= -1;
262 static int hf_ts2_number_of_players
= -1;
263 static int hf_ts2_number_of_channels
= -1;
264 static int hf_ts2_resend_count
= -1;
265 static int hf_ts2_status_channelcommander
= -1;
266 static int hf_ts2_status_blockwhispers
= -1;
267 static int hf_ts2_status_away
= -1;
268 static int hf_ts2_status_mutemicrophone
= -1;
269 static int hf_ts2_status_mute
= -1;
270 static int hf_ts2_channel_unregistered
= -1;
271 static int hf_ts2_channel_moderated
= -1;
272 static int hf_ts2_channel_password
= -1;
273 static int hf_ts2_channel_subchannels
= -1;
274 static int hf_ts2_channel_default
= -1;
275 static int hf_ts2_channel_order
= -1;
276 static int hf_ts2_max_users
= -1;
278 static gint ett_ts2
= -1;
279 static gint ett_ts2_channel_flags
= -1;
281 /* Conversation Variables */
284 guint32 last_inorder_server_frame
;
285 guint32 last_inorder_client_frame
;
288 guint32 server_frag_size
;
289 guint32 server_frag_num
;
290 guint32 client_frag_size
;
291 guint32 client_frag_num
;
295 /* Packet Variables */
304 #define my_init_count 5
306 static reassembly_table msg_reassembly_table
;
308 /* forward reference */
309 static gboolean
ts2_add_checked_crc32(proto_tree
*tree
, int hf_item
, tvbuff_t
*tvb
, guint16 offset
, guint32 icrc32
);
310 static void ts2_parse_playerlist(tvbuff_t
*tvb
, proto_tree
*ts2_tree
);
311 static void ts2_parse_channellist(tvbuff_t
*tvb
, proto_tree
*ts2_tree
);
312 static void ts2_parse_newplayerjoined(tvbuff_t
*tvb
, proto_tree
*ts2_tree
);
313 static void ts2_parse_knownplayerupdate(tvbuff_t
*tvb
, proto_tree
*ts2_tree
);
314 static void ts2_parse_playerleft(tvbuff_t
*tvb
, proto_tree
*ts2_tree
);
315 static void ts2_parse_loginend(tvbuff_t
*tvb
, proto_tree
*ts2_tree
);
316 static void ts2_parse_changestatus(tvbuff_t
*tvb
, proto_tree
*ts2_tree
);
317 static void ts2_parse_switchchannel(tvbuff_t
*tvb
, proto_tree
*ts2_tree
);
318 static void ts2_add_statusflags(tvbuff_t
*tvb
, proto_tree
*ts2_tree
, guint32 offset
);
319 static void ts2_parse_channelchange(tvbuff_t
*tvb
, proto_tree
*ts2_tree
);
320 static void ts2_parse_loginpart2(tvbuff_t
*tvb
, proto_tree
*ts2_tree
);
323 * Check if a packet is in order and if it is set its fragmentation details into the passed pointers.
324 * Returns TRUE if the packet is fragmented.
325 * Must be run sequentially
327 static gboolean
ts2_standard_find_fragments(tvbuff_t
*tvb
, guint32
*last_inorder_frame
, guint32
*frag_size
, guint32
*frag_num
, gboolean
*outoforder
)
331 frag_count
=tvb_get_letohs(tvb
, 18);
335 /* if last_inorder_frame is zero, then this is the first reliable packet */
336 if(*last_inorder_frame
==0)
338 *last_inorder_frame
=tvb_get_letohl(tvb
, 12);
339 *frag_size
=tvb_get_letohs(tvb
, 18);
346 /* This packet is in order */
347 else if(*last_inorder_frame
==tvb_get_letohl(tvb
, 12)-1)
351 *frag_num
=*frag_size
-frag_count
;
360 *frag_size
=tvb_get_letohs(tvb
, 18);
361 *frag_num
=*frag_size
-frag_count
;
367 *last_inorder_frame
=tvb_get_letohl(tvb
, 12);
369 else /* out of order */
377 * Dissect a standard (reliable) ts2 packet, reassembling if required.
379 static void ts2_standard_dissect(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*ts2_tree
, ts2_conversation
*conversation_data
)
381 guint8 save_fragmented
;
382 tvbuff_t
*new_tvb
, *next_tvb
;
383 fragment_head
*frag_msg
;
384 guint16 fragment_number
;
388 guint16 type
= tvb_get_letohs(tvb
, 2);
389 /*guint16 klass = tvb_get_letohs(tvb, 0);*/
390 proto_tree_add_item(ts2_tree
, hf_ts2_seqnum
, tvb
, 12, 4, ENC_LITTLE_ENDIAN
);
392 /* XXX: Following fragmentation stuff should be separate from the GUI stuff ?? */
393 /* Get our stored fragmentation data or create one! */
394 if ( ! ( frag
= (ts2_frag
*)p_get_proto_data(pinfo
->fd
, proto_ts2
, 0) ) ) {
395 frag
= wmem_new(wmem_file_scope(), ts2_frag
);
399 /* decide if the packet is server to client or client to server
400 * then check its fragmentation
402 if(!(pinfo
->fd
->flags
.visited
))
404 if(conversation_data
->server_port
== pinfo
->srcport
)
406 frag
->fragmented
= ts2_standard_find_fragments(tvb
, &conversation_data
->last_inorder_server_frame
, &conversation_data
->server_frag_size
, &conversation_data
->server_frag_num
, &outoforder
);
407 frag
->frag_num
=conversation_data
->server_frag_num
;
408 frag
->frag_size
=conversation_data
->server_frag_size
;
413 frag
->fragmented
= ts2_standard_find_fragments(tvb
, &conversation_data
->last_inorder_client_frame
, &conversation_data
->client_frag_size
, &conversation_data
->client_frag_num
, &outoforder
);
414 frag
->frag_num
=conversation_data
->client_frag_num
;
415 frag
->frag_size
=conversation_data
->client_frag_size
;
417 frag
->outoforder
=outoforder
;
418 p_add_proto_data(pinfo
->fd
, proto_ts2
, 0, frag
);
421 /* Get our stored fragmentation data */
422 frag
= (ts2_frag
*)p_get_proto_data(pinfo
->fd
, proto_ts2
, 0);
424 proto_tree_add_item(ts2_tree
, hf_ts2_resend_count
, tvb
, 16, 2, ENC_LITTLE_ENDIAN
);
425 proto_tree_add_item(ts2_tree
, hf_ts2_fragmentnumber
, tvb
, 18, 2, ENC_LITTLE_ENDIAN
);
426 ts2_add_checked_crc32(ts2_tree
, hf_ts2_crc32
, tvb
, 20, tvb_get_letohl(tvb
, 20));
428 /* Reassemble the packet if it's fragmented */
430 if(frag
&& frag
->fragmented
)
432 save_fragmented
= pinfo
->fragmented
;
434 pinfo
->fragmented
= TRUE
;
435 fragment_number
= tvb_get_letohs(tvb
, 18);
436 frag_msg
= fragment_add_seq_check(&msg_reassembly_table
, tvb
, 24, pinfo
, type
, NULL
, frag
->frag_num
, tvb_length_remaining(tvb
, 24), fragment_number
);
437 new_tvb
= process_reassembled_data(tvb
, 24, pinfo
,"Reassembled TeamSpeak2", frag_msg
, &msg_frag_items
, NULL
, ts2_tree
);
438 if (frag_msg
) /* XXX: should be if (new_tvb) ?? */
440 col_append_str(pinfo
->cinfo
, COL_INFO
, " (Message Reassembled)");
443 { /* Not last packet of reassembled Short Message */
444 col_append_fstr(pinfo
->cinfo
, COL_INFO
," (Message fragment %u)", frag
->frag_num
);
449 next_tvb
= tvb_new_subset_remaining(tvb
, 24);
450 pinfo
->fragmented
= save_fragmented
;
453 next_tvb
= tvb_new_subset_remaining(tvb
, 24);
455 /* If we have a full packet now dissect it */
456 if((new_tvb
|| !frag
->fragmented
) && !frag
->outoforder
)
460 case TS2T_LOGINPART2
:
461 ts2_parse_loginpart2(next_tvb
, ts2_tree
);
463 case TS2T_CHANNELLIST
:
464 ts2_parse_channellist(next_tvb
, ts2_tree
);
466 case TS2T_PLAYERLIST
:
467 ts2_parse_playerlist(next_tvb
, ts2_tree
);
469 case TS2T_NEWPLAYERJOINED
:
470 ts2_parse_newplayerjoined(next_tvb
, ts2_tree
);
472 case TS2T_KNOWNPLAYERUPDATE
:
473 ts2_parse_knownplayerupdate(next_tvb
, ts2_tree
);
475 case TS2T_PLAYERLEFT
:
476 ts2_parse_playerleft(next_tvb
, ts2_tree
);
478 case TS2T_PLAYERKICKED
:
479 ts2_parse_playerleft(next_tvb
, ts2_tree
);
482 ts2_parse_loginend(next_tvb
, ts2_tree
);
484 case TS2T_CHANGESTATUS
:
485 ts2_parse_changestatus(next_tvb
, ts2_tree
);
487 case TS2T_SWITCHCHANNEL
:
488 ts2_parse_switchchannel(next_tvb
, ts2_tree
);
490 case TS2T_CHANNELCHANGE
:
491 ts2_parse_channelchange(next_tvb
, ts2_tree
);
495 /* The packet is out of order, update the cinfo and ignore the packet */
497 col_append_str(pinfo
->cinfo
, COL_INFO
, " (Out Of Order, ignored)");
501 /* Parses a ts2 new player joined (TS2_NEWPLAYERJOINED) packet and adds it to the tree */
502 static void ts2_parse_newplayerjoined(tvbuff_t
*tvb
, proto_tree
*ts2_tree
)
506 proto_tree_add_item(ts2_tree
, hf_ts2_player_id
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
508 proto_tree_add_item(ts2_tree
, hf_ts2_channel_id
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
510 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, offset
, 6, ENC_NA
);
512 proto_tree_add_item(ts2_tree
, hf_ts2_nick
, tvb
, offset
, 1, ENC_ASCII
|ENC_NA
);
515 /* Parses TS2_LOGINEND packet and adds it to the tree */
516 static void ts2_parse_loginend(tvbuff_t
*tvb
, proto_tree
*ts2_tree
)
520 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, offset
, tvb_length_remaining(tvb
, offset
), ENC_NA
);
523 /* Parses a ts2 known player joined (TS2_KNOWNPLAYERUPDATE) packet and adds it to the tree */
524 static void ts2_parse_knownplayerupdate(tvbuff_t
*tvb
, proto_tree
*ts2_tree
)
528 proto_tree_add_item(ts2_tree
, hf_ts2_player_id
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
530 proto_tree_add_item(ts2_tree
, hf_ts2_player_status_flags
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
531 ts2_add_statusflags(tvb
, ts2_tree
, offset
);
534 /* Parses a ts2 switch channel (TS2_SWITCHCHANNEL) packet and adds it to the tree */
535 static void ts2_parse_switchchannel(tvbuff_t
*tvb
, proto_tree
*ts2_tree
)
539 proto_tree_add_item(ts2_tree
, hf_ts2_channel_id
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
541 proto_tree_add_item(ts2_tree
, hf_ts2_password
, tvb
, offset
, 1, ENC_ASCII
|ENC_NA
);
544 /* Parses a ts2 channel change (TS2T_CHANNELCHANGE) packet and adds it to the tree */
545 static void ts2_parse_channelchange(tvbuff_t
*tvb
, proto_tree
*ts2_tree
)
549 proto_tree_add_item(ts2_tree
, hf_ts2_player_id
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
551 proto_tree_add_item(ts2_tree
, hf_ts2_channel_id
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
553 proto_tree_add_item(ts2_tree
, hf_ts2_channel_id
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
555 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, offset
, 2, ENC_NA
);
559 /* Parses a ts2 change status (TS2_CHANGESTATUS) packet and adds it to the tree */
560 static void ts2_parse_changestatus(tvbuff_t
*tvb
, proto_tree
*ts2_tree
)
564 proto_tree_add_item(ts2_tree
, hf_ts2_player_status_flags
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
565 ts2_add_statusflags(tvb
, ts2_tree
, offset
);
569 /* Parses a ts2 known player left (TS2_PLAYERLEFT) packet and adds it to the tree */
570 static void ts2_parse_playerleft(tvbuff_t
*tvb
, proto_tree
*ts2_tree
)
574 proto_tree_add_item(ts2_tree
, hf_ts2_player_id
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
576 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, offset
, 4, ENC_NA
);
578 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, offset
, 4, ENC_NA
);
580 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, offset
, tvb_length_remaining(tvb
, offset
), ENC_NA
);
583 /* Parses a ts2 login part 2 (TS2T_LOGINPART2) packet and adds it to the tree */
584 static void ts2_parse_loginpart2(tvbuff_t
*tvb
, proto_tree
*ts2_tree
)
588 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, 0, 2, ENC_NA
);
590 proto_tree_add_item(ts2_tree
, hf_ts2_channel
, tvb
, offset
, 1, ENC_ASCII
|ENC_NA
);
592 proto_tree_add_item(ts2_tree
, hf_ts2_subchannel
, tvb
, offset
, 1, ENC_ASCII
|ENC_NA
);
594 proto_tree_add_item(ts2_tree
, hf_ts2_channelpassword
, tvb
, offset
, 1, ENC_ASCII
|ENC_NA
);
596 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, offset
, 4, ENC_NA
);
599 /* Parses a ts2 channel list (TS2T_CHANNELLIST) and adds it to the tree */
600 static void ts2_parse_channellist(tvbuff_t
*tvb
, proto_tree
*ts2_tree
)
608 proto_tree_add_item(ts2_tree
, hf_ts2_number_of_channels
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
610 while(offset
<tvb_length_remaining(tvb
, 0))
612 proto_tree_add_item(ts2_tree
, hf_ts2_channel_id
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
616 item
= proto_tree_add_item(ts2_tree
, hf_ts2_channel_flags
, tvb
, offset
, 1, ENC_LITTLE_ENDIAN
);
617 subtree
= proto_item_add_subtree(item
, ett_ts2_channel_flags
);
618 proto_tree_add_item(subtree
, hf_ts2_channel_unregistered
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
619 proto_tree_add_item(subtree
, hf_ts2_channel_moderated
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
620 proto_tree_add_item(subtree
, hf_ts2_channel_password
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
621 proto_tree_add_item(subtree
, hf_ts2_channel_subchannels
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
622 proto_tree_add_item(subtree
, hf_ts2_channel_default
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
625 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, offset
, 1, ENC_NA
);
627 proto_tree_add_item(ts2_tree
, hf_ts2_codec
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
629 proto_tree_add_item(ts2_tree
, hf_ts2_parent_channel_id
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
631 proto_tree_add_item(ts2_tree
, hf_ts2_channel_order
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
633 proto_tree_add_item(ts2_tree
, hf_ts2_max_users
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
635 tvb_get_stringz(wmem_packet_scope(), tvb
, offset
, &string_len
);
636 proto_tree_add_item(ts2_tree
, hf_ts2_channel_name
, tvb
, offset
,string_len
, ENC_ASCII
|ENC_NA
);
638 tvb_get_stringz(wmem_packet_scope(), tvb
, offset
, &string_len
);
639 proto_tree_add_item(ts2_tree
, hf_ts2_channel_topic
, tvb
, offset
,string_len
,ENC_ASCII
|ENC_NA
);
641 tvb_get_stringz(wmem_packet_scope(), tvb
, offset
, &string_len
);
642 proto_tree_add_item(ts2_tree
, hf_ts2_channel_description
, tvb
, offset
,string_len
, ENC_ASCII
|ENC_NA
);
647 static void ts2_add_statusflags(tvbuff_t
*tvb
, proto_tree
*ts2_tree
, guint32 offset
)
649 proto_tree_add_item(ts2_tree
, hf_ts2_status_channelcommander
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
650 proto_tree_add_item(ts2_tree
, hf_ts2_status_blockwhispers
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
651 proto_tree_add_item(ts2_tree
, hf_ts2_status_away
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
652 proto_tree_add_item(ts2_tree
, hf_ts2_status_mutemicrophone
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
653 proto_tree_add_item(ts2_tree
, hf_ts2_status_mute
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
657 /* Parses a ts2 player list (TS2T_PLAYERLIST) and adds it to the tree */
658 static void ts2_parse_playerlist(tvbuff_t
*tvb
, proto_tree
*ts2_tree
)
661 gint32 number_of_players
;
665 proto_tree_add_item(ts2_tree
, hf_ts2_number_of_players
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
666 number_of_players
= tvb_get_letohl(tvb
, 0);
668 while(offset
<tvb_length_remaining(tvb
, 0) && x
<number_of_players
)
670 proto_tree_add_item(ts2_tree
, hf_ts2_player_id
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
672 proto_tree_add_item(ts2_tree
, hf_ts2_channel_id
, tvb
, offset
, 4, ENC_LITTLE_ENDIAN
);
674 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, offset
, 4, ENC_NA
);
676 proto_tree_add_item(ts2_tree
, hf_ts2_player_status_flags
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
677 ts2_add_statusflags(tvb
, ts2_tree
, offset
);
679 proto_tree_add_item(ts2_tree
, hf_ts2_nick
, tvb
, offset
, 1, ENC_ASCII
|ENC_NA
);
683 proto_tree_add_item(ts2_tree
, hf_ts2_emptyspace
, tvb
, offset
, tvb_length_remaining(tvb
, 0), ENC_NA
);
688 /* Find the current conversation or make a new one if required */
689 static ts2_conversation
* ts2_get_conversation(packet_info
*pinfo
)
691 conversation_t
*conversation
;
692 ts2_conversation
*conversation_data
;
693 conversation
= find_conversation(pinfo
->fd
->num
, &pinfo
->src
, &pinfo
->dst
, pinfo
->ptype
, pinfo
->srcport
, pinfo
->destport
, 0);
696 conversation_data
= (ts2_conversation
*)conversation_get_proto_data(conversation
, proto_ts2
);
700 conversation_data
= wmem_new(wmem_file_scope(), ts2_conversation
);
701 conversation_data
->last_inorder_server_frame
=0; /* sequence number should never be zero so we can use this as an initial number */
702 conversation_data
->last_inorder_client_frame
=0;
703 conversation_data
->server_port
=pinfo
->srcport
;
704 conversation_data
->server_frag_size
=0;
705 conversation_data
->server_frag_num
=0;
706 conversation_data
->client_frag_size
=0;
707 conversation_data
->client_frag_num
=0;
708 conversation
= conversation_new(pinfo
->fd
->num
, &pinfo
->src
, &pinfo
->dst
, pinfo
->ptype
, pinfo
->srcport
, pinfo
->destport
, 0);
709 conversation_add_proto_data(conversation
, proto_ts2
, (void *)conversation_data
);
711 return conversation_data
;
716 /* Dissect a TS2 packet */
717 static void dissect_ts2(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
719 ts2_conversation
*conversation_data
;
720 guint16 type
= tvb_get_letohs(tvb
, 2);
721 guint16 klass
= tvb_get_letohs(tvb
, 0);
723 conversation_data
= ts2_get_conversation(pinfo
);
725 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "TS2");
728 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "Class: %s", val_to_str(klass
, classnames
, "Unknown (0x%02x)"));
730 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "Type: %s, Class: %s", val_to_str(type
, typenames
, "Unknown (0x%02x)"), val_to_str(klass
, classnames
, "Unknown (0x%02x)"));
732 /* XXX: We need to do all the non GUI stuff whether or not if(tree) */
733 /* Do only once by checking visited ? */
734 /* ToDo: Rewrite ?? */
737 case TS2C_CONNECTION
:
739 case TS2T_LOGINREQUEST
:
740 conversation_data
->server_port
=pinfo
->destport
;
741 conversation_data
->server_addr
=pinfo
->dst
;
746 ts2_standard_dissect(tvb
, pinfo
, tree
, conversation_data
);
751 if (tree
) { /* we are being asked for details */
752 proto_item
*ti
= NULL
;
753 proto_tree
*ts2_tree
= NULL
;
755 ti
= proto_tree_add_item(tree
, proto_ts2
, tvb
, 0, -1, ENC_NA
);
756 ts2_tree
= proto_item_add_subtree(ti
, ett_ts2
);
758 proto_tree_add_item(ts2_tree
, hf_ts2_class
, tvb
, 0, 2, ENC_LITTLE_ENDIAN
);
760 proto_tree_add_item(ts2_tree
, hf_ts2_resend_count
, tvb
, 2, 2, ENC_LITTLE_ENDIAN
);
762 proto_tree_add_item(ts2_tree
, hf_ts2_type
, tvb
, 2, 2, ENC_LITTLE_ENDIAN
);
764 proto_tree_add_item(ts2_tree
, hf_ts2_sessionkey
, tvb
, 4, 4, ENC_LITTLE_ENDIAN
);
765 proto_tree_add_item(ts2_tree
, hf_ts2_clientid
, tvb
, 8, 4, ENC_LITTLE_ENDIAN
);
768 case TS2C_CONNECTION
:
769 proto_tree_add_item(ts2_tree
, hf_ts2_seqnum
, tvb
, 12, 4, ENC_LITTLE_ENDIAN
);
770 ts2_add_checked_crc32(ts2_tree
, hf_ts2_crc32
, tvb
, 16, tvb_get_letohl(tvb
, 16));
777 proto_tree_add_item(ts2_tree
, hf_ts2_ackto
, tvb
, 20, 4, ENC_LITTLE_ENDIAN
);
779 case TS2T_LOGINREQUEST
:
780 proto_tree_add_item(ts2_tree
, hf_ts2_protocol_string
, tvb
, 20, 1, ENC_ASCII
|ENC_NA
);
781 proto_tree_add_item(ts2_tree
, hf_ts2_platform_string
, tvb
, 50, 1, ENC_ASCII
|ENC_NA
);
782 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, 80, 9, ENC_NA
);
783 proto_tree_add_item(ts2_tree
, hf_ts2_registeredlogin
, tvb
, 90, 1, ENC_LITTLE_ENDIAN
);
784 proto_tree_add_item(ts2_tree
, hf_ts2_name
, tvb
, 90, 1, ENC_ASCII
|ENC_NA
);
785 proto_tree_add_item(ts2_tree
, hf_ts2_password
, tvb
, 120, 1, ENC_ASCII
|ENC_NA
);
786 proto_tree_add_item(ts2_tree
, hf_ts2_nick
, tvb
, 150, 1, ENC_ASCII
|ENC_NA
);
788 conversation_data
->server_port
=pinfo
->destport
;
789 conversation_data
->server_addr
=pinfo
->dst
;
792 case TS2T_LOGINREPLY
:
793 proto_tree_add_item(ts2_tree
, hf_ts2_server_name
, tvb
, 20, 1, ENC_ASCII
|ENC_NA
);
794 proto_tree_add_item(ts2_tree
, hf_ts2_platform_string
, tvb
, 50, 1, ENC_ASCII
|ENC_NA
);
795 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, 80, 9, ENC_NA
);
796 proto_tree_add_item(ts2_tree
, hf_ts2_badlogin
, tvb
, 89, 3, ENC_LITTLE_ENDIAN
);
797 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, 92, 80, ENC_NA
);
798 proto_tree_add_item(ts2_tree
, hf_ts2_sessionkey
, tvb
, 172, 4, ENC_LITTLE_ENDIAN
);
799 proto_tree_add_item(ts2_tree
, hf_ts2_unknown
, tvb
, 178, 3, ENC_NA
);
800 proto_tree_add_item(ts2_tree
, hf_ts2_server_welcome_message
, tvb
, 180, 1, ENC_ASCII
|ENC_NA
);
805 /* Ignore the type for ACK, it's always zero and clashes with CELP_5_1 */
807 proto_tree_add_item(ts2_tree
, hf_ts2_seqnum
, tvb
, 12, 4, ENC_LITTLE_ENDIAN
);
810 ts2_standard_dissect(tvb
, pinfo
, ts2_tree
, conversation_data
);
818 /* Calculates a CRC32 checksum from the tvb zeroing out four bytes at the offset and checks it with the given crc32 and adds the result to the tree
819 * Returns true if the calculated CRC32 matches the passed CRC32.
821 static gboolean
ts2_add_checked_crc32(proto_tree
*tree
, int hf_item
, tvbuff_t
*tvb
, guint16 offset
, guint32 icrc32
)
827 zero
= (guint8
*)wmem_alloc0(wmem_packet_scope(), 4);
828 ocrc32
= crc32_ccitt_tvb(tvb
, offset
);
829 ocrc32
= crc32_ccitt_seed(zero
, 4, 0xffffffff-ocrc32
);
830 len
= tvb_reported_length_remaining(tvb
, offset
+4);
833 ocrc32
= crc32_ccitt_tvb_offset_seed(tvb
, offset
+4, (guint
)len
, 0xffffffff-ocrc32
);
836 proto_tree_add_uint_format(tree
, hf_item
, tvb
, offset
, 4, tvb_get_letohl(tvb
, 16), "crc32: 0x%04x [correct]", tvb_get_letohl(tvb
, offset
));
841 proto_tree_add_uint_format(tree
, hf_item
, tvb
, offset
, 4, tvb_get_letohl(tvb
,16), "crc32: 0x%04x [incorrect, should be 0x%04x]", tvb_get_letohl(tvb
, offset
),ocrc32
);
846 static void ts2_init(void)
848 reassembly_table_init(&msg_reassembly_table
,
849 &addresses_reassembly_table_functions
);
853 * proto_register_ts2()
855 void proto_register_ts2(void)
857 static hf_register_info hf
[] = {
859 { "Class", "ts2.class",
861 VALS(classnames
), 0x0,
865 { "Type", "ts2.type",
867 VALS(typenames
), 0x0,
871 { "Client id", "ts2.clientid",
876 { &hf_ts2_sessionkey
,
877 { "Session Key", "ts2.sessionkey",
883 { "Ping Reply To", "ts2.ping_ackto",
889 { "CRC32 Checksum", "ts2.crc32",
895 { "Sequence Number", "ts2.sequencenum",
900 { &hf_ts2_protocol_string
,
901 { "Protocol String", "ts2.protocolstring",
902 FT_UINT_STRING
, BASE_NONE
,
908 { "String", "ts2.string",
909 FT_STRING
, BASE_NONE
,
914 { &hf_ts2_registeredlogin
,
915 { "Registered Login", "ts2.registeredlogin",
916 FT_BOOLEAN
, BASE_NONE
,
921 { "Name", "ts2.name",
922 FT_UINT_STRING
, BASE_NONE
,
927 { "Password", "ts2.password",
928 FT_UINT_STRING
, BASE_NONE
,
933 { "Nick", "ts2.nick",
934 FT_UINT_STRING
, BASE_NONE
,
939 { "Bad Login", "ts2.badlogin",
940 FT_BOOLEAN
, BASE_NONE
,
945 { "Unknown", "ts2.unknown",
951 { "Channel", "ts2.channel",
952 FT_UINT_STRING
, BASE_NONE
,
956 { &hf_ts2_subchannel
,
957 { "Sub-Channel", "ts2.subchannel",
958 FT_UINT_STRING
, BASE_NONE
,
962 { &hf_ts2_channelpassword
,
963 { "Channel Password", "ts2.channelpassword",
964 FT_UINT_STRING
, BASE_NONE
,
968 { &hf_ts2_emptyspace
,
969 { "Empty Space", "ts2.emptyspace",
974 { &hf_ts2_fragmentnumber
,
975 { "Fragment Number", "ts2.fragmentnumber",
980 { &hf_ts2_platform_string
,
981 { "Platform String", "ts2.platformstring",
982 FT_UINT_STRING
, BASE_NONE
,
986 { &hf_ts2_server_name
,
987 { "Server Name", "ts2.servername",
988 FT_UINT_STRING
, BASE_NONE
,
992 { &hf_ts2_server_welcome_message
,
993 { "Server Welcome Message", "ts2.serverwelcomemessage",
994 FT_UINT_STRING
, BASE_NONE
,
998 { &hf_ts2_parent_channel_id
,
999 { "Parent Channel ID", "ts2.parentchannelid",
1000 FT_UINT32
, BASE_HEX
,
1005 { "Codec", "ts2.codec",
1006 FT_UINT16
, BASE_HEX
,
1007 VALS(codecnames
), 0x0,
1010 { &hf_ts2_channel_flags
,
1011 { "Channel Flags", "ts2.channelflags",
1016 { &hf_ts2_channel_id
,
1017 { "Channel Id", "ts2.chanelid",
1018 FT_UINT32
, BASE_DEC
,
1022 { &hf_ts2_channel_name
,
1023 { "Channel Name", "ts2.chanelname",
1024 FT_STRINGZ
, BASE_NONE
,
1028 { &hf_ts2_channel_topic
,
1029 { "Channel Topic", "ts2.chaneltopic",
1030 FT_STRINGZ
, BASE_NONE
,
1034 { &hf_ts2_channel_description
,
1035 { "Channel Description", "ts2.chaneldescription",
1036 FT_STRINGZ
, BASE_NONE
,
1040 { &hf_ts2_player_id
,
1041 { "Player Id", "ts2.playerid",
1042 FT_UINT32
, BASE_DEC
,
1046 { &hf_ts2_player_status_flags
,
1047 { "Player Status Flags", "ts2.playerstatusflags",
1048 FT_UINT16
, BASE_DEC
,
1052 { &hf_ts2_number_of_players
,
1053 { "Number Of Players", "ts2.numberofplayers",
1054 FT_UINT32
, BASE_DEC
,
1058 { &hf_ts2_number_of_channels
,
1059 { "Number Of Channels", "ts2.numberofchannels",
1060 FT_UINT32
, BASE_DEC
,
1064 { &hf_ts2_resend_count
,
1065 { "Resend Count", "ts2.resendcount",
1066 FT_UINT16
, BASE_DEC
,
1070 { &hf_ts2_status_channelcommander
,
1071 { "Channel Commander", "ts2.playerstatusflags.channelcommander",
1073 NULL
, TS2_STATUS_CHANNELCOMMANDER
,
1076 { &hf_ts2_status_blockwhispers
,
1077 { "Block Whispers", "ts2.playerstatusflags.blockwhispers",
1079 NULL
, TS2_STATUS_BLOCKWHISPERS
,
1082 { &hf_ts2_status_away
,
1083 { "Away", "ts2.playerstatusflags.away",
1085 NULL
, TS2_STATUS_AWAY
,
1088 { &hf_ts2_status_mutemicrophone
,
1089 { "Mute Microphone", "ts2.playerstatusflags.mutemicrophone",
1091 NULL
, TS2_STATUS_MUTEMICROPHONE
,
1094 { &hf_ts2_status_mute
,
1095 { "Mute", "ts2.playerstatusflags.mute",
1097 NULL
, TS2_STATUS_MUTE
,
1100 { &hf_msg_fragments
,
1101 {"Message fragments", "ts2.fragments",
1107 {"Message fragment", "ts2.fragment",
1108 FT_FRAMENUM
, BASE_NONE
,
1112 { &hf_msg_fragment_overlap
,
1113 {"Message fragment overlap", "ts2.fragment.overlap",
1114 FT_BOOLEAN
, BASE_NONE
,
1118 { &hf_msg_fragment_overlap_conflicts
,
1119 {"Message fragment overlapping with conflicting data",
1120 "ts2.fragment.overlap.conflicts",
1121 FT_BOOLEAN
, BASE_NONE
,
1125 { &hf_msg_fragment_multiple_tails
,
1126 {"Message has multiple tail fragments",
1127 "ts2.fragment.multiple_tails",
1128 FT_BOOLEAN
, BASE_NONE
,
1132 { &hf_msg_fragment_too_long_fragment
,
1133 {"Message fragment too long", "ts2.fragment.too_long_fragment",
1134 FT_BOOLEAN
, BASE_NONE
,
1138 { &hf_msg_fragment_error
,
1139 {"Message defragmentation error", "ts2.fragment.error",
1140 FT_FRAMENUM
, BASE_NONE
,
1144 { &hf_msg_fragment_count
,
1145 {"Message fragment count", "ts2.fragment.count",
1146 FT_UINT32
, BASE_DEC
,
1150 { &hf_msg_reassembled_in
,
1151 {"Reassembled in", "ts2.reassembled.in",
1152 FT_FRAMENUM
, BASE_NONE
,
1156 { &hf_msg_reassembled_length
,
1157 {"Reassembled TeamSpeak2 length", "ts2.reassembled.length",
1158 FT_UINT32
, BASE_DEC
,
1162 { &hf_ts2_channel_unregistered
,
1163 { "Unregistered", "ts2.channelflags.unregistered",
1168 { &hf_ts2_channel_moderated
,
1169 { "Moderated", "ts2.channelflags.moderated",
1174 { &hf_ts2_channel_password
,
1175 { "Has password", "ts2.channelflags.has_password",
1180 { &hf_ts2_channel_subchannels
,
1181 { "Has subchannels", "ts2.channelflags.has_subchannels",
1186 { &hf_ts2_channel_default
,
1187 { "Default", "ts2.channelflags.default",
1192 { &hf_ts2_channel_order
,
1193 { "Channel order", "ts2.channelorder",
1194 FT_UINT16
, BASE_DEC
,
1198 { &hf_ts2_max_users
,
1199 { "Max users", "ts2.maxusers",
1200 FT_UINT16
, BASE_DEC
,
1206 static gint
*ett
[] = {
1210 &ett_ts2_channel_flags
1213 /* Setup protocol subtree array */
1214 proto_ts2
= proto_register_protocol (
1215 "Teamspeak2 Protocol", /* name */
1216 "TeamSpeak2", /* short name */
1219 proto_register_field_array(proto_ts2
, hf
, array_length(hf
));
1220 proto_register_subtree_array(ett
, array_length(ett
));
1222 register_init_routine(ts2_init
);
1226 * proto_reg_handoff_ts2()
1228 void proto_reg_handoff_ts2(void)
1230 dissector_handle_t ts2_handle
;
1231 ts2_handle
= create_dissector_handle(dissect_ts2
, proto_ts2
);
1232 dissector_add_uint("udp.port", TS2_PORT
, ts2_handle
);
1236 * Editor modelines - http://www.wireshark.org/tools/modelines.html
1241 * indent-tabs-mode: nil
1244 * vi: set shiftwidth=4 tabstop=8 expandtab:
1245 * :indentSize=4:tabSize=8:noTabs=true: