1 /* packet-indigocare-netrix.c
2 * Dissector routines for the IndigoCare Netrix protocols
3 * By Erik de Jong <erikdejong@gmail.com>
4 * Copyright 2016 Erik de Jong
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
16 #include <epan/packet.h>
17 #include <epan/expert.h>
18 #include <wsutil/strtoi.h>
20 #define INDIGOCARE_NETRIX_SOH 0x01
21 #define INDIGOCARE_NETRIX_STX 0x02
22 #define INDIGOCARE_NETRIX_ETX 0x03
23 #define INDIGOCARE_NETRIX_EOT 0x04
24 #define INDIGOCARE_NETRIX_ACK 0x06
25 #define INDIGOCARE_NETRIX_US 0x1F
26 #define INDIGOCARE_NETRIX_RS 0x1E
28 #define INDIGOCARE_NETRIX_SYSTEMINFO 0x01
29 #define INDIGOCARE_NETRIX_GROUP 0x0A
30 #define INDIGOCARE_NETRIX_PROFILE 0x0F
31 #define INDIGOCARE_NETRIX_GET_CONVERSIONTABLE 0x23
32 #define INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_BEGIN 0x88B8
33 #define INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_END 0x8C9E
34 #define INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_NONE 0x8C9F
35 #define INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES 0x24
36 #define INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_BEGIN 0x8CA0
37 #define INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_END 0x9086
38 #define INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_NONE 0x9087
39 #define INDIGOCARE_NETRIX_BOSCH 0x69
41 #define INDIGOCARE_NETRIX_SYSTEMINFO_COMPUTERNAME 0x01
42 #define INDIGOCARE_NETRIX_SYSTEMINFO_IPADDRESS 0x02
43 #define INDIGOCARE_NETRIX_SYSTEMINFO_VERSION 0x03
44 #define INDIGOCARE_NETRIX_SYSTEMINFO_BEEP 0x04
46 #define INDIGOCARE_NETRIX_GROUP_GROUPNUMBER 0x01
47 #define INDIGOCARE_NETRIX_GROUP_TYPE 0x02
48 #define INDIGOCARE_NETRIX_GROUP_ADDITION 0x03
49 #define INDIGOCARE_NETRIX_GROUP_IDBOSCHLOC 0x04
50 #define INDIGOCARE_NETRIX_GROUP_NAME 0x05
51 #define INDIGOCARE_NETRIX_GROUP_ROOM 0x06
52 #define INDIGOCARE_NETRIX_GROUP_LOCATION 0x07
54 #define INDIGOCARE_NETRIX_PROFILE_PROFILENUMBER 0x01
55 #define INDIGOCARE_NETRIX_PROFILE_TYPE 0x02
56 #define INDIGOCARE_NETRIX_PROFILE_ADDITION 0x03
57 #define INDIGOCARE_NETRIX_PROFILE_IDBOSCHLOC 0x04
58 #define INDIGOCARE_NETRIX_PROFILE_NAME 0x05
59 #define INDIGOCARE_NETRIX_PROFILE_ROOM 0x06
60 #define INDIGOCARE_NETRIX_PROFILE_LOCATION 0x07
62 #define INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_TABLE 0x01
64 #define INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_KEY 0x01
65 #define INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_VALUE 0x02
67 #define INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_KEY 0x01
69 #define INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_TABLE 0x01
71 void proto_reg_handoff_netrix(void);
72 void proto_register_netrix(void);
74 static dissector_handle_t netrix_handle
;
76 static expert_field ei_netrix_unexpected_header
;
77 static expert_field ei_netrix_unexpected_record
;
79 static int proto_netrix
;
80 static int hf_netrix_header_type
;
81 static int hf_netrix_header_systeminfo_type
;
82 static int hf_netrix_header_groupcall_type
;
83 static int hf_netrix_header_profilecall_type
;
84 static int hf_netrix_header_get_conversiontable_type
;
85 static int hf_netrix_header_get_conversiontable_none_type
;
86 static int hf_netrix_header_get_conversiontable_result_type
;
87 static int hf_netrix_header_search_conversiontables_type
;
88 static int hf_netrix_header_search_conversiontables_none_type
;
89 static int hf_netrix_header_boschcall_type
;
91 static int hf_netrix_ack_type
;
93 static int hf_netrix_systeminfo_computername_type
;
94 static int hf_netrix_systeminfo_ipaddress_type
;
95 static int hf_netrix_systeminfo_version_type
;
96 static int hf_netrix_systeminfo_beep_type
;
98 static int hf_netrix_groupcall_groupnumber_type
;
99 static int hf_netrix_groupcall_type_type
;
100 static int hf_netrix_groupcall_addition_type
;
101 static int hf_netrix_groupcall_idboschloc_type
;
102 static int hf_netrix_groupcall_name_type
;
103 static int hf_netrix_groupcall_room_type
;
104 static int hf_netrix_groupcall_location_type
;
106 static int hf_netrix_profilecall_groupnumber_type
;
107 static int hf_netrix_profilecall_type_type
;
108 static int hf_netrix_profilecall_addition_type
;
109 static int hf_netrix_profilecall_idboschloc_type
;
110 static int hf_netrix_profilecall_name_type
;
111 static int hf_netrix_profilecall_room_type
;
112 static int hf_netrix_profilecall_location_type
;
114 static int hf_netrix_get_conversiontable_table_type
;
115 static int hf_netrix_get_conversiontable_key_type
;
116 static int hf_netrix_get_conversiontable_value_type
;
118 static int hf_netrix_search_conversiontables_key_type
;
119 static int hf_netrix_search_conversiontables_table_type
;
121 static int ett_netrix
;
122 static int ett_netrix_systeminfo
;
123 static int ett_netrix_groupcall
;
124 static int ett_netrix_profilecall
;
125 static int ett_netrix_get_conversiontable
;
126 static int ett_netrix_get_conversiontable_result
;
127 static int ett_netrix_search_conversiontables
;
128 static int ett_netrix_search_conversiontables_result
;
129 static int ett_netrix_boschcall
;
130 static int ett_netrix_unknown
;
132 static const value_string netrix_headertypenames
[] = {
133 { INDIGOCARE_NETRIX_SYSTEMINFO
, "System Info" },
134 { INDIGOCARE_NETRIX_GROUP
, "Group Call" },
135 { INDIGOCARE_NETRIX_PROFILE
, "Profile Call" },
136 { INDIGOCARE_NETRIX_GET_CONVERSIONTABLE
, "Get Conversiontable" },
137 { INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_NONE
, "Get Conversiontable - No Results" },
138 { INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES
, "Search Conversiontables" },
139 { INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_NONE
, "Search Conversiontables - No Results" },
140 { INDIGOCARE_NETRIX_BOSCH
, "Bosch Call" },
145 dissect_netrix(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree _U_
, void *data _U_
)
148 proto_item
*header_item
;
149 proto_tree
*netrix_tree
;
150 proto_tree
*netrix_header_tree
;
151 int32_t current_offset
= 0, header_offset
, identifier_start
, identifier_offset
, data_start
, data_offset
, ett
;
153 int32_t record_identifier
;
154 int32_t group_number
;
155 int32_t profile_number
;
156 const char * record_data
;
158 /* Corner case: 'EssecProtocolWithAck' ACK */
159 if (( tvb_get_uint8(tvb
, 0) == INDIGOCARE_NETRIX_ACK
) && (tvb_reported_length(tvb
) == 1)) {
160 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "Netrix");
161 col_clear(pinfo
->cinfo
, COL_INFO
);
162 ti
= proto_tree_add_item(tree
, proto_netrix
, tvb
, 0, -1, ENC_NA
);
163 netrix_tree
= proto_item_add_subtree(ti
, ett_netrix
);
164 col_set_str(pinfo
->cinfo
, COL_INFO
, "Ack");
165 proto_tree_add_item(netrix_tree
, hf_netrix_ack_type
, tvb
, 0, 1, ENC_NA
);
169 /* Starts with SOH */
170 if ( tvb_get_uint8(tvb
, 0) != INDIGOCARE_NETRIX_SOH
)
172 /* Ends with ETX or EOT */
173 if ((tvb_captured_length(tvb
) == tvb_reported_length(tvb
)) && (( tvb_get_uint8(tvb
, tvb_reported_length(tvb
) - 1) != INDIGOCARE_NETRIX_ETX
) && ( tvb_get_uint8(tvb
, tvb_reported_length(tvb
) - 1) != INDIGOCARE_NETRIX_EOT
))) {
176 /* It is a Netrix Communication Protocol packet */
177 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "Netrix");
178 col_clear(pinfo
->cinfo
, COL_INFO
);
179 ti
= proto_tree_add_item(tree
, proto_netrix
, tvb
, 0, -1, ENC_NA
);
180 netrix_tree
= proto_item_add_subtree(ti
, ett_netrix
);
184 header_offset
= tvb_find_uint8(tvb
, current_offset
, -1, INDIGOCARE_NETRIX_STX
);
185 if(!ws_strtoi32(tvb_get_string_enc(pinfo
->pool
, tvb
, current_offset
, header_offset
- current_offset
, ENC_ASCII
|ENC_NA
), NULL
, &header
)) {
186 /* Warn about invalid header? */
190 case INDIGOCARE_NETRIX_SYSTEMINFO
:
191 ett
= ett_netrix_systeminfo
;
192 header_item
= proto_tree_add_item(netrix_tree
, hf_netrix_header_systeminfo_type
, tvb
, current_offset
, header_offset
- current_offset
, ENC_NA
);
193 col_set_str(pinfo
->cinfo
, COL_INFO
, "Systeminfo:");
195 case INDIGOCARE_NETRIX_GROUP
:
196 ett
= ett_netrix_groupcall
;
197 header_item
= proto_tree_add_item(netrix_tree
, hf_netrix_header_groupcall_type
, tvb
, current_offset
, header_offset
- current_offset
, ENC_NA
);
198 col_set_str(pinfo
->cinfo
, COL_INFO
, "Group Call:");
200 case INDIGOCARE_NETRIX_PROFILE
:
201 ett
= ett_netrix_profilecall
;
202 header_item
= proto_tree_add_item(netrix_tree
, hf_netrix_header_profilecall_type
, tvb
, current_offset
, header_offset
- current_offset
, ENC_NA
);
203 col_set_str(pinfo
->cinfo
, COL_INFO
, "Profile Call:");
205 case INDIGOCARE_NETRIX_GET_CONVERSIONTABLE
:
206 ett
= ett_netrix_get_conversiontable
;
207 header_item
= proto_tree_add_item(netrix_tree
, hf_netrix_header_get_conversiontable_type
, tvb
, current_offset
, header_offset
- current_offset
, ENC_NA
);
208 col_set_str(pinfo
->cinfo
, COL_INFO
, "Get Conversiontable:");
210 case INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_NONE
:
211 ett
= ett_netrix_get_conversiontable_result
;
212 header_item
= proto_tree_add_item(netrix_tree
, hf_netrix_header_get_conversiontable_none_type
, tvb
, current_offset
, header_offset
- current_offset
, ENC_NA
);
213 col_set_str(pinfo
->cinfo
, COL_INFO
, "Get Conversiontable: No Results");
215 case INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES
:
216 ett
= ett_netrix_search_conversiontables
;
217 header_item
= proto_tree_add_item(netrix_tree
, hf_netrix_header_search_conversiontables_type
, tvb
, current_offset
, header_offset
- current_offset
, ENC_NA
);
218 col_set_str(pinfo
->cinfo
, COL_INFO
, "Search Conversiontables:");
220 case INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_NONE
:
221 ett
= ett_netrix_search_conversiontables_result
;
222 header_item
= proto_tree_add_item(netrix_tree
, hf_netrix_header_search_conversiontables_none_type
, tvb
, current_offset
, header_offset
- current_offset
, ENC_NA
);
223 col_set_str(pinfo
->cinfo
, COL_INFO
, "Search Conversiontables: No Results");
225 case INDIGOCARE_NETRIX_BOSCH
:
226 ett
= ett_netrix_boschcall
;
227 header_item
= proto_tree_add_item(netrix_tree
, hf_netrix_header_boschcall_type
, tvb
, current_offset
, header_offset
- current_offset
, ENC_NA
);
228 col_set_str(pinfo
->cinfo
, COL_INFO
, "Bosch Call:");
231 if ((header
>= INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_BEGIN
) && (header
<= INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_END
)) {
232 ett
= ett_netrix_get_conversiontable_result
;
233 header_item
= proto_tree_add_item(netrix_tree
, hf_netrix_header_get_conversiontable_result_type
, tvb
, current_offset
, header_offset
- current_offset
, ENC_NA
);
234 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "Get Conversiontable result %d:", header
- INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_BEGIN
);
235 } else if ((header
>= INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_BEGIN
) && (header
<= INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_END
)) {
236 ett
= ett_netrix_search_conversiontables_result
;
237 header_item
= proto_tree_add_item(netrix_tree
, hf_netrix_header_get_conversiontable_result_type
, tvb
, current_offset
, header_offset
- current_offset
, ENC_NA
);
238 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "Search Conversiontables result %d:", header
- INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_BEGIN
);
240 proto_tree_add_expert_format(netrix_tree
, pinfo
, &ei_netrix_unexpected_header
, tvb
, current_offset
, header_offset
- current_offset
, "Unexpected header %d", header
);
241 ett
= ett_netrix_unknown
;
242 header_item
= proto_tree_add_uint_format_value(netrix_tree
, hf_netrix_header_type
, tvb
, current_offset
, header_offset
- current_offset
, header
, "%d", header
);
243 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "%s:", val_to_str(header
, netrix_headertypenames
, "Unknown (%d)"));
247 netrix_header_tree
= proto_item_add_subtree(header_item
, ett
);
248 current_offset
= header_offset
+ 1;
251 while (tvb_get_uint8(tvb
, current_offset
) != INDIGOCARE_NETRIX_ETX
) {
252 identifier_start
= current_offset
;
253 identifier_offset
= tvb_find_uint8(tvb
, current_offset
, -1, INDIGOCARE_NETRIX_US
);
254 ws_strtoi32(tvb_get_string_enc(pinfo
->pool
, tvb
, current_offset
, identifier_offset
- current_offset
, ENC_ASCII
|ENC_NA
), NULL
, &record_identifier
);
255 current_offset
= identifier_offset
+ 1;
257 data_start
= current_offset
;
258 data_offset
= tvb_find_uint8(tvb
, current_offset
, -1, INDIGOCARE_NETRIX_RS
);
259 record_data
= tvb_get_string_enc(pinfo
->pool
, tvb
, current_offset
, data_offset
- current_offset
, ENC_ASCII
|ENC_NA
);
261 current_offset
= data_offset
+ 1;
264 case INDIGOCARE_NETRIX_SYSTEMINFO
:
265 switch (record_identifier
) {
266 case INDIGOCARE_NETRIX_SYSTEMINFO_COMPUTERNAME
:
267 proto_tree_add_item(netrix_header_tree
, hf_netrix_systeminfo_computername_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
268 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Computername=%s", record_data
);
270 case INDIGOCARE_NETRIX_SYSTEMINFO_IPADDRESS
:
271 proto_tree_add_item(netrix_header_tree
, hf_netrix_systeminfo_ipaddress_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
272 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " IP Address=%s", record_data
);
274 case INDIGOCARE_NETRIX_SYSTEMINFO_VERSION
:
275 proto_tree_add_item(netrix_header_tree
, hf_netrix_systeminfo_version_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
276 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Systeminfo=%s", record_data
);
278 case INDIGOCARE_NETRIX_SYSTEMINFO_BEEP
:
279 proto_tree_add_item(netrix_header_tree
, hf_netrix_systeminfo_beep_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
282 proto_tree_add_expert_format(netrix_header_tree
, pinfo
, &ei_netrix_unexpected_record
, tvb
, identifier_start
, data_offset
- identifier_start
, "Unexpected record %d with value %s", record_identifier
, record_data
);
286 case INDIGOCARE_NETRIX_GROUP
:
287 switch (record_identifier
) {
288 case INDIGOCARE_NETRIX_GROUP_GROUPNUMBER
:
289 ws_strtoi32(record_data
, NULL
, &group_number
);
290 proto_tree_add_uint_format_value(netrix_header_tree
, hf_netrix_groupcall_groupnumber_type
, tvb
, identifier_start
, data_offset
- identifier_start
, group_number
, "%d", group_number
);
291 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Groupnumber=%d", group_number
);
293 case INDIGOCARE_NETRIX_GROUP_TYPE
:
294 proto_tree_add_item(netrix_header_tree
, hf_netrix_groupcall_type_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
295 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Type=%s", record_data
);
297 case INDIGOCARE_NETRIX_GROUP_ADDITION
:
298 proto_tree_add_item(netrix_header_tree
, hf_netrix_groupcall_addition_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
300 case INDIGOCARE_NETRIX_GROUP_IDBOSCHLOC
:
301 proto_tree_add_item(netrix_header_tree
, hf_netrix_groupcall_idboschloc_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
303 case INDIGOCARE_NETRIX_GROUP_NAME
:
304 proto_tree_add_item(netrix_header_tree
, hf_netrix_groupcall_name_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
305 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Name=%s", record_data
);
307 case INDIGOCARE_NETRIX_GROUP_ROOM
:
308 proto_tree_add_item(netrix_header_tree
, hf_netrix_groupcall_room_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
309 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Room=%s", record_data
);
311 case INDIGOCARE_NETRIX_GROUP_LOCATION
:
312 proto_tree_add_item(netrix_header_tree
, hf_netrix_groupcall_location_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
313 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Location=%s", record_data
);
316 proto_tree_add_expert_format(netrix_header_tree
, pinfo
, &ei_netrix_unexpected_record
, tvb
, identifier_start
, data_offset
- identifier_start
, "Unexpected record %d with value %s", record_identifier
, record_data
);
320 case INDIGOCARE_NETRIX_PROFILE
:
321 switch (record_identifier
) {
322 case INDIGOCARE_NETRIX_PROFILE_PROFILENUMBER
:
323 ws_strtoi32(record_data
, NULL
, &profile_number
);
324 proto_tree_add_uint_format_value(netrix_header_tree
, hf_netrix_profilecall_groupnumber_type
, tvb
, identifier_start
, data_offset
- identifier_start
, profile_number
, "%d", profile_number
);
325 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Profilenumber=%d", profile_number
);
327 case INDIGOCARE_NETRIX_PROFILE_TYPE
:
328 proto_tree_add_item(netrix_header_tree
, hf_netrix_profilecall_type_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
329 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Type=%s", record_data
);
331 case INDIGOCARE_NETRIX_PROFILE_ADDITION
:
332 proto_tree_add_item(netrix_header_tree
, hf_netrix_profilecall_addition_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
334 case INDIGOCARE_NETRIX_PROFILE_IDBOSCHLOC
:
335 proto_tree_add_item(netrix_header_tree
, hf_netrix_profilecall_idboschloc_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
337 case INDIGOCARE_NETRIX_PROFILE_NAME
:
338 proto_tree_add_item(netrix_header_tree
, hf_netrix_profilecall_name_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
339 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Name=%s", record_data
);
341 case INDIGOCARE_NETRIX_PROFILE_ROOM
:
342 proto_tree_add_item(netrix_header_tree
, hf_netrix_profilecall_room_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
343 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Room=%s", record_data
);
345 case INDIGOCARE_NETRIX_PROFILE_LOCATION
:
346 proto_tree_add_item(netrix_header_tree
, hf_netrix_profilecall_location_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
347 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Location=%s", record_data
);
350 proto_tree_add_expert_format(netrix_header_tree
, pinfo
, &ei_netrix_unexpected_record
, tvb
, identifier_start
, data_offset
- identifier_start
, "Unexpected record %d with value %s", record_identifier
, record_data
);
354 case INDIGOCARE_NETRIX_GET_CONVERSIONTABLE
:
355 switch (record_identifier
) {
356 case INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_TABLE
:
357 proto_tree_add_item(netrix_header_tree
, hf_netrix_get_conversiontable_table_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
358 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Table=%s", record_data
);
362 case INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES
:
363 switch (record_identifier
) {
364 case INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_KEY
:
365 proto_tree_add_item(netrix_header_tree
, hf_netrix_search_conversiontables_key_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
366 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Key=%s", record_data
);
369 proto_tree_add_expert_format(netrix_header_tree
, pinfo
, &ei_netrix_unexpected_record
, tvb
, identifier_start
, data_offset
- identifier_start
, "Unexpected record %d with value %s", record_identifier
, record_data
);
374 if ((header
>= INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_BEGIN
) && (header
<= INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_END
)) {
375 switch (record_identifier
) {
376 case INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_KEY
:
377 proto_tree_add_item(netrix_header_tree
, hf_netrix_get_conversiontable_key_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
378 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Key=%s", record_data
);
380 case INDIGOCARE_NETRIX_GET_CONVERSIONTABLE_VALUE
:
381 proto_tree_add_item(netrix_header_tree
, hf_netrix_get_conversiontable_value_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
382 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Value=%s", record_data
);
385 proto_tree_add_expert_format(netrix_header_tree
, pinfo
, &ei_netrix_unexpected_record
, tvb
, identifier_start
, data_offset
- identifier_start
, "Unexpected record %d with value %s", record_identifier
, record_data
);
388 } else if ((header
>= INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_BEGIN
) && (header
<= INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_END
)) {
389 switch (record_identifier
) {
390 case INDIGOCARE_NETRIX_SEARCH_CONVERSIONTABLES_TABLE
:
391 proto_tree_add_item(netrix_header_tree
, hf_netrix_search_conversiontables_table_type
, tvb
, data_start
, data_offset
- data_start
, ENC_ASCII
);
392 col_append_fstr(pinfo
->cinfo
, COL_INFO
, " Table=%s", record_data
);
395 proto_tree_add_expert_format(netrix_header_tree
, pinfo
, &ei_netrix_unexpected_record
, tvb
, identifier_start
, data_offset
- identifier_start
, "Unexpected record %d with value %s", record_identifier
, record_data
);
402 return tvb_captured_length(tvb
);
406 proto_reg_handoff_netrix(void)
408 dissector_add_for_decode_as("tcp.port", netrix_handle
);
412 proto_register_netrix(void)
414 static hf_register_info hf
[] = {
415 { &hf_netrix_header_type
,
416 { "Header Type", "netrix.header",
421 { &hf_netrix_header_systeminfo_type
,
422 { "System Info", "netrix.systeminfo",
427 { &hf_netrix_header_groupcall_type
,
428 { "Group call", "netrix.groupcall",
433 { &hf_netrix_header_profilecall_type
,
434 { "Profile call", "netrix.profilecall",
439 { &hf_netrix_header_get_conversiontable_type
,
440 { "Get conversiontable", "netrix.getconversiontable",
445 { &hf_netrix_header_get_conversiontable_none_type
,
446 { "Get conversiontable: no results", "netrix.getconversiontable.noresult",
451 { &hf_netrix_header_get_conversiontable_result_type
,
452 { "Get conversiontable result", "netrix.getconversiontable.result",
457 { &hf_netrix_header_search_conversiontables_type
,
458 { "Search conversiontables", "netrix.searchconversiontables",
463 { &hf_netrix_header_search_conversiontables_none_type
,
464 { "Search converstiontables: no results", "netrix.searchconversiontables.noresult",
469 { &hf_netrix_header_boschcall_type
,
470 { "Bosch call", "netrix.boschcall",
475 { &hf_netrix_ack_type
,
476 { "Ack", "netrix.ack",
481 { &hf_netrix_systeminfo_computername_type
,
482 { "Computername", "netrix.systeminfo.computername",
483 FT_STRING
, BASE_NONE
,
487 { &hf_netrix_systeminfo_ipaddress_type
,
488 { "IP Address", "netrix.systeminfo.ipaddress",
489 FT_STRING
, BASE_NONE
,
493 { &hf_netrix_systeminfo_version_type
,
494 { "Version", "netrix.systeminfo.version",
495 FT_STRING
, BASE_NONE
,
499 { &hf_netrix_systeminfo_beep_type
,
500 { "Beep", "netrix.systeminfo.beep",
501 FT_STRING
, BASE_NONE
,
505 { &hf_netrix_groupcall_groupnumber_type
,
506 { "Groupnumber", "netrix.groupcall.groupnumber",
511 { &hf_netrix_groupcall_type_type
,
512 { "MSG1 (Type)", "netrix.groupcall.type",
513 FT_STRING
, BASE_NONE
,
517 { &hf_netrix_groupcall_addition_type
,
518 { "MSG2 (Addition)", "netrix.groupcall.addition",
519 FT_STRING
, BASE_NONE
,
523 { &hf_netrix_groupcall_idboschloc_type
,
524 { "MSG3 (ID / Bosch Loc)", "netrix.groupcall.idboschloc",
525 FT_STRING
, BASE_NONE
,
529 { &hf_netrix_groupcall_name_type
,
530 { "MSG4 (Name)", "netrix.groupcall.name",
531 FT_STRING
, BASE_NONE
,
535 { &hf_netrix_groupcall_room_type
,
536 { "MSG5 (Room)", "netrix.groupcall.room",
537 FT_STRING
, BASE_NONE
,
541 { &hf_netrix_groupcall_location_type
,
542 { "MSG6 (Location)", "netrix.groupcall.location",
543 FT_STRING
, BASE_NONE
,
547 { &hf_netrix_profilecall_groupnumber_type
,
548 { "Profilenumber", "netrix.profilecall.profilenumber",
553 { &hf_netrix_profilecall_type_type
,
554 { "MSG1 (Type)", "netrix.profilecall.type",
555 FT_STRING
, BASE_NONE
,
559 { &hf_netrix_profilecall_addition_type
,
560 { "MSG2 (Addition)", "netrix.profilecall.addition",
561 FT_STRING
, BASE_NONE
,
565 { &hf_netrix_profilecall_idboschloc_type
,
566 { "MSG3 (ID / Bosch Loc)", "netrix.profilecall.idboschloc",
567 FT_STRING
, BASE_NONE
,
571 { &hf_netrix_profilecall_name_type
,
572 { "MSG4 (Name)", "netrix.profilecall.name",
573 FT_STRING
, BASE_NONE
,
577 { &hf_netrix_profilecall_room_type
,
578 { "MSG5 (Room)", "netrix.profilecall.room",
579 FT_STRING
, BASE_NONE
,
583 { &hf_netrix_profilecall_location_type
,
584 { "MSG6 (Location)", "netrix.profilecall.location",
585 FT_STRING
, BASE_NONE
,
589 { &hf_netrix_get_conversiontable_table_type
,
590 { "Table", "netrix.getconversiontable.table",
591 FT_STRING
, BASE_NONE
,
595 { &hf_netrix_get_conversiontable_key_type
,
596 { "Key", "netrix.getconversiontable.key",
597 FT_STRING
, BASE_NONE
,
601 { &hf_netrix_get_conversiontable_value_type
,
602 { "Value", "netrix.getconversiontable.value",
603 FT_STRING
, BASE_NONE
,
607 { &hf_netrix_search_conversiontables_key_type
,
608 { "Key", "netrix.searchconversiontables.key",
609 FT_STRING
, BASE_NONE
,
613 { &hf_netrix_search_conversiontables_table_type
,
614 { "Table", "netrix.searchconversiontables.table",
615 FT_STRING
, BASE_NONE
,
621 static ei_register_info ei
[] = {
622 { &ei_netrix_unexpected_header
, { "netrix.unexpected.header", PI_MALFORMED
, PI_WARN
, "Unexpected header", EXPFILL
}},
623 { &ei_netrix_unexpected_record
, { "netrix.unexpected.record", PI_MALFORMED
, PI_WARN
, "Unexpected record", EXPFILL
}}
626 expert_module_t
* expert_netrix
;
628 /* Setup protocol subtree array */
629 static int *ett
[] = {
631 &ett_netrix_systeminfo
,
632 &ett_netrix_groupcall
,
633 &ett_netrix_profilecall
,
634 &ett_netrix_get_conversiontable
,
635 &ett_netrix_get_conversiontable_result
,
636 &ett_netrix_search_conversiontables
,
637 &ett_netrix_search_conversiontables_result
,
638 &ett_netrix_boschcall
,
642 proto_netrix
= proto_register_protocol (
643 "Netrix Communication Protocol", /* name */
644 "Netrix", /* short name */
645 "netrix" /* abbrev */
648 proto_register_field_array(proto_netrix
, hf
, array_length(hf
));
649 proto_register_subtree_array(ett
, array_length(ett
));
651 expert_netrix
= expert_register_protocol(proto_netrix
);
652 expert_register_field_array(expert_netrix
, ei
, array_length(ei
));
654 netrix_handle
= register_dissector("netrix", dissect_netrix
, proto_netrix
);
658 * Editor modelines - https://www.wireshark.org/tools/modelines.html
663 * indent-tabs-mode: t
666 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
667 * :indentSize=8:tabSize=8:noTabs=false: