/src/wireshark/epan/dissectors/packet-eiss.c
Line | Count | Source |
1 | | /* packet-eiss.c |
2 | | * |
3 | | * Routines for ETV-AM EISS (OC-SP-ETV-AM1.0-I05) |
4 | | * Copyright 2012, Weston Schmidt <weston_schmidt@alumni.purdue.edu> |
5 | | * |
6 | | * Wireshark - Network traffic analyzer |
7 | | * By Gerald Combs <gerald@wireshark.org> |
8 | | * Copyright 1998 Gerald Combs |
9 | | * |
10 | | * SPDX-License-Identifier: GPL-2.0-or-later |
11 | | */ |
12 | | |
13 | | #include "config.h" |
14 | | |
15 | | #include <epan/packet.h> |
16 | | #include <epan/expert.h> |
17 | | #include "packet-mpeg-sect.h" |
18 | | |
19 | | void proto_register_eiss(void); |
20 | | void proto_reg_handoff_eiss(void); |
21 | | |
22 | | static dissector_handle_t eiss_handle; |
23 | | |
24 | | static int proto_eiss; |
25 | | |
26 | | static int hf_eiss_reserved2; |
27 | | static int hf_eiss_section_number; |
28 | | static int hf_eiss_last_section_number; |
29 | | static int hf_eiss_protocol_version_major; |
30 | | static int hf_eiss_protocol_version_minor; |
31 | | static int hf_eiss_application_type; |
32 | | |
33 | | /* application_identifier() */ |
34 | | static int hf_eiss_organisation_id; |
35 | | static int hf_eiss_application_id; |
36 | | |
37 | | static int hf_eiss_platform_id_length; |
38 | | |
39 | | /* platform id information */ |
40 | | static int hf_pdtHWManufacturer; |
41 | | static int hf_pdtHWModel; |
42 | | static int hf_pdtHWVersionMajor; |
43 | | static int hf_pdtHWVersionMinor; |
44 | | static int hf_pdtSWManufacturer; |
45 | | static int hf_pdtSWModel; |
46 | | static int hf_pdtSWVersionMajor; |
47 | | static int hf_pdtSWVersionMinor; |
48 | | static int hf_pdtProfile; |
49 | | |
50 | | /* common to all eiss descriptors */ |
51 | | static int hf_eiss_descriptor_tag; |
52 | | static int hf_eiss_descriptor_length; |
53 | | |
54 | | /* application info descriptor */ |
55 | | static int hf_eiss_aid_app_control_code; |
56 | | static int hf_eiss_aid_app_version_major; |
57 | | static int hf_eiss_aid_app_version_minor; |
58 | | static int hf_eiss_aid_max_proto_version_major; |
59 | | static int hf_eiss_aid_max_proto_version_minor; |
60 | | static int hf_eiss_aid_test_flag; |
61 | | static int hf_eiss_aid_reserved; |
62 | | static int hf_eiss_aid_priority; |
63 | | static int hf_eiss_irl_type; |
64 | | static int hf_eiss_irl_length; |
65 | | static int hf_eiss_irl_string; |
66 | | |
67 | | /* media time descriptor */ |
68 | | static int hf_eiss_mtd_time_value; |
69 | | |
70 | | /* stream event descriptor */ |
71 | | static int hf_eiss_sed_time_value; |
72 | | static int hf_eiss_sed_reserved; |
73 | | static int hf_eiss_sed_descriptor_length; |
74 | | |
75 | | static int ett_eiss; |
76 | | static int ett_eiss_platform_id; |
77 | | static int ett_eiss_desc; |
78 | | |
79 | | static expert_field ei_eiss_platform_id_length; |
80 | | static expert_field ei_eiss_invalid_section_length; |
81 | | static expert_field ei_eiss_invalid_section_syntax_indicator; |
82 | | static expert_field ei_eiss_unknown_descriptor; |
83 | | static expert_field ei_eiss_section_number; |
84 | | static expert_field ei_eiss_application_type; |
85 | | static expert_field ei_eiss_invalid_reserved_bits; |
86 | | |
87 | | #define MPEG_SECT_SYNTAX_INDICATOR_MASK 0x8000 |
88 | | #define MPEG_SECT_RESERVED_MASK 0x7000 |
89 | | #define MPEG_SECT_LENGTH_MASK 0x0FFF |
90 | | |
91 | | static const value_string eiss_descriptor_values[] = { |
92 | | { 0xe0, "ETV Application Information Descriptor" }, |
93 | | { 0xe1, "ETV Media Time Descriptor" }, |
94 | | { 0xe2, "ETV Stream Event Descriptor" }, |
95 | | { 0, NULL } |
96 | | }; |
97 | | |
98 | | /* ETSI TS 101 812 - DVB-MHP Specification section 10.5 */ |
99 | | static const range_string application_id_values[] = { |
100 | | { 0x0000, 0x3fff, "Unsigned Application" }, |
101 | | { 0x4000, 0x7fff, "Signed Application" }, |
102 | | { 0x8000, 0xfffd, "Reserved by DVB" }, |
103 | | { 0xfffe, 0xfffe, "Wildcard for signed applications of an organisation" }, |
104 | | { 0xffff, 0xffff, "Wildcard for all applications of an organisation" }, |
105 | | { 0, 0, NULL } |
106 | | }; |
107 | | |
108 | | static const range_string aid_control_code_values[] = { |
109 | | { 0x00, 0x00, "Reserved" }, |
110 | | { 0x01, 0x01, "AUTOSTART" }, |
111 | | { 0x02, 0x02, "PRESENT" }, |
112 | | { 0x03, 0x03, "DESTROY" }, |
113 | | { 0x04, 0xff, "Reserved" }, |
114 | | { 0, 0, NULL } |
115 | | }; |
116 | | |
117 | | static unsigned |
118 | | dissect_etv_bif_platform_ids(tvbuff_t *tvb, proto_tree *tree, unsigned offset) |
119 | 24 | { |
120 | 24 | proto_tree *platform_tree; |
121 | | |
122 | 24 | platform_tree = proto_tree_add_subtree(tree, tvb, offset, 15, ett_eiss_platform_id, NULL, "Platform Id"); |
123 | 24 | proto_tree_add_item(platform_tree, hf_pdtHWManufacturer, tvb, offset, 3, ENC_BIG_ENDIAN); |
124 | 24 | offset += 3; |
125 | 24 | proto_tree_add_item(platform_tree, hf_pdtHWModel, tvb, offset, 2, ENC_BIG_ENDIAN); |
126 | 24 | offset += 2; |
127 | 24 | proto_tree_add_item(platform_tree, hf_pdtHWVersionMajor, tvb, offset, 1, ENC_BIG_ENDIAN); |
128 | 24 | offset++; |
129 | 24 | proto_tree_add_item(platform_tree, hf_pdtHWVersionMinor, tvb, offset, 1, ENC_BIG_ENDIAN); |
130 | 24 | offset++; |
131 | 24 | proto_tree_add_item(platform_tree, hf_pdtSWManufacturer, tvb, offset, 3, ENC_BIG_ENDIAN); |
132 | 24 | offset += 3; |
133 | 24 | proto_tree_add_item(platform_tree, hf_pdtSWModel, tvb, offset, 2, ENC_BIG_ENDIAN); |
134 | 24 | offset += 2; |
135 | 24 | proto_tree_add_item(platform_tree, hf_pdtSWVersionMajor, tvb, offset, 1, ENC_BIG_ENDIAN); |
136 | 24 | offset++; |
137 | 24 | proto_tree_add_item(platform_tree, hf_pdtSWVersionMinor, tvb, offset, 1, ENC_BIG_ENDIAN); |
138 | 24 | offset++; |
139 | 24 | proto_tree_add_item(platform_tree, hf_pdtProfile, tvb, offset, 1, ENC_BIG_ENDIAN); |
140 | 24 | offset++; |
141 | | |
142 | 24 | return 15; |
143 | 24 | } |
144 | | |
145 | | static unsigned |
146 | | dissect_eiss_descriptors(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset) |
147 | 6 | { |
148 | 6 | proto_tree *sub_tree; |
149 | 6 | unsigned tag; |
150 | | |
151 | 6 | tag = tvb_get_uint8(tvb, offset); |
152 | | |
153 | 6 | if (0xe0 == tag) { |
154 | 0 | unsigned total_length; |
155 | |
|
156 | 0 | total_length = tvb_get_uint8(tvb, offset+1); |
157 | 0 | sub_tree = proto_tree_add_subtree(tree, tvb, offset, (2+total_length), |
158 | 0 | ett_eiss_desc, NULL, "ETV Application Information Descriptor"); |
159 | 0 | proto_tree_add_item(sub_tree, hf_eiss_descriptor_tag, |
160 | 0 | tvb, offset, 1, ENC_BIG_ENDIAN); |
161 | 0 | offset++; |
162 | 0 | proto_tree_add_item(sub_tree, hf_eiss_descriptor_length, tvb, |
163 | 0 | offset, 1, ENC_BIG_ENDIAN); |
164 | 0 | offset++; |
165 | 0 | proto_tree_add_item(sub_tree, hf_eiss_aid_app_control_code, tvb, |
166 | 0 | offset, 1, ENC_BIG_ENDIAN); |
167 | 0 | offset++; |
168 | 0 | proto_tree_add_item(sub_tree, hf_eiss_aid_app_version_major, tvb, |
169 | 0 | offset, 1, ENC_BIG_ENDIAN); |
170 | 0 | offset++; |
171 | 0 | proto_tree_add_item(sub_tree, hf_eiss_aid_app_version_minor, tvb, |
172 | 0 | offset, 1, ENC_BIG_ENDIAN); |
173 | 0 | offset++; |
174 | 0 | proto_tree_add_item(sub_tree, hf_eiss_aid_max_proto_version_major, |
175 | 0 | tvb, offset, 1, ENC_BIG_ENDIAN); |
176 | 0 | offset++; |
177 | 0 | proto_tree_add_item(sub_tree, hf_eiss_aid_max_proto_version_minor, |
178 | 0 | tvb, offset, 1, ENC_BIG_ENDIAN); |
179 | 0 | offset++; |
180 | 0 | proto_tree_add_item(sub_tree, hf_eiss_aid_test_flag, tvb, offset, |
181 | 0 | 1, ENC_BIG_ENDIAN); |
182 | 0 | offset++; |
183 | 0 | proto_tree_add_item(sub_tree, hf_eiss_aid_reserved, tvb, offset, |
184 | 0 | 3, ENC_BIG_ENDIAN); |
185 | 0 | offset += 3; |
186 | 0 | proto_tree_add_item(sub_tree, hf_eiss_aid_priority, tvb, offset, |
187 | 0 | 1, ENC_BIG_ENDIAN); |
188 | 0 | offset++; |
189 | 0 | proto_tree_add_item(sub_tree, hf_eiss_irl_type, tvb, offset, 2, |
190 | 0 | ENC_BIG_ENDIAN); |
191 | 0 | proto_tree_add_item(sub_tree, hf_eiss_irl_length, tvb, offset, |
192 | 0 | 2, ENC_BIG_ENDIAN); |
193 | 0 | offset += 2; |
194 | 0 | proto_tree_add_item(sub_tree, hf_eiss_irl_string, tvb, offset, 2, |
195 | 0 | ENC_ASCII|ENC_BIG_ENDIAN); |
196 | 0 | return (2+total_length); |
197 | 6 | } else if (0xe1 == tag) { |
198 | 0 | sub_tree = proto_tree_add_subtree(tree, tvb, offset, 6, |
199 | 0 | ett_eiss_desc, NULL, "ETV Media Time Descriptor"); |
200 | 0 | proto_tree_add_item(sub_tree, hf_eiss_descriptor_tag, |
201 | 0 | tvb, offset, 1, ENC_BIG_ENDIAN); |
202 | 0 | offset++; |
203 | 0 | proto_tree_add_item(sub_tree, hf_eiss_descriptor_length, tvb, |
204 | 0 | offset, 1, ENC_BIG_ENDIAN); |
205 | 0 | offset++; |
206 | 0 | proto_tree_add_item(sub_tree, hf_eiss_mtd_time_value, tvb, |
207 | 0 | offset, 4, ENC_BIG_ENDIAN); |
208 | 0 | return 6; |
209 | 6 | } else if (0xe2 == tag) { |
210 | 0 | unsigned tmp; |
211 | 0 | tvbuff_t *payload; |
212 | |
|
213 | 0 | tmp = tvb_get_ntohs(tvb, offset+1); |
214 | 0 | sub_tree = proto_tree_add_subtree(tree, tvb, offset, (3+tmp), |
215 | 0 | ett_eiss_desc, NULL, "ETV Stream Event Descriptor"); |
216 | 0 | proto_tree_add_item(sub_tree, hf_eiss_descriptor_tag, |
217 | 0 | tvb, offset, 1, ENC_BIG_ENDIAN); |
218 | 0 | offset++; |
219 | 0 | proto_tree_add_item(sub_tree, hf_eiss_sed_reserved, tvb, |
220 | 0 | offset, 2, ENC_BIG_ENDIAN); |
221 | 0 | proto_tree_add_item(sub_tree, hf_eiss_sed_descriptor_length, tvb, |
222 | 0 | offset, 2, ENC_BIG_ENDIAN); |
223 | 0 | offset += 2; |
224 | 0 | proto_tree_add_item(sub_tree, hf_eiss_sed_time_value, tvb, |
225 | 0 | offset, 4, ENC_BIG_ENDIAN); |
226 | 0 | offset += 4; |
227 | |
|
228 | 0 | payload = tvb_new_subset_length(tvb, offset, tmp-4); |
229 | 0 | call_data_dissector(payload, pinfo, sub_tree); |
230 | |
|
231 | 0 | return (3+tmp); |
232 | 6 | } else { |
233 | 6 | proto_tree_add_expert(tree, pinfo, &ei_eiss_unknown_descriptor, tvb, offset, -1); |
234 | | |
235 | | /* skip the rest of the section... for now */ |
236 | 6 | return 1000; |
237 | 6 | } |
238 | 6 | } |
239 | | |
240 | | static int |
241 | | dissect_eiss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) |
242 | 6 | { |
243 | 6 | unsigned offset = 0, packet_length, sect_len; |
244 | 6 | proto_item *ti; |
245 | 6 | proto_item *pi; |
246 | 6 | proto_tree *eiss_tree; |
247 | 6 | proto_item *items[PACKET_MPEG_SECT_PI__SIZE]; |
248 | 6 | bool ssi; |
249 | 6 | unsigned reserved; |
250 | 6 | uint8_t reserved2; |
251 | 6 | uint8_t sect_num, last_sect_num; |
252 | | |
253 | 6 | uint16_t eiss_application_type; |
254 | 6 | uint8_t platform_id_length; |
255 | | |
256 | 6 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "EISS"); |
257 | | |
258 | 6 | ti = proto_tree_add_item(tree, proto_eiss, tvb, offset, -1, ENC_NA); |
259 | 6 | eiss_tree = proto_item_add_subtree(ti, ett_eiss); |
260 | | |
261 | 6 | offset += packet_mpeg_sect_header_extra(tvb, offset, eiss_tree, §_len, |
262 | 6 | &reserved, &ssi, items); |
263 | | |
264 | 6 | packet_length = sect_len + 3 - 4; /* + for the header, - for the crc */ |
265 | | |
266 | 6 | if (false != ssi) { |
267 | 1 | proto_item *msg_error; |
268 | 1 | msg_error = items[PACKET_MPEG_SECT_PI__SSI]; |
269 | | |
270 | 1 | proto_item_set_generated(msg_error); |
271 | 1 | expert_add_info(pinfo, msg_error, &ei_eiss_invalid_section_syntax_indicator); |
272 | 1 | } |
273 | | |
274 | 6 | if (0 != reserved) { |
275 | 6 | proto_item *msg_error; |
276 | 6 | msg_error = items[PACKET_MPEG_SECT_PI__RESERVED]; |
277 | | |
278 | 6 | proto_item_set_generated(msg_error); |
279 | 6 | expert_add_info_format(pinfo, msg_error, &ei_eiss_invalid_reserved_bits, "Invalid reserved1 bits (should all be 0)"); |
280 | 6 | } |
281 | | |
282 | 6 | if (1021 < sect_len) { |
283 | 1 | proto_item *msg_error; |
284 | 1 | msg_error = items[PACKET_MPEG_SECT_PI__LENGTH]; |
285 | | |
286 | 1 | proto_item_set_generated(msg_error); |
287 | 1 | expert_add_info(pinfo, msg_error, &ei_eiss_invalid_section_length); |
288 | 1 | } |
289 | | |
290 | 6 | reserved2 = tvb_get_uint8(tvb, offset); |
291 | 6 | pi = proto_tree_add_item(eiss_tree, hf_eiss_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN); |
292 | 6 | if (0 != reserved2) { |
293 | 3 | expert_add_info_format(pinfo, pi, &ei_eiss_invalid_reserved_bits, "Invalid reserved2 bits (should all be 0)"); |
294 | 3 | } |
295 | 6 | offset++; |
296 | | |
297 | 6 | sect_num = tvb_get_uint8(tvb, offset); |
298 | 6 | last_sect_num = tvb_get_uint8(tvb, offset + 1); |
299 | 6 | pi = proto_tree_add_item(eiss_tree, hf_eiss_section_number, tvb, offset, 1, ENC_BIG_ENDIAN); |
300 | 6 | if (last_sect_num < sect_num) { |
301 | 0 | expert_add_info(pinfo, pi, &ei_eiss_section_number); |
302 | 0 | } |
303 | 6 | offset++; |
304 | 6 | proto_tree_add_item(eiss_tree, hf_eiss_last_section_number, tvb, offset, 1, ENC_BIG_ENDIAN); |
305 | 6 | offset++; |
306 | 6 | proto_tree_add_item(eiss_tree, hf_eiss_protocol_version_major, tvb, offset, 1, ENC_BIG_ENDIAN); |
307 | 6 | offset++; |
308 | 6 | proto_tree_add_item(eiss_tree, hf_eiss_protocol_version_minor, tvb, offset, 1, ENC_BIG_ENDIAN); |
309 | 6 | offset++; |
310 | | |
311 | 6 | eiss_application_type = tvb_get_ntohs(tvb, offset); |
312 | 6 | pi = proto_tree_add_item(eiss_tree, hf_eiss_application_type, tvb, offset, 2, ENC_BIG_ENDIAN); |
313 | 6 | if (8 != eiss_application_type) { |
314 | 6 | expert_add_info(pinfo, pi, &ei_eiss_application_type); |
315 | 6 | } |
316 | 6 | offset += 2; |
317 | 6 | proto_tree_add_item(eiss_tree, hf_eiss_organisation_id, tvb, offset, 4, ENC_BIG_ENDIAN); |
318 | 6 | offset += 4; |
319 | 6 | proto_tree_add_item(eiss_tree, hf_eiss_application_id, tvb, offset, 2, ENC_BIG_ENDIAN); |
320 | 6 | offset += 2; |
321 | | |
322 | 6 | platform_id_length = tvb_get_uint8(tvb, offset); |
323 | 6 | pi = proto_tree_add_item(eiss_tree, hf_eiss_platform_id_length, tvb, offset, 1, ENC_BIG_ENDIAN); |
324 | 6 | if (0 != platform_id_length % 15) { |
325 | 5 | expert_add_info(pinfo, pi, &ei_eiss_platform_id_length); |
326 | 5 | } |
327 | 6 | offset++; |
328 | | |
329 | 30 | while (0 < platform_id_length) { |
330 | 24 | unsigned tmp; |
331 | | |
332 | 24 | tmp = dissect_etv_bif_platform_ids(tvb, eiss_tree, offset); |
333 | 24 | offset += tmp; |
334 | 24 | if (platform_id_length < tmp) { |
335 | 5 | platform_id_length = 0; |
336 | | /* error */ |
337 | 19 | } else { |
338 | 19 | platform_id_length -= tmp; |
339 | 19 | } |
340 | 24 | } |
341 | | |
342 | 6 | if (0 < packet_length) { |
343 | 5 | proto_tree *eiss_desc_tree; |
344 | 5 | eiss_desc_tree = proto_tree_add_subtree(eiss_tree, tvb, offset, |
345 | 5 | packet_length-offset, ett_eiss_desc, NULL, "EISS Descriptor(s)"); |
346 | 11 | while (offset < packet_length) { |
347 | 6 | offset += dissect_eiss_descriptors(tvb, pinfo, |
348 | 6 | eiss_desc_tree, offset); |
349 | 6 | } |
350 | 5 | } |
351 | | |
352 | 6 | packet_mpeg_sect_crc(tvb, pinfo, eiss_tree, 0, sect_len - 1); |
353 | 6 | return tvb_captured_length(tvb); |
354 | 6 | } |
355 | | |
356 | | |
357 | | void |
358 | | proto_register_eiss(void) |
359 | 14 | { |
360 | | |
361 | 14 | static hf_register_info hf[] = { |
362 | 14 | { &hf_eiss_reserved2, { |
363 | 14 | "Reserved", "eiss.reserved", |
364 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
365 | 14 | } }, |
366 | | |
367 | 14 | { &hf_eiss_section_number, { |
368 | 14 | "Section Number", "eiss.sect_num", |
369 | 14 | FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL |
370 | 14 | } }, |
371 | | |
372 | 14 | { &hf_eiss_last_section_number, { |
373 | 14 | "Last Section Number", "eiss.last_sect_num", |
374 | 14 | FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL |
375 | 14 | } }, |
376 | | |
377 | 14 | { &hf_eiss_protocol_version_major, { |
378 | 14 | "Major Version Number", "eiss.version_major", |
379 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
380 | 14 | } }, |
381 | | |
382 | 14 | { &hf_eiss_protocol_version_minor, { |
383 | 14 | "Minor Version Number", "eiss.version_minor", |
384 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
385 | 14 | } }, |
386 | | |
387 | 14 | { &hf_eiss_application_type, { |
388 | 14 | "Application Type", "eiss.app_type", |
389 | 14 | FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL |
390 | 14 | } }, |
391 | | |
392 | 14 | { &hf_eiss_organisation_id, { |
393 | 14 | "Organisation Id", "eiss.org_id", |
394 | 14 | FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL |
395 | 14 | } }, |
396 | | |
397 | 14 | { &hf_eiss_application_id, { |
398 | 14 | "Application Id", "eiss.app_id", |
399 | 14 | FT_UINT16, BASE_HEX|BASE_RANGE_STRING, RVALS(application_id_values), 0, NULL, HFILL |
400 | 14 | } }, |
401 | | |
402 | 14 | { &hf_eiss_platform_id_length, { |
403 | 14 | "Platform Id Length", "eiss.platform_id_length", |
404 | 14 | FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL |
405 | 14 | } }, |
406 | | |
407 | 14 | { &hf_pdtHWManufacturer, { |
408 | 14 | "Platform Hardware Manufacturer", "eiss.plat_hw_man", |
409 | 14 | FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL |
410 | 14 | } }, |
411 | | |
412 | 14 | { &hf_pdtHWModel, { |
413 | 14 | "Platform Hardware Model", "eiss.plat_hw_model", |
414 | 14 | FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL |
415 | 14 | } }, |
416 | | |
417 | 14 | { &hf_pdtHWVersionMajor, { |
418 | 14 | "Platform Hardware Major Version", "eiss.plat_hw_major", |
419 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
420 | 14 | } }, |
421 | | |
422 | 14 | { &hf_pdtHWVersionMinor, { |
423 | 14 | "Platform Hardware Minor Version", "eiss.plat_hw_minor", |
424 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
425 | 14 | } }, |
426 | | |
427 | 14 | { &hf_pdtSWManufacturer, { |
428 | 14 | "Platform Software Manufacturer", "eiss.plat_sw_man", |
429 | 14 | FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL |
430 | 14 | } }, |
431 | | |
432 | 14 | { &hf_pdtSWModel, { |
433 | 14 | "Platform Software Model", "eiss.plat_sw_model", |
434 | 14 | FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL |
435 | 14 | } }, |
436 | | |
437 | 14 | { &hf_pdtSWVersionMajor, { |
438 | 14 | "Platform Software Major Version", "eiss.plat_sw_major", |
439 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
440 | 14 | } }, |
441 | | |
442 | 14 | { &hf_pdtSWVersionMinor, { |
443 | 14 | "Platform Software Minor Version", "eiss.plat_sw_minor", |
444 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
445 | 14 | } }, |
446 | | |
447 | 14 | { &hf_pdtProfile, { |
448 | 14 | "Platform Profile", "eiss.plat_profile", |
449 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
450 | 14 | } }, |
451 | | |
452 | 14 | { &hf_eiss_descriptor_tag, { |
453 | 14 | "EISS Descriptor Tag", "eiss.desc.tag", |
454 | 14 | FT_UINT8, BASE_HEX, VALS(eiss_descriptor_values), 0, NULL, HFILL |
455 | 14 | } }, |
456 | | |
457 | 14 | { &hf_eiss_descriptor_length, { |
458 | 14 | "Descriptor Length", "eiss.desc.length", |
459 | 14 | FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL |
460 | 14 | } }, |
461 | | |
462 | 14 | { &hf_eiss_aid_app_control_code, { |
463 | 14 | "Application Control Code", "eiss.aid.app_control_code", |
464 | 14 | FT_UINT8, BASE_HEX|BASE_RANGE_STRING, RVALS(aid_control_code_values), 0, NULL, HFILL |
465 | 14 | } }, |
466 | | |
467 | 14 | { &hf_eiss_aid_app_version_major, { |
468 | 14 | "Application Version Major", "eiss.aid.app_version_major", |
469 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
470 | 14 | } }, |
471 | | |
472 | 14 | { &hf_eiss_aid_app_version_minor, { |
473 | 14 | "Application Version Minor", "eiss.aid.app_version_minor", |
474 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
475 | 14 | } }, |
476 | | |
477 | 14 | { &hf_eiss_aid_max_proto_version_major, { |
478 | 14 | "Max Protocol Version Major", "eiss.aid.max_proto_version_major", |
479 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
480 | 14 | } }, |
481 | | |
482 | 14 | { &hf_eiss_aid_max_proto_version_minor, { |
483 | 14 | "Max Protocol Version Minor", "eiss.aid.max_proto_version_minor", |
484 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
485 | 14 | } }, |
486 | | |
487 | 14 | { &hf_eiss_aid_test_flag, { |
488 | 14 | "Application Test Flag", "eiss.aid.test_flag", |
489 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
490 | 14 | } }, |
491 | | |
492 | 14 | { &hf_eiss_aid_reserved, { |
493 | 14 | "Reserved", "eiss.aid.reserved", |
494 | 14 | FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL |
495 | 14 | } }, |
496 | | |
497 | 14 | { &hf_eiss_aid_priority, { |
498 | 14 | "Application Priority", "eiss.aid.priority", |
499 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL |
500 | 14 | } }, |
501 | | |
502 | 14 | { &hf_eiss_irl_type, { |
503 | 14 | "Initial Resource Locator Type", "eiss.aid.irl.type", |
504 | 14 | FT_UINT16, BASE_HEX, NULL, 0xfc00, NULL, HFILL |
505 | 14 | } }, |
506 | | |
507 | 14 | { &hf_eiss_irl_length, { |
508 | 14 | "Initial Resource Locator Length", "eiss.aid.irl.length", |
509 | 14 | FT_UINT16, BASE_DEC, NULL, 0x03ff, NULL, HFILL |
510 | 14 | } }, |
511 | | |
512 | 14 | { &hf_eiss_irl_string, { |
513 | 14 | "Initial Resource Locator String", "eiss.aid.irl.string", |
514 | 14 | FT_UINT_STRING, BASE_NONE, NULL, 0, NULL, HFILL |
515 | 14 | } }, |
516 | | |
517 | 14 | { &hf_eiss_mtd_time_value, { |
518 | 14 | "Time Value (ms)", "eiss.mtd.time_value", |
519 | 14 | FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL |
520 | 14 | } }, |
521 | | |
522 | 14 | { &hf_eiss_sed_reserved, { |
523 | 14 | "Reserved", "eiss.sed.reserved", |
524 | 14 | FT_UINT16, BASE_DEC, NULL, 0xf000, NULL, HFILL |
525 | 14 | } }, |
526 | | |
527 | 14 | { &hf_eiss_sed_descriptor_length, { |
528 | 14 | "Descriptor Length", "eiss.desc.length", |
529 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL |
530 | 14 | } }, |
531 | | |
532 | 14 | { &hf_eiss_sed_time_value, { |
533 | 14 | "Time Value (ms)", "eiss.sed.time_value", |
534 | 14 | FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL |
535 | 14 | } } |
536 | 14 | }; |
537 | | |
538 | 14 | static int *ett[] = { |
539 | 14 | &ett_eiss, |
540 | 14 | &ett_eiss_platform_id, |
541 | 14 | &ett_eiss_desc, |
542 | 14 | }; |
543 | | |
544 | 14 | static ei_register_info ei[] = { |
545 | 14 | { &ei_eiss_unknown_descriptor, { "eiss.unknown_descriptor", PI_MALFORMED, PI_ERROR, "Unknown Descriptor", EXPFILL }}, |
546 | 14 | { &ei_eiss_invalid_section_syntax_indicator, { "eiss.invalid_section_syntax_indicator", PI_MALFORMED, PI_ERROR, "Invalid section_syntax_indicator (should be 0)", EXPFILL }}, |
547 | 14 | { &ei_eiss_invalid_reserved_bits, { "eiss.invalid_reserved_bits", PI_MALFORMED, PI_ERROR, "Invalid reserved bits", EXPFILL }}, |
548 | 14 | { &ei_eiss_invalid_section_length, { "eiss.invalid_section_length", PI_MALFORMED, PI_ERROR, "Invalid section_length (must not exceed 1021)", EXPFILL }}, |
549 | 14 | { &ei_eiss_section_number, { "eiss.sect_num.invalid", PI_MALFORMED, PI_ERROR, "Invalid section_number (must be <= last_section_number)", EXPFILL }}, |
550 | 14 | { &ei_eiss_application_type, { "eiss.app_type.invalid", PI_MALFORMED, PI_ERROR, "Invalid application_type (must be 0x0008)", EXPFILL }}, |
551 | 14 | { &ei_eiss_platform_id_length, { "eiss.platform_id_length.invalid", PI_MALFORMED, PI_ERROR, "Invalid platform_id_length (must be a multiple of sizeof(etv_bif_platform_ids) == 15)", EXPFILL }}, |
552 | 14 | }; |
553 | | |
554 | 14 | expert_module_t* expert_eiss; |
555 | | |
556 | 14 | proto_eiss = proto_register_protocol("ETV-AM EISS Section", "ETV-AM EISS", "eiss"); |
557 | | |
558 | 14 | proto_register_field_array(proto_eiss, hf, array_length(hf)); |
559 | 14 | proto_register_subtree_array(ett, array_length(ett)); |
560 | 14 | expert_eiss = expert_register_protocol(proto_eiss); |
561 | 14 | expert_register_field_array(expert_eiss, ei, array_length(ei)); |
562 | | |
563 | 14 | eiss_handle = register_dissector("eiss", dissect_eiss, proto_eiss); |
564 | 14 | } |
565 | | |
566 | | |
567 | | void |
568 | | proto_reg_handoff_eiss(void) |
569 | 14 | { |
570 | 14 | dissector_add_uint("mpeg_sect.tid", EISS_SECTION_TID, eiss_handle); |
571 | 14 | } |
572 | | |
573 | | /* |
574 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
575 | | * |
576 | | * Local variables: |
577 | | * c-basic-offset: 8 |
578 | | * tab-width: 8 |
579 | | * indent-tabs-mode: t |
580 | | * End: |
581 | | * |
582 | | * vi: set shiftwidth=8 tabstop=8 noexpandtab: |
583 | | * :indentSize=8:tabSize=8:noTabs=false: |
584 | | */ |