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