Coverage Report

Created: 2026-06-30 07:22

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-ms-mms.c
Line
Count
Source
1
/* packet-ms-mms.c
2
 *
3
 * Routines for MicroSoft MMS (Microsoft Media Server) message dissection
4
 *
5
 * See
6
 *
7
 *    https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-mmsp
8
 *
9
 * for the [MS-MMSP] specification.
10
 *
11
 * Copyright 2005
12
 * Written by Martin Mathieson
13
 *
14
 * Wireshark - Network traffic analyzer
15
 * By Gerald Combs <gerald@wireshark.org>
16
 * Copyright 1998 Gerald Combs
17
 *
18
 * SPDX-License-Identifier: GPL-2.0-or-later
19
 */
20
21
/* Information sources:
22
 * sdp.ppona.com
23
 */
24
25
#include "config.h"
26
27
#include <stdio.h>      /* for sscanf() */
28
29
#include <epan/packet.h>
30
#include <epan/conversation.h>
31
#include <epan/strutil.h>
32
33
static dissector_handle_t msmms_handle;
34
static int                proto_msmms;
35
36
37
/* Command fields */
38
static int    hf_msmms_command;
39
static int    hf_msmms_command_common_header;
40
/* static int    hf_msmms_command_version; */
41
static int    hf_msmms_command_signature;
42
static int    hf_msmms_command_length;
43
static int    hf_msmms_command_protocol_type;
44
static int    hf_msmms_command_length_remaining;
45
static int    hf_msmms_command_sequence_number;
46
static int    hf_msmms_command_timestamp;
47
static int    hf_msmms_command_length_remaining2;
48
static int    hf_msmms_command_to_client_id;
49
static int    hf_msmms_command_to_server_id;
50
static int    hf_msmms_command_direction;
51
52
static int    hf_msmms_command_prefix1;
53
static int    hf_msmms_command_prefix1_error;
54
static int    hf_msmms_command_prefix1_command_level;
55
static int    hf_msmms_command_prefix2;
56
57
static int    hf_msmms_command_client_transport_info;
58
static int    hf_msmms_command_client_player_info;
59
60
static int    hf_msmms_command_server_version;
61
static int    hf_msmms_command_tool_version;
62
static int    hf_msmms_command_update_url;
63
static int    hf_msmms_command_password_type;
64
65
static int    hf_msmms_command_server_version_length;
66
static int    hf_msmms_command_tool_version_length;
67
static int    hf_msmms_command_update_url_length;
68
static int    hf_msmms_command_password_type_length;
69
70
static int    hf_msmms_command_number_of_words;
71
static int    hf_msmms_command_client_id;
72
static int    hf_msmms_command_server_file;
73
74
static int    hf_msmms_command_result_flags;
75
76
static int    hf_msmms_command_broadcast_indexing;
77
static int    hf_msmms_command_broadcast_liveness;
78
79
static int    hf_msmms_command_recorded_media_length;
80
static int    hf_msmms_command_media_packet_length;
81
82
static int    hf_msmms_command_strange_string;
83
84
static int    hf_msmms_command_stream_structure_count;
85
static int    hf_msmms_stream_selection_flags;
86
static int    hf_msmms_stream_selection_stream_id;
87
static int    hf_msmms_stream_selection_action;
88
89
static int    hf_msmms_command_header_packet_id_type;
90
91
92
/* Data fields */
93
static int    hf_msmms_data;
94
static int    hf_msmms_data_sequence_number;
95
static int    hf_msmms_data_packet_id_type;
96
static int    hf_msmms_data_udp_sequence;
97
static int    hf_msmms_data_tcp_flags;
98
static int    hf_msmms_data_packet_length;
99
100
static int    hf_msmms_data_header_id;
101
static int    hf_msmms_data_client_id;
102
static int    hf_msmms_data_command_id;
103
static int    hf_msmms_data_packet_to_resend;
104
105
static int    hf_msmms_data_timing_pair;
106
static int    hf_msmms_data_timing_pair_seqno;
107
static int    hf_msmms_data_timing_pair_flags;
108
static int    hf_msmms_data_timing_pair_id;
109
static int    hf_msmms_data_timing_pair_flag;
110
static int    hf_msmms_data_timing_pair_packet_length;
111
112
static int    hf_msmms_data_unparsed;
113
114
115
/* Subtrees */
116
static int    ett_msmms_command;
117
static int    ett_msmms_command_common_header;
118
static int    ett_msmms_data;
119
static int    ett_msmms_data_timing_packet_pair;
120
121
41
#define MSMMS_PORT 1755
122
123
124
/* Known command IDs */
125
0
#define SERVER_COMMAND_CONNECT_INFO                0x01
126
0
#define SERVER_COMMAND_TRANSPORT_INFO              0x02
127
#define SERVER_COMMAND_PROTOCOL_SELECTION_ERROR    0x03
128
0
#define SERVER_COMMAND_REQUEST_SERVER_FILE         0x05
129
0
#define SERVER_COMMAND_START_SENDING_FROM          0x07
130
0
#define SERVER_COMMAND_STOP_BUTTON_PRESSED         0x09
131
0
#define SERVER_COMMAND_CANCEL_PROTOCOL             0x0d
132
0
#define SERVER_COMMAND_HEADER_REQUEST              0x15
133
0
#define SERVER_COMMAND_TIMING_TEST_DATA_REQUEST    0x18
134
#define SERVER_COMMAND_AUTHENTICATION_RESPONSE     0x1a
135
0
#define SERVER_COMMAND_NETWORK_TIMER_TEST_RESPONSE 0x1b
136
#define SERVER_COMMAND_ACTIVATE_FF_RW_BUTTONS      0x28
137
#define SERVER_COMMAND_HAVE_STOPPED_PLAYING        0x30
138
#define SERVER_COMMAND_LOCAL_COMPUTER_DETAILS      0x32
139
0
#define SERVER_COMMAND_MEDIA_STREAM_MBR_SELECTOR   0x33
140
141
static const value_string to_server_command_vals[] =
142
{
143
    { SERVER_COMMAND_CONNECT_INFO,                "Connect info" },
144
    { SERVER_COMMAND_TRANSPORT_INFO,              "Transport info" },
145
    { SERVER_COMMAND_PROTOCOL_SELECTION_ERROR,    "Protocol selection error" },
146
    { SERVER_COMMAND_REQUEST_SERVER_FILE,         "Request server file"  },
147
    { SERVER_COMMAND_START_SENDING_FROM,          "Start sending from:" },
148
    { SERVER_COMMAND_STOP_BUTTON_PRESSED,         "Stop button pressed" },
149
    { SERVER_COMMAND_CANCEL_PROTOCOL,             "Cancel protocol" },
150
    { SERVER_COMMAND_HEADER_REQUEST,              "Header request" },
151
    { SERVER_COMMAND_TIMING_TEST_DATA_REQUEST,    "Timing test data request" },
152
    { SERVER_COMMAND_AUTHENTICATION_RESPONSE,     "Authentication response" },
153
    { SERVER_COMMAND_NETWORK_TIMER_TEST_RESPONSE, "Network timer test response" },
154
    { SERVER_COMMAND_ACTIVATE_FF_RW_BUTTONS,      "Activate FF/Rewind buttons" },
155
    { SERVER_COMMAND_HAVE_STOPPED_PLAYING,        "Have stopped playing" },
156
    { SERVER_COMMAND_LOCAL_COMPUTER_DETAILS,      "Local computer details" },
157
    { SERVER_COMMAND_MEDIA_STREAM_MBR_SELECTOR,   "Media Stream MBR selector" },
158
    { 0,      NULL }
159
};
160
161
162
0
#define CLIENT_COMMAND_SERVER_INFO                0x01
163
0
#define CLIENT_COMMAND_TRANSPORT_INFO_ACK         0x02
164
#define CLIENT_COMMAND_PROTOCOL_SELECTION_ERROR   0x03
165
#define CLIENT_COMMAND_SENDING_MEDIA_FILE_NOW     0x05
166
0
#define CLIENT_COMMAND_MEDIA_DETAILS              0x06
167
#define CLIENT_COMMAND_FF_RW                      0x0a
168
0
#define CLIENT_COMMAND_SENDING_HEADER_RESPONSE    0x11
169
0
#define CLIENT_COMMAND_TIMING_TEST_DATA_RESPONSE  0x15
170
#define CLIENT_COMMAND_TIMING_TEST_DATA_REQUEST   0x18
171
#define CLIENT_COMMAND_AUTHENTICATION_CHALLENGE   0x1a
172
#define CLIENT_COMMAND_NETWORK_TIMER_TEST         0x1b
173
#define CLIENT_COMMAND_END_OF_MEDIA_STREAM        0x1e
174
#define CLIENT_COMMAND_MEDIA_CHANGING_INDICATOR   0x20
175
#define CLIENT_COMMAND_STREAM_SELECTION_INDICATOR 0x21
176
177
static const value_string to_client_command_vals[] =
178
{
179
    { CLIENT_COMMAND_SERVER_INFO,                "Server info" },
180
    { CLIENT_COMMAND_TRANSPORT_INFO_ACK,         "Transport info ack" },
181
    { CLIENT_COMMAND_PROTOCOL_SELECTION_ERROR,   "Protocol selection error" },
182
    { CLIENT_COMMAND_SENDING_MEDIA_FILE_NOW,     "Sending media file now"  },
183
    { CLIENT_COMMAND_MEDIA_DETAILS,              "Media details"  },
184
    { CLIENT_COMMAND_FF_RW,                      "FF/Rewind" },
185
    { CLIENT_COMMAND_SENDING_HEADER_RESPONSE,    "Sending header response" },
186
    { CLIENT_COMMAND_TIMING_TEST_DATA_RESPONSE,  "Timing test data response" },
187
    { CLIENT_COMMAND_TIMING_TEST_DATA_REQUEST,   "Timing test data request" },
188
    { CLIENT_COMMAND_AUTHENTICATION_CHALLENGE,   "Authentication challenge" },
189
    { CLIENT_COMMAND_NETWORK_TIMER_TEST,         "Network timer test" },
190
    { CLIENT_COMMAND_END_OF_MEDIA_STREAM,        "End of media stream" },
191
    { CLIENT_COMMAND_MEDIA_CHANGING_INDICATOR,   "Media changing indicator" },
192
    { CLIENT_COMMAND_STREAM_SELECTION_INDICATOR, "Stream selection indicator" },
193
    { 0,      NULL }
194
};
195
196
/* Command direction */
197
198
0
#define  TO_SERVER      0x0003
199
#define  TO_CLIENT      0x0004
200
201
static const value_string command_direction_vals[] =
202
{
203
    { TO_SERVER,  "To Server"},
204
    { TO_CLIENT,  "To Client"},
205
    { 0, NULL }
206
};
207
208
static const value_string tcp_flags_vals[] =
209
{
210
    { 0x00,     "Middle of packet series" },
211
    { 0x04,     "First packet of a packet series" },
212
    { 0x08,     "Last packet of a packet series" },
213
    { 0x0C,     "There is only one packet in this series"  },
214
    { 0x10,     "UDP packet pair timing packet" },
215
    { 0,        NULL }
216
};
217
218
static const value_string media_result_flags_vals[] =
219
{
220
    { 0x01,  "Media file name was accepted (no auth)"},
221
    { 0x02,  "Authentication for this media was accepted (BASIC auth)"},
222
    { 0x03,  "Authentication accepted (NTLM auth)"},
223
    { 0, NULL }
224
};
225
226
static const value_string broadcast_indexing_vals[] =
227
{
228
    { 0x00,  "No indexed seeking (live or no video streams)"},
229
    { 0x80,  "Indexed seeking (video streams available)"},
230
    { 0, NULL }
231
};
232
233
static const value_string broadcast_liveness_vals[] =
234
{
235
    { 0x01,  "Pre-recorded broadcast"},
236
    { 0x02,  "Live broadcast"},
237
    { 0x42,  "Presentation which includes a script command"},
238
    { 0, NULL }
239
};
240
241
static const value_string stream_selection_action_vals[] =
242
{
243
    { 0x00,  "Stream at full frame rate"},
244
    { 0x01,  "Only stream key frames"},
245
    { 0x02,  "No stream, switch it off"},
246
    { 0, NULL }
247
};
248
249
250
/* Server to client error codes */
251
static const value_string server_to_client_error_vals[] =
252
{
253
    { 0x00000000,  "OK"},
254
    { 0xC00D001A,  "File was not found"},
255
    { 0xC00D000E,  "The network is busy"},
256
    { 0xC00D000F,  "Too many connection sessions to server exist, cannot connect"},
257
    { 0xC00D0029,  "The network has failed - connection was lost"},
258
    { 0xC00D0034,  "There is no more data in the stream (UDP)"},
259
    { 0x80070005,  "You do not have access to the location or file"},
260
    { 0xC00D0013,  "There was no timely response from the server"},
261
    { 0x80070057,  "A parameter in the location is incorrect"},
262
    { 0x8000FFFF,  "File failed to open"},
263
    { 0, NULL }
264
};
265
266
267
268
269
/*************************/
270
/* Function declarations */
271
void proto_register_msmms(void);
272
void proto_reg_handoff_msmms_command(void);
273
274
static int dissect_msmms_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
275
static int dissect_msmms_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
276
static int dissect_msmms_data_udp_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
277
278
static void dissect_client_transport_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
279
                                          unsigned offset, unsigned length_remaining);
280
static void dissect_server_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
281
                                unsigned offset);
282
static void dissect_client_player_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
283
                                       unsigned offset, unsigned length_remaining);
284
static void dissect_start_sending_from_info(tvbuff_t *tvb, proto_tree *tree, unsigned offset);
285
static void dissect_cancel_info(tvbuff_t *tvb, proto_tree *tree, unsigned offset);
286
static void dissect_timing_test_request(tvbuff_t *tvb, proto_tree *tree, unsigned offset);
287
static void dissect_timing_test_response(tvbuff_t *tvb, proto_tree *tree, unsigned offset);
288
static void dissect_request_server_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
289
                                        unsigned offset, unsigned length_remaining);
290
static void dissect_media_details(tvbuff_t *tvb, proto_tree *tree, unsigned offset);
291
static void dissect_header_response(tvbuff_t *tvb, proto_tree *tree, unsigned offset);
292
static void dissect_network_timer_test_response(tvbuff_t *tvb, proto_tree *tree, unsigned offset);
293
static void dissect_transport_info_response(tvbuff_t *tvb, proto_tree *tree, unsigned offset,
294
                                            unsigned length_remaining);
295
static void dissect_media_stream_mbr_selector(tvbuff_t *tvb, proto_tree *tree, unsigned offset);
296
static void dissect_header_request(tvbuff_t *tvb, proto_tree *tree, unsigned offset);
297
static void dissect_stop_button_pressed(tvbuff_t *tvb, proto_tree *tree, unsigned offset);
298
299
static void msmms_data_add_address(packet_info *pinfo, address *addr, conversation_type ckt, int port);
300
301
302
303
/****************************/
304
/* Main dissection function */
305
/****************************/
306
static int dissect_msmms_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
307
13
{
308
    /* Work out what type of packet this is and dissect it as such */
309
310
    /* Just don't dissect if can't even read command signature */
311
13
    if (tvb_captured_length(tvb) < 8) {
312
1
        return 0;
313
1
    }
314
315
    /* Command */
316
12
    if (tvb_get_letohl(tvb, 4) == 0xb00bface)
317
0
    {
318
0
        return dissect_msmms_command(tvb, pinfo, tree);
319
0
    }
320
12
    else
321
    /* UDP data command */
322
12
    if ((pinfo->ptype == PT_UDP) && (pinfo->destport == MSMMS_PORT))
323
10
    {
324
10
        return dissect_msmms_data_udp_command(tvb, pinfo, tree);
325
10
    }
326
2
    else
327
    /* Assume data (don't consider frames from client->server data...) */
328
2
    if (pinfo->destport != MSMMS_PORT)
329
2
    {
330
2
        return dissect_msmms_data(tvb, pinfo, tree);
331
2
    }
332
333
    /* It was none of the above so assume not really an MMS packet */
334
0
    return 0;
335
12
}
336
337
338
/*************************************/
339
/* Dissection of different PDU types */
340
/*************************************/
341
342
/* Dissect command packet */
343
static int dissect_msmms_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
344
0
{
345
0
    int         offset                    = 0;
346
0
    proto_item *ti;
347
0
    proto_tree *msmms_tree;
348
0
    proto_tree *msmms_common_command_tree;
349
0
    uint32_t    sequence_number;
350
0
    uint16_t    command_id;
351
0
    uint16_t    command_dir;
352
0
    uint32_t    length_of_command;
353
0
    uint32_t    length_remaining;
354
355
    /******************************/
356
    /* Check for available length */
357
358
    /* Need to have enough bytes for length field */
359
0
    if (tvb_reported_length_remaining(tvb, offset) < 12)
360
0
    {
361
0
        pinfo->desegment_offset = 0;  /* Start at beginning next time */
362
0
        pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT;     /* Need one more byte to try again */
363
0
        return -1;
364
0
    }
365
366
    /* Read length field and see if we're short */
367
0
    length_of_command = tvb_get_letohl(tvb, offset+8);
368
0
    if (tvb_reported_length_remaining(tvb, 16) < length_of_command)
369
0
    {
370
0
        pinfo->desegment_offset = 0; /* Start at beginning next time */
371
0
        pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT;   /* Need one more byte to try again */
372
0
        return -1;
373
0
    }
374
375
376
    /* Set columns */
377
0
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "MSMMS");
378
0
    col_set_str(pinfo->cinfo, COL_INFO, "Command: ");
379
380
    /* Add hidden filter for "msmms.command" */
381
0
    ti = proto_tree_add_item(tree, hf_msmms_command, tvb, 0, 0, ENC_ASCII);
382
0
    proto_item_set_hidden(ti);
383
384
    /* Create MSMMS control protocol tree */
385
0
    ti = proto_tree_add_item(tree, proto_msmms, tvb, offset, -1, ENC_NA);
386
0
    msmms_tree = proto_item_add_subtree(ti, ett_msmms_command);
387
388
389
    /* Read command ID and direction now so can give common command header a
390
       descriptive label */
391
0
    command_id = tvb_get_letohs(tvb, 36);
392
0
    command_dir = tvb_get_letohs(tvb, 36+2);
393
394
395
    /*************************/
396
    /* Common command header */
397
398
    /* Add a tree for common header */
399
0
    ti =  proto_tree_add_string_format(msmms_tree, hf_msmms_command_common_header, tvb, offset, -1,
400
0
            "",
401
0
            "%s (to %s)",
402
0
            (command_dir == TO_SERVER) ?
403
0
            val_to_str_const(command_id, to_server_command_vals, "Unknown") :
404
0
            val_to_str_const(command_id, to_client_command_vals, "Unknown"),
405
0
            (command_dir == TO_SERVER) ? "server" : "client");
406
0
    msmms_common_command_tree = proto_item_add_subtree(ti, ett_msmms_command_common_header);
407
408
    /* Format of 1st 4 bytes unknown.  May be version... */
409
0
    offset += 4;
410
411
    /* Signature (already verified by main dissection function) */
412
0
    proto_tree_add_item(msmms_common_command_tree, hf_msmms_command_signature, tvb, offset, 4, ENC_LITTLE_ENDIAN);
413
0
    offset += 4;
414
415
    /* Length of command */
416
0
    proto_tree_add_item(msmms_common_command_tree, hf_msmms_command_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
417
0
    offset += 4;
418
419
    /* Protocol name.  Must be "MMS"... */
420
0
    if (strncmp((char*)tvb_get_string_enc(pinfo->pool, tvb, offset, 3, ENC_ASCII), "MMS", 3) != 0)
421
0
    {
422
0
        return offset;
423
0
    }
424
0
    proto_tree_add_item(msmms_common_command_tree, hf_msmms_command_protocol_type, tvb, offset, 4, ENC_ASCII);
425
0
    offset += 4;
426
427
    /* Remaining length in multiples of 8 bytes */
428
0
    proto_tree_add_item(msmms_common_command_tree, hf_msmms_command_length_remaining, tvb, offset, 4, ENC_LITTLE_ENDIAN);
429
0
    offset += 4;
430
431
    /* Sequence number */
432
0
    proto_tree_add_item_ret_uint(msmms_common_command_tree, hf_msmms_command_sequence_number, tvb, offset, 4, ENC_LITTLE_ENDIAN, &sequence_number);
433
0
    offset += 4;
434
435
    /* Timestamp */
436
0
    proto_tree_add_item(msmms_common_command_tree, hf_msmms_command_timestamp, tvb, offset, 8, ENC_LITTLE_ENDIAN);
437
0
    offset += 8;
438
439
    /* Another length remaining field... */
440
0
    length_remaining = tvb_get_letohl(tvb, offset);
441
0
    proto_tree_add_item(msmms_common_command_tree, hf_msmms_command_length_remaining2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
442
0
    offset += 4;
443
444
    /* Command depends up on direction */
445
0
    proto_tree_add_item(msmms_common_command_tree,
446
0
                        (command_dir == TO_SERVER) ?
447
0
                            hf_msmms_command_to_server_id :
448
0
                            hf_msmms_command_to_client_id,
449
0
                        tvb, offset, 2, ENC_LITTLE_ENDIAN);
450
0
    offset += 2;
451
452
    /* Direction */
453
0
    proto_tree_add_item(msmms_common_command_tree, hf_msmms_command_direction, tvb, offset, 2, ENC_LITTLE_ENDIAN);
454
0
    offset += 2;
455
456
    /* This is the end of the common command header */
457
0
    proto_item_set_len(msmms_common_command_tree, offset);
458
459
460
    /* Show summary in info column */
461
0
    col_append_fstr(pinfo->cinfo, COL_INFO,
462
0
                    "seq=%03u: %s %s",
463
0
                    sequence_number,
464
0
                    (command_dir == TO_SERVER) ? "-->" : "<--",
465
0
                    (command_dir == TO_SERVER) ?
466
0
                        val_to_str_const(command_id, to_server_command_vals, "Unknown") :
467
0
                        val_to_str_const(command_id, to_client_command_vals, "Unknown"));
468
469
    /* Adjust length_remaining for command-specific details */
470
0
    length_remaining = (length_remaining*8) - 8;
471
472
    /* Now parse any command-specific params */
473
0
    if (command_dir == TO_SERVER)
474
0
    {
475
        /* Commands to server */
476
0
        switch (command_id)
477
0
        {
478
0
            case SERVER_COMMAND_TRANSPORT_INFO:
479
0
                dissect_client_transport_info(tvb, pinfo, msmms_tree,
480
0
                                              offset, length_remaining);
481
0
                break;
482
0
            case SERVER_COMMAND_CONNECT_INFO:
483
0
                dissect_client_player_info(tvb, pinfo, msmms_tree,
484
0
                                           offset, length_remaining);
485
0
                break;
486
0
            case SERVER_COMMAND_START_SENDING_FROM:
487
0
                dissect_start_sending_from_info(tvb, msmms_tree, offset);
488
0
                break;
489
0
            case SERVER_COMMAND_CANCEL_PROTOCOL:
490
0
                dissect_cancel_info(tvb, msmms_tree, offset);
491
0
                break;
492
0
            case SERVER_COMMAND_TIMING_TEST_DATA_REQUEST:
493
0
                dissect_timing_test_request(tvb, tree, offset);
494
0
                break;
495
0
            case SERVER_COMMAND_REQUEST_SERVER_FILE:
496
0
                dissect_request_server_file(tvb, pinfo, tree, offset, length_remaining);
497
0
                break;
498
0
            case SERVER_COMMAND_NETWORK_TIMER_TEST_RESPONSE:
499
0
                dissect_network_timer_test_response(tvb, tree, offset);
500
0
                break;
501
0
            case SERVER_COMMAND_MEDIA_STREAM_MBR_SELECTOR:
502
0
                dissect_media_stream_mbr_selector(tvb, tree, offset);
503
0
                break;
504
0
            case SERVER_COMMAND_HEADER_REQUEST:
505
0
                dissect_header_request(tvb, tree, offset);
506
0
                break;
507
0
            case SERVER_COMMAND_STOP_BUTTON_PRESSED:
508
0
                dissect_stop_button_pressed(tvb, tree, offset);
509
0
                break;
510
511
            /* TODO: other commands */
512
513
0
            default:
514
0
                break;
515
0
        }
516
0
    }
517
0
    else
518
0
    {
519
        /* Commands to client */
520
0
        switch (command_id)
521
0
        {
522
0
            case CLIENT_COMMAND_SERVER_INFO:
523
0
                dissect_server_info(tvb, pinfo, msmms_tree, offset);
524
0
                break;
525
0
            case CLIENT_COMMAND_TIMING_TEST_DATA_RESPONSE:
526
0
                dissect_timing_test_response(tvb, tree, offset);
527
0
                break;
528
0
            case CLIENT_COMMAND_MEDIA_DETAILS:
529
0
                dissect_media_details(tvb, tree, offset);
530
0
                break;
531
0
            case CLIENT_COMMAND_SENDING_HEADER_RESPONSE:
532
0
                dissect_header_response(tvb, tree, offset);
533
0
                break;
534
0
            case CLIENT_COMMAND_TRANSPORT_INFO_ACK:
535
0
                dissect_transport_info_response(tvb, tree, offset, length_remaining);
536
0
                break;
537
538
            /* TODO: other commands: */
539
0
            default:
540
0
                break;
541
0
        }
542
0
    }
543
544
    /* Got to the end so assume it belongs to this protocol */
545
0
    return length_of_command + 12;
546
0
}
547
548
549
/* Parse the only known UDP command (0x01) */
550
static int dissect_msmms_data_udp_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
551
10
{
552
10
    proto_item *ti;
553
10
    proto_tree *msmms_tree;
554
10
    int         offset     = 0;
555
556
    /* Set protocol column */
557
10
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "MSMMS");
558
559
    /* Create MSMMS data protocol tree */
560
10
    ti = proto_tree_add_item(tree, proto_msmms, tvb, offset, -1, ENC_NA);
561
10
    msmms_tree = proto_item_add_subtree(ti, ett_msmms_data);
562
563
    /* Header ID */
564
10
    proto_tree_add_item(msmms_tree, hf_msmms_data_header_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
565
10
    offset += 4;
566
567
    /* Client ID */
568
10
    proto_tree_add_item(msmms_tree, hf_msmms_data_client_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
569
10
    offset += 4;
570
571
    /* Command ID */
572
10
    proto_tree_add_item(msmms_tree, hf_msmms_data_command_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
573
10
    offset += 4;
574
575
10
    col_set_str(pinfo->cinfo, COL_INFO, "Request to resend packet(s):");
576
577
    /* Show list of packets to resend */
578
325
    while (tvb_reported_length_remaining(tvb, offset) >= 4)
579
315
    {
580
315
        uint32_t packet_number = tvb_get_letohl(tvb, offset);
581
315
        proto_tree_add_item(msmms_tree, hf_msmms_data_packet_to_resend, tvb, offset, 4, ENC_LITTLE_ENDIAN);
582
315
        offset += 4;
583
584
315
        col_append_fstr(pinfo->cinfo, COL_INFO, " %u", packet_number);
585
315
    }
586
587
    /* Report that whole of UDP packet was dissected */
588
10
    return tvb_reported_length_remaining(tvb, 0);
589
10
}
590
591
592
/* Dissect a data packet */
593
static int dissect_msmms_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
594
2
{
595
2
    int         offset = 0;
596
2
    proto_item  *ti;
597
2
    proto_tree  *msmms_tree;
598
2
    proto_tree  *msmms_data_timing_pair_tree = NULL;
599
2
    uint32_t    sequence_number;
600
2
    uint16_t    packet_length;
601
2
    uint16_t    packet_length_found;
602
2
    uint8_t     value = 0;
603
604
    /* How many bytes do we need? */
605
2
    packet_length = tvb_get_letohs(tvb, 6);
606
607
    /* How many bytes have we got? */
608
2
    packet_length_found = tvb_reported_length_remaining(tvb, 0);
609
610
    /* Reject frame reported not to reach length field */
611
2
    if (packet_length < 8)
612
1
    {
613
1
        return 0;
614
1
    }
615
616
    /* Stop and ask for more bytes if necessary */
617
1
    if (packet_length_found < packet_length)
618
1
    {
619
1
        pinfo->desegment_offset = 0;  /* Start from beginning again next time */
620
1
        pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT;     /* Try again with even one more byte */
621
1
        return -1;
622
1
    }
623
624
625
    /* Will reject packet if is TCP and has invalid flag */
626
0
    if (pinfo->ptype == PT_TCP)
627
0
    {
628
        /* Flag value is in 5th byte */
629
0
        value = tvb_get_uint8(tvb, 5);
630
        /* Reject packet if not a recognised packet type */
631
0
        if (try_val_to_str(value, tcp_flags_vals) == NULL)
632
0
        {
633
0
            return 0;
634
0
        }
635
0
    }
636
637
0
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "MSMMS");
638
639
    /* Add hidden filter for "msmms.data" */
640
0
    ti = proto_tree_add_item(tree, hf_msmms_data, tvb, 0, 0, ENC_NA);
641
0
    proto_item_set_hidden(ti);
642
643
    /* Create MSMMS data protocol tree */
644
0
    ti = proto_tree_add_item(tree, proto_msmms, tvb, offset, -1, ENC_NA);
645
0
    msmms_tree = proto_item_add_subtree(ti, ett_msmms_data);
646
647
    /* Sequence number */
648
0
    proto_tree_add_item_ret_uint(msmms_tree, hf_msmms_data_sequence_number, tvb, offset, 4, ENC_LITTLE_ENDIAN, &sequence_number);
649
0
    offset += 4;
650
651
    /* Packet ID type */
652
0
    proto_tree_add_item(msmms_tree, hf_msmms_data_packet_id_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
653
0
    offset++;
654
655
    /* Next byte depends upon whether UDP or TCP */
656
0
    if (pinfo->ptype == PT_UDP)
657
0
    {
658
        /* UDP */
659
0
        proto_tree_add_item(msmms_tree, hf_msmms_data_udp_sequence, tvb,
660
0
                            offset, 1, ENC_LITTLE_ENDIAN);
661
0
    }
662
0
    else
663
0
    {
664
        /* TCP */
665
0
        proto_tree_add_item(msmms_tree, hf_msmms_data_tcp_flags, tvb,
666
0
                            offset, 1, ENC_LITTLE_ENDIAN);
667
0
    }
668
0
    offset++;
669
670
    /* Packet Length */
671
0
    proto_tree_add_item_ret_uint16(msmms_tree, hf_msmms_data_packet_length, tvb, offset, 2, ENC_LITTLE_ENDIAN, &packet_length);
672
0
    offset += 2;
673
674
    /* Parse UDP Timing packet pair headers if present */
675
0
    if (value == 0x01)
676
0
    {
677
        /* Create subtree */
678
0
        ti =  proto_tree_add_string_format(msmms_tree, hf_msmms_data_timing_pair, tvb, offset, 8, "", "Data timing pair");
679
0
        msmms_data_timing_pair_tree = proto_item_add_subtree(ti, ett_msmms_data_timing_packet_pair);
680
681
0
        proto_tree_add_item(msmms_data_timing_pair_tree, hf_msmms_data_timing_pair_seqno, tvb, offset, 1, ENC_LITTLE_ENDIAN);
682
0
        offset++;
683
0
        proto_tree_add_item(msmms_data_timing_pair_tree, hf_msmms_data_timing_pair_flags, tvb, offset, 3, ENC_LITTLE_ENDIAN);
684
0
        offset += 3;
685
0
        proto_tree_add_item(msmms_data_timing_pair_tree, hf_msmms_data_timing_pair_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
686
0
        offset++;
687
0
        proto_tree_add_item(msmms_data_timing_pair_tree, hf_msmms_data_timing_pair_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
688
0
        offset++;
689
0
        proto_tree_add_item(msmms_data_timing_pair_tree, hf_msmms_data_timing_pair_packet_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
690
0
        offset += 2;
691
0
    }
692
693
    /* Everything else is marked as unparsed data */
694
0
    proto_tree_add_item(msmms_tree, hf_msmms_data_unparsed, tvb, offset, packet_length-offset, ENC_NA);
695
0
    offset = packet_length;
696
697
    /* Show summary in info column */
698
0
    col_add_fstr(pinfo->cinfo, COL_INFO, "Data: seq=%05u, len=%05u",
699
0
                 sequence_number, packet_length);
700
701
    /* Whole of packet length has been dissected now */
702
0
    return offset;
703
0
}
704
705
706
707
/***************************************/
708
/* Dissect command-specific parameters */
709
/***************************************/
710
711
/* Transport information (address, port, etc) */
712
static void dissect_client_transport_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
713
                                          unsigned offset, unsigned length_remaining)
714
0
{
715
0
    char    *transport_info;
716
0
    unsigned   ipaddr[4];
717
0
    char    protocol[3+1] = "";
718
0
    unsigned   port;
719
0
    int     fields_matched;
720
721
    /* Flags */
722
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
723
0
    offset += 4;
724
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
725
0
    offset += 4;
726
727
    /* These 12 bytes are not understood */
728
0
    offset += 4;
729
0
    offset += 4;
730
0
    offset += 4;
731
732
    /* Extract and show the string in tree and info column */
733
0
    transport_info = (char*)tvb_get_string_enc(pinfo->pool, tvb, offset, length_remaining - 20, ENC_UTF_16|ENC_LITTLE_ENDIAN);
734
735
0
    proto_tree_add_string(tree, hf_msmms_command_client_transport_info, tvb,
736
0
                                 offset, length_remaining-20, transport_info);
737
738
0
    col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
739
0
                    format_text_string(pinfo->pool, transport_info));
740
741
742
    /* Try to extract details from this string */
743
0
    fields_matched = sscanf(transport_info, "%*c%*c%u.%u.%u.%u%*c%3s%*c%u",
744
0
                            &ipaddr[0], &ipaddr[1], &ipaddr[2], &ipaddr[3],
745
0
                            protocol, &port);
746
747
    /* Use this information to set up a conversation for the data stream */
748
0
    if (fields_matched == 6)
749
0
    {
750
0
        conversation_type ckt = CONVERSATION_NONE;
751
752
        /* Work out the port type */
753
0
        if (strncmp(protocol, "UDP", 3) == 0)
754
0
        {
755
0
            ckt = CONVERSATION_UDP;
756
0
        }
757
0
        else
758
0
        if (strncmp(protocol, "TCP", 3) == 0)
759
0
        {
760
0
            ckt = CONVERSATION_TCP;
761
0
        }
762
763
        /* Set the dissector for indicated conversation */
764
0
        if (ckt != CONVERSATION_NONE)
765
0
        {
766
0
            uint8_t octets[4];
767
0
            address addr;
768
0
            octets[0] = ipaddr[0];
769
0
            octets[1] = ipaddr[1];
770
0
            octets[2] = ipaddr[2];
771
0
            octets[3] = ipaddr[3];
772
0
            addr.type = AT_IPv4;
773
0
            addr.len = 4;
774
0
            addr.data = octets;
775
0
            msmms_data_add_address(pinfo, &addr, ckt, port);
776
0
        }
777
0
    }
778
0
}
779
780
/* Dissect server data */
781
static void dissect_server_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
782
                                unsigned offset)
783
0
{
784
0
    uint32_t      server_version_length;
785
0
    uint32_t      tool_version_length;
786
0
    uint32_t      download_update_player_length;
787
0
    uint32_t      password_encryption_type_length;
788
0
    const char   *server_version;
789
790
    /* ErrorCode */
791
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1_error, tvb, offset, 4, ENC_LITTLE_ENDIAN);
792
0
    offset += 4;
793
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
794
0
    offset += 4;
795
796
    /* Next 8 words are not understood */
797
0
    offset += 4;
798
0
    offset += 4;
799
0
    offset += 4;
800
0
    offset += 4;
801
0
    offset += 4;
802
0
    offset += 4;
803
0
    offset += 4;
804
0
    offset += 4;
805
806
807
    /* Length of server version */
808
0
    proto_tree_add_item_ret_uint(tree, hf_msmms_command_server_version_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &server_version_length);
809
0
    offset += 4;
810
811
    /* Length of tool version */
812
0
    proto_tree_add_item_ret_uint(tree, hf_msmms_command_tool_version_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, &tool_version_length);
813
0
    offset += 4;
814
815
    /* Length of download update player URL */
816
0
    download_update_player_length = tvb_get_letohl(tvb, offset);
817
0
    proto_tree_add_item(tree, hf_msmms_command_update_url_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
818
0
    offset += 4;
819
820
    /* Length of password encryption type */
821
0
    password_encryption_type_length = tvb_get_letohl(tvb, offset);
822
0
    proto_tree_add_item(tree, hf_msmms_command_password_type_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
823
0
    offset += 4;
824
825
    /* Server version string. */
826
0
    if (server_version_length > 1)
827
0
    {
828
        /* Server version string */
829
0
        proto_tree_add_item_ret_string(tree, hf_msmms_command_server_version, tvb,
830
0
                            offset, server_version_length*2,
831
0
                            ENC_UTF_16|ENC_LITTLE_ENDIAN, pinfo->pool, (const uint8_t**)&server_version);
832
833
0
        col_append_fstr(pinfo->cinfo, COL_INFO, " (version='%s')",
834
0
                    format_text_string(pinfo->pool, server_version));
835
0
    }
836
0
    offset += (server_version_length*2);
837
838
839
    /* Tool version string. */
840
0
    if (tool_version_length > 1)
841
0
    {
842
0
        proto_tree_add_item(tree, hf_msmms_command_tool_version, tvb,
843
0
                            offset, tool_version_length*2,
844
0
                            ENC_UTF_16|ENC_LITTLE_ENDIAN);
845
0
    }
846
0
    offset += (tool_version_length*2);
847
848
    /* Download update player url string. */
849
0
    if (download_update_player_length > 1)
850
0
    {
851
0
        proto_tree_add_item(tree, hf_msmms_command_update_url, tvb,
852
0
                            offset, download_update_player_length*2,
853
0
                            ENC_UTF_16|ENC_LITTLE_ENDIAN);
854
0
    }
855
0
    offset += (download_update_player_length*2);
856
857
    /* Password encryption type string. */
858
0
    if (password_encryption_type_length > 1)
859
0
    {
860
0
        proto_tree_add_item(tree, hf_msmms_command_password_type, tvb,
861
0
                            offset, password_encryption_type_length*2,
862
0
                            ENC_UTF_16|ENC_LITTLE_ENDIAN);
863
0
    }
864
/*    offset += (password_encryption_type_length*2); */
865
0
}
866
867
/* Player (client) information */
868
static void dissect_client_player_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
869
                                       unsigned offset, unsigned length_remaining)
870
0
{
871
0
    const char *player_info;
872
873
    /* Flags */
874
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
875
0
    offset += 4;
876
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
877
0
    offset += 4;
878
879
    /* These 4 bytes are not understood */
880
0
    offset += 4;
881
882
    /* Extract and show the string in tree and info column */
883
0
    proto_tree_add_item_ret_string(tree, hf_msmms_command_client_player_info, tvb,
884
0
                        offset, length_remaining-12,
885
0
                        ENC_UTF_16|ENC_LITTLE_ENDIAN, pinfo->pool, (const uint8_t**)&player_info);
886
887
0
    col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
888
0
                    format_text_string(pinfo->pool, player_info));
889
0
}
890
891
/* Dissect info about where client wants to start playing from */
892
static void dissect_start_sending_from_info(tvbuff_t *tvb, proto_tree *tree, unsigned offset)
893
0
{
894
    /* Command Level */
895
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1_command_level, tvb, offset, 4, ENC_LITTLE_ENDIAN);
896
0
    offset += 4;
897
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
898
899
    /* 40 bytes follow the prefixes... */
900
0
}
901
902
/* Dissect cancel parameters */
903
static void dissect_cancel_info(tvbuff_t *tvb, proto_tree *tree, unsigned offset)
904
0
{
905
    /* Command Level */
906
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1_command_level, tvb, offset, 4, ENC_LITTLE_ENDIAN);
907
0
    offset += 4;
908
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
909
0
}
910
911
/* Dissect timing test data request */
912
static void dissect_timing_test_request(tvbuff_t *tvb, proto_tree *tree, unsigned offset)
913
0
{
914
    /* Flags */
915
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
916
0
    offset += 4;
917
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
918
0
}
919
920
/* Dissect timing test data response */
921
static void dissect_timing_test_response(tvbuff_t *tvb, proto_tree *tree, unsigned offset)
922
0
{
923
    /* ErrorCode */
924
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1_error, tvb, offset, 4, ENC_LITTLE_ENDIAN);
925
0
    offset += 4;
926
    /* Flags */
927
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
928
0
    offset += 4;
929
930
    /* Number of 4 byte fields in structure */
931
0
    proto_tree_add_item(tree, hf_msmms_command_number_of_words, tvb, offset, 4, ENC_LITTLE_ENDIAN);
932
0
    offset += 4;
933
0
    offset += 4;
934
0
    offset += 4;
935
936
    /* Client ID */
937
0
    proto_tree_add_item(tree, hf_msmms_command_client_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
938
939
    /* 20 more bytes... */
940
0
}
941
942
/* Dissect request for server file */
943
static void dissect_request_server_file(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
944
                                        unsigned offset, unsigned length_remaining)
945
0
{
946
0
    const char *server_file;
947
948
    /* Command Level */
949
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1_command_level, tvb, offset, 4, ENC_LITTLE_ENDIAN);
950
0
    offset += 4;
951
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
952
0
    offset += 4;
953
954
0
    offset += 4;
955
0
    offset += 4;
956
957
    /* File path on server */
958
0
    proto_tree_add_item_ret_string(tree, hf_msmms_command_server_file, tvb,
959
0
                        offset, length_remaining-16,
960
0
                        ENC_UTF_16|ENC_LITTLE_ENDIAN, pinfo->pool, (const uint8_t**)&server_file);
961
962
0
    col_append_fstr(pinfo->cinfo, COL_INFO, " (%s)",
963
0
                    format_text_string(pinfo->pool, server_file));
964
0
}
965
966
/* Dissect media details from server */
967
static void dissect_media_details(tvbuff_t *tvb, proto_tree *tree, unsigned offset)
968
0
{
969
    /* ErrorCode */
970
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1_error, tvb, offset, 4, ENC_LITTLE_ENDIAN);
971
0
    offset += 4;
972
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
973
0
    offset += 4;
974
975
    /* Result flags */
976
0
    proto_tree_add_item(tree, hf_msmms_command_result_flags, tvb, offset, 4, ENC_LITTLE_ENDIAN);
977
0
    offset += 4;
978
979
0
    offset += 4;
980
0
    offset += 4;
981
982
    /* Broadcast flags. */
983
0
    proto_tree_add_item(tree, hf_msmms_command_broadcast_indexing, tvb, offset+2, 1, ENC_LITTLE_ENDIAN);
984
0
    proto_tree_add_item(tree, hf_msmms_command_broadcast_liveness, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
985
0
    offset += 4;
986
987
    /* These 8 bytes may be a time field... */
988
0
    offset += 4;
989
0
    offset += 4;
990
991
    /* Media length in seconds */
992
0
    proto_tree_add_item(tree, hf_msmms_command_recorded_media_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
993
0
    offset += 4;
994
995
0
    offset += 4;
996
0
    offset += 4;
997
0
    offset += 4;
998
0
    offset += 4;
999
1000
    /* Packet length in bytes */
1001
0
    proto_tree_add_item(tree, hf_msmms_command_media_packet_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1002
0
}
1003
1004
/* Dissect header response */
1005
static void dissect_header_response(tvbuff_t *tvb, proto_tree *tree, unsigned offset)
1006
0
{
1007
    /* ErrorCode */
1008
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1_error, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1009
0
    offset += 4;
1010
    /* Packet ID type */
1011
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1012
1013
    /* 8 more bytes */
1014
0
}
1015
1016
/* Dissect network timer test response */
1017
static void dissect_network_timer_test_response(tvbuff_t *tvb, proto_tree *tree, unsigned offset)
1018
0
{
1019
    /* Command Level */
1020
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1_command_level, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1021
0
    offset += 4;
1022
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1023
0
}
1024
1025
/* Dissect transport info response */
1026
static void dissect_transport_info_response(tvbuff_t *tvb, proto_tree *tree,
1027
                                            unsigned offset, unsigned length_remaining)
1028
0
{
1029
    /* Command Level */
1030
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1_command_level, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1031
0
    offset += 4;
1032
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1033
0
    offset += 4;
1034
1035
    /* Length */
1036
0
    proto_tree_add_item(tree, hf_msmms_command_number_of_words, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1037
0
    offset += 4;
1038
1039
    /* Read this strange string */
1040
0
    proto_tree_add_item(tree, hf_msmms_command_strange_string, tvb,
1041
0
                        offset, length_remaining-12,
1042
0
                        ENC_UTF_16|ENC_LITTLE_ENDIAN);
1043
0
}
1044
1045
/* Media stream MBR selector */
1046
static void dissect_media_stream_mbr_selector(tvbuff_t *tvb, proto_tree *tree, unsigned offset)
1047
0
{
1048
    /* Stream structure count (always 1) */
1049
0
    proto_tree_add_item(tree, hf_msmms_command_stream_structure_count, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1050
0
    offset += 4;
1051
1052
    /* Stream selection structure */
1053
0
    proto_tree_add_item(tree, hf_msmms_stream_selection_flags, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1054
0
    offset += 2;
1055
0
    proto_tree_add_item(tree, hf_msmms_stream_selection_stream_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1056
0
    offset += 2;
1057
0
    proto_tree_add_item(tree, hf_msmms_stream_selection_action, tvb, offset, 2, ENC_LITTLE_ENDIAN);
1058
0
}
1059
1060
/* Dissect header request */
1061
static void dissect_header_request(tvbuff_t *tvb, proto_tree *tree, unsigned offset)
1062
0
{
1063
0
    int n;
1064
1065
    /* Command Level */
1066
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1_command_level, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1067
0
    offset += 4;
1068
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1069
0
    offset += 4;
1070
1071
    /* Skip 8 unknown words */
1072
0
    for (n=0; n < 8; n++)
1073
0
    {
1074
0
        offset += 4;
1075
0
    }
1076
1077
    /* Header packet ID type */
1078
0
    proto_tree_add_item(tree, hf_msmms_command_header_packet_id_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1079
0
}
1080
1081
/* Dissect stop button pressed */
1082
static void dissect_stop_button_pressed(tvbuff_t *tvb, proto_tree *tree, unsigned offset)
1083
0
{
1084
    /* Command Level */
1085
0
    proto_tree_add_item(tree, hf_msmms_command_prefix1_command_level, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1086
0
    offset += 4;
1087
0
    proto_tree_add_item(tree, hf_msmms_command_prefix2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
1088
0
}
1089
1090
1091
/********************************************************/
1092
/* Helper function to set up an MS-MMS data conversation */
1093
/********************************************************/
1094
static void msmms_data_add_address(packet_info *pinfo, address *addr, conversation_type ckt, int port)
1095
0
{
1096
0
    address         null_addr;
1097
0
    conversation_t *p_conv;
1098
1099
    /* If this isn't the first time this packet has been processed,
1100
     * we've already done this work, so we don't need to do it
1101
     * again. */
1102
0
    if (pinfo->fd->visited)
1103
0
    {
1104
0
        return;
1105
0
    }
1106
1107
0
    clear_address(&null_addr);
1108
1109
    /* Check if the ip address and port combination is not
1110
     * already registered as a conversation. */
1111
0
    p_conv = find_conversation(pinfo->num, addr, &null_addr, ckt, port, 0,
1112
0
                               NO_ADDR_B | NO_PORT_B);
1113
1114
    /* If not, create a new conversation. */
1115
0
    if (!p_conv)
1116
0
    {
1117
0
        p_conv = conversation_new(pinfo->num, addr, &null_addr, ckt,
1118
0
                                  (uint32_t)port, 0, NO_ADDR2 | NO_PORT2);
1119
0
    }
1120
1121
    /* Set dissector */
1122
0
    conversation_set_dissector(p_conv, msmms_handle);
1123
0
}
1124
1125
1126
1127
/*************************/
1128
/* Register protocol     */
1129
/*************************/
1130
1131
void proto_register_msmms(void)
1132
14
{
1133
14
    static hf_register_info hf[] =
1134
14
    {
1135
1136
        /* Command fields */
1137
14
        {
1138
14
            &hf_msmms_command,
1139
14
            {
1140
14
                "Command",
1141
14
                "msmms.command",
1142
14
                FT_STRING,
1143
14
                BASE_NONE,
1144
14
                NULL,
1145
14
                0x0,
1146
14
                "MSMMS command hidden filter", HFILL
1147
14
            }
1148
14
        },
1149
14
        {
1150
14
            &hf_msmms_command_common_header,
1151
14
            {
1152
14
                "Command common header",
1153
14
                "msmms.command.common-header",
1154
14
                FT_STRING,
1155
14
                BASE_NONE,
1156
14
                NULL,
1157
14
                0x0,
1158
14
                "MSMMS command common header", HFILL
1159
14
            }
1160
14
        },
1161
1162
#if 0
1163
        {
1164
            &hf_msmms_command_version,
1165
            {
1166
                "Version",
1167
                "msmms.command.version",
1168
                FT_UINT32,
1169
                BASE_DEC,
1170
                NULL,
1171
                0x0,
1172
                NULL, HFILL
1173
            }
1174
        },
1175
#endif
1176
14
        {
1177
14
            &hf_msmms_command_signature,
1178
14
            {
1179
14
                "Command signature",
1180
14
                "msmms.command.signature",
1181
14
                FT_UINT32,
1182
14
                BASE_HEX,
1183
14
                NULL,
1184
14
                0x0,
1185
14
                NULL, HFILL
1186
14
            }
1187
14
        },
1188
14
        {
1189
14
            &hf_msmms_command_length,
1190
14
            {
1191
14
                "Command length",
1192
14
                "msmms.command.length",
1193
14
                FT_UINT32,
1194
14
                BASE_DEC,
1195
14
                NULL,
1196
14
                0x0,
1197
14
                NULL, HFILL
1198
14
            }
1199
14
        },
1200
14
        {
1201
14
            &hf_msmms_command_protocol_type,
1202
14
            {
1203
14
                "Protocol type",
1204
14
                "msmms.command.protocol-type",
1205
14
                FT_STRING,
1206
14
                BASE_NONE,
1207
14
                NULL,
1208
14
                0x0,
1209
14
                NULL, HFILL
1210
14
            }
1211
14
        },
1212
14
        {
1213
14
            &hf_msmms_command_length_remaining,
1214
14
            {
1215
14
                "Length until end (8-byte blocks)",
1216
14
                "msmms.command.length-remaining",
1217
14
                FT_UINT32,
1218
14
                BASE_DEC,
1219
14
                NULL,
1220
14
                0x0,
1221
14
                NULL, HFILL
1222
14
            }
1223
14
        },
1224
14
        {
1225
14
            &hf_msmms_command_sequence_number,
1226
14
            {
1227
14
                "Sequence number",
1228
14
                "msmms.command.sequence-number",
1229
14
                FT_UINT32,
1230
14
                BASE_DEC,
1231
14
                NULL,
1232
14
                0x0,
1233
14
                NULL, HFILL
1234
14
            }
1235
14
        },
1236
14
        {
1237
14
            &hf_msmms_command_timestamp,
1238
14
            {
1239
14
                "Time stamp (s)",
1240
14
                "msmms.command.timestamp",
1241
14
                FT_DOUBLE,
1242
14
                BASE_NONE,
1243
14
                NULL,
1244
14
                0x0,
1245
14
                NULL, HFILL
1246
14
            }
1247
14
        },
1248
14
        {
1249
14
            &hf_msmms_command_length_remaining2,
1250
14
            {
1251
14
                "Length until end (8-byte blocks)",
1252
14
                "msmms.command.length-remaining2",
1253
14
                FT_UINT32,
1254
14
                BASE_DEC,
1255
14
                NULL,
1256
14
                0x0,
1257
14
                NULL, HFILL
1258
14
            }
1259
14
        },
1260
14
        {
1261
14
            &hf_msmms_command_to_server_id,
1262
14
            {
1263
14
                "Command",
1264
14
                "msmms.command.to-server-id",
1265
14
                FT_UINT16,
1266
14
                BASE_HEX,
1267
14
                VALS(to_server_command_vals),
1268
14
                0x0,
1269
14
                NULL, HFILL
1270
14
            }
1271
14
        },
1272
14
        {
1273
14
            &hf_msmms_command_to_client_id,
1274
14
            {
1275
14
                "Command",
1276
14
                "msmms.command.to-client-id",
1277
14
                FT_UINT16,
1278
14
                BASE_HEX,
1279
14
                VALS(to_client_command_vals),
1280
14
                0x0,
1281
14
                NULL, HFILL
1282
14
            }
1283
14
        },
1284
14
        {
1285
14
            &hf_msmms_command_direction,
1286
14
            {
1287
14
                "Command direction",
1288
14
                "msmms.command.direction",
1289
14
                FT_UINT16,
1290
14
                BASE_HEX,
1291
14
                VALS(command_direction_vals),
1292
14
                0x0,
1293
14
                NULL, HFILL
1294
14
            }
1295
14
        },
1296
1297
14
        {
1298
14
            &hf_msmms_command_prefix1,
1299
14
            {
1300
14
                "Prefix 1",
1301
14
                "msmms.command.prefix1",
1302
14
                FT_UINT32,
1303
14
                BASE_HEX,
1304
14
                NULL,
1305
14
                0x0,
1306
14
                NULL, HFILL
1307
14
            }
1308
14
        },
1309
14
        {
1310
14
            &hf_msmms_command_prefix1_error,
1311
14
            {
1312
14
                "Prefix 1 ErrorCode",
1313
14
                "msmms.command.prefix1-error-code",
1314
14
                FT_UINT32,
1315
14
                BASE_HEX,
1316
14
                VALS(server_to_client_error_vals),
1317
14
                0x0,
1318
14
                NULL, HFILL
1319
14
            }
1320
14
        },
1321
14
        {
1322
14
            &hf_msmms_command_prefix1_command_level,
1323
14
            {
1324
14
                "Prefix 1 Command Level",
1325
14
                "msmms.command.prefix1-command-level",
1326
14
                FT_UINT32,
1327
14
                BASE_DEC,
1328
14
                NULL,
1329
14
                0x0,
1330
14
                NULL, HFILL
1331
14
            }
1332
14
        },
1333
14
        {
1334
14
            &hf_msmms_command_prefix2,
1335
14
            {
1336
14
                "Prefix 2",
1337
14
                "msmms.command.prefix2",
1338
14
                FT_UINT32,
1339
14
                BASE_HEX,
1340
14
                NULL,
1341
14
                0x0,
1342
14
                NULL, HFILL
1343
14
            }
1344
14
        },
1345
14
        {
1346
14
            &hf_msmms_command_client_transport_info,
1347
14
            {
1348
14
                "Transport",
1349
14
                "msmms.command.client-transport-info",
1350
14
                FT_STRING,
1351
14
                BASE_NONE,
1352
14
                NULL,
1353
14
                0x0,
1354
14
                NULL, HFILL
1355
14
            }
1356
14
        },
1357
14
        {
1358
14
            &hf_msmms_command_client_player_info,
1359
14
            {
1360
14
                "Player info",
1361
14
                "msmms.command.player-info",
1362
14
                FT_STRING,
1363
14
                BASE_NONE,
1364
14
                NULL,
1365
14
                0x0,
1366
14
                NULL, HFILL
1367
14
            }
1368
14
        },
1369
14
        {
1370
14
            &hf_msmms_command_server_version_length,
1371
14
            {
1372
14
                "Server Version Length",
1373
14
                "msmms.command.server-version-length",
1374
14
                FT_UINT32,
1375
14
                BASE_DEC,
1376
14
                NULL,
1377
14
                0x0,
1378
14
                NULL, HFILL
1379
14
            }
1380
14
        },
1381
14
        {
1382
14
            &hf_msmms_command_tool_version_length,
1383
14
            {
1384
14
                "Tool Version Length",
1385
14
                "msmms.command.tool-version-length",
1386
14
                FT_UINT32,
1387
14
                BASE_DEC,
1388
14
                NULL,
1389
14
                0x0,
1390
14
                NULL, HFILL
1391
14
            }
1392
14
        },
1393
14
        {
1394
14
            &hf_msmms_command_update_url_length,
1395
14
            {
1396
14
                "Download update URL length",
1397
14
                "msmms.command.download-update-player-url-length",
1398
14
                FT_UINT32,
1399
14
                BASE_DEC,
1400
14
                NULL,
1401
14
                0x0,
1402
14
                NULL, HFILL
1403
14
            }
1404
14
        },
1405
14
        {
1406
14
            &hf_msmms_command_password_type_length,
1407
14
            {
1408
14
                "Password encryption type length",
1409
14
                "msmms.command.password-encryption-type-length",
1410
14
                FT_UINT32,
1411
14
                BASE_DEC,
1412
14
                NULL,
1413
14
                0x0,
1414
14
                NULL, HFILL
1415
14
            }
1416
14
        },
1417
14
        {
1418
14
            &hf_msmms_command_server_version,
1419
14
            {
1420
14
                "Server version",
1421
14
                "msmms.command.server-version",
1422
14
                FT_STRING,
1423
14
                BASE_NONE,
1424
14
                NULL,
1425
14
                0x0,
1426
14
                NULL, HFILL
1427
14
            }
1428
14
        },
1429
14
        {
1430
14
            &hf_msmms_command_tool_version,
1431
14
            {
1432
14
                "Tool version",
1433
14
                "msmms.command.tool-version",
1434
14
                FT_STRING,
1435
14
                BASE_NONE,
1436
14
                NULL,
1437
14
                0x0,
1438
14
                NULL, HFILL
1439
14
            }
1440
14
        },
1441
14
        {
1442
14
            &hf_msmms_command_update_url,
1443
14
            {
1444
14
                "Download update player URL",
1445
14
                "msmms.command.download-update-player-url",
1446
14
                FT_STRING,
1447
14
                BASE_NONE,
1448
14
                NULL,
1449
14
                0x0,
1450
14
                NULL, HFILL
1451
14
            }
1452
14
        },
1453
14
        {
1454
14
            &hf_msmms_command_password_type,
1455
14
            {
1456
14
                "Password encryption type",
1457
14
                "msmms.command.password-encryption-type",
1458
14
                FT_STRING,
1459
14
                BASE_NONE,
1460
14
                NULL,
1461
14
                0x0,
1462
14
                NULL, HFILL
1463
14
            }
1464
14
        },
1465
14
        {
1466
14
            &hf_msmms_command_number_of_words,
1467
14
            {
1468
14
                "Number of 4 byte fields in structure",
1469
14
                "msmms.data.words-in-structure",
1470
14
                FT_UINT32,
1471
14
                BASE_DEC,
1472
14
                NULL,
1473
14
                0x0,
1474
14
                NULL, HFILL
1475
14
            }
1476
14
        },
1477
14
        {
1478
14
            &hf_msmms_command_client_id,
1479
14
            {
1480
14
                "Client ID",
1481
14
                "msmms.data.client-id",
1482
14
                FT_UINT32,
1483
14
                BASE_DEC,
1484
14
                NULL,
1485
14
                0x0,
1486
14
                NULL, HFILL
1487
14
            }
1488
14
        },
1489
14
        {
1490
14
            &hf_msmms_command_server_file,
1491
14
            {
1492
14
                "Server file",
1493
14
                "msmms.command.server-file",
1494
14
                FT_STRING,
1495
14
                BASE_NONE,
1496
14
                NULL,
1497
14
                0x0,
1498
14
                NULL, HFILL
1499
14
            }
1500
14
        },
1501
14
        {
1502
14
            &hf_msmms_command_result_flags,
1503
14
            {
1504
14
                "Result flags",
1505
14
                "msmms.command.result-flags",
1506
14
                FT_UINT32,
1507
14
                BASE_HEX,
1508
14
                VALS(media_result_flags_vals),
1509
14
                0x0,
1510
14
                NULL, HFILL
1511
14
            }
1512
14
        },
1513
14
        {
1514
14
            &hf_msmms_command_broadcast_indexing,
1515
14
            {
1516
14
                "Broadcast indexing",
1517
14
                "msmms.command.broadcast-indexing",
1518
14
                FT_UINT8,
1519
14
                BASE_HEX,
1520
14
                VALS(broadcast_indexing_vals),
1521
14
                0x0,
1522
14
                NULL, HFILL
1523
14
            }
1524
14
        },
1525
14
        {
1526
14
            &hf_msmms_command_broadcast_liveness,
1527
14
            {
1528
14
                "Broadcast liveness",
1529
14
                "msmms.command.broadcast-liveness",
1530
14
                FT_UINT8,
1531
14
                BASE_HEX,
1532
14
                VALS(broadcast_liveness_vals),
1533
14
                0x0,
1534
14
                NULL, HFILL
1535
14
            }
1536
14
        },
1537
14
        {
1538
14
            &hf_msmms_command_recorded_media_length,
1539
14
            {
1540
14
                "Pre-recorded media length (seconds)",
1541
14
                "msmms.data.prerecorded-media-length",
1542
14
                FT_UINT32,
1543
14
                BASE_DEC,
1544
14
                NULL,
1545
14
                0x0,
1546
14
                NULL, HFILL
1547
14
            }
1548
14
        },
1549
14
        {
1550
14
            &hf_msmms_command_media_packet_length,
1551
14
            {
1552
14
                "Media packet length (bytes)",
1553
14
                "msmms.data.media-packet-length",
1554
14
                FT_UINT32,
1555
14
                BASE_DEC,
1556
14
                NULL,
1557
14
                0x0,
1558
14
                NULL, HFILL
1559
14
            }
1560
14
        },
1561
14
        {
1562
14
            &hf_msmms_command_strange_string,
1563
14
            {
1564
14
                "Strange string",
1565
14
                "msmms.command.strange-string",
1566
14
                FT_STRING,
1567
14
                BASE_NONE,
1568
14
                NULL,
1569
14
                0x0,
1570
14
                NULL, HFILL
1571
14
            }
1572
14
        },
1573
14
        {
1574
14
            &hf_msmms_command_stream_structure_count,
1575
14
            {
1576
14
                "Stream structure count",
1577
14
                "msmms.data.stream-structure-count",
1578
14
                FT_UINT32,
1579
14
                BASE_DEC,
1580
14
                NULL,
1581
14
                0x0,
1582
14
                NULL, HFILL
1583
14
            }
1584
14
        },
1585
14
        {
1586
14
            &hf_msmms_stream_selection_flags,
1587
14
            {
1588
14
                "Stream selection flags",
1589
14
                "msmms.data.stream-selection-flags",
1590
14
                FT_UINT16,
1591
14
                BASE_HEX,
1592
14
                NULL,
1593
14
                0x0,
1594
14
                NULL, HFILL
1595
14
            }
1596
14
        },
1597
14
        {
1598
14
            &hf_msmms_stream_selection_stream_id,
1599
14
            {
1600
14
                "Stream id",
1601
14
                "msmms.data.selection-stream-id",
1602
14
                FT_UINT16,
1603
14
                BASE_DEC,
1604
14
                NULL,
1605
14
                0x0,
1606
14
                NULL, HFILL
1607
14
            }
1608
14
        },
1609
14
        {
1610
14
            &hf_msmms_stream_selection_action,
1611
14
            {
1612
14
                "Action",
1613
14
                "msmms.data.selection-stream-action",
1614
14
                FT_UINT16,
1615
14
                BASE_DEC,
1616
14
                VALS(stream_selection_action_vals),
1617
14
                0x0,
1618
14
                NULL, HFILL
1619
14
            }
1620
14
        },
1621
14
        {
1622
14
            &hf_msmms_command_header_packet_id_type,
1623
14
            {
1624
14
                "Header packet ID type",
1625
14
                "msmms.data.header-packet-id-type",
1626
14
                FT_UINT32,
1627
14
                BASE_HEX,
1628
14
                NULL,
1629
14
                0x0,
1630
14
                NULL, HFILL
1631
14
            }
1632
14
        },
1633
1634
1635
        /* Data fields */
1636
14
        {
1637
14
            &hf_msmms_data,
1638
14
            {
1639
14
                "Data",
1640
14
                "msmms.data",
1641
14
                FT_NONE,
1642
14
                BASE_NONE,
1643
14
                NULL,
1644
14
                0x0,
1645
14
                NULL, HFILL
1646
14
            }
1647
14
        },
1648
14
        {
1649
14
            &hf_msmms_data_sequence_number,
1650
14
            {
1651
14
                "Sequence number",
1652
14
                "msmms.data.sequence",
1653
14
                FT_UINT32,
1654
14
                BASE_DEC,
1655
14
                NULL,
1656
14
                0x0,
1657
14
                NULL, HFILL
1658
14
            }
1659
14
        },
1660
14
        {
1661
14
            &hf_msmms_data_packet_id_type,
1662
14
            {
1663
14
                "Packet ID type",
1664
14
                "msmms.data.packet-id-type",
1665
14
                FT_UINT8,
1666
14
                BASE_HEX,
1667
14
                NULL,
1668
14
                0x0,
1669
14
                NULL, HFILL
1670
14
            }
1671
14
        },
1672
14
        {
1673
14
            &hf_msmms_data_packet_length,
1674
14
            {
1675
14
                "Packet length",
1676
14
                "msmms.data.packet-length",
1677
14
                FT_UINT16,
1678
14
                BASE_DEC,
1679
14
                NULL,
1680
14
                0x0,
1681
14
                NULL, HFILL
1682
14
            }
1683
14
        },
1684
1685
14
        {
1686
14
            &hf_msmms_data_header_id,
1687
14
            {
1688
14
                "Header ID",
1689
14
                "msmms.data.header-id",
1690
14
                FT_UINT32,
1691
14
                BASE_HEX,
1692
14
                NULL,
1693
14
                0x0,
1694
14
                NULL, HFILL
1695
14
            }
1696
14
        },
1697
14
        {
1698
14
            &hf_msmms_data_client_id,
1699
14
            {
1700
14
                "Client ID",
1701
14
                "msmms.data.client-id",
1702
14
                FT_UINT32,
1703
14
                BASE_HEX,
1704
14
                NULL,
1705
14
                0x0,
1706
14
                NULL, HFILL
1707
14
            }
1708
14
        },
1709
14
        {
1710
14
            &hf_msmms_data_command_id,
1711
14
            {
1712
14
                "Command ID",
1713
14
                "msmms.data.command-id",
1714
14
                FT_UINT16,
1715
14
                BASE_DEC,
1716
14
                NULL,
1717
14
                0x0,
1718
14
                NULL, HFILL
1719
14
            }
1720
14
        },
1721
14
        {
1722
14
            &hf_msmms_data_packet_to_resend,
1723
14
            {
1724
14
                "Packet to resend",
1725
14
                "msmms.data.packet-to-resend",
1726
14
                FT_UINT32,
1727
14
                BASE_DEC,
1728
14
                NULL,
1729
14
                0x0,
1730
14
                NULL, HFILL
1731
14
            }
1732
14
        },
1733
14
        {
1734
14
            &hf_msmms_data_udp_sequence,
1735
14
            {
1736
14
                "UDP Sequence",
1737
14
                "msmms.data.udp-sequence",
1738
14
                FT_UINT8,
1739
14
                BASE_DEC,
1740
14
                NULL,
1741
14
                0x0,
1742
14
                NULL, HFILL
1743
14
            }
1744
14
        },
1745
14
        {
1746
14
            &hf_msmms_data_tcp_flags,
1747
14
            {
1748
14
                "TCP flags",
1749
14
                "msmms.data.tcp-flags",
1750
14
                FT_UINT8,
1751
14
                BASE_HEX,
1752
14
                VALS(tcp_flags_vals),
1753
14
                0x0,
1754
14
                NULL, HFILL
1755
14
            }
1756
14
        },
1757
1758
14
        {
1759
14
            &hf_msmms_data_timing_pair,
1760
14
            {
1761
14
                "Data timing pair",
1762
14
                "msmms.data.timing-pair",
1763
14
                FT_STRING,
1764
14
                BASE_NONE,
1765
14
                NULL,
1766
14
                0x0,
1767
14
                NULL, HFILL
1768
14
            }
1769
14
        },
1770
14
        {
1771
14
            &hf_msmms_data_timing_pair_seqno,
1772
14
            {
1773
14
                "Sequence number",
1774
14
                "msmms.data.timing-pair.sequence-number",
1775
14
                FT_UINT8,
1776
14
                BASE_DEC,
1777
14
                NULL,
1778
14
                0x0,
1779
14
                NULL, HFILL
1780
14
            }
1781
14
        },
1782
14
        {
1783
14
            &hf_msmms_data_timing_pair_flags,
1784
14
            {
1785
14
                "Flags",
1786
14
                "msmms.data.timing-pair.flags",
1787
14
                FT_UINT24,
1788
14
                BASE_DEC,
1789
14
                NULL,
1790
14
                0x0,
1791
14
                NULL, HFILL
1792
14
            }
1793
14
        },
1794
14
        {
1795
14
            &hf_msmms_data_timing_pair_id,
1796
14
            {
1797
14
                "ID",
1798
14
                "msmms.data.timing-pair.id",
1799
14
                FT_UINT8,
1800
14
                BASE_HEX,
1801
14
                NULL,
1802
14
                0x0,
1803
14
                NULL, HFILL
1804
14
            }
1805
14
        },
1806
14
        {
1807
14
            &hf_msmms_data_timing_pair_flag,
1808
14
            {
1809
14
                "Flag",
1810
14
                "msmms.data.timing-pair.flag",
1811
14
                FT_UINT8,
1812
14
                BASE_HEX,
1813
14
                NULL,
1814
14
                0x0,
1815
14
                NULL, HFILL
1816
14
            }
1817
14
        },
1818
14
        {
1819
14
            &hf_msmms_data_timing_pair_packet_length,
1820
14
            {
1821
14
                "Packet length",
1822
14
                "msmms.data.timing-pair.packet-length",
1823
14
                FT_UINT16,
1824
14
                BASE_DEC,
1825
14
                NULL,
1826
14
                0x0,
1827
14
                NULL, HFILL
1828
14
            }
1829
14
        },
1830
1831
        /* Unparsed data */
1832
14
        {
1833
14
            &hf_msmms_data_unparsed,
1834
14
            {
1835
14
                "Unparsed data",
1836
14
                "msmms.data.unparsed",
1837
14
                FT_NONE,
1838
14
                BASE_NONE,
1839
14
                NULL,
1840
14
                0x0,
1841
14
                NULL, HFILL
1842
14
            }
1843
14
        },
1844
1845
14
    };
1846
1847
14
    static int *ett[] =
1848
14
    {
1849
14
        &ett_msmms_command,
1850
14
        &ett_msmms_command_common_header,
1851
14
        &ett_msmms_data,
1852
14
        &ett_msmms_data_timing_packet_pair
1853
14
    };
1854
1855
    /* Register protocol and fields */
1856
14
    proto_msmms = proto_register_protocol("Microsoft Media Server", "MSMMS", "msmms");
1857
14
    proto_register_field_array(proto_msmms, hf, array_length(hf));
1858
14
    proto_register_subtree_array(ett, array_length(ett));
1859
14
    msmms_handle = register_dissector("msmms", dissect_msmms_pdu, proto_msmms);
1860
14
}
1861
1862
void proto_reg_handoff_msmms_command(void)
1863
14
{
1864
    /* Control commands using TCP port */
1865
14
    dissector_add_uint_with_preference("tcp.port", MSMMS_PORT, msmms_handle);
1866
    /* Data command(s) using UDP port */
1867
14
    dissector_add_uint_with_preference("udp.port", MSMMS_PORT, msmms_handle);
1868
14
}
1869
1870
/*
1871
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
1872
 *
1873
 * Local variables:
1874
 * c-basic-offset: 4
1875
 * tab-width: 8
1876
 * indent-tabs-mode: nil
1877
 * End:
1878
 *
1879
 * vi: set shiftwidth=4 tabstop=8 expandtab:
1880
 * :indentSize=4:tabSize=8:noTabs=true:
1881
 */