2 * Routines for SliMP3 protocol dissection
4 * Ashok Narayanan <ashokn@cisco.com>
6 * Adds support for the data packet protocol for the SliMP3
7 * See www.slimdevices.com for details.
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * SPDX-License-Identifier: GPL-2.0-or-later
18 #include <epan/packet.h>
19 #include <epan/unit_strings.h>
21 #include <wsutil/array.h>
22 #include <epan/to_str.h>
24 void proto_register_slimp3(void);
25 void proto_reg_handoff_slimp3(void);
27 static dissector_handle_t slimp3_handle
;
29 static int proto_slimp3
;
30 static int hf_slimp3_opcode
;
31 static int hf_slimp3_control
;
32 static int hf_slimp3_uptime
;
33 static int hf_slimp3_code_id
;
34 static int hf_slimp3_code_bits
;
35 static int hf_slimp3_infrared_slimp3
;
36 static int hf_slimp3_infrared_jvc
;
37 static int hf_slimp3_infrared
;
38 static int hf_slimp3_device_id
;
39 static int hf_slimp3_fw_rev
;
40 static int hf_slimp3_data_offset
;
41 static int hf_slimp3_data_command
;
42 static int hf_slimp3_data_write_pointer
;
43 static int hf_slimp3_data_sequence
;
44 static int hf_slimp3_disc_rsp_server_ip
;
45 static int hf_slimp3_disc_rsp_server_port
;
46 static int hf_slimp3_data_ack_write_pointer
;
47 static int hf_slimp3_data_ack_read_pointer
;
48 static int hf_slimp3_data_ack_sequence
;
49 static int hf_slimp3_data_req_offset
;
50 /* Generated from convert_proto_tree_add_text.pl */
51 static int hf_slimp3_display_delay
;
52 static int hf_slimp3_display_string
;
53 static int hf_slimp3_display_command
;
54 static int hf_slimp3_display_unknown
;
55 static int hf_slimp3_hello_response_client_server
;
56 static int hf_slimp3_hello_request_server_client
;
57 static int hf_slimp3_i2c_response_client_server
;
58 static int hf_slimp3_i2c_request_server_client
;
59 static int hf_slimp3_data_length
;
60 static int hf_slimp3_data_data
;
62 static int ett_slimp3
;
64 #define UDP_PORT_SLIMP3_V1 1069 /* Not IANA registered */
65 #define UDP_PORT_SLIMP3_V2 3483
66 #define UDP_PORT_SLIMP3_RANGE "1069,3483"
69 #define SLIMP3_CONTROL 's'
70 #define SLIMP3_HELLO 'h'
71 #define SLIMP3_DATA 'm'
72 #define SLIMP3_DATA_REQ 'r'
73 #define SLIMP3_DISPLAY 'l'
74 #define SLIMP3_I2C '2'
75 #define SLIMP3_DISC_REQ 'd'
76 #define SLIMP3_DISC_RSP 'D'
77 #define SLIMP3_DATA_ACK 'a'
79 static const value_string slimp3_opcode_vals
[] = {
80 { SLIMP3_IR
, "Infrared Remote Code" },
81 { SLIMP3_CONTROL
, "Stream Control" },
82 { SLIMP3_DATA
, "MPEG Data" },
83 { SLIMP3_DATA_REQ
, "Data Request" },
84 { SLIMP3_HELLO
, "Hello" },
85 { SLIMP3_DISPLAY
, "Display" },
86 { SLIMP3_I2C
, "I2C" },
87 { SLIMP3_DISC_REQ
, "Discovery Request" },
88 { SLIMP3_DISC_RSP
, "Discovery Response" },
89 { SLIMP3_DATA_ACK
, "Ack" },
93 /* IR remote control types */
94 static const value_string slimp3_ir_types
[] = {
96 { 0xff, "JVC DVD Player" },
101 /* IR codes for the custom SLIMP3 remote control */
102 static const value_string slimp3_ir_codes_slimp3
[] = {
103 { 0x768900ff, "voldown" },
104 { 0x768904fb, "brightness" },
106 { 0x768910ef, "play" },
107 { 0x768920df, "pause" },
109 { 0x768938c7, "repeat" },
110 { 0x768940bf, "power" },
112 { 0x768958a7, "search" },
113 { 0x7689609f, "add" },
115 { 0x76897887, "now_playing" },
116 { 0x7689807f, "volup" },
118 { 0x7689906f, "arrow_left" },
120 { 0x7689a05f, "fwd" },
122 { 0x7689b04f, "arrow_down" },
123 { 0x7689b847, "sleep" },
124 { 0x7689c03f, "rew" },
126 { 0x7689d02f, "arrow_right" },
127 { 0x7689d827, "shuffle" },
128 { 0x7689e01f, "arrow_up" },
131 { 0x7689f807, "size" },
135 static value_string_ext slimp3_ir_codes_slimp3_ext
= VALUE_STRING_EXT_INIT(slimp3_ir_codes_slimp3
);
137 /* IR codes for the JVC remote control */
138 static const value_string slimp3_ir_codes_jvc
[] = {
150 { 0xf7f6, "Picture-In-Picture" },
151 /* { 0xf7XX, "Enter" }, */
154 { 0xf76e, "Forward" },
155 { 0xf743, "Record" },
158 /* { 0xf7XX, "TV/Video" }, */
159 { 0xf703, "Display" },
168 { 0xf778, "Volume Up" },
169 { 0xf7f8, "Volume Down" },
170 { 0xf70d, "Channel Up" },
171 { 0xf78d, "Channel Down" },
172 /* { 0xf7XX, "Mute" }, */
173 { 0xf7ab, "Recall" },
180 static const value_string slimp3_display_commands
[] = {
181 { 0x1, "Clear Display"},
182 { 0x2, "Cursor to 1st Line Home"},
184 { 0x4, "Mode: Decrement Address, Shift Cursor"},
185 { 0x5, "Mode: Decrement Address, Shift Display"},
186 { 0x6, "Mode: Increment Address, Shift Cursor"},
187 { 0x7, "Mode: Increment Address, Shift Display"},
189 { 0x8, "Display Off"},
190 { 0xd, "Display On, With Blinking"},
191 { 0xe, "Display On, With Cursor"},
192 { 0xf, "Display On, With Cursor And Blinking"},
194 { 0x10, "Move Cursor Left"},
195 { 0x14, "Move Cursor Right"},
196 { 0x18, "Shift Display Left"},
197 { 0x1b, "Shift Display Right"},
199 { 0x30, "Set (8-bit)"},
200 { 0x20, "Set (4-bit)"},
202 { 0xa0, "Cursor to Top Right"},
203 { 0xc0, "Cursor to 2nd Line Home"},
208 static const value_string slimp3_display_fset8
[] = {
209 { 0x0, "Brightness 100%"},
210 { 0x1, "Brightness 75%"},
211 { 0x2, "Brightness 50%"},
212 { 0x3, "Brightness 25%"},
217 static const value_string slimp3_stream_control
[] = {
218 { 1, "Reset buffer, Start New Stream"},
219 { 2, "Pause Playback"},
220 { 4, "Resume Playback"},
225 static const value_string slimp3_mpg_control
[] = {
226 { 0, "Go"}, /* Run the decoder */
227 { 1, "Stop"}, /* Halt decoder but don't reset rptr */
228 { 3, "Reset"}, /* Halt decoder and reset rptr */
233 #define MAX_LCD_STR_LEN 128
235 dissect_slimp3(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
237 const char *opcode_str
;
238 proto_tree
*slimp3_tree
;
243 unsigned char lcd_char
;
244 char lcd_str
[MAX_LCD_STR_LEN
+ 1];
245 bool to_server
= false;
246 bool old_protocol
= false;
252 * If it doesn't begin with a known opcode, reject it, so that
253 * traffic that happens to be do or from one of our ports
254 * doesn't get misidentified as SliMP3 traffic.
256 if (!tvb_bytes_exist(tvb
, offset
, 1))
257 return 0; /* not even an opcode */
258 opcode
= tvb_get_uint8(tvb
, offset
);
259 opcode_str
= try_val_to_str(opcode
, slimp3_opcode_vals
);
260 if (opcode_str
== NULL
)
263 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "SliMP3");
264 col_add_str(pinfo
->cinfo
, COL_INFO
, opcode_str
);
266 ti
= proto_tree_add_item(tree
, proto_slimp3
, tvb
, offset
, -1, ENC_NA
);
267 slimp3_tree
= proto_item_add_subtree(ti
, ett_slimp3
);
269 proto_tree_add_uint(slimp3_tree
, hf_slimp3_opcode
, tvb
,
272 /* The new protocol (v1.3 and later) uses an IANA-assigned port number.
273 * It usually uses the same number for both sizes of the conversation, so
274 * the port numbers can't always be used to determine client and server.
275 * The new protocol places the clients MAC address in the packet, so that
276 * is used to identify packets originating at the client.
278 if ((pinfo
->destport
== UDP_PORT_SLIMP3_V2
) && (pinfo
->srcport
== UDP_PORT_SLIMP3_V2
)) {
279 set_address_tvb(&tmp_addr
, AT_ETHER
, 6, tvb
, offset
+12);
280 to_server
= addresses_equal(&tmp_addr
, &pinfo
->dl_src
);
282 else if (pinfo
->destport
== UDP_PORT_SLIMP3_V2
) {
285 else if (pinfo
->srcport
== UDP_PORT_SLIMP3_V2
) {
288 if (pinfo
->destport
== UDP_PORT_SLIMP3_V1
) {
292 else if (pinfo
->srcport
== UDP_PORT_SLIMP3_V1
) {
304 * [2..5] player's time since startup in ticks @625 KHz
305 * [6] IR code id, ff=JVC, 02=SLIMP3
306 * [7] number of meaningful bits - 16 for JVC, 32 for SLIMP3
307 * [8..11] the 32-bit IR code
311 i1
= tvb_get_ntohl(tvb
, offset
+2);
312 proto_tree_add_uint_format_value(slimp3_tree
, hf_slimp3_uptime
, tvb
, offset
+2, 4, i1
,
313 "%u sec (%u ticks)", i1
/625000, i1
);
315 proto_tree_add_item(slimp3_tree
, hf_slimp3_code_id
, tvb
, offset
+6, 1, ENC_BIG_ENDIAN
);
316 proto_tree_add_item(slimp3_tree
, hf_slimp3_code_bits
, tvb
, offset
+7, 1, ENC_BIG_ENDIAN
);
318 i1
= tvb_get_ntohl(tvb
, offset
+8);
319 /* Check the code to figure out which remote is being used. */
320 if (tvb_get_uint8(tvb
, offset
+6) == 0x02 &&
321 tvb_get_uint8(tvb
, offset
+7) == 32) {
322 /* This is the custom SLIMP3 remote. */
323 proto_tree_add_item(slimp3_tree
, hf_slimp3_infrared_slimp3
, tvb
, offset
+8, 4, ENC_BIG_ENDIAN
);
324 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", SLIMP3: %s",
325 val_to_str_ext(i1
, &slimp3_ir_codes_slimp3_ext
, "Unknown (0x%0x)"));
327 else if (tvb_get_uint8(tvb
, offset
+6) == 0xff &&
328 tvb_get_uint8(tvb
, offset
+7) == 16) {
329 /* This is a JVC DVD player remote */
330 proto_tree_add_item(slimp3_tree
, hf_slimp3_infrared_jvc
, tvb
, offset
+8, 4, ENC_BIG_ENDIAN
);
331 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", JVC: %s",
332 val_to_str(i1
, slimp3_ir_codes_jvc
, "Unknown (0x%0x)"));
334 /* Unknown code; just write it */
335 proto_tree_add_item(slimp3_tree
, hf_slimp3_infrared
, tvb
, offset
+8, 4, ENC_BIG_ENDIAN
);
336 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", 0x%0x", i1
);
345 /* Loop through the commands */
349 while (i1
< tvb_reported_length_remaining(tvb
, offset
)) {
350 switch(tvb_get_uint8(tvb
, offset
+ i1
)) {
354 proto_tree_add_item(slimp3_tree
, hf_slimp3_display_delay
, tvb
, offset
+ i1
, 2, ENC_NA
);
358 lcd_char
= tvb_get_uint8(tvb
, offset
+ i1
+ 1);
359 if (!g_ascii_isprint(lcd_char
))
363 proto_item_append_text(ti
, "%c", lcd_char
);
364 proto_item_set_len(ti
, lcd_strlen
);
366 ti
= proto_tree_add_uint_format_value(slimp3_tree
, hf_slimp3_display_string
, tvb
, offset
+ i1
, 2,
367 lcd_char
, "%c", lcd_char
);
377 value
= tvb_get_uint8(tvb
, offset
+ i1
+ 1);
378 ti
= proto_tree_add_uint(slimp3_tree
, hf_slimp3_display_command
, tvb
, offset
+ i1
, 2, value
);
379 if ((tvb_get_uint8(tvb
, offset
+ i1
+ 1) & 0xf0) == 0x30) {
380 proto_item_append_text(ti
, ": %s",
381 val_to_str(tvb_get_uint8(tvb
, offset
+ i1
+ 2),
382 slimp3_display_fset8
,
390 proto_tree_add_item(slimp3_tree
, hf_slimp3_display_unknown
, tvb
, offset
+ i1
, 2, ENC_NA
);
399 while (tvb_offset_exists(tvb
, offset
+ i1
) &&
400 lcd_strlen
< MAX_LCD_STR_LEN
) {
401 switch (tvb_get_uint8(tvb
, offset
+ i1
)) {
404 lcd_str
[lcd_strlen
++] = '.';
408 lcd_str
[lcd_strlen
++] = '|';
409 if (tvb_offset_exists(tvb
, offset
+ i1
+ 1) &&
410 (tvb_get_uint8(tvb
, offset
+ i1
+ 1) & 0xf0) == 0x30)
415 if (tvb_offset_exists(tvb
, offset
+ i1
+ 1)) {
416 if ((lcd_strlen
< 1) ||
417 (lcd_str
[lcd_strlen
-1] != ' ') ||
418 (tvb_get_uint8(tvb
, offset
+ i1
+ 1) != ' ')) {
419 lcd_char
= tvb_get_uint8(tvb
, offset
+ i1
+ 1);
420 lcd_str
[lcd_strlen
++] = g_ascii_isprint(lcd_char
) ? lcd_char
: '.';
427 lcd_str
[lcd_strlen
] = '\0';
429 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", %s", lcd_str
);
433 proto_tree_add_item(slimp3_tree
, hf_slimp3_control
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
434 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", %s",
435 val_to_str(tvb_get_uint8(tvb
, offset
+1),
436 slimp3_stream_control
, "Unknown (0x%0x)"));
443 /* Hello response; client->server */
444 proto_tree_add_item(slimp3_tree
, hf_slimp3_hello_response_client_server
, tvb
, offset
, 1, ENC_NA
);
445 proto_tree_add_item(slimp3_tree
, hf_slimp3_device_id
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
446 fw_ver
= tvb_get_uint8(tvb
, offset
+2);
447 proto_tree_add_uint_format_value(slimp3_tree
, hf_slimp3_fw_rev
, tvb
, offset
+2, 1, fw_ver
,
448 "%u.%u (0x%0x)", fw_ver
>>4, fw_ver
& 0xf, fw_ver
);
450 /* Hello request; server->client */
451 proto_tree_add_item(slimp3_tree
, hf_slimp3_hello_request_server_client
, tvb
, offset
, 1, ENC_NA
);
458 /* Hello response; client->server */
459 proto_tree_add_item(slimp3_tree
, hf_slimp3_i2c_response_client_server
, tvb
, offset
, -1, ENC_NA
);
460 col_append_str(pinfo
->cinfo
, COL_INFO
, ", Response");
462 /* Hello request; server->client */
463 proto_tree_add_item(slimp3_tree
, hf_slimp3_i2c_request_server_client
, tvb
, offset
, -1, ENC_NA
);
464 col_append_str(pinfo
->cinfo
, COL_INFO
, ", Request");
468 case SLIMP3_DATA_REQ
:
469 proto_tree_add_item(slimp3_tree
, hf_slimp3_data_req_offset
, tvb
, offset
+2, 2, ENC_BIG_ENDIAN
);
470 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", Offset: %u bytes",
471 tvb_get_ntohs(tvb
, offset
+2)*2);
475 /* MPEG data (v1.3 and later)
479 * [6..7] Write pointer (in words)
481 * [10..11] Sequence number
486 unsigned offset_buffer
;
487 proto_tree_add_bytes_format(slimp3_tree
, hf_slimp3_data_length
, tvb
, offset
, -1,
488 NULL
, "Length: %d bytes",
489 tvb_reported_length_remaining(tvb
, offset
+18));
490 offset_buffer
= tvb_get_ntohs(tvb
, offset
+2) * 2;
491 proto_tree_add_uint(slimp3_tree
, hf_slimp3_data_offset
, tvb
, offset
+2, 2, offset_buffer
);
493 col_append_fstr(pinfo
->cinfo
, COL_INFO
,
494 ", Length: %d bytes, Offset: %u bytes.",
495 tvb_reported_length_remaining(tvb
, offset
+18),
499 unsigned write_pointer
;
500 proto_tree_add_item(slimp3_tree
, hf_slimp3_data_command
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
501 proto_tree_add_bytes_format(slimp3_tree
, hf_slimp3_data_length
, tvb
, offset
, -1,
502 NULL
, "Length: %d bytes",
503 tvb_reported_length_remaining(tvb
, offset
+18));
504 write_pointer
= tvb_get_ntohs(tvb
, offset
+6) * 2;
505 proto_tree_add_uint(slimp3_tree
, hf_slimp3_data_write_pointer
, tvb
, offset
+6, 2, write_pointer
);
506 proto_tree_add_item(slimp3_tree
, hf_slimp3_data_sequence
, tvb
, offset
+10, 2, ENC_BIG_ENDIAN
);
508 col_append_fstr(pinfo
->cinfo
, COL_INFO
,
509 ", %s, %d bytes at %u, Sequence: %u",
510 val_to_str(tvb_get_uint8(tvb
, offset
+1),
511 slimp3_mpg_control
, "Unknown (0x%0x)"),
512 tvb_reported_length_remaining(tvb
, offset
+18),
514 tvb_get_ntohs(tvb
, offset
+10));
518 case SLIMP3_DISC_REQ
:
521 proto_tree_add_item(slimp3_tree
, hf_slimp3_device_id
, tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
522 fw_ver
= tvb_get_uint8(tvb
, offset
+2);
523 proto_tree_add_uint_format_value(slimp3_tree
, hf_slimp3_fw_rev
, tvb
, offset
+2, 1, fw_ver
,
524 "%u.%u (0x%0x)", fw_ver
>>4, fw_ver
& 0xf, fw_ver
);
525 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", Device ID: %u. Firmware: %u.%u",
526 tvb_get_uint8(tvb
, offset
+1), fw_ver
>>4, fw_ver
& 0xf);
530 case SLIMP3_DISC_RSP
:
532 proto_tree_add_item(slimp3_tree
, hf_slimp3_disc_rsp_server_ip
, tvb
, offset
+2, 4, ENC_BIG_ENDIAN
);
533 proto_tree_add_item(slimp3_tree
, hf_slimp3_disc_rsp_server_port
, tvb
, offset
+6, 2, ENC_BIG_ENDIAN
);
536 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", Server Address: %s. Server Port: %u",
537 tvb_ip_to_str(pinfo
->pool
, tvb
, offset
+2),
538 tvb_get_ntohs(tvb
, offset
+ 6));
541 case SLIMP3_DATA_ACK
:
542 /* Acknowledge MPEG data
546 * [6..7] Write pointer (in words)
547 * [8..9] Read pointer (in words)
548 * [10..11] Sequence number
549 * [12..17] client MAC address (v1.3 and later)
554 pointer
= tvb_get_ntohs(tvb
, offset
+6) * 2;
555 proto_tree_add_uint(slimp3_tree
, hf_slimp3_data_ack_write_pointer
, tvb
, offset
+6, 2, pointer
);
556 pointer
= tvb_get_ntohs(tvb
, offset
+8) * 2;
557 proto_tree_add_uint(slimp3_tree
, hf_slimp3_data_ack_read_pointer
, tvb
, offset
+8, 2, pointer
);
558 proto_tree_add_item(slimp3_tree
, hf_slimp3_data_ack_sequence
, tvb
, offset
+10, 2, ENC_BIG_ENDIAN
);
561 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", Sequence: %u",
562 tvb_get_ntohs(tvb
, offset
+10));
567 proto_tree_add_item(slimp3_tree
, hf_slimp3_data_data
, tvb
, offset
, -1, ENC_NA
);
572 return tvb_reported_length(tvb
);
576 proto_register_slimp3(void)
578 static hf_register_info hf
[] = {
580 { "Opcode", "slimp3.opcode",
581 FT_UINT8
, BASE_DEC
, VALS(slimp3_opcode_vals
), 0x0,
582 "SLIMP3 message type", HFILL
}},
584 { &hf_slimp3_control
,
585 { "Control Packet", "slimp3.control",
586 FT_UINT8
, BASE_DEC
, VALS(slimp3_stream_control
), 0x0,
587 "SLIMP3 control", HFILL
}},
590 { "Uptime", "slimp3.uptime",
591 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
594 { &hf_slimp3_code_id
,
595 { "Code identifier", "slimp3.code_id",
596 FT_UINT8
, BASE_DEC
, VALS(slimp3_ir_types
), 0x0,
599 { &hf_slimp3_code_bits
,
600 { "Code bits", "slimp3.code_bits",
601 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
604 { &hf_slimp3_infrared_slimp3
,
605 { "Infrared Code", "slimp3.infrared",
606 FT_UINT32
, BASE_HEX
| BASE_EXT_STRING
, &slimp3_ir_codes_slimp3_ext
, 0x0,
609 { &hf_slimp3_infrared_jvc
,
610 { "Infrared Code", "slimp3.infrared",
611 FT_UINT32
, BASE_HEX
, VALS(slimp3_ir_codes_jvc
), 0x0,
614 { &hf_slimp3_infrared
,
615 { "Infrared Code", "slimp3.infrared",
616 FT_UINT32
, BASE_HEX
, NULL
, 0x0,
619 { &hf_slimp3_device_id
,
620 { "Device ID", "slimp3.device_id",
621 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
625 { "Firmware Revision", "slimp3.fw_rev",
626 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
629 { &hf_slimp3_data_offset
,
630 { "Buffer offset", "slimp3.data.offset",
631 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
634 { &hf_slimp3_data_command
,
635 { "Command", "slimp3.data.command",
636 FT_UINT8
, BASE_HEX
, VALS(slimp3_mpg_control
), 0x0,
639 { &hf_slimp3_data_write_pointer
,
640 { "Write Pointer", "slimp3.data.write_pointer",
641 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
644 { &hf_slimp3_data_sequence
,
645 { "Sequence", "slimp3.data.sequence",
646 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
649 { &hf_slimp3_disc_rsp_server_ip
,
650 { "Server Address", "slimp3.disc_rsp.server_ip",
651 FT_IPv4
, BASE_NONE
, NULL
, 0x0,
654 { &hf_slimp3_disc_rsp_server_port
,
655 { "Server Port", "slimp3.disc_rsp.server_port",
656 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
659 { &hf_slimp3_data_ack_write_pointer
,
660 { "Write Pointer", "slimp3.data_ack.write_pointer",
661 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
664 { &hf_slimp3_data_ack_read_pointer
,
665 { "Read Pointer", "slimp3.data_ack.read_pointer",
666 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
669 { &hf_slimp3_data_ack_sequence
,
670 { "Sequence", "slimp3.data_ack.sequence",
671 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
674 { &hf_slimp3_data_req_offset
,
675 { "Requested offset", "slimp3.data_req.offset",
676 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
679 /* Generated from convert_proto_tree_add_text.pl */
680 { &hf_slimp3_display_delay
, { "Delay", "slimp3.display_delay", FT_UINT16
, BASE_DEC
|BASE_UNIT_STRING
, UNS(&units_milliseconds
), 0x0, NULL
, HFILL
}},
681 { &hf_slimp3_display_string
, { "String", "slimp3.display_string", FT_UINT16
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}},
682 { &hf_slimp3_display_command
, { "Command", "slimp3.display_command", FT_UINT8
, BASE_DEC
, VALS(slimp3_display_commands
), 0x0, NULL
, HFILL
}},
683 { &hf_slimp3_display_unknown
, { "Unknown", "slimp3.display_unknown", FT_UINT16
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}},
684 { &hf_slimp3_hello_response_client_server
, { "Hello Response (Client --> Server)", "slimp3.hello_response_client_server", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
685 { &hf_slimp3_hello_request_server_client
, { "Hello Request (Server --> Client)", "slimp3.hello_request_server_client", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
686 { &hf_slimp3_i2c_response_client_server
, { "I2C Response (Client --> Server)", "slimp3.i2c_response_client_server", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
687 { &hf_slimp3_i2c_request_server_client
, { "I2C Request (Server --> Client)", "slimp3.i2c_request_server_client", FT_NONE
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
688 { &hf_slimp3_data_length
, { "Length", "slimp3.data.length", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
689 { &hf_slimp3_data_data
, { "Data", "slimp3.data.data", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}},
692 static int *ett
[] = {
696 proto_slimp3
= proto_register_protocol("SliMP3 Communication Protocol", "SliMP3", "slimp3");
697 proto_register_field_array(proto_slimp3
, hf
, array_length(hf
));
698 proto_register_subtree_array(ett
, array_length(ett
));
700 slimp3_handle
= register_dissector("slimp3", dissect_slimp3
, proto_slimp3
);
704 proto_reg_handoff_slimp3(void)
706 dissector_add_uint_range_with_preference("udp.port", UDP_PORT_SLIMP3_RANGE
, slimp3_handle
);
715 * indent-tabs-mode: nil
718 * ex: set shiftwidth=4 tabstop=8 expandtab:
719 * :indentSize=4:tabSize=8:noTabs=true: