/src/wireshark/epan/dissectors/packet-dvb-ait.c
Line | Count | Source |
1 | | /* packet-dvb-ait.c |
2 | | * Routines for DVB Application Information Table (AIT) dissection |
3 | | * Copyright 2012-2013, Martin Kaiser <martin@kaiser.cx> |
4 | | * |
5 | | * Wireshark - Network traffic analyzer |
6 | | * By Gerald Combs <gerald@wireshark.org> |
7 | | * Copyright 1998 Gerald Combs |
8 | | * |
9 | | * SPDX-License-Identifier: GPL-2.0-or-later |
10 | | */ |
11 | | |
12 | | /* This dissector processes a DVB Application Information Table (AIT) as |
13 | | * defined in ETSI TS 102 809. */ |
14 | | |
15 | | #include "config.h" |
16 | | |
17 | | #include <epan/packet.h> |
18 | | |
19 | | #include "packet-mpeg-sect.h" |
20 | | #include "packet-mpeg-descriptor.h" |
21 | | |
22 | | void proto_register_dvb_ait(void); |
23 | | void proto_reg_handoff_dvb_ait(void); |
24 | | |
25 | | static dissector_handle_t dvb_ait_handle; |
26 | | |
27 | | static int proto_dvb_ait; |
28 | | |
29 | | static int ett_dvb_ait; |
30 | | static int ett_dvb_ait_descr; |
31 | | static int ett_dvb_ait_app; |
32 | | |
33 | | static int hf_dvb_ait_test_app_flag; |
34 | | static int hf_dvb_ait_app_type; |
35 | | static int hf_dvb_ait_version_number; |
36 | | static int hf_dvb_ait_current_next_indicator; |
37 | | static int hf_dvb_ait_section_number; |
38 | | static int hf_dvb_ait_last_section_number; |
39 | | static int hf_dvb_ait_descr_loop_len; |
40 | | static int hf_dvb_ait_descr_tag; |
41 | | static int hf_dvb_ait_descr_len; |
42 | | static int hf_dvb_ait_descr_data; |
43 | | static int hf_dvb_ait_descr_app_prof_len; |
44 | | static int hf_dvb_ait_descr_app_prof; |
45 | | static int hf_dvb_ait_descr_app_ver; |
46 | | static int hf_dvb_ait_descr_app_svc_bound; |
47 | | static int hf_dvb_ait_descr_app_vis; |
48 | | static int hf_dvb_ait_descr_app_prio; |
49 | | static int hf_dvb_ait_descr_app_trpt_proto_label; |
50 | | static int hf_dvb_ait_descr_app_name_lang; |
51 | | static int hf_dvb_ait_descr_app_name_name; |
52 | | static int hf_dvb_ait_descr_trpt_proto_id; |
53 | | static int hf_dvb_ait_descr_trpt_proto_label; |
54 | | static int hf_dvb_ait_descr_trpt_sel_remote; |
55 | | static int hf_dvb_ait_descr_trpt_sel_onid; |
56 | | static int hf_dvb_ait_descr_trpt_sel_tsid; |
57 | | static int hf_dvb_ait_descr_trpt_sel_svcid; |
58 | | static int hf_dvb_ait_descr_trpt_sel_comp; |
59 | | static int hf_dvb_ait_descr_trpt_sel_url_base; |
60 | | static int hf_dvb_ait_descr_trpt_sel_url_ext_cnt; |
61 | | static int hf_dvb_ait_descr_trpt_sel_url_ext; |
62 | | static int hf_dvb_ait_descr_trpt_sel_bytes; |
63 | | static int hf_dvb_ait_descr_sal_init_path; |
64 | | static int hf_dvb_ait_app_loop_len; |
65 | | static int hf_dvb_ait_org_id; |
66 | | static int hf_dvb_ait_app_id; |
67 | | static int hf_dvb_ait_app_ctrl_code; |
68 | | |
69 | | static const value_string app_ctrl_code[] = { |
70 | | { 0x01, "Autostart" }, |
71 | | { 0x02, "Present" }, |
72 | | { 0x03, "Destroy" }, |
73 | | { 0x04, "Kill" }, |
74 | | { 0x05, "Prefetch" }, |
75 | | { 0x06, "Remote" }, |
76 | | { 0x07, "Disabled" }, |
77 | | { 0x08, "Playback autostart" }, |
78 | | { 0, NULL } |
79 | | }; |
80 | | |
81 | | /* tags of the descriptors defined in ETSI TS 102 809 |
82 | | some of these tags are conflicting with MPEG2 or DVB-SI definitions, |
83 | | therefore these descriptors aren't supported by packet-mpeg-descriptor.c */ |
84 | | |
85 | 172 | #define AIT_DESCR_APP 0x00 |
86 | 13 | #define AIT_DESCR_APP_NAME 0x01 |
87 | 14 | #define AIT_DESCR_TRPT_PROTO 0x02 |
88 | | #define AIT_DESCR_EXT_APP_AUTH 0x05 |
89 | | #define AIT_DESCR_APP_REC 0x06 |
90 | | #define AIT_DESCR_APP_ICO 0x0B |
91 | | #define AIT_DESCR_APP_STOR 0x10 |
92 | | #define AIT_DESCR_GRA_CONST 0x14 |
93 | 0 | #define AIT_DESCR_SIM_APP_LOC 0x15 |
94 | | #define AIT_DESCR_SIM_APP_BND 0x17 |
95 | | #define AIT_DESCR_APP_SIG 0x6F |
96 | | |
97 | | static const value_string ait_descr_tag[] = { |
98 | | { AIT_DESCR_APP, "Application descriptor" }, |
99 | | { AIT_DESCR_APP_NAME, "Application name descriptor" }, |
100 | | { AIT_DESCR_TRPT_PROTO, "Transport protocol descriptor" }, |
101 | | { AIT_DESCR_EXT_APP_AUTH, "External application authorization descriptor" }, |
102 | | { AIT_DESCR_APP_REC, "Application recording descriptor" }, |
103 | | { AIT_DESCR_APP_ICO, "Application icons descriptor" }, |
104 | | { AIT_DESCR_APP_STOR, "Application storage descriptor" }, |
105 | | { AIT_DESCR_GRA_CONST, "Graphics constraints descriptor" }, |
106 | | { AIT_DESCR_SIM_APP_LOC, "Simple application location descriptor" }, |
107 | | { AIT_DESCR_SIM_APP_BND, "Simple application boundary descriptor" }, |
108 | | { AIT_DESCR_APP_SIG, "Application signalling descriptor" }, |
109 | | { 0, NULL } |
110 | | }; |
111 | | |
112 | 11 | #define TRPT_OBJ_CAROUSEL 0x0001 |
113 | 11 | #define TRPT_HTTP 0x0003 |
114 | | |
115 | | static const value_string trpt_proto_id[] = { |
116 | | { TRPT_OBJ_CAROUSEL, "Object Carousel" }, |
117 | | { TRPT_HTTP, "Transport via HTTP" }, |
118 | | { 0, NULL } |
119 | | }; |
120 | | |
121 | | static const value_string app_vis[] = { |
122 | | { 0x0, "not visible" }, |
123 | | { 0x1, "not visible to users, only to applications" }, |
124 | | { 0x3, "fully visible" }, |
125 | | { 0, NULL } |
126 | | }; |
127 | | |
128 | | |
129 | | /* dissect the body of an application_descriptor |
130 | | offset points to the start of the body, |
131 | | i.e. to the first byte after the length field */ |
132 | | static int |
133 | | dissect_dvb_ait_app_desc_body(tvbuff_t *tvb, unsigned offset, |
134 | | uint8_t body_len, packet_info *pinfo _U_, proto_tree *tree) |
135 | 172 | { |
136 | 172 | unsigned offset_start, offset_app_prof_start; |
137 | 172 | uint8_t app_prof_len; |
138 | 172 | uint8_t ver_maj, ver_min, ver_mic; |
139 | | |
140 | 172 | offset_start = offset; |
141 | | |
142 | 172 | app_prof_len = tvb_get_uint8(tvb, offset); |
143 | 172 | proto_tree_add_item(tree, hf_dvb_ait_descr_app_prof_len, |
144 | 172 | tvb, offset, 1, ENC_BIG_ENDIAN); |
145 | 172 | offset++; |
146 | 172 | offset_app_prof_start = offset; |
147 | 374 | while (offset-offset_app_prof_start < app_prof_len) { |
148 | 202 | proto_tree_add_item(tree, hf_dvb_ait_descr_app_prof, |
149 | 202 | tvb, offset, 2, ENC_BIG_ENDIAN); |
150 | 202 | offset += 2; |
151 | 202 | ver_maj = tvb_get_uint8(tvb, offset); |
152 | 202 | ver_min = tvb_get_uint8(tvb, offset+1); |
153 | 202 | ver_mic = tvb_get_uint8(tvb, offset+2); |
154 | 202 | proto_tree_add_uint_format(tree, hf_dvb_ait_descr_app_ver, |
155 | 202 | tvb, offset, 3, ver_maj<<16|ver_min<<8|ver_mic, |
156 | 202 | "Version %d.%d.%d", ver_maj, ver_min, ver_mic); |
157 | 202 | offset += 3; |
158 | 202 | } |
159 | 172 | proto_tree_add_item(tree, hf_dvb_ait_descr_app_svc_bound, |
160 | 172 | tvb, offset, 1, ENC_BIG_ENDIAN); |
161 | 172 | proto_tree_add_item(tree, hf_dvb_ait_descr_app_vis, |
162 | 172 | tvb, offset, 1, ENC_BIG_ENDIAN); |
163 | 172 | offset++; |
164 | 172 | proto_tree_add_item(tree, hf_dvb_ait_descr_app_prio, |
165 | 172 | tvb, offset, 1, ENC_BIG_ENDIAN); |
166 | 172 | offset++; |
167 | 450 | while (offset-offset_start < body_len) { |
168 | 278 | proto_tree_add_item(tree, hf_dvb_ait_descr_app_trpt_proto_label, |
169 | 278 | tvb, offset, 1, ENC_BIG_ENDIAN); |
170 | 278 | offset++; |
171 | 278 | } |
172 | 172 | return (int)(offset-offset_start); |
173 | 172 | } |
174 | | |
175 | | |
176 | | static int |
177 | | dissect_dvb_ait_app_name_desc_body(tvbuff_t *tvb, unsigned offset, |
178 | | uint8_t body_len, packet_info *pinfo _U_, proto_tree *tree) |
179 | 13 | { |
180 | 13 | unsigned offset_start; |
181 | 13 | uint8_t len; |
182 | | |
183 | 13 | offset_start = offset; |
184 | 37 | while (offset-offset_start < body_len) { |
185 | 24 | proto_tree_add_item(tree, hf_dvb_ait_descr_app_name_lang, |
186 | 24 | tvb, offset, 3, ENC_ASCII); |
187 | 24 | offset += 3; |
188 | 24 | len = tvb_get_uint8(tvb, offset); |
189 | | /* FT_UINT_STRING with 1 leading len byte */ |
190 | 24 | proto_tree_add_item(tree, hf_dvb_ait_descr_app_name_name, |
191 | 24 | tvb, offset, 1, ENC_ASCII|ENC_BIG_ENDIAN); |
192 | 24 | offset += 1+len; |
193 | 24 | } |
194 | | |
195 | 13 | return (int)(offset-offset_start); |
196 | 13 | } |
197 | | |
198 | | |
199 | | static int |
200 | | dissect_dvb_ait_trpt_proto_desc_body(tvbuff_t *tvb, unsigned offset, |
201 | | uint8_t body_len, packet_info *pinfo _U_, proto_tree *tree) |
202 | 14 | { |
203 | 14 | unsigned offset_start; |
204 | 14 | uint16_t proto_id; |
205 | 14 | bool remote_connection; |
206 | | |
207 | 14 | offset_start = offset; |
208 | | |
209 | 14 | proto_id = tvb_get_ntohs(tvb, offset); |
210 | 14 | proto_tree_add_item(tree, hf_dvb_ait_descr_trpt_proto_id, |
211 | 14 | tvb, offset, 2, ENC_BIG_ENDIAN); |
212 | 14 | offset += 2; |
213 | 14 | proto_tree_add_item(tree, hf_dvb_ait_descr_trpt_proto_label, |
214 | 14 | tvb, offset, 1, ENC_BIG_ENDIAN); |
215 | 14 | offset++; |
216 | 14 | if (offset-offset_start < body_len) { |
217 | 11 | if (proto_id == TRPT_OBJ_CAROUSEL) { |
218 | 0 | remote_connection = ((tvb_get_uint8(tvb, offset) & 0x80) == 0x80); |
219 | 0 | proto_tree_add_item(tree, hf_dvb_ait_descr_trpt_sel_remote, |
220 | 0 | tvb, offset, 1, ENC_BIG_ENDIAN); |
221 | 0 | offset++; |
222 | 0 | if (remote_connection) { |
223 | 0 | proto_tree_add_item(tree, hf_dvb_ait_descr_trpt_sel_onid, |
224 | 0 | tvb, offset, 2, ENC_BIG_ENDIAN); |
225 | 0 | offset += 2; |
226 | 0 | proto_tree_add_item(tree, hf_dvb_ait_descr_trpt_sel_tsid, |
227 | 0 | tvb, offset, 2, ENC_BIG_ENDIAN); |
228 | 0 | offset += 2; |
229 | 0 | proto_tree_add_item(tree, hf_dvb_ait_descr_trpt_sel_svcid, |
230 | 0 | tvb, offset, 2, ENC_BIG_ENDIAN); |
231 | 0 | offset += 2; |
232 | 0 | } |
233 | 0 | proto_tree_add_item(tree, hf_dvb_ait_descr_trpt_sel_comp, |
234 | 0 | tvb, offset, 1, ENC_BIG_ENDIAN); |
235 | 0 | offset++; |
236 | 0 | } |
237 | 11 | else if (proto_id == TRPT_HTTP) { |
238 | 0 | uint8_t url_base_len, url_ext_cnt, url_ext_len, i; |
239 | |
|
240 | 0 | url_base_len = tvb_get_uint8(tvb, offset); |
241 | | /* FT_UINT_STRING with one leading length byte */ |
242 | 0 | proto_tree_add_item(tree, hf_dvb_ait_descr_trpt_sel_url_base, |
243 | 0 | tvb, offset, 1, ENC_ASCII|ENC_BIG_ENDIAN); |
244 | 0 | offset += 1+url_base_len; |
245 | |
|
246 | 0 | url_ext_cnt = tvb_get_uint8(tvb, offset); |
247 | 0 | proto_tree_add_item(tree, hf_dvb_ait_descr_trpt_sel_url_ext_cnt, |
248 | 0 | tvb, offset, 1, ENC_BIG_ENDIAN); |
249 | 0 | offset++; |
250 | |
|
251 | 0 | for (i=0; i<url_ext_cnt; i++) { |
252 | 0 | url_ext_len = tvb_get_uint8(tvb, offset); |
253 | 0 | proto_tree_add_item(tree, hf_dvb_ait_descr_trpt_sel_url_ext, |
254 | 0 | tvb, offset, 1, ENC_ASCII|ENC_BIG_ENDIAN); |
255 | 0 | offset += 1+url_ext_len; |
256 | 0 | } |
257 | 0 | } |
258 | 11 | else { |
259 | 11 | proto_tree_add_item(tree, hf_dvb_ait_descr_trpt_sel_bytes, |
260 | 11 | tvb, offset, offset_start+body_len-offset, ENC_NA); |
261 | 11 | offset = offset_start+body_len; |
262 | 11 | } |
263 | 11 | } |
264 | | |
265 | 14 | return (int)(offset-offset_start); |
266 | 14 | } |
267 | | |
268 | | |
269 | | static int |
270 | | dissect_dvb_ait_descriptor(tvbuff_t *tvb, unsigned offset, |
271 | | packet_info *pinfo, proto_tree *tree) |
272 | 435 | { |
273 | 435 | int ret; |
274 | 435 | unsigned offset_start; |
275 | 435 | uint8_t tag, len; |
276 | 435 | proto_tree *descr_tree; |
277 | | |
278 | 435 | tag = tvb_get_uint8(tvb, offset); |
279 | 435 | len = tvb_get_uint8(tvb, offset+1); |
280 | | |
281 | | /* if the descriptor is a special one that's defined in ETSI TS 102 809, |
282 | | we dissect it ourselves |
283 | | otherwise, we assume it's a generic DVB-SI descriptor and pass it |
284 | | on to packet-mpeg-descriptor */ |
285 | 435 | if (try_val_to_str(tag, ait_descr_tag)) { |
286 | | |
287 | 215 | offset_start = offset; |
288 | 215 | descr_tree = proto_tree_add_subtree_format(tree, tvb, offset_start, len+2, |
289 | 215 | ett_dvb_ait_descr, NULL, "Descriptor Tag=0x%02x", tag); |
290 | | |
291 | 215 | proto_tree_add_item(descr_tree, hf_dvb_ait_descr_tag, |
292 | 215 | tvb, offset, 1, ENC_BIG_ENDIAN); |
293 | 215 | offset++; |
294 | 215 | proto_tree_add_item(descr_tree, hf_dvb_ait_descr_len, |
295 | 215 | tvb, offset, 1, ENC_BIG_ENDIAN); |
296 | 215 | offset++; |
297 | | |
298 | 215 | switch (tag) { |
299 | 172 | case AIT_DESCR_APP: |
300 | 172 | ret = dissect_dvb_ait_app_desc_body(tvb, offset, len, |
301 | 172 | pinfo, descr_tree); |
302 | 172 | if (ret>0) |
303 | 161 | offset += ret; |
304 | 172 | break; |
305 | 13 | case AIT_DESCR_APP_NAME: |
306 | 13 | ret = dissect_dvb_ait_app_name_desc_body(tvb, offset, len, |
307 | 13 | pinfo, descr_tree); |
308 | 13 | if (ret>0) |
309 | 7 | offset += ret; |
310 | 13 | break; |
311 | 14 | case AIT_DESCR_TRPT_PROTO: |
312 | 14 | ret = dissect_dvb_ait_trpt_proto_desc_body(tvb, offset, len, |
313 | 14 | pinfo, descr_tree); |
314 | 14 | if (ret>0) |
315 | 12 | offset += ret; |
316 | 14 | break; |
317 | 0 | case AIT_DESCR_SIM_APP_LOC: |
318 | 0 | proto_tree_add_item(descr_tree, |
319 | 0 | hf_dvb_ait_descr_sal_init_path, |
320 | 0 | tvb, offset, len, ENC_ASCII); |
321 | 0 | offset += len; |
322 | 0 | break; |
323 | 16 | default: |
324 | 16 | proto_tree_add_item(descr_tree, hf_dvb_ait_descr_data, |
325 | 16 | tvb, offset, len, ENC_NA); |
326 | 16 | offset += len; |
327 | 16 | break; |
328 | 215 | } |
329 | | |
330 | 199 | ret = (int)(offset-offset_start); |
331 | 199 | } |
332 | 220 | else |
333 | 220 | ret = (int)proto_mpeg_descriptor_dissect(tvb, pinfo, offset, tree); |
334 | | |
335 | 419 | return ret; |
336 | 435 | } |
337 | | |
338 | | |
339 | | static int |
340 | | dissect_dvb_ait(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) |
341 | 74 | { |
342 | 74 | int offset=0; |
343 | 74 | proto_item *ait_tree_ti = NULL, *app_tree_ti = NULL; |
344 | 74 | proto_tree *ait_tree = NULL, *ait_app_tree = NULL; |
345 | 74 | int offset_loop_start, offset_inner_loop_start, offset_app_start; |
346 | 74 | uint16_t descr_loop_len, app_loop_len; |
347 | 74 | int ret; |
348 | 74 | uint32_t org_id; |
349 | 74 | uint16_t app_id; |
350 | | |
351 | 74 | col_set_str(pinfo->cinfo, COL_INFO, "Application Information Table (AIT)"); |
352 | | |
353 | 74 | if (tree) { |
354 | 74 | ait_tree_ti = proto_tree_add_protocol_format(tree, proto_dvb_ait, |
355 | 74 | tvb, 0, -1, "Application Information Table (AIT)"); |
356 | 74 | ait_tree = proto_item_add_subtree(ait_tree_ti, ett_dvb_ait); |
357 | 74 | } |
358 | | |
359 | 74 | offset += packet_mpeg_sect_header(tvb, offset, ait_tree, NULL, NULL); |
360 | | |
361 | 74 | proto_tree_add_item(ait_tree, hf_dvb_ait_test_app_flag, |
362 | 74 | tvb, offset, 1, ENC_BIG_ENDIAN); |
363 | 74 | proto_tree_add_item(ait_tree, hf_dvb_ait_app_type, |
364 | 74 | tvb, offset, 2, ENC_BIG_ENDIAN); |
365 | 74 | offset += 2; |
366 | | |
367 | | /* no hf for reserved bits */ |
368 | 74 | proto_tree_add_item(ait_tree, hf_dvb_ait_version_number, |
369 | 74 | tvb, offset, 1, ENC_BIG_ENDIAN); |
370 | 74 | proto_tree_add_item(ait_tree, hf_dvb_ait_current_next_indicator, |
371 | 74 | tvb, offset, 1, ENC_BIG_ENDIAN); |
372 | 74 | offset++; |
373 | | |
374 | 74 | proto_tree_add_item(ait_tree, hf_dvb_ait_section_number, |
375 | 74 | tvb, offset, 1, ENC_BIG_ENDIAN); |
376 | 74 | offset++; |
377 | | |
378 | 74 | proto_tree_add_item(ait_tree, hf_dvb_ait_last_section_number, |
379 | 74 | tvb, offset, 1, ENC_BIG_ENDIAN); |
380 | 74 | offset++; |
381 | | |
382 | 74 | descr_loop_len = tvb_get_ntohs(tvb, offset) & 0x0FFF; |
383 | 74 | proto_tree_add_item(ait_tree, hf_dvb_ait_descr_loop_len, |
384 | 74 | tvb, offset, 2, ENC_BIG_ENDIAN); |
385 | 74 | offset += 2; |
386 | 74 | offset_loop_start = offset; |
387 | 290 | while (offset-offset_loop_start < descr_loop_len) { |
388 | 216 | ret = dissect_dvb_ait_descriptor(tvb, offset, pinfo, ait_tree); |
389 | 216 | if (ret<=0) |
390 | 0 | break; |
391 | 216 | offset += ret; |
392 | 216 | } |
393 | | |
394 | 74 | app_loop_len = tvb_get_ntohs(tvb, offset) & 0x0FFF; |
395 | 74 | proto_tree_add_item(ait_tree, hf_dvb_ait_app_loop_len, |
396 | 74 | tvb, offset, 2, ENC_BIG_ENDIAN); |
397 | 74 | offset += 2; |
398 | 74 | offset_loop_start = offset; |
399 | 147 | while (offset-offset_loop_start < app_loop_len) { |
400 | 73 | offset_app_start = offset; |
401 | 73 | org_id = tvb_get_ntohl(tvb, offset); |
402 | 73 | app_id = tvb_get_ntohs(tvb, offset+4); |
403 | 73 | ait_app_tree = proto_tree_add_subtree_format(ait_tree, tvb, offset, -1, |
404 | 73 | ett_dvb_ait_app, &app_tree_ti, "Application: Org 0x%x, App 0x%x", org_id, app_id); |
405 | | |
406 | 73 | proto_tree_add_item(ait_app_tree, hf_dvb_ait_org_id, |
407 | 73 | tvb, offset, 4, ENC_BIG_ENDIAN); |
408 | 73 | offset += 4; |
409 | 73 | proto_tree_add_item(ait_app_tree, hf_dvb_ait_app_id, |
410 | 73 | tvb, offset, 2, ENC_BIG_ENDIAN); |
411 | 73 | offset += 2; |
412 | 73 | proto_tree_add_item(ait_app_tree, hf_dvb_ait_app_ctrl_code, |
413 | 73 | tvb, offset, 1, ENC_BIG_ENDIAN); |
414 | 73 | offset++; |
415 | 73 | descr_loop_len = tvb_get_ntohs(tvb, offset) & 0x0FFF; |
416 | 73 | proto_tree_add_item(ait_app_tree, hf_dvb_ait_descr_loop_len, |
417 | 73 | tvb, offset, 2, ENC_BIG_ENDIAN); |
418 | 73 | offset += 2; |
419 | 73 | offset_inner_loop_start = offset; |
420 | 292 | while (offset-offset_inner_loop_start < descr_loop_len) { |
421 | 219 | ret = dissect_dvb_ait_descriptor(tvb, offset, pinfo, ait_app_tree); |
422 | 219 | if (ret<=0) |
423 | 0 | break; |
424 | 219 | offset += ret; |
425 | 219 | } |
426 | 73 | proto_item_set_len(app_tree_ti, offset-offset_app_start); |
427 | 73 | } |
428 | | |
429 | 74 | offset += packet_mpeg_sect_crc(tvb, pinfo, ait_tree, 0, offset); |
430 | | |
431 | 74 | proto_item_set_len(ait_tree_ti, offset); |
432 | | |
433 | 74 | return offset; |
434 | 74 | } |
435 | | |
436 | | void |
437 | | proto_register_dvb_ait(void) |
438 | 14 | { |
439 | 14 | static int *ett[] = { |
440 | 14 | &ett_dvb_ait, |
441 | 14 | &ett_dvb_ait_descr, |
442 | 14 | &ett_dvb_ait_app |
443 | 14 | }; |
444 | | |
445 | 14 | static hf_register_info hf[] = { |
446 | 14 | { &hf_dvb_ait_test_app_flag, |
447 | 14 | { "Test application flag", "dvb_ait.test_app_flag", |
448 | 14 | FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL } }, |
449 | 14 | { &hf_dvb_ait_app_type, |
450 | 14 | { "Application type", "dvb_ait.app_type", |
451 | 14 | FT_UINT16, BASE_HEX, NULL, 0x7FFF, NULL, HFILL } }, |
452 | 14 | { &hf_dvb_ait_version_number, |
453 | 14 | { "Version Number", "dvb_ait.version", |
454 | 14 | FT_UINT8, BASE_HEX, NULL, 0x3E, NULL, HFILL } }, |
455 | 14 | { &hf_dvb_ait_current_next_indicator, |
456 | 14 | { "Current/Next Indicator", "dvb_ait.cur_next_ind", |
457 | 14 | FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL } }, |
458 | 14 | { &hf_dvb_ait_section_number, |
459 | 14 | { "Section Number", "dvb_ait.sect_num", |
460 | 14 | FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, |
461 | 14 | { &hf_dvb_ait_last_section_number, |
462 | 14 | { "Last Section Number", "dvb_ait.last_sect_num", |
463 | 14 | FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, |
464 | 14 | { &hf_dvb_ait_descr_loop_len, |
465 | 14 | { "Descriptor loop length", "dvb_ait.descr_loop_len", |
466 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0FFF, NULL, HFILL } }, |
467 | 14 | { &hf_dvb_ait_descr_tag, |
468 | 14 | { "Descriptor Tag", "dvb_ait.descr.tag", |
469 | 14 | FT_UINT8, BASE_HEX, VALS(ait_descr_tag), 0, NULL, HFILL } }, |
470 | 14 | { &hf_dvb_ait_descr_len, |
471 | 14 | { "Descriptor Length", "dvb_ait.descr.len", |
472 | 14 | FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, |
473 | 14 | { &hf_dvb_ait_descr_data, |
474 | 14 | { "Descriptor Data", "dvb_ait.descr.data", |
475 | 14 | FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, |
476 | 14 | { &hf_dvb_ait_descr_app_prof_len, |
477 | 14 | { "Application profiles length", "dvb_ait.descr.app.prof_len", |
478 | 14 | FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, |
479 | 14 | { &hf_dvb_ait_descr_app_prof, |
480 | 14 | { "Application profile", "dvb_ait.descr.app.prof", |
481 | 14 | FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, |
482 | | /* version is major|minor|micro */ |
483 | 14 | { &hf_dvb_ait_descr_app_ver, |
484 | 14 | { "Version", "dvb_ait.descr.app.ver", |
485 | 14 | FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL } }, |
486 | 14 | { &hf_dvb_ait_descr_app_svc_bound, |
487 | 14 | { "Service-bound flag", "dvb_ait.descr.app.svc_bound_flag", |
488 | 14 | FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL } }, |
489 | 14 | { &hf_dvb_ait_descr_app_vis, |
490 | 14 | { "Visibility", "dvb_ait.descr.app.visibility", |
491 | 14 | FT_UINT8, BASE_HEX, VALS(app_vis), 0x60, NULL, HFILL } }, |
492 | 14 | { &hf_dvb_ait_descr_app_prio, |
493 | 14 | { "Application priority", "dvb_ait.descr.app.prio", |
494 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, |
495 | 14 | { &hf_dvb_ait_descr_app_trpt_proto_label, |
496 | 14 | { "Transport protocol label", "dvb_ait.descr.app.trpt_proto_label", |
497 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, |
498 | 14 | { &hf_dvb_ait_descr_app_name_lang, |
499 | 14 | { "ISO 639 language code", "dvb_ait.descr.app_name.lang", |
500 | 14 | FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, |
501 | 14 | { &hf_dvb_ait_descr_app_name_name, |
502 | 14 | { "Application name", "dvb_ait.descr.app_name.name", |
503 | 14 | FT_UINT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, |
504 | 14 | { &hf_dvb_ait_descr_trpt_proto_id, |
505 | 14 | { "Protocol ID", "dvb_ait.descr.trpt_proto.id", |
506 | 14 | FT_UINT16, BASE_HEX, VALS(trpt_proto_id), 0, NULL, HFILL } }, |
507 | 14 | { &hf_dvb_ait_descr_trpt_proto_label, |
508 | 14 | { "Transport protocol label", "dvb_ait.descr.trpt_proto.label", |
509 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, |
510 | 14 | { &hf_dvb_ait_descr_trpt_sel_remote, |
511 | 14 | { "Remote connection", "dvb_ait.descr.trpt_proto.remote", |
512 | 14 | FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL } }, |
513 | 14 | { &hf_dvb_ait_descr_trpt_sel_onid, |
514 | 14 | { "Original network ID", "dvb_ait.descr.trpt_proto.onid", |
515 | 14 | FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, |
516 | 14 | { &hf_dvb_ait_descr_trpt_sel_tsid, |
517 | 14 | { "Transport stream ID", "dvb_ait.descr.trpt_proto.tsid", |
518 | 14 | FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, |
519 | 14 | { &hf_dvb_ait_descr_trpt_sel_svcid, |
520 | 14 | { "Service ID", "dvb_ait.descr.trpt_proto.svcid", |
521 | 14 | FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, |
522 | 14 | { &hf_dvb_ait_descr_trpt_sel_comp, |
523 | 14 | { "Component tag", "dvb_ait.descr.trpt_proto.comp_tag", |
524 | 14 | FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } }, |
525 | 14 | { &hf_dvb_ait_descr_trpt_sel_url_base, |
526 | 14 | { "URL base", "dvb_ait.descr.trpt_proto.url_base", |
527 | 14 | FT_UINT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, |
528 | 14 | { &hf_dvb_ait_descr_trpt_sel_url_ext_cnt, |
529 | 14 | { "URL extension count", "dvb_ait.descr.trpt_proto.url_ext_cnt", |
530 | 14 | FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, |
531 | 14 | { &hf_dvb_ait_descr_trpt_sel_url_ext, |
532 | 14 | { "URL extension", "dvb_ait.descr.trpt_proto.url_ext", |
533 | 14 | FT_UINT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, |
534 | 14 | { &hf_dvb_ait_descr_trpt_sel_bytes, |
535 | 14 | { "Selector bytes", "dvb_ait.descr.trpt_proto.selector_bytes", |
536 | 14 | FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } }, |
537 | 14 | { &hf_dvb_ait_descr_sal_init_path, |
538 | 14 | { "Initial path", "dvb_ait.descr.sim_app_loc.initial_path", |
539 | 14 | FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, |
540 | 14 | { &hf_dvb_ait_app_loop_len, |
541 | 14 | { "Application loop length", "dvb_ait.app_loop_len", |
542 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0FFF, NULL, HFILL } }, |
543 | 14 | { &hf_dvb_ait_org_id, |
544 | 14 | { "Organisation ID", "dvb_ait.app.org_id", |
545 | 14 | FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } }, |
546 | 14 | { &hf_dvb_ait_app_id, |
547 | 14 | { "Application ID", "dvb_ait.app.app_id", |
548 | 14 | FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, |
549 | 14 | { &hf_dvb_ait_app_ctrl_code, |
550 | 14 | { "Application control code", "dvb_ait.app.ctrl_code", |
551 | 14 | FT_UINT8, BASE_HEX, VALS(app_ctrl_code), 0, NULL, HFILL } } |
552 | 14 | }; |
553 | | |
554 | 14 | proto_dvb_ait = proto_register_protocol("DVB Application Information Table", "DVB AIT", "dvb_ait"); |
555 | | |
556 | 14 | proto_register_field_array(proto_dvb_ait, hf, array_length(hf)); |
557 | 14 | proto_register_subtree_array(ett, array_length(ett)); |
558 | | |
559 | 14 | dvb_ait_handle = register_dissector("dvb_ait", dissect_dvb_ait, proto_dvb_ait); |
560 | 14 | } |
561 | | |
562 | | |
563 | | void |
564 | | proto_reg_handoff_dvb_ait(void) |
565 | 14 | { |
566 | 14 | dissector_add_uint("mpeg_sect.tid", DVB_AIT_TID, dvb_ait_handle); |
567 | 14 | } |
568 | | |
569 | | /* |
570 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
571 | | * |
572 | | * Local variables: |
573 | | * c-basic-offset: 4 |
574 | | * tab-width: 8 |
575 | | * indent-tabs-mode: nil |
576 | | * End: |
577 | | * |
578 | | * vi: set shiftwidth=4 tabstop=8 expandtab: |
579 | | * :indentSize=4:tabSize=8:noTabs=true: |
580 | | */ |