/src/wireshark/epan/dissectors/packet-ehs.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* packet-ehs.c |
2 | | * Routines for "Enhanced HOSC System" (EHS) dissection |
3 | | * Copyright 2000, Scott Hovis scott.hovis@ums.msfc.nasa.gov |
4 | | * Enhanced 2008, Matt Dunkle Matthew.L.Dunkle@nasa.gov |
5 | | * |
6 | | * Wireshark - Network traffic analyzer |
7 | | * By Gerald Combs <gerald@wireshark.com> |
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/tfs.h> |
17 | | |
18 | | void proto_register_ehs(void); |
19 | | void proto_reg_handoff_ehs(void); |
20 | | |
21 | | /* Initialize the protocol and registered fields */ |
22 | | static int proto_ehs; |
23 | | |
24 | | static int hf_ehs_ph_version; |
25 | | static int hf_ehs_ph_project; |
26 | | static int hf_ehs_ph_support_mode; |
27 | | static int hf_ehs_ph_data_mode; |
28 | | static int hf_ehs_ph_mission; |
29 | | static int hf_ehs_ph_protocol; |
30 | | |
31 | | static int hf_ehs_ph_year; /* numeric year as years since 1900 */ |
32 | | static int hf_ehs_ph_jday; /* julian day of year */ |
33 | | static int hf_ehs_ph_hour; |
34 | | static int hf_ehs_ph_minute; |
35 | | static int hf_ehs_ph_second; |
36 | | static int hf_ehs_ph_tenths; |
37 | | |
38 | | static int hf_ehs_ph_new_data_flag; /* indicates the time has changed */ |
39 | | /* static int hf_ehs_ph_pad1; */ |
40 | | static int hf_ehs_ph_hold_flag; /* indicates a hold condition */ |
41 | | static int hf_ehs_ph_sign_flag; /* indicates pre-mission, i.e. countdown, time */ |
42 | | |
43 | | /* static int hf_ehs_ph_pad2; */ |
44 | | /* static int hf_ehs_ph_pad3; */ |
45 | | /* static int hf_ehs_ph_pad4; */ |
46 | | |
47 | | static int hf_ehs_ph_hosc_packet_size; |
48 | | |
49 | | /* generic ehs secondary header values */ |
50 | | static int hf_ehs_sh_version; |
51 | | static int hf_ehs_sh_data_status_bit_5; |
52 | | static int hf_ehs_sh_data_status_bit_4; |
53 | | static int hf_ehs_sh_data_status_bit_3; |
54 | | static int hf_ehs_sh_data_status_bit_2; |
55 | | static int hf_ehs_sh_data_status_bit_1; |
56 | | static int hf_ehs_sh_data_status_bit_0; |
57 | | |
58 | | /* other common remappings of the data status bits specific to certain secondary ehs header values */ |
59 | | static int hf_ehs_sh_parent_stream_error; /* data status bit 3 */ |
60 | | static int hf_ehs_sh_vcdu_sequence_error; /* data status bit 2 */ |
61 | | static int hf_ehs_sh_packet_sequence_error; /* data status bit 1 */ |
62 | | |
63 | | /* common ehs secondary header values */ |
64 | | static int hf_ehs_sh_vcdu_sequence_number; |
65 | | static int hf_ehs_sh_data_stream_id; |
66 | | /* static int hf_ehs_sh_pdss_reserved_1; */ |
67 | | /* static int hf_ehs_sh_pdss_reserved_2; */ |
68 | | /* static int hf_ehs_sh_pdss_reserved_3; */ |
69 | | static int hf_ehs_sh_gse_pkt_id; |
70 | | static int hf_ehs_sh_payload_vs_core_id; |
71 | | static int hf_ehs_sh_apid; |
72 | | static int hf_ehs_sh_virtual_channel; |
73 | | static int hf_ehs_sh_pdss_reserved_sync; |
74 | | |
75 | | /* tdm ehs secondary header values */ |
76 | | static int hf_ehs_sh_tdm_secondary_header_length; |
77 | | |
78 | | static int hf_ehs_sh_tdm_extra_data_packet; |
79 | | static int hf_ehs_sh_tdm_backup_stream_id_number; |
80 | | static int hf_ehs_sh_tdm_end_of_data_flag; |
81 | | static int hf_ehs_sh_tdm_parent_frame_error; |
82 | | static int hf_ehs_sh_tdm_checksum_error; |
83 | | static int hf_ehs_sh_tdm_fixed_value_error; |
84 | | |
85 | | static int hf_ehs_sh_tdm_minor_frame_counter_error; |
86 | | static int hf_ehs_sh_tdm_format_id_error; |
87 | | static int hf_ehs_sh_tdm_bit_slip_error; |
88 | | static int hf_ehs_sh_tdm_sync_error; |
89 | | static int hf_ehs_sh_tdm_aoslos_flag; |
90 | | static int hf_ehs_sh_tdm_override_errors_flag; |
91 | | static int hf_ehs_sh_tdm_data_status; |
92 | | |
93 | | static int hf_ehs_sh_tdm_idq; |
94 | | static int hf_ehs_sh_tdm_cdq; |
95 | | static int hf_ehs_sh_tdm_adq; |
96 | | static int hf_ehs_sh_tdm_data_dq; |
97 | | /* static int hf_ehs_sh_tdm_unused; */ |
98 | | static int hf_ehs_sh_tdm_format_id; |
99 | | |
100 | | static int hf_ehs_sh_tdm_major_frame_packet_index; |
101 | | static int hf_ehs_sh_tdm_numpkts_per_major_frame; |
102 | | static int hf_ehs_sh_tdm_num_minor_frames_per_packet; |
103 | | |
104 | | static int hf_ehs_sh_tdm_cntmet_present; |
105 | | static int hf_ehs_sh_tdm_obt_present; |
106 | | static int hf_ehs_sh_tdm_major_frame_status_present; |
107 | | /* static int hf_ehs_sh_tdm_reserved; */ |
108 | | |
109 | | static int hf_ehs_sh_tdm_cnt_year; /* numeric year as years since 1900 */ |
110 | | static int hf_ehs_sh_tdm_cnt_jday; /* julian day of year */ |
111 | | static int hf_ehs_sh_tdm_cnt_hour; |
112 | | static int hf_ehs_sh_tdm_cnt_minute; |
113 | | static int hf_ehs_sh_tdm_cnt_second; |
114 | | static int hf_ehs_sh_tdm_cnt_tenths; |
115 | | |
116 | | static int hf_ehs_sh_tdm_obt_year; /* numeric year as years since 1900 */ |
117 | | static int hf_ehs_sh_tdm_obt_jday; /* julian day of year */ |
118 | | static int hf_ehs_sh_tdm_obt_hour; |
119 | | static int hf_ehs_sh_tdm_obt_minute; |
120 | | static int hf_ehs_sh_tdm_obt_second; |
121 | | static int hf_ehs_sh_tdm_obt_tenths; |
122 | | |
123 | | static int hf_ehs_sh_tdm_obt_delta_time_flag; |
124 | | static int hf_ehs_sh_tdm_obt_computed_flag; |
125 | | static int hf_ehs_sh_tdm_obt_not_retrieved_flag; |
126 | | /* static int hf_ehs_sh_tdm_obt_reserved; */ |
127 | | static int hf_ehs_sh_tdm_obt_source_apid; |
128 | | |
129 | | static int hf_ehs_sh_tdm_num_major_frame_status_words; |
130 | | |
131 | | /* static int hf_ehs_sh_tdm_mjfs_reserved; */ |
132 | | static int hf_ehs_sh_tdm_mjfs_parent_frame_error; |
133 | | static int hf_ehs_sh_tdm_mjfs_checksum_error; |
134 | | static int hf_ehs_sh_tdm_mjfs_fixed_value_error; |
135 | | |
136 | | static int hf_ehs_sh_tdm_mnfs_parent_frame_error; |
137 | | static int hf_ehs_sh_tdm_mnfs_data_not_available; |
138 | | static int hf_ehs_sh_tdm_mnfs_checksum_error; |
139 | | static int hf_ehs_sh_tdm_mnfs_fixed_value_error; |
140 | | static int hf_ehs_sh_tdm_mnfs_counter_error; |
141 | | static int hf_ehs_sh_tdm_mnfs_format_id_error; |
142 | | static int hf_ehs_sh_tdm_mnfs_bit_slip_error; |
143 | | static int hf_ehs_sh_tdm_mnfs_sync_error; |
144 | | |
145 | | /* pseudo ehs secondary header values */ |
146 | | /* static int hf_ehs_sh_pseudo_unused; */ |
147 | | static int hf_ehs_sh_pseudo_workstation_id; |
148 | | static int hf_ehs_sh_pseudo_user_id; |
149 | | static int hf_ehs_sh_pseudo_comp_id; |
150 | | |
151 | | /* data zone values for well known protocol AOS/LOS */ |
152 | | static int hf_ehs_dz_aoslos_indicator; |
153 | | |
154 | | /* data zone values for well known protocol UDSM */ |
155 | | static int hf_ehs_dz_udsm_ccsds_vs_bpdu; |
156 | | /* static int hf_ehs_dz_udsm_unused1; */ |
157 | | |
158 | | /* static int hf_ehs_dz_udsm_unused2; */ |
159 | | |
160 | | /* static int hf_ehs_dz_udsm_unused3; */ |
161 | | static int hf_ehs_dz_udsm_gse_pkt_id; |
162 | | static int hf_ehs_dz_udsm_payload_vs_core; |
163 | | static int hf_ehs_dz_udsm_apid; |
164 | | |
165 | | static int hf_ehs_dz_udsm_start_time_year; |
166 | | static int hf_ehs_dz_udsm_start_time_jday; |
167 | | static int hf_ehs_dz_udsm_start_time_hour; |
168 | | static int hf_ehs_dz_udsm_start_time_minute; |
169 | | static int hf_ehs_dz_udsm_start_time_second; |
170 | | |
171 | | static int hf_ehs_dz_udsm_stop_time_year; |
172 | | static int hf_ehs_dz_udsm_stop_time_jday; |
173 | | static int hf_ehs_dz_udsm_stop_time_hour; |
174 | | static int hf_ehs_dz_udsm_stop_time_minute; |
175 | | static int hf_ehs_dz_udsm_stop_time_second; |
176 | | |
177 | | /* static int hf_ehs_dz_udsm_unused4; */ |
178 | | |
179 | | static int hf_ehs_dz_udsm_num_pkts_xmtd; |
180 | | |
181 | | static int hf_ehs_dz_udsm_num_vcdu_seqerrs; |
182 | | |
183 | | static int hf_ehs_dz_udsm_num_pkt_seqerrs; |
184 | | |
185 | | static int hf_ehs_dz_udsm_num_pktlen_errors; |
186 | | |
187 | | static int hf_ehs_dz_udsm_event; |
188 | | |
189 | | static int hf_ehs_dz_udsm_num_pkts_xmtd_rollover; |
190 | | |
191 | | |
192 | | static dissector_handle_t ehs_handle; |
193 | | |
194 | | /* handle to ccsds packet dissector */ |
195 | | static dissector_handle_t ccsds_handle; |
196 | | |
197 | | /* Initialize the subtree pointers */ |
198 | | static int ett_ehs; |
199 | | static int ett_ehs_primary_header; |
200 | | static int ett_ehs_secondary_header; |
201 | | static int ett_ehs_data_zone; |
202 | | static int ett_ehs_cnt_time; |
203 | | static int ett_ehs_obt_time; |
204 | | static int ett_ehs_udsm_start_time; |
205 | | static int ett_ehs_udsm_stop_time; |
206 | | static int ett_ehs_ground_receipt_time; |
207 | | static int ett_ehs_major_frame; |
208 | | static int ett_ehs_minor_frame; |
209 | | |
210 | | /* EHS protocol types */ |
211 | | typedef enum EHS_Protocol_Type |
212 | | { |
213 | | EHS_PROTOCOL__ALL_PROTOCOLS, |
214 | | EHS_PROTOCOL__TDM_TELEMETRY, |
215 | | EHS_PROTOCOL__NASCOM_TELEMETRY, |
216 | | EHS_PROTOCOL__PSEUDO_TELEMETRY, |
217 | | EHS_PROTOCOL__TDS_DATA, |
218 | | EHS_PROTOCOL__TEST_DATA, |
219 | | EHS_PROTOCOL__GSE_DATA, |
220 | | EHS_PROTOCOL__CUSTOM_DATA, |
221 | | EHS_PROTOCOL__HDRS_DQ, |
222 | | EHS_PROTOCOL__CSS, |
223 | | EHS_PROTOCOL__AOS_LOS, |
224 | | EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET, |
225 | | EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET, |
226 | | EHS_PROTOCOL__PDSS_PAYLOAD_BPDU, |
227 | | EHS_PROTOCOL__PDSS_UDSM, |
228 | | EHS_PROTOCOL__PDSS_RPSM, |
229 | | NUMBER_PROTOCOLS = 15 |
230 | | } EHS_Protocol_Type_t; |
231 | | |
232 | | |
233 | | /* some basic sizing parameters */ |
234 | | enum |
235 | | { |
236 | | IP_HEADER_LENGTH = 48, |
237 | | CCSDS_PRIMARY_HEADER_LENGTH = 6, |
238 | | CCSDS_SECONDARY_HEADER_LENGTH = 10, |
239 | | EHS_PRIMARY_HEADER_SIZE = 16, |
240 | | EHS_SECONDARY_HEADER_SIZE = 12 |
241 | | }; |
242 | | |
243 | | /* determine if a ccsds primary header indicates a secondary exists */ |
244 | 0 | #define HDR_SECHDR 0x0800 |
245 | | |
246 | | |
247 | | static const value_string ehs_primary_header_project[] = |
248 | | { |
249 | | { 0, "All" }, |
250 | | { 1, "STS" }, |
251 | | { 2, "SL" }, |
252 | | { 3, "ISS" }, |
253 | | { 4, "AXAF" }, |
254 | | { 0, NULL } |
255 | | }; |
256 | | |
257 | | static const value_string ehs_primary_header_support_mode[] = |
258 | | { |
259 | | { 0, "All" }, |
260 | | { 1, "Flight" }, |
261 | | { 2, "Test" }, |
262 | | { 3, "Sim" }, |
263 | | { 4, "Validation" }, |
264 | | { 5, "Development" }, |
265 | | { 6, "Training" }, |
266 | | { 7, "Offline" }, |
267 | | { 0, NULL } |
268 | | }; |
269 | | |
270 | | static const value_string ehs_primary_header_data_mode[] = |
271 | | { |
272 | | { 0, "Unused" }, |
273 | | { 1, "Realtime" }, |
274 | | { 2, "Dump1" }, |
275 | | { 3, "Dump2" }, |
276 | | { 4, "Dump3" }, |
277 | | { 5, "Playback1" }, |
278 | | { 6, "Playback2" }, |
279 | | { 7, "Playback3" }, |
280 | | { 8, "Playback4" }, |
281 | | { 9, "Playback5" }, |
282 | | { 10, "Playback6" }, |
283 | | { 11, "Playback7" }, |
284 | | { 12, "Playback8" }, |
285 | | { 13, "Playback9" }, |
286 | | { 14, "Playback10" }, |
287 | | { 15, "Playback11" }, |
288 | | { 16, "Mode Independent" }, |
289 | | { 0, NULL } |
290 | | }; |
291 | | |
292 | | static const value_string ehs_primary_header_protocol[] = |
293 | | { |
294 | | { 0, "All" }, |
295 | | { 1, "TDM" }, |
296 | | { 2, "NASCOM" }, |
297 | | { 3, "PSEUDO" }, |
298 | | { 4, "Time" }, |
299 | | { 5, "Test" }, |
300 | | { 6, "GSE" }, |
301 | | { 7, "Custom_Data" }, |
302 | | { 8, "HDRS_DQ" }, |
303 | | { 9, "CSS" }, |
304 | | { 10, "AOS_LOS" }, |
305 | | { 11, "PDSS_PAYLOAD_CCSDS" }, |
306 | | { 12, "PDSS_CORE_CCSDS" }, |
307 | | { 13, "PDSS_PAYLOAD_BPDU" }, |
308 | | { 14, "PDSS_UDSM" }, |
309 | | { 15, "PDSS_RPSM" }, |
310 | | { 0, NULL } |
311 | | }; |
312 | | |
313 | | static const value_string ehs_secondary_header_data_stream_id[] = |
314 | | { |
315 | | { 0, "CCSDS" }, |
316 | | { 1, "BPDU" }, |
317 | | { 0, NULL } |
318 | | }; |
319 | | |
320 | | static const value_string ehs_secondary_header_payload_vs_core_id[] = |
321 | | { |
322 | | { 0, "Core" }, |
323 | | { 1, "Payload" }, |
324 | | { 0, NULL } |
325 | | }; |
326 | | |
327 | | static const value_string ehs_secondary_header_tdm_backup_stream_id[] = |
328 | | { |
329 | | { 0, "Stream A / KMTS-A" }, |
330 | | { 1, "Stream B / KMTS-B" }, |
331 | | { 2, "SKR" }, |
332 | | { 0, NULL } |
333 | | }; |
334 | | |
335 | | static const value_string ehs_secondary_header_tdm_end_of_data_flag[] = |
336 | | { |
337 | | { 0, "OK" }, |
338 | | { 1, "Loss of Clock" }, |
339 | | { 2, "Watchdog Timeout" }, |
340 | | { 3, "Loss of Sync" }, |
341 | | { 0, NULL } |
342 | | }; |
343 | | |
344 | | static const true_false_string ehs_tfs_secondary_header_tdm_aoslos_flag = |
345 | | { |
346 | | "AOS" , |
347 | | "LOS" |
348 | | }; |
349 | | |
350 | | static const value_string ehs_secondary_header_tdm_data_status[] = |
351 | | { |
352 | | { 0, "OK" }, |
353 | | { 1, "Suspect" }, |
354 | | { 2, "DQ Failed" }, |
355 | | { 3, "No Data" }, |
356 | | { 0, NULL } |
357 | | }; |
358 | | |
359 | | static const value_string ehs_data_zone_aoslos_indicator[] = |
360 | | { |
361 | | { 0, "S-band LOS" }, |
362 | | { 1, "S-band AOS" }, |
363 | | { 2, "Ku-band LOS" }, |
364 | | { 3, "Ku-band AOS" }, |
365 | | { 0, NULL } |
366 | | }; |
367 | | |
368 | | static const value_string ehs_data_zone_udsm_ccsds_vs_bpdu[] = |
369 | | { |
370 | | { 0, "CCSDS" }, |
371 | | { 1, "BPDU" }, |
372 | | { 0, NULL } |
373 | | }; |
374 | | |
375 | | static const value_string ehs_data_zone_udsm_payload_vs_core[] = |
376 | | { |
377 | | { 0, "Core" }, |
378 | | { 1, "Payload" }, |
379 | | { 0, NULL } |
380 | | }; |
381 | | |
382 | | static const value_string ehs_data_zone_udsm_event[] = |
383 | | { |
384 | | { 0, "Undefined" }, |
385 | | { 1, "Actual LOS" }, |
386 | | { 2, "Scheduled End of Data" }, |
387 | | { 3, "Operator Requested" }, |
388 | | { 0, NULL } |
389 | | }; |
390 | | |
391 | | |
392 | | /* function to return EHS secondary header size according to protocol. |
393 | | * the buffer pointer tvb should be pointing to the packets ehs primary |
394 | | * header, and the offset should be set to the start of the ehs secondary |
395 | | * header on input. |
396 | | */ |
397 | | static int |
398 | | ehs_secondary_header_size ( int protocol, tvbuff_t* tvb, int offset ) |
399 | 0 | { |
400 | | /* for most protocols the ehs secondary header is a standard size */ |
401 | 0 | int size = EHS_SECONDARY_HEADER_SIZE; |
402 | |
|
403 | 0 | switch ( protocol ) |
404 | 0 | { |
405 | 0 | case EHS_PROTOCOL__TDM_TELEMETRY: |
406 | | /* the TDM secondary header size is variable. its value is actually |
407 | | * contained in the first two bytes of the secondary header itself. |
408 | | */ |
409 | 0 | size = tvb_get_ntohs ( tvb, offset ); |
410 | 0 | break; |
411 | | |
412 | 0 | case EHS_PROTOCOL__NASCOM_TELEMETRY: |
413 | 0 | break; |
414 | | |
415 | 0 | case EHS_PROTOCOL__PSEUDO_TELEMETRY: |
416 | 0 | size = 8; |
417 | 0 | break; |
418 | | |
419 | 0 | case EHS_PROTOCOL__TDS_DATA: |
420 | 0 | break; |
421 | | |
422 | 0 | case EHS_PROTOCOL__TEST_DATA: |
423 | 0 | break; |
424 | | |
425 | 0 | case EHS_PROTOCOL__GSE_DATA: |
426 | 0 | size = 16; |
427 | 0 | break; |
428 | | |
429 | 0 | case EHS_PROTOCOL__CUSTOM_DATA: |
430 | 0 | break; |
431 | | |
432 | 0 | case EHS_PROTOCOL__HDRS_DQ: |
433 | 0 | break; |
434 | | |
435 | 0 | case EHS_PROTOCOL__CSS: |
436 | 0 | break; |
437 | | |
438 | 0 | case EHS_PROTOCOL__AOS_LOS: |
439 | 0 | break; |
440 | | |
441 | 0 | case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET: |
442 | 0 | break; |
443 | | |
444 | 0 | case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET: |
445 | 0 | break; |
446 | | |
447 | 0 | case EHS_PROTOCOL__PDSS_PAYLOAD_BPDU: |
448 | 0 | break; |
449 | | |
450 | 0 | case EHS_PROTOCOL__PDSS_UDSM: |
451 | 0 | break; |
452 | | |
453 | 0 | case EHS_PROTOCOL__PDSS_RPSM: |
454 | 0 | break; |
455 | | |
456 | 0 | default: |
457 | 0 | break; |
458 | 0 | } |
459 | | |
460 | 0 | return size; |
461 | |
|
462 | 0 | } |
463 | | |
464 | | |
465 | | /* common EHS secondary header dissector */ |
466 | | static void |
467 | | common_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset ) |
468 | 0 | { |
469 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_vcdu_sequence_number, tvb, *offset, 3, ENC_BIG_ENDIAN ); |
470 | 0 | *offset += 3; |
471 | |
|
472 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_stream_id, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
473 | | /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_1, tvb, *offset, 1, ENC_BIG_ENDIAN ); */ |
474 | 0 | ++(*offset); |
475 | | |
476 | | /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_2, tvb, *offset, 1, ENC_BIG_ENDIAN ); */ |
477 | 0 | ++(*offset); |
478 | | |
479 | | /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_3, tvb, *offset, 2, ENC_BIG_ENDIAN ); */ |
480 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_gse_pkt_id, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
481 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_payload_vs_core_id, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
482 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_apid, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
483 | 0 | *offset += 2; |
484 | |
|
485 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_virtual_channel, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
486 | 0 | *offset += 2; |
487 | |
|
488 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_sync, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
489 | 0 | *offset += 2; |
490 | |
|
491 | 0 | } |
492 | | |
493 | | |
494 | | /* AOS/LOS EHS secondary header dissector */ |
495 | | static void |
496 | | aoslos_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset ) |
497 | 0 | { |
498 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
499 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
500 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
501 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_3, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
502 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_2, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
503 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_1, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
504 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
505 | 0 | ++(*offset); |
506 | |
|
507 | 0 | common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset ); |
508 | 0 | } |
509 | | |
510 | | |
511 | | /* payload ccsds secondary header dissector */ |
512 | | static void |
513 | | payload_ccsds_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset ) |
514 | 0 | { |
515 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
516 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
517 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
518 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_3, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
519 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_vcdu_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
520 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_packet_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
521 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
522 | 0 | ++(*offset); |
523 | |
|
524 | 0 | common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset ); |
525 | 0 | } |
526 | | |
527 | | |
528 | | /* core ccsds secondary header dissector */ |
529 | | static void |
530 | | core_ccsds_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset ) |
531 | 0 | { |
532 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
533 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
534 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
535 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_parent_stream_error, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
536 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_vcdu_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
537 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_packet_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
538 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
539 | 0 | ++(*offset); |
540 | |
|
541 | 0 | common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset ); |
542 | 0 | } |
543 | | |
544 | | |
545 | | /* payload bpdu secondary header dissector */ |
546 | | static void |
547 | | payload_bpdu_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset ) |
548 | 0 | { |
549 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
550 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
551 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
552 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_3, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
553 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_vcdu_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
554 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_1, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
555 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
556 | 0 | ++(*offset); |
557 | |
|
558 | 0 | common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset ); |
559 | 0 | } |
560 | | |
561 | | |
562 | | /* udsm secondary header dissector */ |
563 | | static void |
564 | | udsm_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset ) |
565 | 0 | { |
566 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
567 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
568 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
569 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_3, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
570 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_2, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
571 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_1, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
572 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
573 | 0 | ++(*offset); |
574 | |
|
575 | 0 | common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset ); |
576 | 0 | } |
577 | | |
578 | | |
579 | | /* tdm secondary header dissector */ |
580 | | static void |
581 | | tdm_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset ) |
582 | 0 | { |
583 | 0 | int j; |
584 | 0 | int num_major_frames = 0; |
585 | 0 | int num_minor_frames = 0; |
586 | 0 | int cntmet_present = 0; |
587 | 0 | int obt_present = 0; |
588 | 0 | int mjfs_present = 0; |
589 | |
|
590 | 0 | proto_tree* time_tree; |
591 | 0 | proto_item* time_item; |
592 | 0 | int year, jday, hour, minute, second, tenths; |
593 | |
|
594 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_secondary_header_length, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
595 | 0 | *offset += 2; |
596 | |
|
597 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_extra_data_packet, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
598 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_backup_stream_id_number, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
599 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_end_of_data_flag, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
600 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_parent_frame_error, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
601 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_checksum_error, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
602 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_fixed_value_error, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
603 | 0 | ++(*offset); |
604 | |
|
605 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_minor_frame_counter_error, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
606 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_format_id_error, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
607 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_bit_slip_error, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
608 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_sync_error, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
609 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_aoslos_flag, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
610 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_override_errors_flag, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
611 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_data_status, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
612 | 0 | ++(*offset); |
613 | |
|
614 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_idq, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
615 | 0 | *offset += 2; |
616 | |
|
617 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_cdq, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
618 | 0 | *offset += 2; |
619 | |
|
620 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_adq, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
621 | 0 | *offset += 2; |
622 | |
|
623 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_data_dq, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
624 | 0 | *offset += 2; |
625 | | |
626 | | /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_unused, tvb, *offset, 2, ENC_BIG_ENDIAN ); */ |
627 | 0 | *offset += 2; |
628 | |
|
629 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_format_id, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
630 | 0 | *offset += 2; |
631 | |
|
632 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_major_frame_packet_index, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
633 | 0 | ++(*offset); |
634 | |
|
635 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_numpkts_per_major_frame, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
636 | 0 | ++(*offset); |
637 | |
|
638 | 0 | num_minor_frames = 1 + tvb_get_uint8 ( tvb, *offset ); |
639 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_num_minor_frames_per_packet, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
640 | 0 | ++(*offset); |
641 | |
|
642 | 0 | cntmet_present = tvb_get_uint8 ( tvb, *offset ) & 0x80; |
643 | 0 | obt_present = tvb_get_uint8 ( tvb, *offset ) & 0x40; |
644 | 0 | mjfs_present = tvb_get_uint8 ( tvb, *offset ) & 0x20; |
645 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_cntmet_present, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
646 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_present, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
647 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_major_frame_status_present, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
648 | | /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_reserved, tvb, *offset, 1, ENC_BIG_ENDIAN ); */ |
649 | 0 | ++(*offset); |
650 | |
|
651 | 0 | if ( cntmet_present ) |
652 | 0 | { |
653 | 0 | time_tree = proto_tree_add_subtree(ehs_secondary_header_tree, tvb, *offset, 7, ett_ehs_cnt_time, &time_item, "CNT/MET Time: "); |
654 | |
|
655 | 0 | year = tvb_get_uint8 ( tvb, *offset ); |
656 | 0 | proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_year, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
657 | 0 | ++(*offset); |
658 | |
|
659 | 0 | jday = tvb_get_ntohs ( tvb, *offset ); |
660 | 0 | proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_jday, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
661 | 0 | *offset += 2; |
662 | |
|
663 | 0 | hour = tvb_get_uint8 ( tvb, *offset ); |
664 | 0 | proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_hour, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
665 | 0 | ++(*offset); |
666 | |
|
667 | 0 | minute = tvb_get_uint8 ( tvb, *offset ); |
668 | 0 | proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_minute, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
669 | 0 | ++(*offset); |
670 | |
|
671 | 0 | second = tvb_get_uint8 ( tvb, *offset ); |
672 | 0 | proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_second, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
673 | 0 | ++(*offset); |
674 | |
|
675 | 0 | tenths = tvb_get_uint8 ( tvb, *offset ) >> 4; |
676 | 0 | proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_tenths, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
677 | 0 | ++(*offset); |
678 | | |
679 | | /* format a more readable time */ |
680 | 0 | proto_item_append_text(time_item, "%04d/%03d:%02d:%02d:%02d.%1d", year + 1900, jday, hour, minute, second, tenths ); |
681 | 0 | } |
682 | | |
683 | |
|
684 | 0 | if ( obt_present ) |
685 | 0 | { |
686 | 0 | time_tree = proto_tree_add_subtree(ehs_secondary_header_tree, tvb, *offset, 7, ett_ehs_obt_time, &time_item, "OBT Time: "); |
687 | |
|
688 | 0 | year = tvb_get_uint8 ( tvb, *offset ); |
689 | 0 | proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_year, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
690 | 0 | ++(*offset); |
691 | |
|
692 | 0 | jday = tvb_get_ntohs ( tvb, *offset ); |
693 | 0 | proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_jday, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
694 | 0 | *offset += 2; |
695 | |
|
696 | 0 | hour = tvb_get_uint8 ( tvb, *offset ); |
697 | 0 | proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_hour, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
698 | 0 | ++(*offset); |
699 | |
|
700 | 0 | minute = tvb_get_uint8 ( tvb, *offset ); |
701 | 0 | proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_minute, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
702 | 0 | ++(*offset); |
703 | |
|
704 | 0 | second = tvb_get_uint8 ( tvb, *offset ); |
705 | 0 | proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_second, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
706 | 0 | ++(*offset); |
707 | |
|
708 | 0 | tenths = tvb_get_uint8 ( tvb, *offset ) >> 4; |
709 | 0 | proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_tenths, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
710 | 0 | ++(*offset); |
711 | | |
712 | | /* format a more readable time */ |
713 | 0 | proto_item_append_text ( time_item, "%04d/%03d:%02d:%02d:%02d.%1d", year + 1900, jday, hour, minute, second, tenths ); |
714 | |
|
715 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_delta_time_flag, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
716 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_computed_flag, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
717 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_not_retrieved_flag, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
718 | | /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_reserved, tvb, *offset, 1, ENC_BIG_ENDIAN ); */ |
719 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_source_apid, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
720 | 0 | } |
721 | |
|
722 | 0 | if ( mjfs_present ) |
723 | 0 | { |
724 | 0 | num_major_frames = 1 + tvb_get_uint8 ( tvb, *offset ); |
725 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_num_major_frame_status_words, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
726 | 0 | ++(*offset); |
727 | |
|
728 | 0 | for ( j=0; j < num_major_frames; ++j ) |
729 | 0 | { |
730 | 0 | proto_tree* major_tree; |
731 | 0 | static int * const major_fields[] = { |
732 | | /* &hf_ehs_sh_tdm_mjfs_reserved, */ |
733 | 0 | &hf_ehs_sh_tdm_mjfs_parent_frame_error, |
734 | 0 | &hf_ehs_sh_tdm_mjfs_checksum_error, |
735 | 0 | &hf_ehs_sh_tdm_mjfs_fixed_value_error, |
736 | 0 | NULL |
737 | 0 | }; |
738 | |
|
739 | 0 | major_tree = proto_tree_add_subtree_format( ehs_secondary_header_tree, tvb, *offset, 1, ett_ehs_major_frame, NULL, "Major Frame Status Byte# %d", j ); |
740 | 0 | proto_tree_add_bitmask_list(major_tree, tvb, *offset, 1, major_fields, ENC_BIG_ENDIAN); |
741 | 0 | ++(*offset); |
742 | 0 | } |
743 | 0 | } |
744 | |
|
745 | 0 | for ( j=0; j < num_minor_frames; ++j ) |
746 | 0 | { |
747 | 0 | proto_tree* minor_tree; |
748 | 0 | static int * const minor_fields[] = { |
749 | 0 | &hf_ehs_sh_tdm_mnfs_parent_frame_error, |
750 | 0 | &hf_ehs_sh_tdm_mnfs_data_not_available, |
751 | 0 | &hf_ehs_sh_tdm_mnfs_checksum_error, |
752 | 0 | &hf_ehs_sh_tdm_mnfs_fixed_value_error, |
753 | 0 | &hf_ehs_sh_tdm_mnfs_counter_error, |
754 | 0 | &hf_ehs_sh_tdm_mnfs_format_id_error, |
755 | 0 | &hf_ehs_sh_tdm_mnfs_bit_slip_error, |
756 | 0 | &hf_ehs_sh_tdm_mnfs_sync_error, |
757 | 0 | NULL |
758 | 0 | }; |
759 | |
|
760 | 0 | minor_tree = proto_tree_add_subtree_format( ehs_secondary_header_tree, tvb, *offset, 1, ett_ehs_minor_frame, NULL, "Minor Frame Status Byte# %d", j ); |
761 | 0 | proto_tree_add_bitmask_list(minor_tree, tvb, *offset, 1, minor_fields, ENC_BIG_ENDIAN); |
762 | 0 | ++(*offset); |
763 | 0 | } |
764 | |
|
765 | 0 | } |
766 | | |
767 | | |
768 | | /* pseudo secondary header dissector */ |
769 | | static void |
770 | | pseudo_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset ) |
771 | 0 | { |
772 | | /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pseudo_unused, tvb, *offset, 2, ENC_BIG_ENDIAN ); */ |
773 | 0 | *offset += 2; |
774 | |
|
775 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pseudo_workstation_id, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
776 | 0 | *offset += 2; |
777 | |
|
778 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pseudo_user_id, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
779 | 0 | *offset += 2; |
780 | |
|
781 | 0 | proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pseudo_comp_id, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
782 | 0 | *offset += 2; |
783 | |
|
784 | 0 | } |
785 | | |
786 | | |
787 | | |
788 | | |
789 | | /* EHS secondary header dissector */ |
790 | | static void |
791 | | ehs_secondary_header_dissector ( int protocol, proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset ) |
792 | 0 | { |
793 | | /* the ehs secondary header structure is potentially different for each and every |
794 | | * protocol type, including its size. we support certain protocols but not all. |
795 | | * for those protocols which are not supported we simply increment the offset |
796 | | * and return. support for these other protocols can easily be added at a later |
797 | | * time if and when it becomes necessary to do so. but for right now, we're only |
798 | | * going to dissect those protocols that we work with on a regular basis in pdss. |
799 | | */ |
800 | 0 | switch ( protocol ) |
801 | 0 | { |
802 | 0 | case EHS_PROTOCOL__TDM_TELEMETRY: |
803 | 0 | tdm_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset ); |
804 | 0 | break; |
805 | | |
806 | 0 | case EHS_PROTOCOL__NASCOM_TELEMETRY: |
807 | 0 | *offset += ehs_secondary_header_size ( protocol, tvb, *offset ); |
808 | 0 | break; |
809 | | |
810 | 0 | case EHS_PROTOCOL__PSEUDO_TELEMETRY: |
811 | 0 | pseudo_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset ); |
812 | 0 | break; |
813 | | |
814 | 0 | case EHS_PROTOCOL__TDS_DATA: |
815 | 0 | *offset += ehs_secondary_header_size ( protocol, tvb, *offset ); |
816 | 0 | break; |
817 | | |
818 | 0 | case EHS_PROTOCOL__TEST_DATA: |
819 | 0 | *offset += ehs_secondary_header_size ( protocol, tvb, *offset ); |
820 | 0 | break; |
821 | | |
822 | 0 | case EHS_PROTOCOL__GSE_DATA: |
823 | 0 | *offset += ehs_secondary_header_size ( protocol, tvb, *offset ); |
824 | 0 | break; |
825 | | |
826 | 0 | case EHS_PROTOCOL__CUSTOM_DATA: |
827 | 0 | *offset += ehs_secondary_header_size ( protocol, tvb, *offset ); |
828 | 0 | break; |
829 | | |
830 | 0 | case EHS_PROTOCOL__HDRS_DQ: |
831 | 0 | *offset += ehs_secondary_header_size ( protocol, tvb, *offset ); |
832 | 0 | break; |
833 | | |
834 | 0 | case EHS_PROTOCOL__CSS: |
835 | 0 | *offset += ehs_secondary_header_size ( protocol, tvb, *offset ); |
836 | 0 | break; |
837 | | |
838 | 0 | case EHS_PROTOCOL__AOS_LOS: |
839 | 0 | aoslos_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset ); |
840 | 0 | break; |
841 | | |
842 | 0 | case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET: |
843 | 0 | payload_ccsds_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset ); |
844 | 0 | break; |
845 | | |
846 | 0 | case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET: |
847 | 0 | core_ccsds_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset ); |
848 | 0 | break; |
849 | | |
850 | 0 | case EHS_PROTOCOL__PDSS_PAYLOAD_BPDU: |
851 | 0 | payload_bpdu_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset ); |
852 | 0 | break; |
853 | | |
854 | 0 | case EHS_PROTOCOL__PDSS_UDSM: |
855 | 0 | udsm_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset ); |
856 | 0 | break; |
857 | | |
858 | 0 | case EHS_PROTOCOL__PDSS_RPSM: |
859 | 0 | *offset += ehs_secondary_header_size ( protocol, tvb, *offset ); |
860 | 0 | break; |
861 | | |
862 | 0 | default: |
863 | 0 | *offset += ehs_secondary_header_size ( protocol, tvb, *offset ); |
864 | 0 | break; |
865 | 0 | } |
866 | 0 | } |
867 | | |
868 | | |
869 | | /* AOS/LOS data zone dissector */ |
870 | | static void |
871 | | aoslos_data_zone_dissector ( proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, packet_info* pinfo _U_) |
872 | 0 | { |
873 | 0 | proto_tree *ehs_data_zone_tree; |
874 | | |
875 | | /* create the data zone tree */ |
876 | 0 | ehs_data_zone_tree = proto_tree_add_subtree( ehs_tree, tvb, *offset, tvb_reported_length(tvb) - *offset, |
877 | 0 | ett_ehs_data_zone, NULL, "AOS/LOS Data Zone" ); |
878 | | |
879 | | /* since the aos/los EHS packet data zone is well known, format it for display as well |
880 | | * |
881 | | * The AOS/LOS packet data zone is only 2 bytes in |
882 | | * length and only 2 bits in the first byte are |
883 | | * meaningful -- Ku band or S band and AOS or LOS |
884 | | * |
885 | | * 7-2 - unused |
886 | | * 1-0 - band + AOS/LOS indicator |
887 | | * |
888 | | * bit 1 - 0=sband 1=kuband |
889 | | * bit 0 - 0=LOS 1=AOS |
890 | | * |
891 | | * 0 00 - sband LOS |
892 | | * 1 01 - sband AOS |
893 | | * 2 10 - kuband LOS |
894 | | * 3 11 - kuband AOS |
895 | | */ |
896 | 0 | proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_aoslos_indicator, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
897 | 0 | ++(*offset); |
898 | 0 | } |
899 | | |
900 | | |
901 | | /* UDSM data zone dissector */ |
902 | | static void |
903 | | udsm_data_zone_dissector ( proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, packet_info* pinfo _U_) |
904 | 0 | { |
905 | 0 | proto_tree *ehs_data_zone_tree; |
906 | |
|
907 | 0 | proto_tree* time_tree; |
908 | 0 | proto_item* time_item; |
909 | 0 | int year, jday, hour, minute, second; |
910 | | |
911 | | /* create the data zone tree */ |
912 | 0 | ehs_data_zone_tree = proto_tree_add_subtree( ehs_tree, tvb, *offset, tvb_reported_length(tvb) - *offset, |
913 | 0 | ett_ehs_data_zone, NULL, "UDSM Data Zone" ); |
914 | |
|
915 | 0 | proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_ccsds_vs_bpdu, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
916 | | /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused1, tvb, *offset, 1, ENC_BIG_ENDIAN ); */ |
917 | 0 | ++(*offset); |
918 | | |
919 | | /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused2, tvb, *offset, 1, ENC_BIG_ENDIAN ); */ |
920 | 0 | ++(*offset); |
921 | | |
922 | | /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused3, tvb, *offset, 2, ENC_BIG_ENDIAN ); */ |
923 | 0 | proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_gse_pkt_id, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
924 | 0 | proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_payload_vs_core, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
925 | 0 | proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_apid, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
926 | 0 | *offset += 2; |
927 | |
|
928 | 0 | time_tree = proto_tree_add_subtree(ehs_data_zone_tree, tvb, *offset, 7, ett_ehs_udsm_start_time, &time_item, "UDSM Start Time: "); |
929 | 0 | year = tvb_get_uint8 ( tvb, *offset ); |
930 | 0 | proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_year, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
931 | 0 | ++(*offset); |
932 | |
|
933 | 0 | jday = tvb_get_ntohs ( tvb, *offset ); |
934 | 0 | proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_jday, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
935 | 0 | *offset += 2; |
936 | |
|
937 | 0 | hour = tvb_get_uint8 ( tvb, *offset ); |
938 | 0 | proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_hour, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
939 | 0 | ++(*offset); |
940 | |
|
941 | 0 | minute = tvb_get_uint8 ( tvb, *offset ); |
942 | 0 | proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_minute, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
943 | 0 | ++(*offset); |
944 | |
|
945 | 0 | second = tvb_get_uint8 ( tvb, *offset ); |
946 | 0 | proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_second, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
947 | 0 | ++(*offset); |
948 | | |
949 | | /* format a more readable time */ |
950 | 0 | proto_item_append_text( time_item, "%04d/%03d:%02d:%02d:%02d = UDSM Start Time", year + 1900, jday, hour, minute, second ); |
951 | |
|
952 | 0 | time_tree = proto_tree_add_subtree(ehs_data_zone_tree, tvb, *offset, 7, ett_ehs_udsm_stop_time, &time_item, "UDSM Stop Time: "); |
953 | 0 | year = tvb_get_uint8 ( tvb, *offset ); |
954 | 0 | proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_year, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
955 | 0 | ++(*offset); |
956 | |
|
957 | 0 | jday = tvb_get_ntohs ( tvb, *offset ); |
958 | 0 | proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_jday, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
959 | 0 | *offset += 2; |
960 | |
|
961 | 0 | hour = tvb_get_uint8 ( tvb, *offset ); |
962 | 0 | proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_hour, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
963 | 0 | ++(*offset); |
964 | |
|
965 | 0 | minute = tvb_get_uint8 ( tvb, *offset ); |
966 | 0 | proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_minute, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
967 | 0 | ++(*offset); |
968 | |
|
969 | 0 | second = tvb_get_uint8 ( tvb, *offset ); |
970 | 0 | proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_second, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
971 | 0 | ++(*offset); |
972 | | |
973 | | /* format a more readable time */ |
974 | 0 | proto_item_append_text ( time_item, "%04d/%03d:%02d:%02d:%02d", year + 1900, jday, hour, minute, second ); |
975 | | |
976 | | /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused4, tvb, *offset, 2, ENC_BIG_ENDIAN ); */ |
977 | 0 | *offset += 2; |
978 | |
|
979 | 0 | proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_pkts_xmtd, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
980 | 0 | *offset += 2; |
981 | |
|
982 | 0 | proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_vcdu_seqerrs, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
983 | 0 | *offset += 2; |
984 | |
|
985 | 0 | proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_pkt_seqerrs, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
986 | 0 | *offset += 2; |
987 | |
|
988 | 0 | proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_pktlen_errors, tvb, *offset, 2, ENC_BIG_ENDIAN ); |
989 | 0 | *offset += 2; |
990 | |
|
991 | 0 | proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_event, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
992 | 0 | ++(*offset); |
993 | |
|
994 | 0 | proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_pkts_xmtd_rollover, tvb, *offset, 1, ENC_BIG_ENDIAN ); |
995 | 0 | ++(*offset); |
996 | |
|
997 | 0 | } |
998 | | |
999 | | |
1000 | | /* data zone dissector */ |
1001 | | static void |
1002 | | ehs_data_zone_dissector ( int protocol, proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, packet_info* pinfo ) |
1003 | 0 | { |
1004 | | /* the data zone of certain protocols such as AOS/LOS and UDSM is well known. |
1005 | | */ |
1006 | 0 | switch ( protocol ) |
1007 | 0 | { |
1008 | 0 | case EHS_PROTOCOL__TDM_TELEMETRY: |
1009 | 0 | break; |
1010 | | |
1011 | 0 | case EHS_PROTOCOL__NASCOM_TELEMETRY: |
1012 | 0 | break; |
1013 | | |
1014 | 0 | case EHS_PROTOCOL__PSEUDO_TELEMETRY: |
1015 | 0 | break; |
1016 | | |
1017 | 0 | case EHS_PROTOCOL__TDS_DATA: |
1018 | 0 | break; |
1019 | | |
1020 | 0 | case EHS_PROTOCOL__TEST_DATA: |
1021 | 0 | break; |
1022 | | |
1023 | 0 | case EHS_PROTOCOL__GSE_DATA: |
1024 | 0 | break; |
1025 | | |
1026 | 0 | case EHS_PROTOCOL__CUSTOM_DATA: |
1027 | 0 | break; |
1028 | | |
1029 | 0 | case EHS_PROTOCOL__HDRS_DQ: |
1030 | 0 | break; |
1031 | | |
1032 | 0 | case EHS_PROTOCOL__CSS: |
1033 | 0 | break; |
1034 | | |
1035 | 0 | case EHS_PROTOCOL__AOS_LOS: |
1036 | 0 | aoslos_data_zone_dissector ( ehs_tree, tvb, offset, pinfo ); |
1037 | 0 | break; |
1038 | | |
1039 | 0 | case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET: |
1040 | 0 | break; |
1041 | | |
1042 | 0 | case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET: |
1043 | 0 | break; |
1044 | | |
1045 | 0 | case EHS_PROTOCOL__PDSS_PAYLOAD_BPDU: |
1046 | 0 | break; |
1047 | | |
1048 | 0 | case EHS_PROTOCOL__PDSS_UDSM: |
1049 | 0 | udsm_data_zone_dissector ( ehs_tree, tvb, offset, pinfo ); |
1050 | 0 | break; |
1051 | | |
1052 | 0 | case EHS_PROTOCOL__PDSS_RPSM: |
1053 | 0 | break; |
1054 | | |
1055 | 0 | default: |
1056 | 0 | break; |
1057 | 0 | } |
1058 | 0 | } |
1059 | | |
1060 | | |
1061 | | /* Code to actually dissect the packets */ |
1062 | | static int |
1063 | | dissect_ehs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) |
1064 | 0 | { |
1065 | 0 | int offset = 0; |
1066 | 0 | uint16_t first_word; |
1067 | |
|
1068 | 0 | tvbuff_t *new_tvb; |
1069 | |
|
1070 | 0 | proto_item *ehs_packet; |
1071 | 0 | proto_tree *ehs_tree; |
1072 | |
|
1073 | 0 | proto_tree* time_tree; |
1074 | 0 | proto_item* time_item; |
1075 | 0 | proto_tree *ehs_primary_header_tree; |
1076 | 0 | proto_tree *ehs_secondary_header_tree; |
1077 | |
|
1078 | 0 | int protocol; |
1079 | 0 | int year, jday, hour, minute, second, tenths; |
1080 | |
|
1081 | 0 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "EHS"); |
1082 | 0 | col_set_str(pinfo->cinfo, COL_INFO, "EHS"); |
1083 | |
|
1084 | 0 | ehs_packet = proto_tree_add_item ( tree, proto_ehs, tvb, 0, -1, ENC_NA ); |
1085 | 0 | ehs_tree = proto_item_add_subtree ( ehs_packet, ett_ehs ); |
1086 | | |
1087 | | /* build the ehs primary header tree */ |
1088 | 0 | ehs_primary_header_tree = proto_tree_add_subtree( ehs_tree, tvb, offset, EHS_PRIMARY_HEADER_SIZE, |
1089 | 0 | ett_ehs_primary_header, NULL, "Primary EHS Header" ); |
1090 | |
|
1091 | 0 | proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_version, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1092 | 0 | proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_project, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1093 | 0 | ++offset; |
1094 | |
|
1095 | 0 | proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_support_mode, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1096 | 0 | proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_data_mode, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1097 | 0 | ++offset; |
1098 | |
|
1099 | 0 | proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_mission, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1100 | 0 | ++offset; |
1101 | | |
1102 | | /* save protocol for use later on */ |
1103 | 0 | protocol = tvb_get_uint8 ( tvb, offset ); |
1104 | 0 | proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_protocol, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1105 | 0 | ++offset; |
1106 | |
|
1107 | 0 | time_tree = proto_tree_add_subtree(ehs_primary_header_tree, tvb, offset, 7, ett_ehs_ground_receipt_time, &time_item, "EHS Ground Receipt Time: "); |
1108 | 0 | year = tvb_get_uint8 ( tvb, offset ); |
1109 | 0 | proto_tree_add_item ( time_tree, hf_ehs_ph_year, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1110 | 0 | ++offset; |
1111 | |
|
1112 | 0 | jday = tvb_get_ntohs ( tvb, offset ); |
1113 | 0 | proto_tree_add_item ( time_tree, hf_ehs_ph_jday, tvb, offset, 2, ENC_BIG_ENDIAN ); |
1114 | 0 | offset += 2; |
1115 | |
|
1116 | 0 | hour = tvb_get_uint8 ( tvb, offset ); |
1117 | 0 | proto_tree_add_item ( time_tree, hf_ehs_ph_hour, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1118 | 0 | ++offset; |
1119 | |
|
1120 | 0 | minute = tvb_get_uint8 ( tvb, offset ); |
1121 | 0 | proto_tree_add_item ( time_tree, hf_ehs_ph_minute, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1122 | 0 | ++offset; |
1123 | |
|
1124 | 0 | second = tvb_get_uint8 ( tvb, offset ); |
1125 | 0 | proto_tree_add_item ( time_tree, hf_ehs_ph_second, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1126 | 0 | ++offset; |
1127 | |
|
1128 | 0 | tenths = tvb_get_uint8 ( tvb, offset ) >> 4; |
1129 | 0 | proto_tree_add_item ( time_tree, hf_ehs_ph_tenths, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1130 | | |
1131 | | /* format a more readable ground receipt time string */ |
1132 | 0 | proto_item_append_text ( time_item, "%04d/%03d:%02d:%02d:%02d.%1d", year + 1900, jday, hour, minute, second, tenths ); |
1133 | |
|
1134 | 0 | proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_new_data_flag, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1135 | | /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad1, tvb, offset, 1, ENC_BIG_ENDIAN ); */ |
1136 | 0 | proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_hold_flag, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1137 | 0 | proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_sign_flag, tvb, offset, 1, ENC_BIG_ENDIAN ); |
1138 | 0 | ++offset; |
1139 | | |
1140 | | /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad2, tvb, offset, 1, ENC_BIG_ENDIAN ); */ |
1141 | 0 | ++offset; |
1142 | | /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad3, tvb, offset, 1, ENC_BIG_ENDIAN ); */ |
1143 | 0 | ++offset; |
1144 | | /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad4, tvb, offset, 1, ENC_BIG_ENDIAN ); */ |
1145 | 0 | ++offset; |
1146 | |
|
1147 | 0 | proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_hosc_packet_size, tvb, offset, 2, ENC_BIG_ENDIAN ); |
1148 | 0 | offset += 2; |
1149 | | |
1150 | | /* build the ehs secondary header tree */ |
1151 | 0 | ehs_secondary_header_tree = proto_tree_add_subtree( ehs_tree, tvb, offset, ehs_secondary_header_size ( protocol, tvb, offset ), |
1152 | 0 | ett_ehs_secondary_header, NULL, "Secondary EHS Header" ); |
1153 | | |
1154 | | /* since each protocol can have a different ehs secondary header structure, we will offload |
1155 | | * this processing to lower levels of code so we don't have to insert all of that complexity |
1156 | | * directly inline here, which would no doubt make this difficult to read at best. |
1157 | | */ |
1158 | 0 | ehs_secondary_header_dissector ( protocol, ehs_secondary_header_tree, tvb, &offset ); |
1159 | | |
1160 | | /* for ccsds protocol types pass the remaining packet off to the ccsds packet dissector */ |
1161 | 0 | switch ( protocol ) |
1162 | 0 | { |
1163 | 0 | case EHS_PROTOCOL__TDM_TELEMETRY: |
1164 | 0 | case EHS_PROTOCOL__PSEUDO_TELEMETRY: |
1165 | 0 | case EHS_PROTOCOL__AOS_LOS: |
1166 | 0 | case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET: |
1167 | 0 | case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET: |
1168 | 0 | case EHS_PROTOCOL__PDSS_UDSM: |
1169 | 0 | new_tvb = tvb_new_subset_remaining ( tvb, offset); |
1170 | 0 | call_dissector ( ccsds_handle, new_tvb, pinfo, ehs_tree ); |
1171 | | |
1172 | | /* bump the offset to the data zone area */ |
1173 | 0 | first_word = tvb_get_ntohs ( tvb, offset ); |
1174 | |
|
1175 | 0 | offset += CCSDS_PRIMARY_HEADER_LENGTH; |
1176 | 0 | if ( first_word & HDR_SECHDR ) offset += CCSDS_SECONDARY_HEADER_LENGTH; |
1177 | 0 | break; |
1178 | | |
1179 | | |
1180 | 0 | default: |
1181 | 0 | break; |
1182 | 0 | } |
1183 | | |
1184 | | /* build the ehs data zone tree for well known protocols such as AOS/LOS and UDSM */ |
1185 | 0 | ehs_data_zone_dissector ( protocol, ehs_tree, tvb, &offset, pinfo ); |
1186 | |
|
1187 | 0 | return tvb_captured_length(tvb); |
1188 | 0 | } |
1189 | | |
1190 | | |
1191 | | /* Register the protocol with Wireshark |
1192 | | * this format is require because a script is used to build the C function |
1193 | | * that calls all the protocol registration. |
1194 | | */ |
1195 | | void |
1196 | | proto_register_ehs(void) |
1197 | 14 | { |
1198 | | /* Setup list of header fields See Section 1.6.1 for details*/ |
1199 | 14 | static hf_register_info hf[] = |
1200 | 14 | { |
1201 | | /* primary ehs header */ |
1202 | 14 | { &hf_ehs_ph_version, |
1203 | 14 | { "Version", "ehs.version", |
1204 | 14 | FT_UINT8, BASE_DEC, NULL, 0xf0, |
1205 | 14 | NULL, HFILL } |
1206 | 14 | }, |
1207 | 14 | { &hf_ehs_ph_project, |
1208 | 14 | { "Project", "ehs.project", |
1209 | 14 | FT_UINT8, BASE_DEC, VALS(ehs_primary_header_project), 0x0f, |
1210 | 14 | NULL, HFILL } |
1211 | 14 | }, |
1212 | | |
1213 | 14 | { &hf_ehs_ph_support_mode, |
1214 | 14 | { "Support Mode", "ehs.support_mode", |
1215 | 14 | FT_UINT8, BASE_DEC, VALS(ehs_primary_header_support_mode), 0xf0, |
1216 | 14 | NULL, HFILL } |
1217 | 14 | }, |
1218 | 14 | { &hf_ehs_ph_data_mode, |
1219 | 14 | { "Data Mode", "ehs.data_mode", |
1220 | 14 | FT_UINT8, BASE_DEC, VALS(ehs_primary_header_data_mode), 0x0f, |
1221 | 14 | NULL, HFILL } |
1222 | 14 | }, |
1223 | | |
1224 | 14 | { &hf_ehs_ph_mission, |
1225 | 14 | { "Mission", "ehs.mission", |
1226 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1227 | 14 | NULL, HFILL } |
1228 | 14 | }, |
1229 | | |
1230 | 14 | { &hf_ehs_ph_protocol, |
1231 | 14 | { "Protocol", "ehs.protocol", |
1232 | 14 | FT_UINT8, BASE_DEC, VALS(ehs_primary_header_protocol), 0x0, |
1233 | 14 | NULL, HFILL } |
1234 | 14 | }, |
1235 | | |
1236 | 14 | { &hf_ehs_ph_year, |
1237 | 14 | { "Years since 1900", "ehs.year", |
1238 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1239 | 14 | NULL, HFILL } |
1240 | 14 | }, |
1241 | | |
1242 | 14 | { &hf_ehs_ph_jday, |
1243 | 14 | { "Julian Day of Year", "ehs.jday", |
1244 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1245 | 14 | NULL, HFILL } |
1246 | 14 | }, |
1247 | | |
1248 | 14 | { &hf_ehs_ph_hour, |
1249 | 14 | { "Hour", "ehs.hour", |
1250 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1251 | 14 | NULL, HFILL } |
1252 | 14 | }, |
1253 | | |
1254 | 14 | { &hf_ehs_ph_minute, |
1255 | 14 | { "Minute", "ehs.minute", |
1256 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1257 | 14 | NULL, HFILL } |
1258 | 14 | }, |
1259 | | |
1260 | 14 | { &hf_ehs_ph_second, |
1261 | 14 | { "Second", "ehs.second", |
1262 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1263 | 14 | NULL, HFILL } |
1264 | 14 | }, |
1265 | | |
1266 | 14 | { &hf_ehs_ph_tenths, |
1267 | 14 | { "Tenths", "ehs.tenths", |
1268 | 14 | FT_UINT8, BASE_DEC, NULL, 0xf0, |
1269 | 14 | NULL, HFILL } |
1270 | 14 | }, |
1271 | 14 | { &hf_ehs_ph_new_data_flag, |
1272 | 14 | { "New Data Flag", "ehs.new_data_flag", |
1273 | 14 | FT_BOOLEAN, 8, NULL, 0x08, |
1274 | 14 | NULL, HFILL } |
1275 | 14 | }, |
1276 | | #if 0 |
1277 | | { &hf_ehs_ph_pad1, |
1278 | | { "Pad1", "ehs.pad1", |
1279 | | FT_UINT8, BASE_DEC, NULL, 0x04, |
1280 | | NULL, HFILL } |
1281 | | }, |
1282 | | #endif |
1283 | 14 | { &hf_ehs_ph_hold_flag, |
1284 | 14 | { "Hold Flag", "ehs.hold_flag", |
1285 | 14 | FT_BOOLEAN, 8, NULL, 0x02, |
1286 | 14 | NULL, HFILL } |
1287 | 14 | }, |
1288 | 14 | { &hf_ehs_ph_sign_flag, |
1289 | 14 | { "Sign Flag (1->CDT)", "ehs.sign_flag", |
1290 | 14 | FT_UINT8, BASE_DEC, NULL, 0x01, |
1291 | 14 | NULL, HFILL } |
1292 | 14 | }, |
1293 | | |
1294 | | #if 0 |
1295 | | { &hf_ehs_ph_pad2, |
1296 | | { "Pad2", "ehs.pad2", |
1297 | | FT_UINT8, BASE_DEC, NULL, 0xff, |
1298 | | NULL, HFILL } |
1299 | | }, |
1300 | | |
1301 | | { &hf_ehs_ph_pad3, |
1302 | | { "Pad3", "ehs.pad3", |
1303 | | FT_UINT8, BASE_DEC, NULL, 0xff, |
1304 | | NULL, HFILL } |
1305 | | }, |
1306 | | |
1307 | | { &hf_ehs_ph_pad4, |
1308 | | { "Pad4", "ehs.pad4", |
1309 | | FT_UINT8, BASE_DEC, NULL, 0xff, |
1310 | | NULL, HFILL } |
1311 | | }, |
1312 | | #endif |
1313 | | |
1314 | 14 | { &hf_ehs_ph_hosc_packet_size, |
1315 | 14 | { "HOSC Packet Size", "ehs.hosc_packet_size", |
1316 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1317 | 14 | NULL, HFILL } |
1318 | 14 | }, |
1319 | | |
1320 | | |
1321 | | /* secondary ehs header */ |
1322 | 14 | { &hf_ehs_sh_version, |
1323 | 14 | { "Version", "ehs2.version", |
1324 | 14 | FT_UINT8, BASE_DEC, NULL, 0xc0, |
1325 | 14 | NULL, HFILL } |
1326 | 14 | }, |
1327 | 14 | { &hf_ehs_sh_data_status_bit_5, |
1328 | 14 | { "Data Status Bit 5", "ehs2.data_status_bit_5", |
1329 | 14 | FT_UINT8, BASE_DEC, NULL, 0x20, |
1330 | 14 | NULL, HFILL } |
1331 | 14 | }, |
1332 | 14 | { &hf_ehs_sh_data_status_bit_4, |
1333 | 14 | { "Data Status Bit 4", "ehs2.data_status_bit_4", |
1334 | 14 | FT_UINT8, BASE_DEC, NULL, 0x10, |
1335 | 14 | NULL, HFILL } |
1336 | 14 | }, |
1337 | 14 | { &hf_ehs_sh_data_status_bit_3, |
1338 | 14 | { "Data Status Bit 3", "ehs2.data_status_bit_3", |
1339 | 14 | FT_UINT8, BASE_DEC, NULL, 0x08, |
1340 | 14 | NULL, HFILL } |
1341 | 14 | }, |
1342 | 14 | { &hf_ehs_sh_data_status_bit_2, |
1343 | 14 | { "Data Status Bit 2", "ehs2.data_status_bit_2", |
1344 | 14 | FT_UINT8, BASE_DEC, NULL, 0x04, |
1345 | 14 | NULL, HFILL } |
1346 | 14 | }, |
1347 | 14 | { &hf_ehs_sh_data_status_bit_1, |
1348 | 14 | { "Data Status Bit 1", "ehs2.data_status_bit_1", |
1349 | 14 | FT_UINT8, BASE_DEC, NULL, 0x02, |
1350 | 14 | NULL, HFILL } |
1351 | 14 | }, |
1352 | 14 | { &hf_ehs_sh_data_status_bit_0, |
1353 | 14 | { "Data Status Bit 0", "ehs2.data_status_bit_0", |
1354 | 14 | FT_UINT8, BASE_DEC, NULL, 0x01, |
1355 | 14 | NULL, HFILL } |
1356 | 14 | }, |
1357 | | |
1358 | | |
1359 | | /* other common remappings of the data status bits specific to certain secondary ehs header values */ |
1360 | 14 | { &hf_ehs_sh_parent_stream_error, |
1361 | 14 | { "Parent Stream Error", "ehs2.parent_stream_error", |
1362 | 14 | FT_BOOLEAN, 8, NULL, 0x08, |
1363 | 14 | NULL, HFILL } |
1364 | 14 | }, |
1365 | 14 | { &hf_ehs_sh_vcdu_sequence_error, |
1366 | 14 | { "VCDU Sequence Error", "ehs2.vcdu_sequence_error", |
1367 | 14 | FT_BOOLEAN, 8, NULL, 0x04, |
1368 | 14 | NULL, HFILL } |
1369 | 14 | }, |
1370 | 14 | { &hf_ehs_sh_packet_sequence_error, |
1371 | 14 | { "Packet Sequence Error", "ehs2.packet_sequence_error", |
1372 | 14 | FT_UINT8, BASE_DEC, NULL, 0x02, |
1373 | 14 | NULL, HFILL } |
1374 | 14 | }, |
1375 | | |
1376 | | |
1377 | | /* common ehs secondary header values */ |
1378 | 14 | { &hf_ehs_sh_vcdu_sequence_number, |
1379 | 14 | { "VCDU Sequence Number", "ehs2.vcdu_seqno", |
1380 | 14 | FT_UINT24, BASE_DEC, NULL, 0x0, |
1381 | 14 | NULL, HFILL } |
1382 | 14 | }, |
1383 | | |
1384 | 14 | { &hf_ehs_sh_data_stream_id, |
1385 | 14 | { "Data Stream ID", "ehs2.data_stream_id", |
1386 | 14 | FT_UINT8, BASE_DEC, VALS(ehs_secondary_header_data_stream_id), 0x80, |
1387 | 14 | NULL, HFILL } |
1388 | 14 | }, |
1389 | | #if 0 |
1390 | | { &hf_ehs_sh_pdss_reserved_1, |
1391 | | { "Pdss Reserved 1", "ehs2.pdss_reserved_1", |
1392 | | FT_UINT8, BASE_DEC, NULL, 0x7f, |
1393 | | NULL, HFILL } |
1394 | | }, |
1395 | | |
1396 | | { &hf_ehs_sh_pdss_reserved_2, |
1397 | | { "Pdss Reserved 2", "ehs2.pdss_reserved_2", |
1398 | | FT_UINT8, BASE_DEC, NULL, 0xff, |
1399 | | NULL, HFILL } |
1400 | | }, |
1401 | | |
1402 | | { &hf_ehs_sh_pdss_reserved_3, |
1403 | | { "Pdss Reserved 3", "ehs2.pdss_reserved_3", |
1404 | | FT_UINT16, BASE_DEC, NULL, 0xe000, |
1405 | | NULL, HFILL } |
1406 | | }, |
1407 | | #endif |
1408 | 14 | { &hf_ehs_sh_gse_pkt_id, |
1409 | 14 | { "GSE Packet ID (1=GSE)", "ehs2.gse_pkt_id", |
1410 | 14 | FT_UINT16, BASE_DEC, NULL, 0x1000, |
1411 | 14 | NULL, HFILL } |
1412 | 14 | }, |
1413 | 14 | { &hf_ehs_sh_payload_vs_core_id, |
1414 | 14 | { "Payload vs Core ID", "ehs2.payload_vs_core_id", |
1415 | 14 | FT_UINT16, BASE_DEC, VALS(ehs_secondary_header_payload_vs_core_id), 0x0800, |
1416 | 14 | NULL, HFILL } |
1417 | 14 | }, |
1418 | 14 | { &hf_ehs_sh_apid, |
1419 | 14 | { "APID", "ehs2.apid", |
1420 | 14 | FT_UINT16, BASE_DEC, NULL, 0x07ff, |
1421 | 14 | NULL, HFILL } |
1422 | 14 | }, |
1423 | | |
1424 | 14 | { &hf_ehs_sh_virtual_channel, |
1425 | 14 | { "Virtual Channel", "ehs2.vcid", |
1426 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1427 | 14 | NULL, HFILL } |
1428 | 14 | }, |
1429 | | |
1430 | 14 | { &hf_ehs_sh_pdss_reserved_sync, |
1431 | 14 | { "Pdss Reserved Sync", "ehs2.sync", |
1432 | 14 | FT_UINT16, BASE_HEX, NULL, 0x0, |
1433 | 14 | NULL, HFILL } |
1434 | 14 | }, |
1435 | | |
1436 | | |
1437 | | /* tdm ehs secondary header values */ |
1438 | 14 | { &hf_ehs_sh_tdm_secondary_header_length, |
1439 | 14 | { "Secondary Header Length", "ehs2.tdm_secondary_header_length", |
1440 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1441 | 14 | NULL, HFILL } |
1442 | 14 | }, |
1443 | | |
1444 | 14 | { &hf_ehs_sh_tdm_extra_data_packet, |
1445 | 14 | { "Extra Data Packet", "ehs2.tdm_extra_data_packet", |
1446 | 14 | FT_BOOLEAN, 8, NULL, 0x80, |
1447 | 14 | NULL, HFILL } |
1448 | 14 | }, |
1449 | 14 | { &hf_ehs_sh_tdm_backup_stream_id_number, |
1450 | 14 | { "Backup Stream ID Number", "ehs2.tdm_backup_stream_id_number", |
1451 | 14 | FT_UINT8, BASE_DEC, VALS(ehs_secondary_header_tdm_backup_stream_id), 0x60, |
1452 | 14 | NULL, HFILL } |
1453 | 14 | }, |
1454 | 14 | { &hf_ehs_sh_tdm_end_of_data_flag, |
1455 | 14 | { "End of Data Flag", "ehs2.tdm_end_of_data_flag", |
1456 | 14 | FT_UINT8, BASE_DEC, VALS(ehs_secondary_header_tdm_end_of_data_flag), 0x18, |
1457 | 14 | NULL, HFILL } |
1458 | 14 | }, |
1459 | 14 | { &hf_ehs_sh_tdm_parent_frame_error, |
1460 | 14 | { "Parent Frame Error", "ehs2.tdm_parent_frame_error", |
1461 | 14 | FT_BOOLEAN, 8, NULL, 0x04, |
1462 | 14 | NULL, HFILL } |
1463 | 14 | }, |
1464 | 14 | { &hf_ehs_sh_tdm_checksum_error, |
1465 | 14 | { "Checksum Error", "ehs2.tdm_checksum_error", |
1466 | 14 | FT_BOOLEAN, 8, NULL, 0x02, |
1467 | 14 | NULL, HFILL } |
1468 | 14 | }, |
1469 | 14 | { &hf_ehs_sh_tdm_fixed_value_error, |
1470 | 14 | { "Fixed Value Error", "ehs2.tdm_fixed_value_error", |
1471 | 14 | FT_BOOLEAN, 8, NULL, 0x01, |
1472 | 14 | NULL, HFILL } |
1473 | 14 | }, |
1474 | | |
1475 | 14 | { &hf_ehs_sh_tdm_minor_frame_counter_error, |
1476 | 14 | { "Minor Frame Counter Error", "ehs2.tdm_minor_frame_counter_error", |
1477 | 14 | FT_BOOLEAN, 8, NULL, 0x80, |
1478 | 14 | NULL, HFILL } |
1479 | 14 | }, |
1480 | 14 | { &hf_ehs_sh_tdm_format_id_error, |
1481 | 14 | { "Format ID Error", "ehs2.tdm_format_id_error", |
1482 | 14 | FT_BOOLEAN, 8, NULL, 0x40, |
1483 | 14 | NULL, HFILL } |
1484 | 14 | }, |
1485 | 14 | { &hf_ehs_sh_tdm_bit_slip_error, |
1486 | 14 | { "Bit Slip Error", "ehs2.tdm_bit_slip_error", |
1487 | 14 | FT_BOOLEAN, 8, NULL, 0x20, |
1488 | 14 | NULL, HFILL } |
1489 | 14 | }, |
1490 | 14 | { &hf_ehs_sh_tdm_sync_error, |
1491 | 14 | { "Sync Error", "ehs2.tdm_sync_error", |
1492 | 14 | FT_BOOLEAN, 8, NULL, 0x10, |
1493 | 14 | NULL, HFILL } |
1494 | 14 | }, |
1495 | 14 | { &hf_ehs_sh_tdm_aoslos_flag, |
1496 | 14 | { "AOS/LOS Flag", "ehs2.tdm_aoslos_flag", |
1497 | 14 | FT_BOOLEAN, 8, TFS(&ehs_tfs_secondary_header_tdm_aoslos_flag), 0x08, |
1498 | 14 | NULL, HFILL } |
1499 | 14 | }, |
1500 | 14 | { &hf_ehs_sh_tdm_override_errors_flag, |
1501 | 14 | { "Override Errors", "ehs2.tdm_override_errors_flag", |
1502 | 14 | FT_BOOLEAN, 8, NULL, 0x04, |
1503 | 14 | NULL, HFILL } |
1504 | 14 | }, |
1505 | 14 | { &hf_ehs_sh_tdm_data_status, |
1506 | 14 | { "Data Status", "ehs2.tdm_data_status", |
1507 | 14 | FT_UINT8, BASE_DEC, VALS(ehs_secondary_header_tdm_data_status), 0x03, |
1508 | 14 | NULL, HFILL } |
1509 | 14 | }, |
1510 | | |
1511 | 14 | { &hf_ehs_sh_tdm_idq, |
1512 | 14 | { "IDQ", "ehs2.tdm_idq", |
1513 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1514 | 14 | NULL, HFILL } |
1515 | 14 | }, |
1516 | | |
1517 | 14 | { &hf_ehs_sh_tdm_cdq, |
1518 | 14 | { "CDQ", "ehs2.tdm_cdq", |
1519 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1520 | 14 | NULL, HFILL } |
1521 | 14 | }, |
1522 | | |
1523 | 14 | { &hf_ehs_sh_tdm_adq, |
1524 | 14 | { "ADQ", "ehs2.tdm_adq", |
1525 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1526 | 14 | NULL, HFILL } |
1527 | 14 | }, |
1528 | | |
1529 | 14 | { &hf_ehs_sh_tdm_data_dq, |
1530 | 14 | { "Data DQ", "ehs2.tdm_data_dq", |
1531 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1532 | 14 | NULL, HFILL } |
1533 | 14 | }, |
1534 | | |
1535 | | #if 0 |
1536 | | { &hf_ehs_sh_tdm_unused, |
1537 | | { "Unused", "ehs2.tdm_unused", |
1538 | | FT_UINT16, BASE_DEC, NULL, 0x0, |
1539 | | NULL, HFILL } |
1540 | | }, |
1541 | | #endif |
1542 | | |
1543 | 14 | { &hf_ehs_sh_tdm_format_id, |
1544 | 14 | { "Format ID", "ehs2.tdm_format_id", |
1545 | 14 | FT_UINT16, BASE_HEX, NULL, 0x0, |
1546 | 14 | NULL, HFILL } |
1547 | 14 | }, |
1548 | | |
1549 | 14 | { &hf_ehs_sh_tdm_major_frame_packet_index, |
1550 | 14 | { "Major Frame Packet Index", "ehs2.tdm_major_frame_packet_index", |
1551 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1552 | 14 | NULL, HFILL } |
1553 | 14 | }, |
1554 | | |
1555 | 14 | { &hf_ehs_sh_tdm_numpkts_per_major_frame, |
1556 | 14 | { "Num Packets per Major Frame", "ehs2.tdm_numpkts_per_major_frame", |
1557 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1558 | 14 | NULL, HFILL } |
1559 | 14 | }, |
1560 | | |
1561 | 14 | { &hf_ehs_sh_tdm_num_minor_frames_per_packet, |
1562 | 14 | { "Num Minor Frames per Packet", "ehs2.tdm_num_minor_frame_per_packet", |
1563 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1564 | 14 | NULL, HFILL } |
1565 | 14 | }, |
1566 | | |
1567 | 14 | { &hf_ehs_sh_tdm_cntmet_present, |
1568 | 14 | { "CNT or MET Present", "ehs2.tdm_cntmet_present", |
1569 | 14 | FT_BOOLEAN, 8, NULL, 0x80, |
1570 | 14 | NULL, HFILL } |
1571 | 14 | }, |
1572 | 14 | { &hf_ehs_sh_tdm_obt_present, |
1573 | 14 | { "OBT Present", "ehs2.tdm_obt_present", |
1574 | 14 | FT_BOOLEAN, 8, NULL, 0x40, |
1575 | 14 | NULL, HFILL } |
1576 | 14 | }, |
1577 | 14 | { &hf_ehs_sh_tdm_major_frame_status_present, |
1578 | 14 | { "Major Frame Status Present", "ehs2.tdm_major_frame_status_present", |
1579 | 14 | FT_BOOLEAN, 8, NULL, 0x20, |
1580 | 14 | NULL, HFILL } |
1581 | 14 | }, |
1582 | | #if 0 |
1583 | | { &hf_ehs_sh_tdm_reserved, |
1584 | | { "Reserved", "ehs2.tdm_reserved", |
1585 | | FT_UINT8, BASE_DEC, NULL, 0x1f, |
1586 | | NULL, HFILL } |
1587 | | }, |
1588 | | #endif |
1589 | | |
1590 | 14 | { &hf_ehs_sh_tdm_cnt_year, |
1591 | 14 | { "CNT Years since 1900", "ehs2.tdm_cnt_year", |
1592 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1593 | 14 | NULL, HFILL } |
1594 | 14 | }, |
1595 | 14 | { &hf_ehs_sh_tdm_cnt_jday, |
1596 | 14 | { "CNT Julian Day of Year", "ehs2.tdm_cnt_jday", |
1597 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1598 | 14 | NULL, HFILL } |
1599 | 14 | }, |
1600 | 14 | { &hf_ehs_sh_tdm_cnt_hour, |
1601 | 14 | { "CNT Hour", "ehs2.tdm_cnt_hour", |
1602 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1603 | 14 | NULL, HFILL } |
1604 | 14 | }, |
1605 | 14 | { &hf_ehs_sh_tdm_cnt_minute, |
1606 | 14 | { "CNT Minute", "ehs2.tdm_cnt_minute", |
1607 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1608 | 14 | NULL, HFILL } |
1609 | 14 | }, |
1610 | 14 | { &hf_ehs_sh_tdm_cnt_second, |
1611 | 14 | { "CNT Second", "ehs2.tdm_cnt_second", |
1612 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1613 | 14 | NULL, HFILL } |
1614 | 14 | }, |
1615 | 14 | { &hf_ehs_sh_tdm_cnt_tenths, |
1616 | 14 | { "CNT Tenths", "ehs2.tdm_cnt_tenths", |
1617 | 14 | FT_UINT8, BASE_DEC, NULL, 0xf0, |
1618 | 14 | NULL, HFILL } |
1619 | 14 | }, |
1620 | | |
1621 | 14 | { &hf_ehs_sh_tdm_obt_year, |
1622 | 14 | { "OBT Years since 1900", "ehs2.tdm_cnt_year", |
1623 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1624 | 14 | NULL, HFILL } |
1625 | 14 | }, |
1626 | 14 | { &hf_ehs_sh_tdm_obt_jday, |
1627 | 14 | { "OBT Julian Day of Year", "ehs2.tdm_cnt_jday", |
1628 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1629 | 14 | NULL, HFILL } |
1630 | 14 | }, |
1631 | 14 | { &hf_ehs_sh_tdm_obt_hour, |
1632 | 14 | { "OBT Hour", "ehs2.tdm_cnt_hour", |
1633 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1634 | 14 | NULL, HFILL } |
1635 | 14 | }, |
1636 | 14 | { &hf_ehs_sh_tdm_obt_minute, |
1637 | 14 | { "OBT Minute", "ehs2.tdm_cnt_minute", |
1638 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1639 | 14 | NULL, HFILL } |
1640 | 14 | }, |
1641 | 14 | { &hf_ehs_sh_tdm_obt_second, |
1642 | 14 | { "OBT Second", "ehs2.tdm_cnt_second", |
1643 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1644 | 14 | NULL, HFILL } |
1645 | 14 | }, |
1646 | 14 | { &hf_ehs_sh_tdm_obt_tenths, |
1647 | 14 | { "OBT Tenths", "ehs2.tdm_cnt_tenths", |
1648 | 14 | FT_UINT8, BASE_DEC, NULL, 0xf0, |
1649 | 14 | NULL, HFILL } |
1650 | 14 | }, |
1651 | | |
1652 | 14 | { &hf_ehs_sh_tdm_obt_delta_time_flag, |
1653 | 14 | { "OBT is Delta Time Instead of GMT", "ehs2.tdm_obt_delta_time_flag", |
1654 | 14 | FT_BOOLEAN, 16, NULL, 0x8000, |
1655 | 14 | NULL, HFILL } |
1656 | 14 | }, |
1657 | 14 | { &hf_ehs_sh_tdm_obt_computed_flag, |
1658 | 14 | { "OBT Computed", "ehs2.tdm_obt_computed_flag", |
1659 | 14 | FT_BOOLEAN, 16, NULL, 0x4000, |
1660 | 14 | NULL, HFILL } |
1661 | 14 | }, |
1662 | 14 | { &hf_ehs_sh_tdm_obt_not_retrieved_flag, |
1663 | 14 | { "OBT Not Retrieved", "ehs2.tdm_obt_not_retrieved_flag", |
1664 | 14 | FT_BOOLEAN, 16, NULL, 0x2000, |
1665 | 14 | NULL, HFILL } |
1666 | 14 | }, |
1667 | | #if 0 |
1668 | | { &hf_ehs_sh_tdm_obt_reserved, |
1669 | | { "OBT Reserved", "ehs2.tdm_obt_reserved", |
1670 | | FT_BOOLEAN, 16, NULL, 0x1800, |
1671 | | NULL, HFILL } |
1672 | | }, |
1673 | | #endif |
1674 | 14 | { &hf_ehs_sh_tdm_obt_source_apid, |
1675 | 14 | { "OBT Source APID", "ehs2.tdm_obt_source_apid", |
1676 | 14 | FT_UINT16, BASE_DEC, NULL, 0x07ff, |
1677 | 14 | NULL, HFILL } |
1678 | 14 | }, |
1679 | | |
1680 | 14 | { &hf_ehs_sh_tdm_num_major_frame_status_words, |
1681 | 14 | { "Number of Major Frame Status Words", "ehs2.tdm_num_major_frame_status_words", |
1682 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1683 | 14 | NULL, HFILL } |
1684 | 14 | }, |
1685 | | |
1686 | | #if 0 |
1687 | | { &hf_ehs_sh_tdm_mjfs_reserved, |
1688 | | { "Reserved", "ehs2.tdm_mjfs_reserved", |
1689 | | FT_UINT8, BASE_DEC, NULL, 0xf8, |
1690 | | NULL, HFILL } |
1691 | | }, |
1692 | | #endif |
1693 | 14 | { &hf_ehs_sh_tdm_mjfs_parent_frame_error, |
1694 | 14 | { "Parent Frame Error", "ehs2.tdm_mjfs_parent_frame_error", |
1695 | 14 | FT_BOOLEAN, 8, NULL, 0x04, |
1696 | 14 | NULL, HFILL } |
1697 | 14 | }, |
1698 | 14 | { &hf_ehs_sh_tdm_mjfs_checksum_error, |
1699 | 14 | { "Checksum Error", "ehs2.tdm_mjfs_checksum_error", |
1700 | 14 | FT_BOOLEAN, 8, NULL, 0x02, |
1701 | 14 | NULL, HFILL } |
1702 | 14 | }, |
1703 | 14 | { &hf_ehs_sh_tdm_mjfs_fixed_value_error, |
1704 | 14 | { "Fixed Value Error", "ehs2.tdm_mjfs_fixed_value_error", |
1705 | 14 | FT_BOOLEAN, 8, NULL, 0x01, |
1706 | 14 | NULL, HFILL } |
1707 | 14 | }, |
1708 | | |
1709 | 14 | { &hf_ehs_sh_tdm_mnfs_parent_frame_error, |
1710 | 14 | { "Parent Frame Error", "ehs2.tdm_mnfs_parent_frame_error", |
1711 | 14 | FT_BOOLEAN, 8, NULL, 0x80, |
1712 | 14 | NULL, HFILL } |
1713 | 14 | }, |
1714 | 14 | { &hf_ehs_sh_tdm_mnfs_data_not_available, |
1715 | 14 | { "Data Not Available", "ehs2.tdm_mnfs_data_not_available", |
1716 | 14 | FT_BOOLEAN, 8, NULL, 0x40, |
1717 | 14 | NULL, HFILL } |
1718 | 14 | }, |
1719 | 14 | { &hf_ehs_sh_tdm_mnfs_checksum_error, |
1720 | 14 | { "Checksum Error", "ehs2.tdm_mnfs_checksum_error", |
1721 | 14 | FT_BOOLEAN, 8, NULL, 0x20, |
1722 | 14 | NULL, HFILL } |
1723 | 14 | }, |
1724 | 14 | { &hf_ehs_sh_tdm_mnfs_fixed_value_error, |
1725 | 14 | { "Fixed Value Error", "ehs2.tdm_mnfs_fixed_value_error", |
1726 | 14 | FT_BOOLEAN, 8, NULL, 0x10, |
1727 | 14 | NULL, HFILL } |
1728 | 14 | }, |
1729 | 14 | { &hf_ehs_sh_tdm_mnfs_counter_error, |
1730 | 14 | { "Counter Error", "ehs2.tdm_mnfs_counter_error", |
1731 | 14 | FT_BOOLEAN, 8, NULL, 0x08, |
1732 | 14 | NULL, HFILL } |
1733 | 14 | }, |
1734 | 14 | { &hf_ehs_sh_tdm_mnfs_format_id_error, |
1735 | 14 | { "Format ID Error", "ehs2.tdm_mnfs_format_id_error", |
1736 | 14 | FT_BOOLEAN, 8, NULL, 0x04, |
1737 | 14 | NULL, HFILL } |
1738 | 14 | }, |
1739 | 14 | { &hf_ehs_sh_tdm_mnfs_bit_slip_error, |
1740 | 14 | { "Bit Slip Error", "ehs2.tdm_mnfs_bit_slip_error", |
1741 | 14 | FT_BOOLEAN, 8, NULL, 0x02, |
1742 | 14 | NULL, HFILL } |
1743 | 14 | }, |
1744 | 14 | { &hf_ehs_sh_tdm_mnfs_sync_error, |
1745 | 14 | { "Sync Error", "ehs2.tdm_mnfs_sync_error", |
1746 | 14 | FT_BOOLEAN, 8, NULL, 0x01, |
1747 | 14 | NULL, HFILL } |
1748 | 14 | }, |
1749 | | |
1750 | | |
1751 | | /* pseudo secondary header */ |
1752 | | #if 0 |
1753 | | { &hf_ehs_sh_pseudo_unused, |
1754 | | { "Unused", "ehs2.pseudo_unused", |
1755 | | FT_UINT16, BASE_DEC, NULL, 0xffff, |
1756 | | NULL, HFILL } |
1757 | | }, |
1758 | | #endif |
1759 | 14 | { &hf_ehs_sh_pseudo_workstation_id, |
1760 | 14 | { "Workstation ID", "ehs2.pseudo_workstation_id", |
1761 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1762 | 14 | NULL, HFILL } |
1763 | 14 | }, |
1764 | 14 | { &hf_ehs_sh_pseudo_user_id, |
1765 | 14 | { "User ID", "ehs2.pseudo_user_id", |
1766 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1767 | 14 | NULL, HFILL } |
1768 | 14 | }, |
1769 | 14 | { &hf_ehs_sh_pseudo_comp_id, |
1770 | 14 | { "Comp ID", "ehs2.pseudo_comp_id", |
1771 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1772 | 14 | NULL, HFILL } |
1773 | 14 | }, |
1774 | | |
1775 | | |
1776 | | /* aos/los protocol data zone */ |
1777 | 14 | { &hf_ehs_dz_aoslos_indicator, |
1778 | 14 | { "AOS/LOS Indicator", "ehs.dz.aoslos_indicator", |
1779 | 14 | FT_UINT8, BASE_DEC, VALS(ehs_data_zone_aoslos_indicator), 0x03, |
1780 | 14 | NULL, HFILL } |
1781 | 14 | }, |
1782 | | |
1783 | | |
1784 | | /* udsm protocol data zone */ |
1785 | 14 | { &hf_ehs_dz_udsm_ccsds_vs_bpdu, |
1786 | 14 | { "CCSDS vs BPDU", "ehs.dz.udsm_ccsds_vs_bpdu", |
1787 | 14 | FT_UINT8, BASE_DEC, VALS(ehs_data_zone_udsm_ccsds_vs_bpdu), 0x80, |
1788 | 14 | NULL, HFILL } |
1789 | 14 | }, |
1790 | | #if 0 |
1791 | | { &hf_ehs_dz_udsm_unused1, |
1792 | | { "Unused 1", "ehs.dz.udsm_unused1", |
1793 | | FT_UINT8, BASE_DEC, NULL, 0x7f, |
1794 | | NULL, HFILL } |
1795 | | }, |
1796 | | |
1797 | | { &hf_ehs_dz_udsm_unused2, |
1798 | | { "Unused 2", "ehs.dz.udsm_unused2", |
1799 | | FT_UINT8, BASE_DEC, NULL, 0xff, |
1800 | | NULL, HFILL } |
1801 | | }, |
1802 | | |
1803 | | { &hf_ehs_dz_udsm_unused3, |
1804 | | { "Unused 3", "ehs.dz.udsm_unused3", |
1805 | | FT_UINT16, BASE_DEC, NULL, 0xe000, |
1806 | | NULL, HFILL } |
1807 | | }, |
1808 | | #endif |
1809 | 14 | { &hf_ehs_dz_udsm_gse_pkt_id, |
1810 | 14 | { "GSE Pkt ID", "ehs.dz.udsm_gse_pkt_id", |
1811 | 14 | FT_BOOLEAN, 16, NULL, 0x1000, |
1812 | 14 | NULL, HFILL } |
1813 | 14 | }, |
1814 | 14 | { &hf_ehs_dz_udsm_payload_vs_core, |
1815 | 14 | { "Payload vs Core", "ehs.dz.udsm_payload_vs_core", |
1816 | 14 | FT_UINT16, BASE_DEC, VALS(ehs_data_zone_udsm_payload_vs_core), 0x0800, |
1817 | 14 | NULL, HFILL } |
1818 | 14 | }, |
1819 | 14 | { &hf_ehs_dz_udsm_apid, |
1820 | 14 | { "APID", "ehs.dz.udsm_apid", |
1821 | 14 | FT_UINT16, BASE_DEC, NULL, 0x07ff, |
1822 | 14 | NULL, HFILL } |
1823 | 14 | }, |
1824 | | |
1825 | 14 | { &hf_ehs_dz_udsm_start_time_year, |
1826 | 14 | { "Start Time Years since 1900", "ehs.dz.udsm_start_time_year", |
1827 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1828 | 14 | NULL, HFILL } |
1829 | 14 | }, |
1830 | 14 | { &hf_ehs_dz_udsm_start_time_jday, |
1831 | 14 | { "Start Time Julian Day", "ehs.dz.udsm_start_time_jday", |
1832 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1833 | 14 | NULL, HFILL } |
1834 | 14 | }, |
1835 | 14 | { &hf_ehs_dz_udsm_start_time_hour, |
1836 | 14 | { "Start Time Hour", "ehs.dz.udsm_start_time_hour", |
1837 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1838 | 14 | NULL, HFILL } |
1839 | 14 | }, |
1840 | 14 | { &hf_ehs_dz_udsm_start_time_minute, |
1841 | 14 | { "Start Time Minute", "ehs.dz.udsm_start_time_minute", |
1842 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1843 | 14 | NULL, HFILL } |
1844 | 14 | }, |
1845 | 14 | { &hf_ehs_dz_udsm_start_time_second, |
1846 | 14 | { "Start Time Second", "ehs.dz.udsm_start_time_second", |
1847 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1848 | 14 | NULL, HFILL } |
1849 | 14 | }, |
1850 | | |
1851 | 14 | { &hf_ehs_dz_udsm_stop_time_year, |
1852 | 14 | { "Stop Time Years since 1900", "ehs.dz.udsm_stop_time_year", |
1853 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1854 | 14 | NULL, HFILL } |
1855 | 14 | }, |
1856 | 14 | { &hf_ehs_dz_udsm_stop_time_jday, |
1857 | 14 | { "Stop Time Julian Day", "ehs.dz.udsm_stop_time_jday", |
1858 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1859 | 14 | NULL, HFILL } |
1860 | 14 | }, |
1861 | 14 | { &hf_ehs_dz_udsm_stop_time_hour, |
1862 | 14 | { "Stop Time Hour", "ehs.dz.udsm_stop_time_hour", |
1863 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1864 | 14 | NULL, HFILL } |
1865 | 14 | }, |
1866 | 14 | { &hf_ehs_dz_udsm_stop_time_minute, |
1867 | 14 | { "Stop Time Minute", "ehs.dz.udsm_stop_time_minute", |
1868 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1869 | 14 | NULL, HFILL } |
1870 | 14 | }, |
1871 | 14 | { &hf_ehs_dz_udsm_stop_time_second, |
1872 | 14 | { "Stop Time Second", "ehs.dz.udsm_stop_time_second", |
1873 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1874 | 14 | NULL, HFILL } |
1875 | 14 | }, |
1876 | | |
1877 | | #if 0 |
1878 | | { &hf_ehs_dz_udsm_unused4, |
1879 | | { "Unused 4", "ehs.dz.udsm_unused4", |
1880 | | FT_UINT16, BASE_DEC, NULL, 0xffff, |
1881 | | NULL, HFILL } |
1882 | | }, |
1883 | | #endif |
1884 | | |
1885 | 14 | { &hf_ehs_dz_udsm_num_pkts_xmtd, |
1886 | 14 | { "Num Pkts Transmitted", "ehs.dz.udsm_num_pkts_xmtd", |
1887 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1888 | 14 | NULL, HFILL } |
1889 | 14 | }, |
1890 | | |
1891 | 14 | { &hf_ehs_dz_udsm_num_vcdu_seqerrs, |
1892 | 14 | { "Num VCDU Sequence Errors", "ehs.dz.udsm_num_vcdu_seqerrs", |
1893 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1894 | 14 | NULL, HFILL } |
1895 | 14 | }, |
1896 | | |
1897 | 14 | { &hf_ehs_dz_udsm_num_pkt_seqerrs, |
1898 | 14 | { "Num Packet Sequence Errors", "ehs.dz.udsm_num_pkt_seqerrs", |
1899 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1900 | 14 | NULL, HFILL } |
1901 | 14 | }, |
1902 | | |
1903 | 14 | { &hf_ehs_dz_udsm_num_pktlen_errors, |
1904 | 14 | { "Num Pkt Length Errors", "ehs.dz.udsm_num_pktlen_errors", |
1905 | 14 | FT_UINT16, BASE_DEC, NULL, 0x0, |
1906 | 14 | NULL, HFILL } |
1907 | 14 | }, |
1908 | | |
1909 | 14 | { &hf_ehs_dz_udsm_event, |
1910 | 14 | { "UDSM Event Code", "ehs.dz.udsm_event", |
1911 | 14 | FT_UINT8, BASE_DEC, VALS(ehs_data_zone_udsm_event), 0x0, |
1912 | 14 | NULL, HFILL } |
1913 | 14 | }, |
1914 | | |
1915 | 14 | { &hf_ehs_dz_udsm_num_pkts_xmtd_rollover, |
1916 | 14 | { "Num Pkts Transmitted Rollover Counter", "ehs.dz.udsm_num_pkts_xmtd_rollover", |
1917 | 14 | FT_UINT8, BASE_DEC, NULL, 0x0, |
1918 | 14 | NULL, HFILL } |
1919 | 14 | }, |
1920 | | |
1921 | 14 | }; |
1922 | | |
1923 | | /* Setup protocol subtree array */ |
1924 | 14 | static int *ett[] = { |
1925 | 14 | &ett_ehs, |
1926 | 14 | &ett_ehs_primary_header, |
1927 | 14 | &ett_ehs_secondary_header, |
1928 | 14 | &ett_ehs_data_zone, |
1929 | 14 | &ett_ehs_cnt_time, |
1930 | 14 | &ett_ehs_obt_time, |
1931 | 14 | &ett_ehs_udsm_start_time, |
1932 | 14 | &ett_ehs_udsm_stop_time, |
1933 | 14 | &ett_ehs_ground_receipt_time, |
1934 | 14 | &ett_ehs_major_frame, |
1935 | 14 | &ett_ehs_minor_frame, |
1936 | 14 | }; |
1937 | | |
1938 | | /* Register the protocol name and description */ |
1939 | 14 | proto_ehs = proto_register_protocol("EHS", "EHS", "ehs"); |
1940 | | |
1941 | | /* Required function calls to register the header fields and subtrees used */ |
1942 | 14 | proto_register_field_array(proto_ehs, hf, array_length(hf)); |
1943 | 14 | proto_register_subtree_array(ett, array_length(ett)); |
1944 | | |
1945 | | /* XX: Does this dissector need to be publicly registered ?? */ |
1946 | 14 | ehs_handle = register_dissector ( "ehs", dissect_ehs, proto_ehs ); |
1947 | 14 | } |
1948 | | |
1949 | | void |
1950 | | proto_reg_handoff_ehs(void) |
1951 | 14 | { |
1952 | 14 | dissector_add_for_decode_as_with_preference( "udp.port", ehs_handle ); |
1953 | 14 | ccsds_handle = find_dissector_add_dependency ( "ccsds", proto_ehs ); |
1954 | 14 | } |
1955 | | |
1956 | | /* |
1957 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
1958 | | * |
1959 | | * Local Variables: |
1960 | | * c-basic-offset: 2 |
1961 | | * tab-width: 8 |
1962 | | * indent-tabs-mode: nil |
1963 | | * End: |
1964 | | * |
1965 | | * ex: set shiftwidth=2 tabstop=8 expandtab: |
1966 | | * :indentSize=2:tabSize=8:noTabs=true: |
1967 | | */ |