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
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.com>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
15 #include <epan/packet.h>
17 void proto_register_ehs(void);
18 void proto_reg_handoff_ehs(void);
20 /* Initialize the protocol and registered fields */
21 static int proto_ehs = -1;
23 static int hf_ehs_ph_version = -1;
24 static int hf_ehs_ph_project = -1;
25 static int hf_ehs_ph_support_mode = -1;
26 static int hf_ehs_ph_data_mode = -1;
27 static int hf_ehs_ph_mission = -1;
28 static int hf_ehs_ph_protocol = -1;
30 static int hf_ehs_ph_year = -1; /* numeric year as years since 1900 */
31 static int hf_ehs_ph_jday = -1; /* julian day of year */
32 static int hf_ehs_ph_hour = -1;
33 static int hf_ehs_ph_minute = -1;
34 static int hf_ehs_ph_second = -1;
35 static int hf_ehs_ph_tenths = -1;
37 static int hf_ehs_ph_new_data_flag = -1; /* indicates the time has changed */
38 /* static int hf_ehs_ph_pad1 = -1; */
39 static int hf_ehs_ph_hold_flag = -1; /* indicates a hold condition */
40 static int hf_ehs_ph_sign_flag = -1; /* indicates pre-mission, i.e. countdown, time */
42 /* static int hf_ehs_ph_pad2 = -1; */
43 /* static int hf_ehs_ph_pad3 = -1; */
44 /* static int hf_ehs_ph_pad4 = -1; */
46 static int hf_ehs_ph_hosc_packet_size = -1;
48 /* generic ehs secondary header values */
49 static int hf_ehs_sh_version = -1;
50 static int hf_ehs_sh_data_status_bit_5 = -1;
51 static int hf_ehs_sh_data_status_bit_4 = -1;
52 static int hf_ehs_sh_data_status_bit_3 = -1;
53 static int hf_ehs_sh_data_status_bit_2 = -1;
54 static int hf_ehs_sh_data_status_bit_1 = -1;
55 static int hf_ehs_sh_data_status_bit_0 = -1;
57 /* other common remappings of the data status bits specific to certain secondary ehs header values */
58 static int hf_ehs_sh_parent_stream_error = -1; /* data status bit 3 */
59 static int hf_ehs_sh_vcdu_sequence_error = -1; /* data status bit 2 */
60 static int hf_ehs_sh_packet_sequence_error = -1; /* data status bit 1 */
62 /* common ehs secondary header values */
63 static int hf_ehs_sh_vcdu_sequence_number = -1;
64 static int hf_ehs_sh_data_stream_id = -1;
65 /* static int hf_ehs_sh_pdss_reserved_1 = -1; */
66 /* static int hf_ehs_sh_pdss_reserved_2 = -1; */
67 /* static int hf_ehs_sh_pdss_reserved_3 = -1; */
68 static int hf_ehs_sh_gse_pkt_id = -1;
69 static int hf_ehs_sh_payload_vs_core_id = -1;
70 static int hf_ehs_sh_apid = -1;
71 static int hf_ehs_sh_virtual_channel = -1;
72 static int hf_ehs_sh_pdss_reserved_sync = -1;
74 /* tdm ehs secondary header values */
75 static int hf_ehs_sh_tdm_secondary_header_length = -1;
77 static int hf_ehs_sh_tdm_extra_data_packet = -1;
78 static int hf_ehs_sh_tdm_backup_stream_id_number = -1;
79 static int hf_ehs_sh_tdm_end_of_data_flag = -1;
80 static int hf_ehs_sh_tdm_parent_frame_error = -1;
81 static int hf_ehs_sh_tdm_checksum_error = -1;
82 static int hf_ehs_sh_tdm_fixed_value_error = -1;
84 static int hf_ehs_sh_tdm_minor_frame_counter_error = -1;
85 static int hf_ehs_sh_tdm_format_id_error = -1;
86 static int hf_ehs_sh_tdm_bit_slip_error = -1;
87 static int hf_ehs_sh_tdm_sync_error = -1;
88 static int hf_ehs_sh_tdm_aoslos_flag = -1;
89 static int hf_ehs_sh_tdm_override_errors_flag = -1;
90 static int hf_ehs_sh_tdm_data_status = -1;
92 static int hf_ehs_sh_tdm_idq = -1;
93 static int hf_ehs_sh_tdm_cdq = -1;
94 static int hf_ehs_sh_tdm_adq = -1;
95 static int hf_ehs_sh_tdm_data_dq = -1;
96 /* static int hf_ehs_sh_tdm_unused = -1; */
97 static int hf_ehs_sh_tdm_format_id = -1;
99 static int hf_ehs_sh_tdm_major_frame_packet_index = -1;
100 static int hf_ehs_sh_tdm_numpkts_per_major_frame = -1;
101 static int hf_ehs_sh_tdm_num_minor_frames_per_packet = -1;
103 static int hf_ehs_sh_tdm_cntmet_present = -1;
104 static int hf_ehs_sh_tdm_obt_present = -1;
105 static int hf_ehs_sh_tdm_major_frame_status_present = -1;
106 /* static int hf_ehs_sh_tdm_reserved = -1; */
108 static int hf_ehs_sh_tdm_cnt_year = -1; /* numeric year as years since 1900 */
109 static int hf_ehs_sh_tdm_cnt_jday = -1; /* julian day of year */
110 static int hf_ehs_sh_tdm_cnt_hour = -1;
111 static int hf_ehs_sh_tdm_cnt_minute = -1;
112 static int hf_ehs_sh_tdm_cnt_second = -1;
113 static int hf_ehs_sh_tdm_cnt_tenths = -1;
115 static int hf_ehs_sh_tdm_obt_year = -1; /* numeric year as years since 1900 */
116 static int hf_ehs_sh_tdm_obt_jday = -1; /* julian day of year */
117 static int hf_ehs_sh_tdm_obt_hour = -1;
118 static int hf_ehs_sh_tdm_obt_minute = -1;
119 static int hf_ehs_sh_tdm_obt_second = -1;
120 static int hf_ehs_sh_tdm_obt_tenths = -1;
122 static int hf_ehs_sh_tdm_obt_delta_time_flag = -1;
123 static int hf_ehs_sh_tdm_obt_computed_flag = -1;
124 static int hf_ehs_sh_tdm_obt_not_retrieved_flag = -1;
125 /* static int hf_ehs_sh_tdm_obt_reserved = -1; */
126 static int hf_ehs_sh_tdm_obt_source_apid = -1;
128 static int hf_ehs_sh_tdm_num_major_frame_status_words = -1;
130 /* static int hf_ehs_sh_tdm_mjfs_reserved = -1; */
131 static int hf_ehs_sh_tdm_mjfs_parent_frame_error = -1;
132 static int hf_ehs_sh_tdm_mjfs_checksum_error = -1;
133 static int hf_ehs_sh_tdm_mjfs_fixed_value_error = -1;
135 static int hf_ehs_sh_tdm_mnfs_parent_frame_error = -1;
136 static int hf_ehs_sh_tdm_mnfs_data_not_available = -1;
137 static int hf_ehs_sh_tdm_mnfs_checksum_error = -1;
138 static int hf_ehs_sh_tdm_mnfs_fixed_value_error = -1;
139 static int hf_ehs_sh_tdm_mnfs_counter_error = -1;
140 static int hf_ehs_sh_tdm_mnfs_format_id_error = -1;
141 static int hf_ehs_sh_tdm_mnfs_bit_slip_error = -1;
142 static int hf_ehs_sh_tdm_mnfs_sync_error = -1;
144 /* pseudo ehs secondary header values */
145 /* static int hf_ehs_sh_pseudo_unused = -1; */
146 static int hf_ehs_sh_pseudo_workstation_id = -1;
147 static int hf_ehs_sh_pseudo_user_id = -1;
148 static int hf_ehs_sh_pseudo_comp_id = -1;
150 /* data zone values for well known protocol AOS/LOS */
151 static int hf_ehs_dz_aoslos_indicator = -1;
153 /* data zone values for well known protocol UDSM */
154 static int hf_ehs_dz_udsm_ccsds_vs_bpdu = -1;
155 /* static int hf_ehs_dz_udsm_unused1 = -1; */
157 /* static int hf_ehs_dz_udsm_unused2 = -1; */
159 /* static int hf_ehs_dz_udsm_unused3 = -1; */
160 static int hf_ehs_dz_udsm_gse_pkt_id = -1;
161 static int hf_ehs_dz_udsm_payload_vs_core = -1;
162 static int hf_ehs_dz_udsm_apid = -1;
164 static int hf_ehs_dz_udsm_start_time_year = -1;
165 static int hf_ehs_dz_udsm_start_time_jday = -1;
166 static int hf_ehs_dz_udsm_start_time_hour = -1;
167 static int hf_ehs_dz_udsm_start_time_minute = -1;
168 static int hf_ehs_dz_udsm_start_time_second = -1;
170 static int hf_ehs_dz_udsm_stop_time_year = -1;
171 static int hf_ehs_dz_udsm_stop_time_jday = -1;
172 static int hf_ehs_dz_udsm_stop_time_hour = -1;
173 static int hf_ehs_dz_udsm_stop_time_minute = -1;
174 static int hf_ehs_dz_udsm_stop_time_second = -1;
176 /* static int hf_ehs_dz_udsm_unused4 = -1; */
178 static int hf_ehs_dz_udsm_num_pkts_xmtd = -1;
180 static int hf_ehs_dz_udsm_num_vcdu_seqerrs = -1;
182 static int hf_ehs_dz_udsm_num_pkt_seqerrs = -1;
184 static int hf_ehs_dz_udsm_num_pktlen_errors = -1;
186 static int hf_ehs_dz_udsm_event = -1;
188 static int hf_ehs_dz_udsm_num_pkts_xmtd_rollover = -1;
191 static dissector_handle_t ehs_handle;
193 /* handle to ccsds packet dissector */
194 static dissector_handle_t ccsds_handle;
196 /* Initialize the subtree pointers */
197 static gint ett_ehs = -1;
198 static gint ett_ehs_primary_header = -1;
199 static gint ett_ehs_secondary_header = -1;
200 static gint ett_ehs_data_zone = -1;
201 static gint ett_ehs_cnt_time = -1;
202 static gint ett_ehs_obt_time = -1;
203 static gint ett_ehs_udsm_start_time = -1;
204 static gint ett_ehs_udsm_stop_time = -1;
205 static gint ett_ehs_ground_receipt_time = -1;
206 static gint ett_ehs_major_frame = -1;
207 static gint ett_ehs_minor_frame = -1;
209 /* EHS protocol types */
210 typedef enum EHS_Protocol_Type
212 EHS_PROTOCOL__ALL_PROTOCOLS,
213 EHS_PROTOCOL__TDM_TELEMETRY,
214 EHS_PROTOCOL__NASCOM_TELEMETRY,
215 EHS_PROTOCOL__PSEUDO_TELEMETRY,
216 EHS_PROTOCOL__TDS_DATA,
217 EHS_PROTOCOL__TEST_DATA,
218 EHS_PROTOCOL__GSE_DATA,
219 EHS_PROTOCOL__CUSTOM_DATA,
220 EHS_PROTOCOL__HDRS_DQ,
222 EHS_PROTOCOL__AOS_LOS,
223 EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET,
224 EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET,
225 EHS_PROTOCOL__PDSS_PAYLOAD_BPDU,
226 EHS_PROTOCOL__PDSS_UDSM,
227 EHS_PROTOCOL__PDSS_RPSM,
228 NUMBER_PROTOCOLS = 15
229 } EHS_Protocol_Type_t;
232 /* some basic sizing parameters */
235 IP_HEADER_LENGTH = 48,
236 CCSDS_PRIMARY_HEADER_LENGTH = 6,
237 CCSDS_SECONDARY_HEADER_LENGTH = 10,
238 EHS_PRIMARY_HEADER_SIZE = 16,
239 EHS_SECONDARY_HEADER_SIZE = 12
242 /* determine if a ccsds primary header indicates a secondary exists */
243 #define HDR_SECHDR 0x0800
246 static const value_string ehs_primary_header_project[] =
256 static const value_string ehs_primary_header_support_mode[] =
263 { 5, "Development" },
269 static const value_string ehs_primary_header_data_mode[] =
285 { 14, "Playback10" },
286 { 15, "Playback11" },
287 { 16, "Mode Independent" },
291 static const value_string ehs_primary_header_protocol[] =
300 { 7, "Custom_Data" },
304 { 11, "PDSS_PAYLOAD_CCSDS" },
305 { 12, "PDSS_CORE_CCSDS" },
306 { 13, "PDSS_PAYLOAD_BPDU" },
312 static const value_string ehs_secondary_header_data_stream_id[] =
319 static const value_string ehs_secondary_header_payload_vs_core_id[] =
326 static const value_string ehs_secondary_header_tdm_backup_stream_id[] =
328 { 0, "Stream A / KMTS-A" },
329 { 1, "Stream B / KMTS-B" },
334 static const value_string ehs_secondary_header_tdm_end_of_data_flag[] =
337 { 1, "Loss of Clock" },
338 { 2, "Watchdog Timeout" },
339 { 3, "Loss of Sync" },
343 static const true_false_string ehs_tfs_secondary_header_tdm_aoslos_flag =
349 static const value_string ehs_secondary_header_tdm_data_status[] =
358 static const value_string ehs_data_zone_aoslos_indicator[] =
362 { 2, "Ku-band LOS" },
363 { 3, "Ku-band AOS" },
367 static const value_string ehs_data_zone_udsm_ccsds_vs_bpdu[] =
374 static const value_string ehs_data_zone_udsm_payload_vs_core[] =
381 static const value_string ehs_data_zone_udsm_event[] =
385 { 2, "Scheduled End of Data" },
386 { 3, "Operator Requested" },
391 /* function to return EHS secondary header size according to protocol.
392 * the buffer pointer tvb should be pointing to the packets ehs primary
393 * header, and the offset should be set to the start of the ehs secondary
397 ehs_secondary_header_size ( int protocol, tvbuff_t* tvb, int offset )
399 /* for most protocols the ehs secondary header is a standard size */
400 int size = EHS_SECONDARY_HEADER_SIZE;
404 case EHS_PROTOCOL__TDM_TELEMETRY:
405 /* the TDM secondary header size is variable. its value is actually
406 * contained in the first two bytes of the secondary header itself.
408 size = tvb_get_ntohs ( tvb, offset );
411 case EHS_PROTOCOL__NASCOM_TELEMETRY:
414 case EHS_PROTOCOL__PSEUDO_TELEMETRY:
418 case EHS_PROTOCOL__TDS_DATA:
421 case EHS_PROTOCOL__TEST_DATA:
424 case EHS_PROTOCOL__GSE_DATA:
428 case EHS_PROTOCOL__CUSTOM_DATA:
431 case EHS_PROTOCOL__HDRS_DQ:
434 case EHS_PROTOCOL__CSS:
437 case EHS_PROTOCOL__AOS_LOS:
440 case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET:
443 case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET:
446 case EHS_PROTOCOL__PDSS_PAYLOAD_BPDU:
449 case EHS_PROTOCOL__PDSS_UDSM:
452 case EHS_PROTOCOL__PDSS_RPSM:
464 /* common EHS secondary header dissector */
466 common_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
468 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_vcdu_sequence_number, tvb, *offset, 3, ENC_BIG_ENDIAN );
471 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_stream_id, tvb, *offset, 1, ENC_BIG_ENDIAN );
472 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_1, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
475 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_2, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
478 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_3, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
479 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_gse_pkt_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
480 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_payload_vs_core_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
481 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_apid, tvb, *offset, 2, ENC_BIG_ENDIAN );
484 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_virtual_channel, tvb, *offset, 2, ENC_BIG_ENDIAN );
487 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_sync, tvb, *offset, 2, ENC_BIG_ENDIAN );
493 /* AOS/LOS EHS secondary header dissector */
495 aoslos_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
497 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN );
498 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN );
499 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN );
500 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_3, tvb, *offset, 1, ENC_BIG_ENDIAN );
501 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_2, tvb, *offset, 1, ENC_BIG_ENDIAN );
502 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_1, tvb, *offset, 1, ENC_BIG_ENDIAN );
503 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN );
506 common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
510 /* payload ccsds secondary header dissector */
512 payload_ccsds_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
514 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN );
515 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN );
516 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN );
517 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_3, tvb, *offset, 1, ENC_BIG_ENDIAN );
518 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_vcdu_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
519 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_packet_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
520 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN );
523 common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
527 /* core ccsds secondary header dissector */
529 core_ccsds_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
531 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN );
532 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN );
533 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN );
534 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_parent_stream_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
535 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_vcdu_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
536 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_packet_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
537 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN );
540 common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
544 /* payload bpdu secondary header dissector */
546 payload_bpdu_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
548 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN );
549 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN );
550 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN );
551 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_3, tvb, *offset, 1, ENC_BIG_ENDIAN );
552 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_vcdu_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
553 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_1, tvb, *offset, 1, ENC_BIG_ENDIAN );
554 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN );
557 common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
561 /* udsm secondary header dissector */
563 udsm_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
565 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN );
566 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN );
567 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN );
568 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_3, tvb, *offset, 1, ENC_BIG_ENDIAN );
569 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_2, tvb, *offset, 1, ENC_BIG_ENDIAN );
570 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_1, tvb, *offset, 1, ENC_BIG_ENDIAN );
571 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN );
574 common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
578 /* tdm secondary header dissector */
580 tdm_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
583 int num_major_frames = 0;
584 int num_minor_frames = 0;
585 int cntmet_present = 0;
587 int mjfs_present = 0;
589 proto_tree* time_tree;
590 proto_item* time_item;
591 int year, jday, hour, minute, second, tenths;
593 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_secondary_header_length, tvb, *offset, 2, ENC_BIG_ENDIAN );
596 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_extra_data_packet, tvb, *offset, 1, ENC_BIG_ENDIAN );
597 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_backup_stream_id_number, tvb, *offset, 1, ENC_BIG_ENDIAN );
598 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_end_of_data_flag, tvb, *offset, 1, ENC_BIG_ENDIAN );
599 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_parent_frame_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
600 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_checksum_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
601 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_fixed_value_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
604 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_minor_frame_counter_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
605 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_format_id_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
606 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_bit_slip_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
607 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_sync_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
608 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_aoslos_flag, tvb, *offset, 1, ENC_BIG_ENDIAN );
609 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_override_errors_flag, tvb, *offset, 1, ENC_BIG_ENDIAN );
610 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_data_status, tvb, *offset, 1, ENC_BIG_ENDIAN );
613 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_idq, tvb, *offset, 2, ENC_BIG_ENDIAN );
616 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_cdq, tvb, *offset, 2, ENC_BIG_ENDIAN );
619 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_adq, tvb, *offset, 2, ENC_BIG_ENDIAN );
622 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_data_dq, tvb, *offset, 2, ENC_BIG_ENDIAN );
625 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_unused, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
628 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_format_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
631 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_major_frame_packet_index, tvb, *offset, 1, ENC_BIG_ENDIAN );
634 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_numpkts_per_major_frame, tvb, *offset, 1, ENC_BIG_ENDIAN );
637 num_minor_frames = 1 + tvb_get_guint8 ( tvb, *offset );
638 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_num_minor_frames_per_packet, tvb, *offset, 1, ENC_BIG_ENDIAN );
641 cntmet_present = tvb_get_guint8 ( tvb, *offset ) & 0x80;
642 obt_present = tvb_get_guint8 ( tvb, *offset ) & 0x40;
643 mjfs_present = tvb_get_guint8 ( tvb, *offset ) & 0x20;
644 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_cntmet_present, tvb, *offset, 1, ENC_BIG_ENDIAN );
645 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_present, tvb, *offset, 1, ENC_BIG_ENDIAN );
646 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_major_frame_status_present, tvb, *offset, 1, ENC_BIG_ENDIAN );
647 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_reserved, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
650 if ( cntmet_present )
652 time_tree = proto_tree_add_subtree(ehs_secondary_header_tree, tvb, *offset, 7, ett_ehs_cnt_time, &time_item, "CNT/MET Time: ");
654 year = tvb_get_guint8 ( tvb, *offset );
655 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_year, tvb, *offset, 1, ENC_BIG_ENDIAN );
658 jday = tvb_get_ntohs ( tvb, *offset );
659 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_jday, tvb, *offset, 2, ENC_BIG_ENDIAN );
662 hour = tvb_get_guint8 ( tvb, *offset );
663 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_hour, tvb, *offset, 1, ENC_BIG_ENDIAN );
666 minute = tvb_get_guint8 ( tvb, *offset );
667 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_minute, tvb, *offset, 1, ENC_BIG_ENDIAN );
670 second = tvb_get_guint8 ( tvb, *offset );
671 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_second, tvb, *offset, 1, ENC_BIG_ENDIAN );
674 tenths = tvb_get_guint8 ( tvb, *offset ) >> 4;
675 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_tenths, tvb, *offset, 1, ENC_BIG_ENDIAN );
678 /* format a more readable time */
679 proto_item_append_text(time_item, "%04d/%03d:%02d:%02d:%02d.%1d", year + 1900, jday, hour, minute, second, tenths );
685 time_tree = proto_tree_add_subtree(ehs_secondary_header_tree, tvb, *offset, 7, ett_ehs_obt_time, &time_item, "OBT Time: ");
687 year = tvb_get_guint8 ( tvb, *offset );
688 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_year, tvb, *offset, 1, ENC_BIG_ENDIAN );
691 jday = tvb_get_ntohs ( tvb, *offset );
692 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_jday, tvb, *offset, 2, ENC_BIG_ENDIAN );
695 hour = tvb_get_guint8 ( tvb, *offset );
696 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_hour, tvb, *offset, 1, ENC_BIG_ENDIAN );
699 minute = tvb_get_guint8 ( tvb, *offset );
700 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_minute, tvb, *offset, 1, ENC_BIG_ENDIAN );
703 second = tvb_get_guint8 ( tvb, *offset );
704 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_second, tvb, *offset, 1, ENC_BIG_ENDIAN );
707 tenths = tvb_get_guint8 ( tvb, *offset ) >> 4;
708 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_tenths, tvb, *offset, 1, ENC_BIG_ENDIAN );
711 /* format a more readable time */
712 proto_item_append_text ( time_item, "%04d/%03d:%02d:%02d:%02d.%1d", year + 1900, jday, hour, minute, second, tenths );
714 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_delta_time_flag, tvb, *offset, 1, ENC_BIG_ENDIAN );
715 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_computed_flag, tvb, *offset, 1, ENC_BIG_ENDIAN );
716 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_not_retrieved_flag, tvb, *offset, 1, ENC_BIG_ENDIAN );
717 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_reserved, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
718 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_source_apid, tvb, *offset, 1, ENC_BIG_ENDIAN );
723 num_major_frames = 1 + tvb_get_guint8 ( tvb, *offset );
724 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_num_major_frame_status_words, tvb, *offset, 1, ENC_BIG_ENDIAN );
727 for ( j=0; j < num_major_frames; ++j )
729 proto_tree* major_tree;
730 const int * major_fields[] = {
731 /* &hf_ehs_sh_tdm_mjfs_reserved, */
732 &hf_ehs_sh_tdm_mjfs_parent_frame_error,
733 &hf_ehs_sh_tdm_mjfs_checksum_error,
734 &hf_ehs_sh_tdm_mjfs_fixed_value_error,
738 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 );
739 proto_tree_add_bitmask_list(major_tree, tvb, *offset, 1, major_fields, ENC_BIG_ENDIAN);
744 for ( j=0; j < num_minor_frames; ++j )
746 proto_tree* minor_tree;
747 const int * minor_fields[] = {
748 &hf_ehs_sh_tdm_mnfs_parent_frame_error,
749 &hf_ehs_sh_tdm_mnfs_data_not_available,
750 &hf_ehs_sh_tdm_mnfs_checksum_error,
751 &hf_ehs_sh_tdm_mnfs_fixed_value_error,
752 &hf_ehs_sh_tdm_mnfs_counter_error,
753 &hf_ehs_sh_tdm_mnfs_format_id_error,
754 &hf_ehs_sh_tdm_mnfs_bit_slip_error,
755 &hf_ehs_sh_tdm_mnfs_sync_error,
759 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 );
760 proto_tree_add_bitmask_list(minor_tree, tvb, *offset, 1, minor_fields, ENC_BIG_ENDIAN);
767 /* pseudo secondary header dissector */
769 pseudo_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
771 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pseudo_unused, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
774 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pseudo_workstation_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
777 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pseudo_user_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
780 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pseudo_comp_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
788 /* EHS secondary header dissector */
790 ehs_secondary_header_dissector ( int protocol, proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
792 /* the ehs secondary header structure is potentially different for each and every
793 * protocol type, including its size. we support certain protocols but not all.
794 * for those protocols which are not supported we simply increment the offset
795 * and return. support for these other protocols can easily be added at a later
796 * time if and when it becomes necessary to do so. but for right now, we're only
797 * going to dissect those protocols that we work with on a regular basis in pdss.
801 case EHS_PROTOCOL__TDM_TELEMETRY:
802 tdm_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
805 case EHS_PROTOCOL__NASCOM_TELEMETRY:
806 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
809 case EHS_PROTOCOL__PSEUDO_TELEMETRY:
810 pseudo_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
813 case EHS_PROTOCOL__TDS_DATA:
814 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
817 case EHS_PROTOCOL__TEST_DATA:
818 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
821 case EHS_PROTOCOL__GSE_DATA:
822 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
825 case EHS_PROTOCOL__CUSTOM_DATA:
826 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
829 case EHS_PROTOCOL__HDRS_DQ:
830 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
833 case EHS_PROTOCOL__CSS:
834 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
837 case EHS_PROTOCOL__AOS_LOS:
838 aoslos_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
841 case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET:
842 payload_ccsds_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
845 case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET:
846 core_ccsds_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
849 case EHS_PROTOCOL__PDSS_PAYLOAD_BPDU:
850 payload_bpdu_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
853 case EHS_PROTOCOL__PDSS_UDSM:
854 udsm_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
857 case EHS_PROTOCOL__PDSS_RPSM:
858 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
862 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
868 /* AOS/LOS data zone dissector */
870 aoslos_data_zone_dissector ( proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, packet_info* pinfo _U_)
872 proto_tree *ehs_data_zone_tree;
874 /* create the data zone tree */
875 ehs_data_zone_tree = proto_tree_add_subtree( ehs_tree, tvb, *offset, tvb_reported_length(tvb) - *offset,
876 ett_ehs_data_zone, NULL, "AOS/LOS Data Zone" );
878 /* since the aos/los EHS packet data zone is well known, format it for display as well
880 * The AOS/LOS packet data zone is only 2 bytes in
881 * length and only 2 bits in the first byte are
882 * meaningful -- Ku band or S band and AOS or LOS
885 * 1-0 - band + AOS/LOS indicator
887 * bit 1 - 0=sband 1=kuband
888 * bit 0 - 0=LOS 1=AOS
895 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_aoslos_indicator, tvb, *offset, 1, ENC_BIG_ENDIAN );
900 /* UDSM data zone dissector */
902 udsm_data_zone_dissector ( proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, packet_info* pinfo _U_)
904 proto_tree *ehs_data_zone_tree;
906 proto_tree* time_tree;
907 proto_item* time_item;
908 int year, jday, hour, minute, second;
910 /* create the data zone tree */
911 ehs_data_zone_tree = proto_tree_add_subtree( ehs_tree, tvb, *offset, tvb_reported_length(tvb) - *offset,
912 ett_ehs_data_zone, NULL, "UDSM Data Zone" );
914 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_ccsds_vs_bpdu, tvb, *offset, 1, ENC_BIG_ENDIAN );
915 /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused1, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
918 /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused2, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
921 /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused3, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
922 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_gse_pkt_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
923 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_payload_vs_core, tvb, *offset, 2, ENC_BIG_ENDIAN );
924 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_apid, tvb, *offset, 2, ENC_BIG_ENDIAN );
927 time_tree = proto_tree_add_subtree(ehs_data_zone_tree, tvb, *offset, 7, ett_ehs_udsm_start_time, &time_item, "UDSM Start Time: ");
928 year = tvb_get_guint8 ( tvb, *offset );
929 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_year, tvb, *offset, 1, ENC_BIG_ENDIAN );
932 jday = tvb_get_ntohs ( tvb, *offset );
933 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_jday, tvb, *offset, 2, ENC_BIG_ENDIAN );
936 hour = tvb_get_guint8 ( tvb, *offset );
937 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_hour, tvb, *offset, 1, ENC_BIG_ENDIAN );
940 minute = tvb_get_guint8 ( tvb, *offset );
941 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_minute, tvb, *offset, 1, ENC_BIG_ENDIAN );
944 second = tvb_get_guint8 ( tvb, *offset );
945 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_second, tvb, *offset, 1, ENC_BIG_ENDIAN );
948 /* format a more readable time */
949 proto_item_append_text( time_item, "%04d/%03d:%02d:%02d:%02d = UDSM Start Time", year + 1900, jday, hour, minute, second );
951 time_tree = proto_tree_add_subtree(ehs_data_zone_tree, tvb, *offset, 7, ett_ehs_udsm_stop_time, &time_item, "UDSM Stop Time: ");
952 year = tvb_get_guint8 ( tvb, *offset );
953 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_year, tvb, *offset, 1, ENC_BIG_ENDIAN );
956 jday = tvb_get_ntohs ( tvb, *offset );
957 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_jday, tvb, *offset, 2, ENC_BIG_ENDIAN );
960 hour = tvb_get_guint8 ( tvb, *offset );
961 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_hour, tvb, *offset, 1, ENC_BIG_ENDIAN );
964 minute = tvb_get_guint8 ( tvb, *offset );
965 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_minute, tvb, *offset, 1, ENC_BIG_ENDIAN );
968 second = tvb_get_guint8 ( tvb, *offset );
969 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_second, tvb, *offset, 1, ENC_BIG_ENDIAN );
972 /* format a more readable time */
973 proto_item_append_text ( time_item, "%04d/%03d:%02d:%02d:%02d", year + 1900, jday, hour, minute, second );
975 /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused4, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
978 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_pkts_xmtd, tvb, *offset, 2, ENC_BIG_ENDIAN );
981 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_vcdu_seqerrs, tvb, *offset, 2, ENC_BIG_ENDIAN );
984 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_pkt_seqerrs, tvb, *offset, 2, ENC_BIG_ENDIAN );
987 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_pktlen_errors, tvb, *offset, 2, ENC_BIG_ENDIAN );
990 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_event, tvb, *offset, 1, ENC_BIG_ENDIAN );
993 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_pkts_xmtd_rollover, tvb, *offset, 1, ENC_BIG_ENDIAN );
999 /* data zone dissector */
1001 ehs_data_zone_dissector ( int protocol, proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, packet_info* pinfo )
1003 /* the data zone of certain protocols such as AOS/LOS and UDSM is well known.
1007 case EHS_PROTOCOL__TDM_TELEMETRY:
1010 case EHS_PROTOCOL__NASCOM_TELEMETRY:
1013 case EHS_PROTOCOL__PSEUDO_TELEMETRY:
1016 case EHS_PROTOCOL__TDS_DATA:
1019 case EHS_PROTOCOL__TEST_DATA:
1022 case EHS_PROTOCOL__GSE_DATA:
1025 case EHS_PROTOCOL__CUSTOM_DATA:
1028 case EHS_PROTOCOL__HDRS_DQ:
1031 case EHS_PROTOCOL__CSS:
1034 case EHS_PROTOCOL__AOS_LOS:
1035 aoslos_data_zone_dissector ( ehs_tree, tvb, offset, pinfo );
1038 case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET:
1041 case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET:
1044 case EHS_PROTOCOL__PDSS_PAYLOAD_BPDU:
1047 case EHS_PROTOCOL__PDSS_UDSM:
1048 udsm_data_zone_dissector ( ehs_tree, tvb, offset, pinfo );
1051 case EHS_PROTOCOL__PDSS_RPSM:
1060 /* Code to actually dissect the packets */
1062 dissect_ehs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1069 proto_item *ehs_packet;
1070 proto_tree *ehs_tree;
1072 proto_tree* time_tree;
1073 proto_item* time_item;
1074 proto_tree *ehs_primary_header_tree;
1075 proto_tree *ehs_secondary_header_tree;
1078 int year, jday, hour, minute, second, tenths;
1080 col_set_str(pinfo->cinfo, COL_PROTOCOL, "EHS");
1081 col_set_str(pinfo->cinfo, COL_INFO, "EHS");
1083 ehs_packet = proto_tree_add_item ( tree, proto_ehs, tvb, 0, -1, ENC_NA );
1084 ehs_tree = proto_item_add_subtree ( ehs_packet, ett_ehs );
1086 /* build the ehs primary header tree */
1087 ehs_primary_header_tree = proto_tree_add_subtree( ehs_tree, tvb, offset, EHS_PRIMARY_HEADER_SIZE,
1088 ett_ehs_primary_header, NULL, "Primary EHS Header" );
1090 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_version, tvb, offset, 1, ENC_BIG_ENDIAN );
1091 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_project, tvb, offset, 1, ENC_BIG_ENDIAN );
1094 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_support_mode, tvb, offset, 1, ENC_BIG_ENDIAN );
1095 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_data_mode, tvb, offset, 1, ENC_BIG_ENDIAN );
1098 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_mission, tvb, offset, 1, ENC_BIG_ENDIAN );
1101 /* save protocol for use later on */
1102 protocol = tvb_get_guint8 ( tvb, offset );
1103 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_protocol, tvb, offset, 1, ENC_BIG_ENDIAN );
1106 time_tree = proto_tree_add_subtree(ehs_primary_header_tree, tvb, offset, 7, ett_ehs_ground_receipt_time, &time_item, "EHS Ground Receipt Time: ");
1107 year = tvb_get_guint8 ( tvb, offset );
1108 proto_tree_add_item ( time_tree, hf_ehs_ph_year, tvb, offset, 1, ENC_BIG_ENDIAN );
1111 jday = tvb_get_ntohs ( tvb, offset );
1112 proto_tree_add_item ( time_tree, hf_ehs_ph_jday, tvb, offset, 2, ENC_BIG_ENDIAN );
1115 hour = tvb_get_guint8 ( tvb, offset );
1116 proto_tree_add_item ( time_tree, hf_ehs_ph_hour, tvb, offset, 1, ENC_BIG_ENDIAN );
1119 minute = tvb_get_guint8 ( tvb, offset );
1120 proto_tree_add_item ( time_tree, hf_ehs_ph_minute, tvb, offset, 1, ENC_BIG_ENDIAN );
1123 second = tvb_get_guint8 ( tvb, offset );
1124 proto_tree_add_item ( time_tree, hf_ehs_ph_second, tvb, offset, 1, ENC_BIG_ENDIAN );
1127 tenths = tvb_get_guint8 ( tvb, offset ) >> 4;
1128 proto_tree_add_item ( time_tree, hf_ehs_ph_tenths, tvb, offset, 1, ENC_BIG_ENDIAN );
1130 /* format a more readable ground receipt time string */
1131 proto_item_append_text ( time_item, "%04d/%03d:%02d:%02d:%02d.%1d", year + 1900, jday, hour, minute, second, tenths );
1133 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_new_data_flag, tvb, offset, 1, ENC_BIG_ENDIAN );
1134 /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad1, tvb, offset, 1, ENC_BIG_ENDIAN ); */
1135 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_hold_flag, tvb, offset, 1, ENC_BIG_ENDIAN );
1136 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_sign_flag, tvb, offset, 1, ENC_BIG_ENDIAN );
1139 /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad2, tvb, offset, 1, ENC_BIG_ENDIAN ); */
1141 /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad3, tvb, offset, 1, ENC_BIG_ENDIAN ); */
1143 /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad4, tvb, offset, 1, ENC_BIG_ENDIAN ); */
1146 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_hosc_packet_size, tvb, offset, 2, ENC_BIG_ENDIAN );
1149 /* build the ehs secondary header tree */
1150 ehs_secondary_header_tree = proto_tree_add_subtree( ehs_tree, tvb, offset, ehs_secondary_header_size ( protocol, tvb, offset ),
1151 ett_ehs_secondary_header, NULL, "Secondary EHS Header" );
1153 /* since each protocol can have a different ehs secondary header structure, we will offload
1154 * this processing to lower levels of code so we don't have to insert all of that complexity
1155 * directly inline here, which would no doubt make this difficult to read at best.
1157 ehs_secondary_header_dissector ( protocol, ehs_secondary_header_tree, tvb, &offset );
1159 /* for ccsds protocol types pass the remaining packet off to the ccsds packet dissector */
1162 case EHS_PROTOCOL__TDM_TELEMETRY:
1163 case EHS_PROTOCOL__PSEUDO_TELEMETRY:
1164 case EHS_PROTOCOL__AOS_LOS:
1165 case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET:
1166 case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET:
1167 case EHS_PROTOCOL__PDSS_UDSM:
1168 new_tvb = tvb_new_subset_remaining ( tvb, offset);
1169 call_dissector ( ccsds_handle, new_tvb, pinfo, ehs_tree );
1171 /* bump the offset to the data zone area */
1172 first_word = tvb_get_ntohs ( tvb, offset );
1174 offset += CCSDS_PRIMARY_HEADER_LENGTH;
1175 if ( first_word & HDR_SECHDR ) offset += CCSDS_SECONDARY_HEADER_LENGTH;
1183 /* build the ehs data zone tree for well known protocols such as AOS/LOS and UDSM */
1184 ehs_data_zone_dissector ( protocol, ehs_tree, tvb, &offset, pinfo );
1186 return tvb_captured_length(tvb);
1190 /* Register the protocol with Wireshark
1191 * this format is require because a script is used to build the C function
1192 * that calls all the protocol registration.
1195 proto_register_ehs(void)
1197 /* Setup list of header fields See Section 1.6.1 for details*/
1198 static hf_register_info hf[] =
1200 /* primary ehs header */
1201 { &hf_ehs_ph_version,
1202 { "Version", "ehs.version",
1203 FT_UINT8, BASE_DEC, NULL, 0xf0,
1206 { &hf_ehs_ph_project,
1207 { "Project", "ehs.project",
1208 FT_UINT8, BASE_DEC, VALS(ehs_primary_header_project), 0x0f,
1212 { &hf_ehs_ph_support_mode,
1213 { "Support Mode", "ehs.support_mode",
1214 FT_UINT8, BASE_DEC, VALS(ehs_primary_header_support_mode), 0xf0,
1217 { &hf_ehs_ph_data_mode,
1218 { "Data Mode", "ehs.data_mode",
1219 FT_UINT8, BASE_DEC, VALS(ehs_primary_header_data_mode), 0x0f,
1223 { &hf_ehs_ph_mission,
1224 { "Mission", "ehs.mission",
1225 FT_UINT8, BASE_DEC, NULL, 0xff,
1229 { &hf_ehs_ph_protocol,
1230 { "Protocol", "ehs.protocol",
1231 FT_UINT8, BASE_DEC, VALS(ehs_primary_header_protocol), 0xff,
1236 { "Years since 1900", "ehs.year",
1237 FT_UINT8, BASE_DEC, NULL, 0xff,
1242 { "Julian Day of Year", "ehs.jday",
1243 FT_UINT16, BASE_DEC, NULL, 0xffff,
1248 { "Hour", "ehs.hour",
1249 FT_UINT8, BASE_DEC, NULL, 0xff,
1253 { &hf_ehs_ph_minute,
1254 { "Minute", "ehs.minute",
1255 FT_UINT8, BASE_DEC, NULL, 0xff,
1259 { &hf_ehs_ph_second,
1260 { "Second", "ehs.second",
1261 FT_UINT8, BASE_DEC, NULL, 0xff,
1265 { &hf_ehs_ph_tenths,
1266 { "Tenths", "ehs.tenths",
1267 FT_UINT8, BASE_DEC, NULL, 0xf0,
1270 { &hf_ehs_ph_new_data_flag,
1271 { "New Data Flag", "ehs.new_data_flag",
1272 FT_BOOLEAN, 8, NULL, 0x08,
1277 { "Pad1", "ehs.pad1",
1278 FT_UINT8, BASE_DEC, NULL, 0x04,
1282 { &hf_ehs_ph_hold_flag,
1283 { "Hold Flag", "ehs.hold_flag",
1284 FT_BOOLEAN, 8, NULL, 0x02,
1287 { &hf_ehs_ph_sign_flag,
1288 { "Sign Flag (1->CDT)", "ehs.sign_flag",
1289 FT_UINT8, BASE_DEC, NULL, 0x01,
1295 { "Pad2", "ehs.pad2",
1296 FT_UINT8, BASE_DEC, NULL, 0xff,
1301 { "Pad3", "ehs.pad3",
1302 FT_UINT8, BASE_DEC, NULL, 0xff,
1307 { "Pad4", "ehs.pad4",
1308 FT_UINT8, BASE_DEC, NULL, 0xff,
1313 { &hf_ehs_ph_hosc_packet_size,
1314 { "HOSC Packet Size", "ehs.hosc_packet_size",
1315 FT_UINT16, BASE_DEC, NULL, 0xffff,
1320 /* secondary ehs header */
1321 { &hf_ehs_sh_version,
1322 { "Version", "ehs2.version",
1323 FT_UINT8, BASE_DEC, NULL, 0xc0,
1326 { &hf_ehs_sh_data_status_bit_5,
1327 { "Data Status Bit 5", "ehs2.data_status_bit_5",
1328 FT_UINT8, BASE_DEC, NULL, 0x20,
1331 { &hf_ehs_sh_data_status_bit_4,
1332 { "Data Status Bit 4", "ehs2.data_status_bit_4",
1333 FT_UINT8, BASE_DEC, NULL, 0x10,
1336 { &hf_ehs_sh_data_status_bit_3,
1337 { "Data Status Bit 3", "ehs2.data_status_bit_3",
1338 FT_UINT8, BASE_DEC, NULL, 0x08,
1341 { &hf_ehs_sh_data_status_bit_2,
1342 { "Data Status Bit 2", "ehs2.data_status_bit_2",
1343 FT_UINT8, BASE_DEC, NULL, 0x04,
1346 { &hf_ehs_sh_data_status_bit_1,
1347 { "Data Status Bit 1", "ehs2.data_status_bit_1",
1348 FT_UINT8, BASE_DEC, NULL, 0x02,
1351 { &hf_ehs_sh_data_status_bit_0,
1352 { "Data Status Bit 0", "ehs2.data_status_bit_0",
1353 FT_UINT8, BASE_DEC, NULL, 0x01,
1358 /* other common remappings of the data status bits specific to certain secondary ehs header values */
1359 { &hf_ehs_sh_parent_stream_error,
1360 { "Parent Stream Error", "ehs2.parent_stream_error",
1361 FT_BOOLEAN, 8, NULL, 0x08,
1364 { &hf_ehs_sh_vcdu_sequence_error,
1365 { "VCDU Sequence Error", "ehs2.vcdu_sequence_error",
1366 FT_BOOLEAN, 8, NULL, 0x04,
1369 { &hf_ehs_sh_packet_sequence_error,
1370 { "Packet Sequence Error", "ehs2.packet_sequence_error",
1371 FT_UINT8, BASE_DEC, NULL, 0x02,
1376 /* common ehs secondary header values */
1377 { &hf_ehs_sh_vcdu_sequence_number,
1378 { "VCDU Sequence Number", "ehs2.vcdu_seqno",
1379 FT_UINT24, BASE_DEC, NULL, 0xffffff,
1383 { &hf_ehs_sh_data_stream_id,
1384 { "Data Stream ID", "ehs2.data_stream_id",
1385 FT_UINT8, BASE_DEC, VALS(ehs_secondary_header_data_stream_id), 0x80,
1389 { &hf_ehs_sh_pdss_reserved_1,
1390 { "Pdss Reserved 1", "ehs2.pdss_reserved_1",
1391 FT_UINT8, BASE_DEC, NULL, 0x7f,
1395 { &hf_ehs_sh_pdss_reserved_2,
1396 { "Pdss Reserved 2", "ehs2.pdss_reserved_2",
1397 FT_UINT8, BASE_DEC, NULL, 0xff,
1401 { &hf_ehs_sh_pdss_reserved_3,
1402 { "Pdss Reserved 3", "ehs2.pdss_reserved_3",
1403 FT_UINT16, BASE_DEC, NULL, 0xe000,
1407 { &hf_ehs_sh_gse_pkt_id,
1408 { "GSE Packet ID (1=GSE)", "ehs2.gse_pkt_id",
1409 FT_UINT16, BASE_DEC, NULL, 0x1000,
1412 { &hf_ehs_sh_payload_vs_core_id,
1413 { "Payload vs Core ID", "ehs2.payload_vs_core_id",
1414 FT_UINT16, BASE_DEC, VALS(ehs_secondary_header_payload_vs_core_id), 0x0800,
1418 { "APID", "ehs2.apid",
1419 FT_UINT16, BASE_DEC, NULL, 0x07ff,
1423 { &hf_ehs_sh_virtual_channel,
1424 { "Virtual Channel", "ehs2.vcid",
1425 FT_UINT16, BASE_DEC, NULL, 0xffff,
1429 { &hf_ehs_sh_pdss_reserved_sync,
1430 { "Pdss Reserved Sync", "ehs2.sync",
1431 FT_UINT16, BASE_HEX, NULL, 0xffff,
1436 /* tdm ehs secondary header values */
1437 { &hf_ehs_sh_tdm_secondary_header_length,
1438 { "Secondary Header Length", "ehs2.tdm_secondary_header_length",
1439 FT_UINT16, BASE_DEC, NULL, 0xffff,
1443 { &hf_ehs_sh_tdm_extra_data_packet,
1444 { "Extra Data Packet", "ehs2.tdm_extra_data_packet",
1445 FT_BOOLEAN, 8, NULL, 0x80,
1448 { &hf_ehs_sh_tdm_backup_stream_id_number,
1449 { "Backup Stream ID Number", "ehs2.tdm_backup_stream_id_number",
1450 FT_UINT8, BASE_DEC, VALS(ehs_secondary_header_tdm_backup_stream_id), 0x60,
1453 { &hf_ehs_sh_tdm_end_of_data_flag,
1454 { "End of Data Flag", "ehs2.tdm_end_of_data_flag",
1455 FT_UINT8, BASE_DEC, VALS(ehs_secondary_header_tdm_end_of_data_flag), 0x18,
1458 { &hf_ehs_sh_tdm_parent_frame_error,
1459 { "Parent Frame Error", "ehs2.tdm_parent_frame_error",
1460 FT_BOOLEAN, 8, NULL, 0x04,
1463 { &hf_ehs_sh_tdm_checksum_error,
1464 { "Checksum Error", "ehs2.tdm_checksum_error",
1465 FT_BOOLEAN, 8, NULL, 0x02,
1468 { &hf_ehs_sh_tdm_fixed_value_error,
1469 { "Fixed Value Error", "ehs2.tdm_fixed_value_error",
1470 FT_BOOLEAN, 8, NULL, 0x01,
1474 { &hf_ehs_sh_tdm_minor_frame_counter_error,
1475 { "Minor Frame Counter Error", "ehs2.tdm_minor_frame_counter_error",
1476 FT_BOOLEAN, 8, NULL, 0x80,
1479 { &hf_ehs_sh_tdm_format_id_error,
1480 { "Format ID Error", "ehs2.tdm_format_id_error",
1481 FT_BOOLEAN, 8, NULL, 0x40,
1484 { &hf_ehs_sh_tdm_bit_slip_error,
1485 { "Bit Slip Error", "ehs2.tdm_bit_slip_error",
1486 FT_BOOLEAN, 8, NULL, 0x20,
1489 { &hf_ehs_sh_tdm_sync_error,
1490 { "Sync Error", "ehs2.tdm_sync_error",
1491 FT_BOOLEAN, 8, NULL, 0x10,
1494 { &hf_ehs_sh_tdm_aoslos_flag,
1495 { "AOS/LOS Flag", "ehs2.tdm_aoslos_flag",
1496 FT_BOOLEAN, 8, TFS(&ehs_tfs_secondary_header_tdm_aoslos_flag), 0x08,
1499 { &hf_ehs_sh_tdm_override_errors_flag,
1500 { "Override Errors", "ehs2.tdm_override_errors_flag",
1501 FT_BOOLEAN, 8, NULL, 0x04,
1504 { &hf_ehs_sh_tdm_data_status,
1505 { "Data Status", "ehs2.tdm_data_status",
1506 FT_UINT8, BASE_DEC, VALS(ehs_secondary_header_tdm_data_status), 0x03,
1510 { &hf_ehs_sh_tdm_idq,
1511 { "IDQ", "ehs2.tdm_idq",
1512 FT_UINT16, BASE_DEC, NULL, 0xffff,
1516 { &hf_ehs_sh_tdm_cdq,
1517 { "CDQ", "ehs2.tdm_cdq",
1518 FT_UINT16, BASE_DEC, NULL, 0xffff,
1522 { &hf_ehs_sh_tdm_adq,
1523 { "ADQ", "ehs2.tdm_adq",
1524 FT_UINT16, BASE_DEC, NULL, 0xffff,
1528 { &hf_ehs_sh_tdm_data_dq,
1529 { "Data DQ", "ehs2.tdm_data_dq",
1530 FT_UINT16, BASE_DEC, NULL, 0xffff,
1535 { &hf_ehs_sh_tdm_unused,
1536 { "Unused", "ehs2.tdm_unused",
1537 FT_UINT16, BASE_DEC, NULL, 0xffff,
1542 { &hf_ehs_sh_tdm_format_id,
1543 { "Format ID", "ehs2.tdm_format_id",
1544 FT_UINT16, BASE_HEX, NULL, 0xffff,
1548 { &hf_ehs_sh_tdm_major_frame_packet_index,
1549 { "Major Frame Packet Index", "ehs2.tdm_major_frame_packet_index",
1550 FT_UINT8, BASE_DEC, NULL, 0xff,
1554 { &hf_ehs_sh_tdm_numpkts_per_major_frame,
1555 { "Num Packets per Major Frame", "ehs2.tdm_numpkts_per_major_frame",
1556 FT_UINT8, BASE_DEC, NULL, 0xff,
1560 { &hf_ehs_sh_tdm_num_minor_frames_per_packet,
1561 { "Num Minor Frames per Packet", "ehs2.tdm_num_minor_frame_per_packet",
1562 FT_UINT8, BASE_DEC, NULL, 0xff,
1566 { &hf_ehs_sh_tdm_cntmet_present,
1567 { "CNT or MET Present", "ehs2.tdm_cntmet_present",
1568 FT_BOOLEAN, 8, NULL, 0x80,
1571 { &hf_ehs_sh_tdm_obt_present,
1572 { "OBT Present", "ehs2.tdm_obt_present",
1573 FT_BOOLEAN, 8, NULL, 0x40,
1576 { &hf_ehs_sh_tdm_major_frame_status_present,
1577 { "Major Frame Status Present", "ehs2.tdm_major_frame_status_present",
1578 FT_BOOLEAN, 8, NULL, 0x20,
1582 { &hf_ehs_sh_tdm_reserved,
1583 { "Reserved", "ehs2.tdm_reserved",
1584 FT_UINT8, BASE_DEC, NULL, 0x1f,
1589 { &hf_ehs_sh_tdm_cnt_year,
1590 { "CNT Years since 1900", "ehs2.tdm_cnt_year",
1591 FT_UINT8, BASE_DEC, NULL, 0xff,
1594 { &hf_ehs_sh_tdm_cnt_jday,
1595 { "CNT Julian Day of Year", "ehs2.tdm_cnt_jday",
1596 FT_UINT16, BASE_DEC, NULL, 0xffff,
1599 { &hf_ehs_sh_tdm_cnt_hour,
1600 { "CNT Hour", "ehs2.tdm_cnt_hour",
1601 FT_UINT8, BASE_DEC, NULL, 0xff,
1604 { &hf_ehs_sh_tdm_cnt_minute,
1605 { "CNT Minute", "ehs2.tdm_cnt_minute",
1606 FT_UINT8, BASE_DEC, NULL, 0xff,
1609 { &hf_ehs_sh_tdm_cnt_second,
1610 { "CNT Second", "ehs2.tdm_cnt_second",
1611 FT_UINT8, BASE_DEC, NULL, 0xff,
1614 { &hf_ehs_sh_tdm_cnt_tenths,
1615 { "CNT Tenths", "ehs2.tdm_cnt_tenths",
1616 FT_UINT8, BASE_DEC, NULL, 0xf0,
1620 { &hf_ehs_sh_tdm_obt_year,
1621 { "OBT Years since 1900", "ehs2.tdm_cnt_year",
1622 FT_UINT8, BASE_DEC, NULL, 0xff,
1625 { &hf_ehs_sh_tdm_obt_jday,
1626 { "OBT Julian Day of Year", "ehs2.tdm_cnt_jday",
1627 FT_UINT16, BASE_DEC, NULL, 0xffff,
1630 { &hf_ehs_sh_tdm_obt_hour,
1631 { "OBT Hour", "ehs2.tdm_cnt_hour",
1632 FT_UINT8, BASE_DEC, NULL, 0xff,
1635 { &hf_ehs_sh_tdm_obt_minute,
1636 { "OBT Minute", "ehs2.tdm_cnt_minute",
1637 FT_UINT8, BASE_DEC, NULL, 0xff,
1640 { &hf_ehs_sh_tdm_obt_second,
1641 { "OBT Second", "ehs2.tdm_cnt_second",
1642 FT_UINT8, BASE_DEC, NULL, 0xff,
1645 { &hf_ehs_sh_tdm_obt_tenths,
1646 { "OBT Tenths", "ehs2.tdm_cnt_tenths",
1647 FT_UINT8, BASE_DEC, NULL, 0xf0,
1651 { &hf_ehs_sh_tdm_obt_delta_time_flag,
1652 { "OBT is Delta Time Instead of GMT", "ehs2.tdm_obt_delta_time_flag",
1653 FT_BOOLEAN, 16, NULL, 0x8000,
1656 { &hf_ehs_sh_tdm_obt_computed_flag,
1657 { "OBT Computed", "ehs2.tdm_obt_computed_flag",
1658 FT_BOOLEAN, 16, NULL, 0x4000,
1661 { &hf_ehs_sh_tdm_obt_not_retrieved_flag,
1662 { "OBT Not Retrieved", "ehs2.tdm_obt_not_retrieved_flag",
1663 FT_BOOLEAN, 16, NULL, 0x2000,
1667 { &hf_ehs_sh_tdm_obt_reserved,
1668 { "OBT Reserved", "ehs2.tdm_obt_reserved",
1669 FT_BOOLEAN, 16, NULL, 0x1800,
1673 { &hf_ehs_sh_tdm_obt_source_apid,
1674 { "OBT Source APID", "ehs2.tdm_obt_source_apid",
1675 FT_UINT16, BASE_DEC, NULL, 0x07ff,
1679 { &hf_ehs_sh_tdm_num_major_frame_status_words,
1680 { "Number of Major Frame Status Words", "ehs2.tdm_num_major_frame_status_words",
1681 FT_UINT8, BASE_DEC, NULL, 0x0ff,
1686 { &hf_ehs_sh_tdm_mjfs_reserved,
1687 { "Reserved", "ehs2.tdm_mjfs_reserved",
1688 FT_UINT8, BASE_DEC, NULL, 0xf8,
1692 { &hf_ehs_sh_tdm_mjfs_parent_frame_error,
1693 { "Parent Frame Error", "ehs2.tdm_mjfs_parent_frame_error",
1694 FT_BOOLEAN, 8, NULL, 0x04,
1697 { &hf_ehs_sh_tdm_mjfs_checksum_error,
1698 { "Checksum Error", "ehs2.tdm_mjfs_checksum_error",
1699 FT_BOOLEAN, 8, NULL, 0x02,
1702 { &hf_ehs_sh_tdm_mjfs_fixed_value_error,
1703 { "Fixed Value Error", "ehs2.tdm_mjfs_fixed_value_error",
1704 FT_BOOLEAN, 8, NULL, 0x01,
1708 { &hf_ehs_sh_tdm_mnfs_parent_frame_error,
1709 { "Parent Frame Error", "ehs2.tdm_mnfs_parent_frame_error",
1710 FT_BOOLEAN, 8, NULL, 0x80,
1713 { &hf_ehs_sh_tdm_mnfs_data_not_available,
1714 { "Data Not Available", "ehs2.tdm_mnfs_data_not_available",
1715 FT_BOOLEAN, 8, NULL, 0x40,
1718 { &hf_ehs_sh_tdm_mnfs_checksum_error,
1719 { "Checksum Error", "ehs2.tdm_mnfs_checksum_error",
1720 FT_BOOLEAN, 8, NULL, 0x20,
1723 { &hf_ehs_sh_tdm_mnfs_fixed_value_error,
1724 { "Fixed Value Error", "ehs2.tdm_mnfs_fixed_value_error",
1725 FT_BOOLEAN, 8, NULL, 0x10,
1728 { &hf_ehs_sh_tdm_mnfs_counter_error,
1729 { "Counter Error", "ehs2.tdm_mnfs_counter_error",
1730 FT_BOOLEAN, 8, NULL, 0x08,
1733 { &hf_ehs_sh_tdm_mnfs_format_id_error,
1734 { "Format ID Error", "ehs2.tdm_mnfs_format_id_error",
1735 FT_BOOLEAN, 8, NULL, 0x04,
1738 { &hf_ehs_sh_tdm_mnfs_bit_slip_error,
1739 { "Bit Slip Error", "ehs2.tdm_mnfs_bit_slip_error",
1740 FT_BOOLEAN, 8, NULL, 0x02,
1743 { &hf_ehs_sh_tdm_mnfs_sync_error,
1744 { "Sync Error", "ehs2.tdm_mnfs_sync_error",
1745 FT_BOOLEAN, 8, NULL, 0x01,
1750 /* pseudo secondary header */
1752 { &hf_ehs_sh_pseudo_unused,
1753 { "Unused", "ehs2.pseudo_unused",
1754 FT_UINT16, BASE_DEC, NULL, 0xffff,
1758 { &hf_ehs_sh_pseudo_workstation_id,
1759 { "Workstation ID", "ehs2.pseudo_workstation_id",
1760 FT_UINT16, BASE_DEC, NULL, 0xffff,
1763 { &hf_ehs_sh_pseudo_user_id,
1764 { "User ID", "ehs2.pseudo_user_id",
1765 FT_UINT16, BASE_DEC, NULL, 0xffff,
1768 { &hf_ehs_sh_pseudo_comp_id,
1769 { "Comp ID", "ehs2.pseudo_comp_id",
1770 FT_UINT16, BASE_DEC, NULL, 0xffff,
1775 /* aos/los protocol data zone */
1776 { &hf_ehs_dz_aoslos_indicator,
1777 { "AOS/LOS Indicator", "ehs.dz.aoslos_indicator",
1778 FT_UINT8, BASE_DEC, VALS(ehs_data_zone_aoslos_indicator), 0x03,
1783 /* udsm protocol data zone */
1784 { &hf_ehs_dz_udsm_ccsds_vs_bpdu,
1785 { "CCSDS vs BPDU", "ehs.dz.udsm_ccsds_vs_bpdu",
1786 FT_UINT8, BASE_DEC, VALS(ehs_data_zone_udsm_ccsds_vs_bpdu), 0x80,
1790 { &hf_ehs_dz_udsm_unused1,
1791 { "Unused 1", "ehs.dz.udsm_unused1",
1792 FT_UINT8, BASE_DEC, NULL, 0x7f,
1796 { &hf_ehs_dz_udsm_unused2,
1797 { "Unused 2", "ehs.dz.udsm_unused2",
1798 FT_UINT8, BASE_DEC, NULL, 0xff,
1802 { &hf_ehs_dz_udsm_unused3,
1803 { "Unused 3", "ehs.dz.udsm_unused3",
1804 FT_UINT16, BASE_DEC, NULL, 0xe000,
1808 { &hf_ehs_dz_udsm_gse_pkt_id,
1809 { "GSE Pkt ID", "ehs.dz.udsm_gse_pkt_id",
1810 FT_BOOLEAN, 16, NULL, 0x1000,
1813 { &hf_ehs_dz_udsm_payload_vs_core,
1814 { "Payload vs Core", "ehs.dz.udsm_payload_vs_core",
1815 FT_UINT16, BASE_DEC, VALS(ehs_data_zone_udsm_payload_vs_core), 0x0800,
1818 { &hf_ehs_dz_udsm_apid,
1819 { "APID", "ehs.dz.udsm_apid",
1820 FT_UINT16, BASE_DEC, NULL, 0x07ff,
1824 { &hf_ehs_dz_udsm_start_time_year,
1825 { "Start Time Years since 1900", "ehs.dz.udsm_start_time_year",
1826 FT_UINT8, BASE_DEC, NULL, 0xff,
1829 { &hf_ehs_dz_udsm_start_time_jday,
1830 { "Start Time Julian Day", "ehs.dz.udsm_start_time_jday",
1831 FT_UINT16, BASE_DEC, NULL, 0xffff,
1834 { &hf_ehs_dz_udsm_start_time_hour,
1835 { "Start Time Hour", "ehs.dz.udsm_start_time_hour",
1836 FT_UINT8, BASE_DEC, NULL, 0xff,
1839 { &hf_ehs_dz_udsm_start_time_minute,
1840 { "Start Time Minute", "ehs.dz.udsm_start_time_minute",
1841 FT_UINT8, BASE_DEC, NULL, 0xff,
1844 { &hf_ehs_dz_udsm_start_time_second,
1845 { "Start Time Second", "ehs.dz.udsm_start_time_second",
1846 FT_UINT8, BASE_DEC, NULL, 0xff,
1850 { &hf_ehs_dz_udsm_stop_time_year,
1851 { "Stop Time Years since 1900", "ehs.dz.udsm_stop_time_year",
1852 FT_UINT8, BASE_DEC, NULL, 0xff,
1855 { &hf_ehs_dz_udsm_stop_time_jday,
1856 { "Stop Time Julian Day", "ehs.dz.udsm_stop_time_jday",
1857 FT_UINT16, BASE_DEC, NULL, 0xffff,
1860 { &hf_ehs_dz_udsm_stop_time_hour,
1861 { "Stop Time Hour", "ehs.dz.udsm_stop_time_hour",
1862 FT_UINT8, BASE_DEC, NULL, 0xff,
1865 { &hf_ehs_dz_udsm_stop_time_minute,
1866 { "Stop Time Minute", "ehs.dz.udsm_stop_time_minute",
1867 FT_UINT8, BASE_DEC, NULL, 0xff,
1870 { &hf_ehs_dz_udsm_stop_time_second,
1871 { "Stop Time Second", "ehs.dz.udsm_stop_time_second",
1872 FT_UINT8, BASE_DEC, NULL, 0xff,
1877 { &hf_ehs_dz_udsm_unused4,
1878 { "Unused 4", "ehs.dz.udsm_unused4",
1879 FT_UINT16, BASE_DEC, NULL, 0xffff,
1884 { &hf_ehs_dz_udsm_num_pkts_xmtd,
1885 { "Num Pkts Transmitted", "ehs.dz.udsm_num_pkts_xmtd",
1886 FT_UINT16, BASE_DEC, NULL, 0xffff,
1890 { &hf_ehs_dz_udsm_num_vcdu_seqerrs,
1891 { "Num VCDU Sequence Errors", "ehs.dz.udsm_num_vcdu_seqerrs",
1892 FT_UINT16, BASE_DEC, NULL, 0xffff,
1896 { &hf_ehs_dz_udsm_num_pkt_seqerrs,
1897 { "Num Packet Sequence Errors", "ehs.dz.udsm_num_pkt_seqerrs",
1898 FT_UINT16, BASE_DEC, NULL, 0xffff,
1902 { &hf_ehs_dz_udsm_num_pktlen_errors,
1903 { "Num Pkt Length Errors", "ehs.dz.udsm_num_pktlen_errors",
1904 FT_UINT16, BASE_DEC, NULL, 0xffff,
1908 { &hf_ehs_dz_udsm_event,
1909 { "UDSM Event Code", "ehs.dz.udsm_event",
1910 FT_UINT8, BASE_DEC, VALS(ehs_data_zone_udsm_event), 0xff,
1914 { &hf_ehs_dz_udsm_num_pkts_xmtd_rollover,
1915 { "Num Pkts Transmitted Rollover Counter", "ehs.dz.udsm_num_pkts_xmtd_rollover",
1916 FT_UINT8, BASE_DEC, NULL, 0xff,
1922 /* Setup protocol subtree array */
1923 static gint *ett[] = {
1925 &ett_ehs_primary_header,
1926 &ett_ehs_secondary_header,
1930 &ett_ehs_udsm_start_time,
1931 &ett_ehs_udsm_stop_time,
1932 &ett_ehs_ground_receipt_time,
1933 &ett_ehs_major_frame,
1934 &ett_ehs_minor_frame,
1937 /* Register the protocol name and description */
1938 proto_ehs = proto_register_protocol("EHS", "EHS", "ehs");
1940 /* Required function calls to register the header fields and subtrees used */
1941 proto_register_field_array(proto_ehs, hf, array_length(hf));
1942 proto_register_subtree_array(ett, array_length(ett));
1944 /* XX: Does this dissector need to be publicly registered ?? */
1945 ehs_handle = register_dissector ( "ehs", dissect_ehs, proto_ehs );
1949 proto_reg_handoff_ehs(void)
1951 dissector_add_for_decode_as_with_preference( "udp.port", ehs_handle );
1952 ccsds_handle = find_dissector_add_dependency ( "ccsds", proto_ehs );
1956 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1961 * indent-tabs-mode: nil
1964 * ex: set shiftwidth=2 tabstop=8 expandtab:
1965 * :indentSize=2:tabSize=8:noTabs=true: