if (opcode_str == NULL)
return 0;
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "SliMP3");
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SliMP3");
if (check_col(pinfo->cinfo, COL_INFO)) {
if (tree) {
- ti = proto_tree_add_item(tree, proto_slimp3, tvb, offset, -1, FALSE);
+ ti = proto_tree_add_item(tree, proto_slimp3, tvb, offset, -1, ENC_NA);
slimp3_tree = proto_item_add_subtree(ti, ett_slimp3);
proto_tree_add_uint(slimp3_tree, hf_slimp3_opcode, tvb,
* [12..17] reserved
*/
if (tree) {
- hidden_item = proto_tree_add_item(slimp3_tree, hf_slimp3_ir, tvb, offset+8, 4, FALSE);
+ hidden_item = proto_tree_add_item(slimp3_tree, hf_slimp3_ir, tvb, offset+8, 4, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_HIDDEN(hidden_item);
i1 = tvb_get_ntohl(tvb, offset+2);
if (tree) {
hidden_item = proto_tree_add_item(slimp3_tree, hf_slimp3_display,
- tvb, offset, 1, FALSE);
+ tvb, offset, 1, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_HIDDEN(hidden_item);
/* Loop through the commands */
if (check_col(pinfo->cinfo, COL_INFO)) {
i1 = 18;
lcd_strlen = 0;
- while (tvb_offset_exists(tvb, offset + i1) &&
+ while (tvb_offset_exists(tvb, offset + i1) &&
lcd_strlen < MAX_LCD_STR_LEN) {
switch (tvb_get_guint8(tvb, offset + i1)) {
case SLIMP3_CONTROL:
if (tree) {
hidden_item = proto_tree_add_item(slimp3_tree, hf_slimp3_control,
- tvb, offset+1, 1, FALSE);
+ tvb, offset+1, 1, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_text(slimp3_tree, tvb, offset+1, 1, "Command: %s",
val_to_str(tvb_get_guint8(tvb, offset+1),
case SLIMP3_HELLO:
if (tree) {
hidden_item = proto_tree_add_item(slimp3_tree, hf_slimp3_hello,
- tvb, offset+1, 1, FALSE);
+ tvb, offset+1, 1, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_HIDDEN(hidden_item);
if (to_server) {
guint8 fw_ver = 0;
case SLIMP3_I2C:
if (tree) {
hidden_item = proto_tree_add_item(slimp3_tree, hf_slimp3_i2c,
- tvb, offset, 1, FALSE);
+ tvb, offset, 1, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_HIDDEN(hidden_item);
if (to_server) {
/* Hello response; client->server */
case SLIMP3_DATA_REQ:
if (tree) {
hidden_item = proto_tree_add_item(slimp3_tree, hf_slimp3_data_request,
- tvb, offset, 1, FALSE);
+ tvb, offset, 1, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_text(slimp3_tree, tvb, offset+2, 2,
"Requested offset: %d bytes.",
*/
if (tree) {
hidden_item = proto_tree_add_item(slimp3_tree, hf_slimp3_data,
- tvb, offset, 1, FALSE);
+ tvb, offset, 1, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_HIDDEN(hidden_item);
if (old_protocol) {
proto_tree_add_text(slimp3_tree, tvb, offset, -1,
- "Length: %d bytes",
+ "Length: %d bytes",
tvb_reported_length_remaining(tvb, offset+18));
proto_tree_add_text(slimp3_tree, tvb, offset+2, 2,
"Buffer offset: %d bytes.",
val_to_str(tvb_get_guint8(tvb, offset+1),
slimp3_mpg_control, "Unknown (0x%0x)"));
proto_tree_add_text(slimp3_tree, tvb, offset, -1,
- "Length: %d bytes",
+ "Length: %d bytes",
tvb_reported_length_remaining(tvb, offset+18));
proto_tree_add_text(slimp3_tree, tvb, offset+6, 2,
"Write Pointer: %d",
if (check_col(pinfo->cinfo, COL_INFO)) {
if (old_protocol) {
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
", Length: %d bytes, Offset: %d bytes.",
tvb_reported_length_remaining(tvb, offset+18),
tvb_get_ntohs(tvb, offset+2) * 2);
}
else {
- col_append_fstr(pinfo->cinfo, COL_INFO,
+ col_append_fstr(pinfo->cinfo, COL_INFO,
", %s, %d bytes at %d, Sequence: %d",
val_to_str(tvb_get_guint8(tvb, offset+1),
slimp3_mpg_control, "Unknown (0x%0x)"),
if (tree) {
guint8 fw_ver;
hidden_item = proto_tree_add_item(slimp3_tree, hf_slimp3_discover_request,
- tvb, offset, 1, FALSE);
+ tvb, offset, 1, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_text(slimp3_tree, tvb, offset+1, 1,
"Device ID: %d.", tvb_get_guint8(tvb, offset+1));
case SLIMP3_DISC_RSP:
if (tree) {
hidden_item = proto_tree_add_item(slimp3_tree, hf_slimp3_discover_response,
- tvb, offset, 1, FALSE);
+ tvb, offset, 1, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_text(slimp3_tree, tvb, offset+2, 4,
"Server Address: %s.",
- ip_to_str(tvb_get_ptr(tvb, offset+2, 4)));
+ tvb_ip_to_str(tvb, offset+2));
proto_tree_add_text(slimp3_tree, tvb, offset+6, 2,
"Server Port: %d", tvb_get_ntohs(tvb, offset + 6));
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Server Address: %s. Server Port: %d",
- ip_to_str(tvb_get_ptr(tvb, offset+2, 4)),
+ tvb_ip_to_str(tvb, offset+2),
tvb_get_ntohs(tvb, offset + 6));
}
break;
/* Acknowledge MPEG data
*
* [0] 'a'
- * [1..5]
+ * [1..5]
* [6..7] Write pointer (in words)
* [8..9] Read pointer (in words)
* [10..11] Sequence number
*/
if (tree) {
hidden_item = proto_tree_add_item(slimp3_tree, hf_slimp3_data_ack,
- tvb, offset, 1, FALSE);
+ tvb, offset, 1, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_text(slimp3_tree, tvb, offset+6, 2,
"Write Pointer: %d",
{ &hf_slimp3_control,
{ "Control Packet", "slimp3.control",
- FT_BOOLEAN, BASE_DEC, NULL, 0x0,
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"SLIMP3 control", HFILL }},
{ &hf_slimp3_display,
{ "Display", "slimp3.display",
- FT_BOOLEAN, BASE_DEC, NULL, 0x0,
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"SLIMP3 display", HFILL }},
{ &hf_slimp3_hello,
{ "Hello", "slimp3.hello",
- FT_BOOLEAN, BASE_DEC, NULL, 0x0,
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"SLIMP3 hello", HFILL }},
{ &hf_slimp3_i2c,
{ "I2C", "slimp3.i2c",
- FT_BOOLEAN, BASE_DEC, NULL, 0x0,
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"SLIMP3 I2C", HFILL }},
{ &hf_slimp3_data,
{ "Data", "slimp3.data",
- FT_BOOLEAN, BASE_DEC, NULL, 0x0,
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"SLIMP3 Data", HFILL }},
{ &hf_slimp3_data_request,
{ "Data Request", "slimp3.data_req",
- FT_BOOLEAN, BASE_DEC, NULL, 0x0,
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"SLIMP3 Data Request", HFILL }},
{ &hf_slimp3_discover_request,
{ "Discovery Request", "slimp3.discovery_req",
- FT_BOOLEAN, BASE_DEC, NULL, 0x0,
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"SLIMP3 Discovery Request", HFILL }},
{ &hf_slimp3_discover_response,
{ "Discovery Response", "slimp3.discovery_response",
- FT_BOOLEAN, BASE_DEC, NULL, 0x0,
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"SLIMP3 Discovery Response", HFILL }},
{ &hf_slimp3_data_ack,
{ "Data Ack", "slimp3.data_ack",
- FT_BOOLEAN, BASE_DEC, NULL, 0x0,
+ FT_BOOLEAN, BASE_NONE, NULL, 0x0,
"SLIMP3 Data Ack", HFILL }},
};
dissector_handle_t slimp3_handle;
slimp3_handle = new_create_dissector_handle(dissect_slimp3, proto_slimp3);
- dissector_add("udp.port", UDP_PORT_SLIMP3_V1, slimp3_handle);
- dissector_add("udp.port", UDP_PORT_SLIMP3_V2, slimp3_handle);
+ dissector_add_uint("udp.port", UDP_PORT_SLIMP3_V1, slimp3_handle);
+ dissector_add_uint("udp.port", UDP_PORT_SLIMP3_V2, slimp3_handle);
}