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 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #include <epan/packet.h>
29 void proto_register_ehs(void);
30 void proto_reg_handoff_ehs(void);
32 /* Initialize the protocol and registered fields */
33 static int proto_ehs = -1;
35 static int hf_ehs_ph_version = -1;
36 static int hf_ehs_ph_project = -1;
37 static int hf_ehs_ph_support_mode = -1;
38 static int hf_ehs_ph_data_mode = -1;
39 static int hf_ehs_ph_mission = -1;
40 static int hf_ehs_ph_protocol = -1;
42 static int hf_ehs_ph_year = -1; /* numeric year as years since 1900 */
43 static int hf_ehs_ph_jday = -1; /* julian day of year */
44 static int hf_ehs_ph_hour = -1;
45 static int hf_ehs_ph_minute = -1;
46 static int hf_ehs_ph_second = -1;
47 static int hf_ehs_ph_tenths = -1;
49 static int hf_ehs_ph_new_data_flag = -1; /* indicates the time has changed */
50 /* static int hf_ehs_ph_pad1 = -1; */
51 static int hf_ehs_ph_hold_flag = -1; /* indicates a hold condition */
52 static int hf_ehs_ph_sign_flag = -1; /* indicates pre-mission, i.e. countdown, time */
54 /* static int hf_ehs_ph_pad2 = -1; */
55 /* static int hf_ehs_ph_pad3 = -1; */
56 /* static int hf_ehs_ph_pad4 = -1; */
58 static int hf_ehs_ph_hosc_packet_size = -1;
60 /* generic ehs secondary header values */
61 static int hf_ehs_sh_version = -1;
62 static int hf_ehs_sh_data_status_bit_5 = -1;
63 static int hf_ehs_sh_data_status_bit_4 = -1;
64 static int hf_ehs_sh_data_status_bit_3 = -1;
65 static int hf_ehs_sh_data_status_bit_2 = -1;
66 static int hf_ehs_sh_data_status_bit_1 = -1;
67 static int hf_ehs_sh_data_status_bit_0 = -1;
69 /* other common remappings of the data status bits specific to certain secondary ehs header values */
70 static int hf_ehs_sh_parent_stream_error = -1; /* data status bit 3 */
71 static int hf_ehs_sh_vcdu_sequence_error = -1; /* data status bit 2 */
72 static int hf_ehs_sh_packet_sequence_error = -1; /* data status bit 1 */
74 /* common ehs secondary header values */
75 static int hf_ehs_sh_vcdu_sequence_number = -1;
76 static int hf_ehs_sh_data_stream_id = -1;
77 /* static int hf_ehs_sh_pdss_reserved_1 = -1; */
78 /* static int hf_ehs_sh_pdss_reserved_2 = -1; */
79 /* static int hf_ehs_sh_pdss_reserved_3 = -1; */
80 static int hf_ehs_sh_gse_pkt_id = -1;
81 static int hf_ehs_sh_payload_vs_core_id = -1;
82 static int hf_ehs_sh_apid = -1;
83 static int hf_ehs_sh_virtual_channel = -1;
84 static int hf_ehs_sh_pdss_reserved_sync = -1;
86 /* tdm ehs secondary header values */
87 static int hf_ehs_sh_tdm_secondary_header_length = -1;
89 static int hf_ehs_sh_tdm_extra_data_packet = -1;
90 static int hf_ehs_sh_tdm_backup_stream_id_number = -1;
91 static int hf_ehs_sh_tdm_end_of_data_flag = -1;
92 static int hf_ehs_sh_tdm_parent_frame_error = -1;
93 static int hf_ehs_sh_tdm_checksum_error = -1;
94 static int hf_ehs_sh_tdm_fixed_value_error = -1;
96 static int hf_ehs_sh_tdm_minor_frame_counter_error = -1;
97 static int hf_ehs_sh_tdm_format_id_error = -1;
98 static int hf_ehs_sh_tdm_bit_slip_error = -1;
99 static int hf_ehs_sh_tdm_sync_error = -1;
100 static int hf_ehs_sh_tdm_aoslos_flag = -1;
101 static int hf_ehs_sh_tdm_override_errors_flag = -1;
102 static int hf_ehs_sh_tdm_data_status = -1;
104 static int hf_ehs_sh_tdm_idq = -1;
105 static int hf_ehs_sh_tdm_cdq = -1;
106 static int hf_ehs_sh_tdm_adq = -1;
107 static int hf_ehs_sh_tdm_data_dq = -1;
108 /* static int hf_ehs_sh_tdm_unused = -1; */
109 static int hf_ehs_sh_tdm_format_id = -1;
111 static int hf_ehs_sh_tdm_major_frame_packet_index = -1;
112 static int hf_ehs_sh_tdm_numpkts_per_major_frame = -1;
113 static int hf_ehs_sh_tdm_num_minor_frames_per_packet = -1;
115 static int hf_ehs_sh_tdm_cntmet_present = -1;
116 static int hf_ehs_sh_tdm_obt_present = -1;
117 static int hf_ehs_sh_tdm_major_frame_status_present = -1;
118 /* static int hf_ehs_sh_tdm_reserved = -1; */
120 static int hf_ehs_sh_tdm_cnt_year = -1; /* numeric year as years since 1900 */
121 static int hf_ehs_sh_tdm_cnt_jday = -1; /* julian day of year */
122 static int hf_ehs_sh_tdm_cnt_hour = -1;
123 static int hf_ehs_sh_tdm_cnt_minute = -1;
124 static int hf_ehs_sh_tdm_cnt_second = -1;
125 static int hf_ehs_sh_tdm_cnt_tenths = -1;
127 static int hf_ehs_sh_tdm_obt_year = -1; /* numeric year as years since 1900 */
128 static int hf_ehs_sh_tdm_obt_jday = -1; /* julian day of year */
129 static int hf_ehs_sh_tdm_obt_hour = -1;
130 static int hf_ehs_sh_tdm_obt_minute = -1;
131 static int hf_ehs_sh_tdm_obt_second = -1;
132 static int hf_ehs_sh_tdm_obt_tenths = -1;
134 static int hf_ehs_sh_tdm_obt_delta_time_flag = -1;
135 static int hf_ehs_sh_tdm_obt_computed_flag = -1;
136 static int hf_ehs_sh_tdm_obt_not_retrieved_flag = -1;
137 /* static int hf_ehs_sh_tdm_obt_reserved = -1; */
138 static int hf_ehs_sh_tdm_obt_source_apid = -1;
140 static int hf_ehs_sh_tdm_num_major_frame_status_words = -1;
142 /* static int hf_ehs_sh_tdm_mjfs_reserved = -1; */
143 static int hf_ehs_sh_tdm_mjfs_parent_frame_error = -1;
144 static int hf_ehs_sh_tdm_mjfs_checksum_error = -1;
145 static int hf_ehs_sh_tdm_mjfs_fixed_value_error = -1;
147 static int hf_ehs_sh_tdm_mnfs_parent_frame_error = -1;
148 static int hf_ehs_sh_tdm_mnfs_data_not_available = -1;
149 static int hf_ehs_sh_tdm_mnfs_checksum_error = -1;
150 static int hf_ehs_sh_tdm_mnfs_fixed_value_error = -1;
151 static int hf_ehs_sh_tdm_mnfs_counter_error = -1;
152 static int hf_ehs_sh_tdm_mnfs_format_id_error = -1;
153 static int hf_ehs_sh_tdm_mnfs_bit_slip_error = -1;
154 static int hf_ehs_sh_tdm_mnfs_sync_error = -1;
156 /* pseudo ehs secondary header values */
157 /* static int hf_ehs_sh_pseudo_unused = -1; */
158 static int hf_ehs_sh_pseudo_workstation_id = -1;
159 static int hf_ehs_sh_pseudo_user_id = -1;
160 static int hf_ehs_sh_pseudo_comp_id = -1;
162 /* data zone values for well known protocol AOS/LOS */
163 static int hf_ehs_dz_aoslos_indicator = -1;
165 /* data zone values for well known protocol UDSM */
166 static int hf_ehs_dz_udsm_ccsds_vs_bpdu = -1;
167 /* static int hf_ehs_dz_udsm_unused1 = -1; */
169 /* static int hf_ehs_dz_udsm_unused2 = -1; */
171 /* static int hf_ehs_dz_udsm_unused3 = -1; */
172 static int hf_ehs_dz_udsm_gse_pkt_id = -1;
173 static int hf_ehs_dz_udsm_payload_vs_core = -1;
174 static int hf_ehs_dz_udsm_apid = -1;
176 static int hf_ehs_dz_udsm_start_time_year = -1;
177 static int hf_ehs_dz_udsm_start_time_jday = -1;
178 static int hf_ehs_dz_udsm_start_time_hour = -1;
179 static int hf_ehs_dz_udsm_start_time_minute = -1;
180 static int hf_ehs_dz_udsm_start_time_second = -1;
182 static int hf_ehs_dz_udsm_stop_time_year = -1;
183 static int hf_ehs_dz_udsm_stop_time_jday = -1;
184 static int hf_ehs_dz_udsm_stop_time_hour = -1;
185 static int hf_ehs_dz_udsm_stop_time_minute = -1;
186 static int hf_ehs_dz_udsm_stop_time_second = -1;
188 /* static int hf_ehs_dz_udsm_unused4 = -1; */
190 static int hf_ehs_dz_udsm_num_pkts_xmtd = -1;
192 static int hf_ehs_dz_udsm_num_vcdu_seqerrs = -1;
194 static int hf_ehs_dz_udsm_num_pkt_seqerrs = -1;
196 static int hf_ehs_dz_udsm_num_pktlen_errors = -1;
198 static int hf_ehs_dz_udsm_event = -1;
200 static int hf_ehs_dz_udsm_num_pkts_xmtd_rollover = -1;
203 /* handle to ccsds packet dissector */
204 static dissector_handle_t ccsds_handle;
206 /* Initialize the subtree pointers */
207 static gint ett_ehs = -1;
208 static gint ett_ehs_primary_header = -1;
209 static gint ett_ehs_secondary_header = -1;
210 static gint ett_ehs_data_zone = -1;
211 static gint ett_ehs_cnt_time = -1;
212 static gint ett_ehs_obt_time = -1;
213 static gint ett_ehs_udsm_start_time = -1;
214 static gint ett_ehs_udsm_stop_time = -1;
215 static gint ett_ehs_ground_receipt_time = -1;
216 static gint ett_ehs_major_frame = -1;
217 static gint ett_ehs_minor_frame = -1;
219 /* EHS protocol types */
220 typedef enum EHS_Protocol_Type
222 EHS_PROTOCOL__ALL_PROTOCOLS,
223 EHS_PROTOCOL__TDM_TELEMETRY,
224 EHS_PROTOCOL__NASCOM_TELEMETRY,
225 EHS_PROTOCOL__PSEUDO_TELEMETRY,
226 EHS_PROTOCOL__TDS_DATA,
227 EHS_PROTOCOL__TEST_DATA,
228 EHS_PROTOCOL__GSE_DATA,
229 EHS_PROTOCOL__CUSTOM_DATA,
230 EHS_PROTOCOL__HDRS_DQ,
232 EHS_PROTOCOL__AOS_LOS,
233 EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET,
234 EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET,
235 EHS_PROTOCOL__PDSS_PAYLOAD_BPDU,
236 EHS_PROTOCOL__PDSS_UDSM,
237 EHS_PROTOCOL__PDSS_RPSM,
238 NUMBER_PROTOCOLS = 15
239 } EHS_Protocol_Type_t;
242 /* some basic sizing parameters */
245 IP_HEADER_LENGTH = 48,
246 CCSDS_PRIMARY_HEADER_LENGTH = 6,
247 CCSDS_SECONDARY_HEADER_LENGTH = 10,
248 EHS_PRIMARY_HEADER_SIZE = 16,
249 EHS_SECONDARY_HEADER_SIZE = 12
252 /* determine if a ccsds primary header indicates a secondary exists */
253 #define HDR_SECHDR 0x0800
256 static const value_string ehs_primary_header_project[] =
266 static const value_string ehs_primary_header_support_mode[] =
273 { 5, "Development" },
279 static const value_string ehs_primary_header_data_mode[] =
295 { 14, "Playback10" },
296 { 15, "Playback11" },
297 { 16, "Mode Independent" },
301 static const value_string ehs_primary_header_protocol[] =
310 { 7, "Custom_Data" },
314 { 11, "PDSS_PAYLOAD_CCSDS" },
315 { 12, "PDSS_CORE_CCSDS" },
316 { 13, "PDSS_PAYLOAD_BPDU" },
322 static const value_string ehs_secondary_header_data_stream_id[] =
329 static const value_string ehs_secondary_header_payload_vs_core_id[] =
336 static const value_string ehs_secondary_header_tdm_backup_stream_id[] =
338 { 0, "Stream A / KMTS-A" },
339 { 1, "Stream B / KMTS-B" },
344 static const value_string ehs_secondary_header_tdm_end_of_data_flag[] =
347 { 1, "Loss of Clock" },
348 { 2, "Watchdog Timeout" },
349 { 3, "Loss of Sync" },
353 static const true_false_string ehs_tfs_secondary_header_tdm_aoslos_flag =
359 static const value_string ehs_secondary_header_tdm_data_status[] =
368 static const value_string ehs_data_zone_aoslos_indicator[] =
372 { 2, "Ku-band LOS" },
373 { 3, "Ku-band AOS" },
377 static const value_string ehs_data_zone_udsm_ccsds_vs_bpdu[] =
384 static const value_string ehs_data_zone_udsm_payload_vs_core[] =
391 static const value_string ehs_data_zone_udsm_event[] =
395 { 2, "Scheduled End of Data" },
396 { 3, "Operator Requested" },
401 /* function to return EHS secondary header size according to protocol.
402 * the buffer pointer tvb should be pointing to the packets ehs primary
403 * header, and the offset should be set to the start of the ehs secondary
407 ehs_secondary_header_size ( int protocol, tvbuff_t* tvb, int offset )
409 /* for most protocols the ehs secondary header is a standard size */
410 int size = EHS_SECONDARY_HEADER_SIZE;
414 case EHS_PROTOCOL__TDM_TELEMETRY:
415 /* the TDM secondary header size is variable. its value is actually
416 * contained in the first two bytes of the secondary header itself.
418 size = tvb_get_ntohs ( tvb, offset );
421 case EHS_PROTOCOL__NASCOM_TELEMETRY:
424 case EHS_PROTOCOL__PSEUDO_TELEMETRY:
428 case EHS_PROTOCOL__TDS_DATA:
431 case EHS_PROTOCOL__TEST_DATA:
434 case EHS_PROTOCOL__GSE_DATA:
438 case EHS_PROTOCOL__CUSTOM_DATA:
441 case EHS_PROTOCOL__HDRS_DQ:
444 case EHS_PROTOCOL__CSS:
447 case EHS_PROTOCOL__AOS_LOS:
450 case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET:
453 case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET:
456 case EHS_PROTOCOL__PDSS_PAYLOAD_BPDU:
459 case EHS_PROTOCOL__PDSS_UDSM:
462 case EHS_PROTOCOL__PDSS_RPSM:
474 /* common EHS secondary header dissector */
476 common_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
478 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_vcdu_sequence_number, tvb, *offset, 3, ENC_BIG_ENDIAN );
481 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_stream_id, tvb, *offset, 1, ENC_BIG_ENDIAN );
482 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_1, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
485 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_2, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
488 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_3, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
489 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_gse_pkt_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
490 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_payload_vs_core_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
491 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_apid, tvb, *offset, 2, ENC_BIG_ENDIAN );
494 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_virtual_channel, tvb, *offset, 2, ENC_BIG_ENDIAN );
497 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_sync, tvb, *offset, 2, ENC_BIG_ENDIAN );
503 /* AOS/LOS EHS secondary header dissector */
505 aoslos_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
507 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN );
508 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN );
509 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN );
510 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_3, tvb, *offset, 1, ENC_BIG_ENDIAN );
511 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_2, tvb, *offset, 1, ENC_BIG_ENDIAN );
512 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_1, tvb, *offset, 1, ENC_BIG_ENDIAN );
513 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN );
516 common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
520 /* payload ccsds secondary header dissector */
522 payload_ccsds_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
524 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN );
525 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN );
526 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN );
527 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_3, tvb, *offset, 1, ENC_BIG_ENDIAN );
528 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_vcdu_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
529 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_packet_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
530 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN );
533 common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
537 /* core ccsds secondary header dissector */
539 core_ccsds_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
541 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN );
542 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN );
543 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN );
544 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_parent_stream_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
545 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_vcdu_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
546 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_packet_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
547 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN );
550 common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
554 /* payload bpdu secondary header dissector */
556 payload_bpdu_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
558 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN );
559 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN );
560 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN );
561 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_3, tvb, *offset, 1, ENC_BIG_ENDIAN );
562 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_vcdu_sequence_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
563 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_1, tvb, *offset, 1, ENC_BIG_ENDIAN );
564 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN );
567 common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
571 /* udsm secondary header dissector */
573 udsm_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
575 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_version, tvb, *offset, 1, ENC_BIG_ENDIAN );
576 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_5, tvb, *offset, 1, ENC_BIG_ENDIAN );
577 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_4, tvb, *offset, 1, ENC_BIG_ENDIAN );
578 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_3, tvb, *offset, 1, ENC_BIG_ENDIAN );
579 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_2, tvb, *offset, 1, ENC_BIG_ENDIAN );
580 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_1, tvb, *offset, 1, ENC_BIG_ENDIAN );
581 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_data_status_bit_0, tvb, *offset, 1, ENC_BIG_ENDIAN );
584 common_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
588 /* tdm secondary header dissector */
590 tdm_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
593 int num_major_frames = 0;
594 int num_minor_frames = 0;
595 int cntmet_present = 0;
597 int mjfs_present = 0;
599 proto_tree* time_tree;
600 proto_item* time_item;
601 int year, jday, hour, minute, second, tenths;
603 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_secondary_header_length, tvb, *offset, 2, ENC_BIG_ENDIAN );
606 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_extra_data_packet, tvb, *offset, 1, ENC_BIG_ENDIAN );
607 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_backup_stream_id_number, tvb, *offset, 1, ENC_BIG_ENDIAN );
608 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_end_of_data_flag, tvb, *offset, 1, ENC_BIG_ENDIAN );
609 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_parent_frame_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
610 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_checksum_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
611 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_fixed_value_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
614 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_minor_frame_counter_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
615 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_format_id_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
616 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_bit_slip_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
617 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_sync_error, tvb, *offset, 1, ENC_BIG_ENDIAN );
618 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_aoslos_flag, tvb, *offset, 1, ENC_BIG_ENDIAN );
619 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_override_errors_flag, tvb, *offset, 1, ENC_BIG_ENDIAN );
620 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_data_status, tvb, *offset, 1, ENC_BIG_ENDIAN );
623 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_idq, tvb, *offset, 2, ENC_BIG_ENDIAN );
626 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_cdq, tvb, *offset, 2, ENC_BIG_ENDIAN );
629 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_adq, tvb, *offset, 2, ENC_BIG_ENDIAN );
632 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_data_dq, tvb, *offset, 2, ENC_BIG_ENDIAN );
635 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_unused, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
638 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_format_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
641 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_major_frame_packet_index, tvb, *offset, 1, ENC_BIG_ENDIAN );
644 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_numpkts_per_major_frame, tvb, *offset, 1, ENC_BIG_ENDIAN );
647 num_minor_frames = 1 + tvb_get_guint8 ( tvb, *offset );
648 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_num_minor_frames_per_packet, tvb, *offset, 1, ENC_BIG_ENDIAN );
651 cntmet_present = tvb_get_guint8 ( tvb, *offset ) & 0x80;
652 obt_present = tvb_get_guint8 ( tvb, *offset ) & 0x40;
653 mjfs_present = tvb_get_guint8 ( tvb, *offset ) & 0x20;
654 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_cntmet_present, tvb, *offset, 1, ENC_BIG_ENDIAN );
655 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_present, tvb, *offset, 1, ENC_BIG_ENDIAN );
656 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_major_frame_status_present, tvb, *offset, 1, ENC_BIG_ENDIAN );
657 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_reserved, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
660 if ( cntmet_present )
662 time_tree = proto_tree_add_subtree(ehs_secondary_header_tree, tvb, *offset, 7, ett_ehs_cnt_time, &time_item, "CNT/MET Time: ");
664 year = tvb_get_guint8 ( tvb, *offset );
665 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_year, tvb, *offset, 1, ENC_BIG_ENDIAN );
668 jday = tvb_get_ntohs ( tvb, *offset );
669 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_jday, tvb, *offset, 2, ENC_BIG_ENDIAN );
672 hour = tvb_get_guint8 ( tvb, *offset );
673 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_hour, tvb, *offset, 1, ENC_BIG_ENDIAN );
676 minute = tvb_get_guint8 ( tvb, *offset );
677 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_minute, tvb, *offset, 1, ENC_BIG_ENDIAN );
680 second = tvb_get_guint8 ( tvb, *offset );
681 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_second, tvb, *offset, 1, ENC_BIG_ENDIAN );
684 tenths = tvb_get_guint8 ( tvb, *offset ) >> 4;
685 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_cnt_tenths, tvb, *offset, 1, ENC_BIG_ENDIAN );
688 /* format a more readable time */
689 proto_item_append_text(time_item, "%04d/%03d:%02d:%02d:%02d.%1d", year + 1900, jday, hour, minute, second, tenths );
695 time_tree = proto_tree_add_subtree(ehs_secondary_header_tree, tvb, *offset, 7, ett_ehs_obt_time, &time_item, "OBT Time: ");
697 year = tvb_get_guint8 ( tvb, *offset );
698 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_year, tvb, *offset, 1, ENC_BIG_ENDIAN );
701 jday = tvb_get_ntohs ( tvb, *offset );
702 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_jday, tvb, *offset, 2, ENC_BIG_ENDIAN );
705 hour = tvb_get_guint8 ( tvb, *offset );
706 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_hour, tvb, *offset, 1, ENC_BIG_ENDIAN );
709 minute = tvb_get_guint8 ( tvb, *offset );
710 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_minute, tvb, *offset, 1, ENC_BIG_ENDIAN );
713 second = tvb_get_guint8 ( tvb, *offset );
714 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_second, tvb, *offset, 1, ENC_BIG_ENDIAN );
717 tenths = tvb_get_guint8 ( tvb, *offset ) >> 4;
718 proto_tree_add_item ( time_tree, hf_ehs_sh_tdm_obt_tenths, tvb, *offset, 1, ENC_BIG_ENDIAN );
721 /* format a more readable time */
722 proto_item_append_text ( time_item, "%04d/%03d:%02d:%02d:%02d.%1d", year + 1900, jday, hour, minute, second, tenths );
724 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_delta_time_flag, tvb, *offset, 1, ENC_BIG_ENDIAN );
725 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_computed_flag, tvb, *offset, 1, ENC_BIG_ENDIAN );
726 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_not_retrieved_flag, tvb, *offset, 1, ENC_BIG_ENDIAN );
727 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_reserved, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
728 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_source_apid, tvb, *offset, 1, ENC_BIG_ENDIAN );
733 num_major_frames = 1 + tvb_get_guint8 ( tvb, *offset );
734 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_num_major_frame_status_words, tvb, *offset, 1, ENC_BIG_ENDIAN );
737 for ( j=0; j < num_major_frames; ++j )
739 proto_tree* major_tree;
740 const int * major_fields[] = {
741 /* &hf_ehs_sh_tdm_mjfs_reserved, */
742 &hf_ehs_sh_tdm_mjfs_parent_frame_error,
743 &hf_ehs_sh_tdm_mjfs_checksum_error,
744 &hf_ehs_sh_tdm_mjfs_fixed_value_error,
748 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 );
749 proto_tree_add_bitmask_list(major_tree, tvb, *offset, 1, major_fields, ENC_BIG_ENDIAN);
754 for ( j=0; j < num_minor_frames; ++j )
756 proto_tree* minor_tree;
757 const int * minor_fields[] = {
758 &hf_ehs_sh_tdm_mnfs_parent_frame_error,
759 &hf_ehs_sh_tdm_mnfs_data_not_available,
760 &hf_ehs_sh_tdm_mnfs_checksum_error,
761 &hf_ehs_sh_tdm_mnfs_fixed_value_error,
762 &hf_ehs_sh_tdm_mnfs_counter_error,
763 &hf_ehs_sh_tdm_mnfs_format_id_error,
764 &hf_ehs_sh_tdm_mnfs_bit_slip_error,
765 &hf_ehs_sh_tdm_mnfs_sync_error,
769 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 );
770 proto_tree_add_bitmask_list(minor_tree, tvb, *offset, 1, minor_fields, ENC_BIG_ENDIAN);
777 /* pseudo secondary header dissector */
779 pseudo_secondary_header_dissector ( proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
781 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pseudo_unused, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
784 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pseudo_workstation_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
787 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pseudo_user_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
790 proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pseudo_comp_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
798 /* EHS secondary header dissector */
800 ehs_secondary_header_dissector ( int protocol, proto_tree* ehs_secondary_header_tree, tvbuff_t* tvb, int* offset )
802 /* the ehs secondary header structure is potentially different for each and every
803 * protocol type, including its size. we support certain protocols but not all.
804 * for those protocols which are not supported we simply increment the offset
805 * and return. support for these other protocols can easily be added at a later
806 * time if and when it becomes necessary to do so. but for right now, we're only
807 * going to dissect those protocols that we work with on a regular basis in pdss.
811 case EHS_PROTOCOL__TDM_TELEMETRY:
812 tdm_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
815 case EHS_PROTOCOL__NASCOM_TELEMETRY:
816 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
819 case EHS_PROTOCOL__PSEUDO_TELEMETRY:
820 pseudo_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
823 case EHS_PROTOCOL__TDS_DATA:
824 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
827 case EHS_PROTOCOL__TEST_DATA:
828 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
831 case EHS_PROTOCOL__GSE_DATA:
832 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
835 case EHS_PROTOCOL__CUSTOM_DATA:
836 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
839 case EHS_PROTOCOL__HDRS_DQ:
840 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
843 case EHS_PROTOCOL__CSS:
844 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
847 case EHS_PROTOCOL__AOS_LOS:
848 aoslos_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
851 case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET:
852 payload_ccsds_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
855 case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET:
856 core_ccsds_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
859 case EHS_PROTOCOL__PDSS_PAYLOAD_BPDU:
860 payload_bpdu_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
863 case EHS_PROTOCOL__PDSS_UDSM:
864 udsm_secondary_header_dissector ( ehs_secondary_header_tree, tvb, offset );
867 case EHS_PROTOCOL__PDSS_RPSM:
868 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
872 *offset += ehs_secondary_header_size ( protocol, tvb, *offset );
878 /* AOS/LOS data zone dissector */
880 aoslos_data_zone_dissector ( proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, packet_info* pinfo _U_)
882 proto_tree *ehs_data_zone_tree;
884 /* create the data zone tree */
885 ehs_data_zone_tree = proto_tree_add_subtree( ehs_tree, tvb, *offset, tvb_reported_length(tvb) - *offset,
886 ett_ehs_data_zone, NULL, "AOS/LOS Data Zone" );
888 /* since the aos/los EHS packet data zone is well known, format it for display as well
890 * The AOS/LOS packet data zone is only 2 bytes in
891 * length and only 2 bits in the first byte are
892 * meaningful -- Ku band or S band and AOS or LOS
895 * 1-0 - band + AOS/LOS indicator
897 * bit 1 - 0=sband 1=kuband
898 * bit 0 - 0=LOS 1=AOS
905 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_aoslos_indicator, tvb, *offset, 1, ENC_BIG_ENDIAN );
910 /* UDSM data zone dissector */
912 udsm_data_zone_dissector ( proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, packet_info* pinfo _U_)
914 proto_tree *ehs_data_zone_tree;
916 proto_tree* time_tree;
917 proto_item* time_item;
918 int year, jday, hour, minute, second;
920 /* create the data zone tree */
921 ehs_data_zone_tree = proto_tree_add_subtree( ehs_tree, tvb, *offset, tvb_reported_length(tvb) - *offset,
922 ett_ehs_data_zone, NULL, "UDSM Data Zone" );
924 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_ccsds_vs_bpdu, tvb, *offset, 1, ENC_BIG_ENDIAN );
925 /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused1, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
928 /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused2, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
931 /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused3, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
932 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_gse_pkt_id, tvb, *offset, 2, ENC_BIG_ENDIAN );
933 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_payload_vs_core, tvb, *offset, 2, ENC_BIG_ENDIAN );
934 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_apid, tvb, *offset, 2, ENC_BIG_ENDIAN );
937 time_tree = proto_tree_add_subtree(ehs_data_zone_tree, tvb, *offset, 7, ett_ehs_udsm_start_time, &time_item, "UDSM Start Time: ");
938 year = tvb_get_guint8 ( tvb, *offset );
939 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_year, tvb, *offset, 1, ENC_BIG_ENDIAN );
942 jday = tvb_get_ntohs ( tvb, *offset );
943 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_jday, tvb, *offset, 2, ENC_BIG_ENDIAN );
946 hour = tvb_get_guint8 ( tvb, *offset );
947 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_hour, tvb, *offset, 1, ENC_BIG_ENDIAN );
950 minute = tvb_get_guint8 ( tvb, *offset );
951 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_minute, tvb, *offset, 1, ENC_BIG_ENDIAN );
954 second = tvb_get_guint8 ( tvb, *offset );
955 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_start_time_second, tvb, *offset, 1, ENC_BIG_ENDIAN );
958 /* format a more readable time */
959 proto_item_append_text( time_item, "%04d/%03d:%02d:%02d:%02d = UDSM Start Time", year + 1900, jday, hour, minute, second );
961 time_tree = proto_tree_add_subtree(ehs_data_zone_tree, tvb, *offset, 7, ett_ehs_udsm_stop_time, &time_item, "UDSM Stop Time: ");
962 year = tvb_get_guint8 ( tvb, *offset );
963 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_year, tvb, *offset, 1, ENC_BIG_ENDIAN );
966 jday = tvb_get_ntohs ( tvb, *offset );
967 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_jday, tvb, *offset, 2, ENC_BIG_ENDIAN );
970 hour = tvb_get_guint8 ( tvb, *offset );
971 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_hour, tvb, *offset, 1, ENC_BIG_ENDIAN );
974 minute = tvb_get_guint8 ( tvb, *offset );
975 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_minute, tvb, *offset, 1, ENC_BIG_ENDIAN );
978 second = tvb_get_guint8 ( tvb, *offset );
979 proto_tree_add_item ( time_tree, hf_ehs_dz_udsm_stop_time_second, tvb, *offset, 1, ENC_BIG_ENDIAN );
982 /* format a more readable time */
983 proto_item_append_text ( time_item, "%04d/%03d:%02d:%02d:%02d", year + 1900, jday, hour, minute, second );
985 /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused4, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
988 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_pkts_xmtd, tvb, *offset, 2, ENC_BIG_ENDIAN );
991 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_vcdu_seqerrs, tvb, *offset, 2, ENC_BIG_ENDIAN );
994 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_pkt_seqerrs, tvb, *offset, 2, ENC_BIG_ENDIAN );
997 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_pktlen_errors, tvb, *offset, 2, ENC_BIG_ENDIAN );
1000 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_event, tvb, *offset, 1, ENC_BIG_ENDIAN );
1003 proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_num_pkts_xmtd_rollover, tvb, *offset, 1, ENC_BIG_ENDIAN );
1009 /* data zone dissector */
1011 ehs_data_zone_dissector ( int protocol, proto_tree* ehs_tree, tvbuff_t* tvb, int* offset, packet_info* pinfo )
1013 /* the data zone of certain protocols such as AOS/LOS and UDSM is well known.
1017 case EHS_PROTOCOL__TDM_TELEMETRY:
1020 case EHS_PROTOCOL__NASCOM_TELEMETRY:
1023 case EHS_PROTOCOL__PSEUDO_TELEMETRY:
1026 case EHS_PROTOCOL__TDS_DATA:
1029 case EHS_PROTOCOL__TEST_DATA:
1032 case EHS_PROTOCOL__GSE_DATA:
1035 case EHS_PROTOCOL__CUSTOM_DATA:
1038 case EHS_PROTOCOL__HDRS_DQ:
1041 case EHS_PROTOCOL__CSS:
1044 case EHS_PROTOCOL__AOS_LOS:
1045 aoslos_data_zone_dissector ( ehs_tree, tvb, offset, pinfo );
1048 case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET:
1051 case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET:
1054 case EHS_PROTOCOL__PDSS_PAYLOAD_BPDU:
1057 case EHS_PROTOCOL__PDSS_UDSM:
1058 udsm_data_zone_dissector ( ehs_tree, tvb, offset, pinfo );
1061 case EHS_PROTOCOL__PDSS_RPSM:
1070 /* Code to actually dissect the packets */
1072 dissect_ehs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1079 proto_item *ehs_packet;
1080 proto_tree *ehs_tree;
1082 proto_tree* time_tree;
1083 proto_item* time_item;
1084 proto_tree *ehs_primary_header_tree;
1085 proto_tree *ehs_secondary_header_tree;
1088 int year, jday, hour, minute, second, tenths;
1090 col_set_str(pinfo->cinfo, COL_PROTOCOL, "EHS");
1091 col_set_str(pinfo->cinfo, COL_INFO, "EHS");
1093 ehs_packet = proto_tree_add_item ( tree, proto_ehs, tvb, 0, -1, ENC_NA );
1094 ehs_tree = proto_item_add_subtree ( ehs_packet, ett_ehs );
1096 /* build the ehs primary header tree */
1097 ehs_primary_header_tree = proto_tree_add_subtree( ehs_tree, tvb, offset, EHS_PRIMARY_HEADER_SIZE,
1098 ett_ehs_primary_header, NULL, "Primary EHS Header" );
1100 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_version, tvb, offset, 1, ENC_BIG_ENDIAN );
1101 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_project, tvb, offset, 1, ENC_BIG_ENDIAN );
1104 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_support_mode, tvb, offset, 1, ENC_BIG_ENDIAN );
1105 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_data_mode, tvb, offset, 1, ENC_BIG_ENDIAN );
1108 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_mission, tvb, offset, 1, ENC_BIG_ENDIAN );
1111 /* save protocol for use later on */
1112 protocol = tvb_get_guint8 ( tvb, offset );
1113 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_protocol, tvb, offset, 1, ENC_BIG_ENDIAN );
1116 time_tree = proto_tree_add_subtree(ehs_primary_header_tree, tvb, offset, 7, ett_ehs_ground_receipt_time, &time_item, "EHS Ground Receipt Time: ");
1117 year = tvb_get_guint8 ( tvb, offset );
1118 proto_tree_add_item ( time_tree, hf_ehs_ph_year, tvb, offset, 1, ENC_BIG_ENDIAN );
1121 jday = tvb_get_ntohs ( tvb, offset );
1122 proto_tree_add_item ( time_tree, hf_ehs_ph_jday, tvb, offset, 2, ENC_BIG_ENDIAN );
1125 hour = tvb_get_guint8 ( tvb, offset );
1126 proto_tree_add_item ( time_tree, hf_ehs_ph_hour, tvb, offset, 1, ENC_BIG_ENDIAN );
1129 minute = tvb_get_guint8 ( tvb, offset );
1130 proto_tree_add_item ( time_tree, hf_ehs_ph_minute, tvb, offset, 1, ENC_BIG_ENDIAN );
1133 second = tvb_get_guint8 ( tvb, offset );
1134 proto_tree_add_item ( time_tree, hf_ehs_ph_second, tvb, offset, 1, ENC_BIG_ENDIAN );
1137 tenths = tvb_get_guint8 ( tvb, offset ) >> 4;
1138 proto_tree_add_item ( time_tree, hf_ehs_ph_tenths, tvb, offset, 1, ENC_BIG_ENDIAN );
1140 /* format a more readable ground receipt time string */
1141 proto_item_append_text ( time_item, "%04d/%03d:%02d:%02d:%02d.%1d", year + 1900, jday, hour, minute, second, tenths );
1143 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_new_data_flag, tvb, offset, 1, ENC_BIG_ENDIAN );
1144 /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad1, tvb, offset, 1, ENC_BIG_ENDIAN ); */
1145 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_hold_flag, tvb, offset, 1, ENC_BIG_ENDIAN );
1146 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_sign_flag, tvb, offset, 1, ENC_BIG_ENDIAN );
1149 /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad2, tvb, offset, 1, ENC_BIG_ENDIAN ); */
1151 /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad3, tvb, offset, 1, ENC_BIG_ENDIAN ); */
1153 /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad4, tvb, offset, 1, ENC_BIG_ENDIAN ); */
1156 proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_hosc_packet_size, tvb, offset, 2, ENC_BIG_ENDIAN );
1159 /* build the ehs secondary header tree */
1160 ehs_secondary_header_tree = proto_tree_add_subtree( ehs_tree, tvb, offset, ehs_secondary_header_size ( protocol, tvb, offset ),
1161 ett_ehs_secondary_header, NULL, "Secondary EHS Header" );
1163 /* since each protocol can have a different ehs secondary header structure, we will offload
1164 * this processing to lower levels of code so we don't have to insert all of that complexity
1165 * directly inline here, which would no doubt make this difficult to read at best.
1167 ehs_secondary_header_dissector ( protocol, ehs_secondary_header_tree, tvb, &offset );
1169 /* for ccsds protocol types pass the remaining packet off to the ccsds packet dissector */
1172 case EHS_PROTOCOL__TDM_TELEMETRY:
1173 case EHS_PROTOCOL__PSEUDO_TELEMETRY:
1174 case EHS_PROTOCOL__AOS_LOS:
1175 case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET:
1176 case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET:
1177 case EHS_PROTOCOL__PDSS_UDSM:
1178 new_tvb = tvb_new_subset_remaining ( tvb, offset);
1179 call_dissector ( ccsds_handle, new_tvb, pinfo, ehs_tree );
1181 /* bump the offset to the data zone area */
1182 first_word = tvb_get_ntohs ( tvb, offset );
1184 offset += CCSDS_PRIMARY_HEADER_LENGTH;
1185 if ( first_word & HDR_SECHDR ) offset += CCSDS_SECONDARY_HEADER_LENGTH;
1193 /* build the ehs data zone tree for well known protocols such as AOS/LOS and UDSM */
1194 ehs_data_zone_dissector ( protocol, ehs_tree, tvb, &offset, pinfo );
1199 /* Register the protocol with Wireshark
1200 * this format is require because a script is used to build the C function
1201 * that calls all the protocol registration.
1204 proto_register_ehs(void)
1206 /* Setup list of header fields See Section 1.6.1 for details*/
1207 static hf_register_info hf[] =
1209 /* primary ehs header */
1210 { &hf_ehs_ph_version,
1211 { "Version", "ehs.version",
1212 FT_UINT8, BASE_DEC, NULL, 0xf0,
1215 { &hf_ehs_ph_project,
1216 { "Project", "ehs.project",
1217 FT_UINT8, BASE_DEC, VALS(ehs_primary_header_project), 0x0f,
1221 { &hf_ehs_ph_support_mode,
1222 { "Support Mode", "ehs.support_mode",
1223 FT_UINT8, BASE_DEC, VALS(ehs_primary_header_support_mode), 0xf0,
1226 { &hf_ehs_ph_data_mode,
1227 { "Data Mode", "ehs.data_mode",
1228 FT_UINT8, BASE_DEC, VALS(ehs_primary_header_data_mode), 0x0f,
1232 { &hf_ehs_ph_mission,
1233 { "Mission", "ehs.mission",
1234 FT_UINT8, BASE_DEC, NULL, 0xff,
1238 { &hf_ehs_ph_protocol,
1239 { "Protocol", "ehs.protocol",
1240 FT_UINT8, BASE_DEC, VALS(ehs_primary_header_protocol), 0xff,
1245 { "Years since 1900", "ehs.year",
1246 FT_UINT8, BASE_DEC, NULL, 0xff,
1251 { "Julian Day of Year", "ehs.jday",
1252 FT_UINT16, BASE_DEC, NULL, 0xffff,
1257 { "Hour", "ehs.hour",
1258 FT_UINT8, BASE_DEC, NULL, 0xff,
1262 { &hf_ehs_ph_minute,
1263 { "Minute", "ehs.minute",
1264 FT_UINT8, BASE_DEC, NULL, 0xff,
1268 { &hf_ehs_ph_second,
1269 { "Second", "ehs.second",
1270 FT_UINT8, BASE_DEC, NULL, 0xff,
1274 { &hf_ehs_ph_tenths,
1275 { "Tenths", "ehs.tenths",
1276 FT_UINT8, BASE_DEC, NULL, 0xf0,
1279 { &hf_ehs_ph_new_data_flag,
1280 { "New Data Flag", "ehs.new_data_flag",
1281 FT_BOOLEAN, 8, NULL, 0x08,
1286 { "Pad1", "ehs.pad1",
1287 FT_UINT8, BASE_DEC, NULL, 0x04,
1291 { &hf_ehs_ph_hold_flag,
1292 { "Hold Flag", "ehs.hold_flag",
1293 FT_BOOLEAN, 8, NULL, 0x02,
1296 { &hf_ehs_ph_sign_flag,
1297 { "Sign Flag (1->CDT)", "ehs.sign_flag",
1298 FT_UINT8, BASE_DEC, NULL, 0x01,
1304 { "Pad2", "ehs.pad2",
1305 FT_UINT8, BASE_DEC, NULL, 0xff,
1310 { "Pad3", "ehs.pad3",
1311 FT_UINT8, BASE_DEC, NULL, 0xff,
1316 { "Pad4", "ehs.pad4",
1317 FT_UINT8, BASE_DEC, NULL, 0xff,
1322 { &hf_ehs_ph_hosc_packet_size,
1323 { "HOSC Packet Size", "ehs.hosc_packet_size",
1324 FT_UINT16, BASE_DEC, NULL, 0xffff,
1329 /* secondary ehs header */
1330 { &hf_ehs_sh_version,
1331 { "Version", "ehs2.version",
1332 FT_UINT8, BASE_DEC, NULL, 0xc0,
1335 { &hf_ehs_sh_data_status_bit_5,
1336 { "Data Status Bit 5", "ehs2.data_status_bit_5",
1337 FT_UINT8, BASE_DEC, NULL, 0x20,
1340 { &hf_ehs_sh_data_status_bit_4,
1341 { "Data Status Bit 4", "ehs2.data_status_bit_4",
1342 FT_UINT8, BASE_DEC, NULL, 0x10,
1345 { &hf_ehs_sh_data_status_bit_3,
1346 { "Data Status Bit 3", "ehs2.data_status_bit_3",
1347 FT_UINT8, BASE_DEC, NULL, 0x08,
1350 { &hf_ehs_sh_data_status_bit_2,
1351 { "Data Status Bit 2", "ehs2.data_status_bit_2",
1352 FT_UINT8, BASE_DEC, NULL, 0x04,
1355 { &hf_ehs_sh_data_status_bit_1,
1356 { "Data Status Bit 1", "ehs2.data_status_bit_1",
1357 FT_UINT8, BASE_DEC, NULL, 0x02,
1360 { &hf_ehs_sh_data_status_bit_0,
1361 { "Data Status Bit 0", "ehs2.data_status_bit_0",
1362 FT_UINT8, BASE_DEC, NULL, 0x01,
1367 /* other common remappings of the data status bits specific to certain secondary ehs header values */
1368 { &hf_ehs_sh_parent_stream_error,
1369 { "Parent Stream Error", "ehs2.parent_stream_error",
1370 FT_BOOLEAN, 8, NULL, 0x08,
1373 { &hf_ehs_sh_vcdu_sequence_error,
1374 { "VCDU Sequence Error", "ehs2.vcdu_sequence_error",
1375 FT_BOOLEAN, 8, NULL, 0x04,
1378 { &hf_ehs_sh_packet_sequence_error,
1379 { "Packet Sequence Error", "ehs2.packet_sequence_error",
1380 FT_UINT8, BASE_DEC, NULL, 0x02,
1385 /* common ehs secondary header values */
1386 { &hf_ehs_sh_vcdu_sequence_number,
1387 { "VCDU Sequence Number", "ehs2.vcdu_seqno",
1388 FT_UINT24, BASE_DEC, NULL, 0xffffff,
1392 { &hf_ehs_sh_data_stream_id,
1393 { "Data Stream ID", "ehs2.data_stream_id",
1394 FT_UINT8, BASE_DEC, VALS(ehs_secondary_header_data_stream_id), 0x80,
1398 { &hf_ehs_sh_pdss_reserved_1,
1399 { "Pdss Reserved 1", "ehs2.pdss_reserved_1",
1400 FT_UINT8, BASE_DEC, NULL, 0x7f,
1404 { &hf_ehs_sh_pdss_reserved_2,
1405 { "Pdss Reserved 2", "ehs2.pdss_reserved_2",
1406 FT_UINT8, BASE_DEC, NULL, 0xff,
1410 { &hf_ehs_sh_pdss_reserved_3,
1411 { "Pdss Reserved 3", "ehs2.pdss_reserved_3",
1412 FT_UINT16, BASE_DEC, NULL, 0xe000,
1416 { &hf_ehs_sh_gse_pkt_id,
1417 { "GSE Packet ID (1=GSE)", "ehs2.gse_pkt_id",
1418 FT_UINT16, BASE_DEC, NULL, 0x1000,
1421 { &hf_ehs_sh_payload_vs_core_id,
1422 { "Payload vs Core ID", "ehs2.payload_vs_core_id",
1423 FT_UINT16, BASE_DEC, VALS(ehs_secondary_header_payload_vs_core_id), 0x0800,
1427 { "APID", "ehs2.apid",
1428 FT_UINT16, BASE_DEC, NULL, 0x07ff,
1432 { &hf_ehs_sh_virtual_channel,
1433 { "Virtual Channel", "ehs2.vcid",
1434 FT_UINT16, BASE_DEC, NULL, 0xffff,
1438 { &hf_ehs_sh_pdss_reserved_sync,
1439 { "Pdss Reserved Sync", "ehs2.sync",
1440 FT_UINT16, BASE_HEX, NULL, 0xffff,
1445 /* tdm ehs secondary header values */
1446 { &hf_ehs_sh_tdm_secondary_header_length,
1447 { "Secondary Header Length", "ehs2.tdm_secondary_header_length",
1448 FT_UINT16, BASE_DEC, NULL, 0xffff,
1452 { &hf_ehs_sh_tdm_extra_data_packet,
1453 { "Extra Data Packet", "ehs2.tdm_extra_data_packet",
1454 FT_BOOLEAN, 8, NULL, 0x80,
1457 { &hf_ehs_sh_tdm_backup_stream_id_number,
1458 { "Backup Stream ID Number", "ehs2.tdm_backup_stream_id_number",
1459 FT_UINT8, BASE_DEC, VALS(ehs_secondary_header_tdm_backup_stream_id), 0x60,
1462 { &hf_ehs_sh_tdm_end_of_data_flag,
1463 { "End of Data Flag", "ehs2.tdm_end_of_data_flag",
1464 FT_UINT8, BASE_DEC, VALS(ehs_secondary_header_tdm_end_of_data_flag), 0x18,
1467 { &hf_ehs_sh_tdm_parent_frame_error,
1468 { "Parent Frame Error", "ehs2.tdm_parent_frame_error",
1469 FT_BOOLEAN, 8, NULL, 0x04,
1472 { &hf_ehs_sh_tdm_checksum_error,
1473 { "Checksum Error", "ehs2.tdm_checksum_error",
1474 FT_BOOLEAN, 8, NULL, 0x02,
1477 { &hf_ehs_sh_tdm_fixed_value_error,
1478 { "Fixed Value Error", "ehs2.tdm_fixed_value_error",
1479 FT_BOOLEAN, 8, NULL, 0x01,
1483 { &hf_ehs_sh_tdm_minor_frame_counter_error,
1484 { "Minor Frame Counter Error", "ehs2.tdm_minor_frame_counter_error",
1485 FT_BOOLEAN, 8, NULL, 0x80,
1488 { &hf_ehs_sh_tdm_format_id_error,
1489 { "Format ID Error", "ehs2.tdm_format_id_error",
1490 FT_BOOLEAN, 8, NULL, 0x40,
1493 { &hf_ehs_sh_tdm_bit_slip_error,
1494 { "Bit Slip Error", "ehs2.tdm_bit_slip_error",
1495 FT_BOOLEAN, 8, NULL, 0x20,
1498 { &hf_ehs_sh_tdm_sync_error,
1499 { "Sync Error", "ehs2.tdm_sync_error",
1500 FT_BOOLEAN, 8, NULL, 0x10,
1503 { &hf_ehs_sh_tdm_aoslos_flag,
1504 { "AOS/LOS Flag", "ehs2.tdm_aoslos_flag",
1505 FT_BOOLEAN, 8, TFS(&ehs_tfs_secondary_header_tdm_aoslos_flag), 0x08,
1508 { &hf_ehs_sh_tdm_override_errors_flag,
1509 { "Override Errors", "ehs2.tdm_override_errors_flag",
1510 FT_BOOLEAN, 8, NULL, 0x04,
1513 { &hf_ehs_sh_tdm_data_status,
1514 { "Data Status", "ehs2.tdm_data_status",
1515 FT_UINT8, BASE_DEC, VALS(ehs_secondary_header_tdm_data_status), 0x03,
1519 { &hf_ehs_sh_tdm_idq,
1520 { "IDQ", "ehs2.tdm_idq",
1521 FT_UINT16, BASE_DEC, NULL, 0xffff,
1525 { &hf_ehs_sh_tdm_cdq,
1526 { "CDQ", "ehs2.tdm_cdq",
1527 FT_UINT16, BASE_DEC, NULL, 0xffff,
1531 { &hf_ehs_sh_tdm_adq,
1532 { "ADQ", "ehs2.tdm_adq",
1533 FT_UINT16, BASE_DEC, NULL, 0xffff,
1537 { &hf_ehs_sh_tdm_data_dq,
1538 { "Data DQ", "ehs2.tdm_data_dq",
1539 FT_UINT16, BASE_DEC, NULL, 0xffff,
1544 { &hf_ehs_sh_tdm_unused,
1545 { "Unused", "ehs2.tdm_unused",
1546 FT_UINT16, BASE_DEC, NULL, 0xffff,
1551 { &hf_ehs_sh_tdm_format_id,
1552 { "Format ID", "ehs2.tdm_format_id",
1553 FT_UINT16, BASE_HEX, NULL, 0xffff,
1557 { &hf_ehs_sh_tdm_major_frame_packet_index,
1558 { "Major Frame Packet Index", "ehs2.tdm_major_frame_packet_index",
1559 FT_UINT8, BASE_DEC, NULL, 0xff,
1563 { &hf_ehs_sh_tdm_numpkts_per_major_frame,
1564 { "Num Packets per Major Frame", "ehs2.tdm_numpkts_per_major_frame",
1565 FT_UINT8, BASE_DEC, NULL, 0xff,
1569 { &hf_ehs_sh_tdm_num_minor_frames_per_packet,
1570 { "Num Minor Frames per Packet", "ehs2.tdm_num_minor_frame_per_packet",
1571 FT_UINT8, BASE_DEC, NULL, 0xff,
1575 { &hf_ehs_sh_tdm_cntmet_present,
1576 { "CNT or MET Present", "ehs2.tdm_cntmet_present",
1577 FT_BOOLEAN, 8, NULL, 0x80,
1580 { &hf_ehs_sh_tdm_obt_present,
1581 { "OBT Present", "ehs2.tdm_obt_present",
1582 FT_BOOLEAN, 8, NULL, 0x40,
1585 { &hf_ehs_sh_tdm_major_frame_status_present,
1586 { "Major Frame Status Present", "ehs2.tdm_major_frame_status_present",
1587 FT_BOOLEAN, 8, NULL, 0x20,
1591 { &hf_ehs_sh_tdm_reserved,
1592 { "Reserved", "ehs2.tdm_reserved",
1593 FT_UINT8, BASE_DEC, NULL, 0x1f,
1598 { &hf_ehs_sh_tdm_cnt_year,
1599 { "CNT Years since 1900", "ehs2.tdm_cnt_year",
1600 FT_UINT8, BASE_DEC, NULL, 0xff,
1603 { &hf_ehs_sh_tdm_cnt_jday,
1604 { "CNT Julian Day of Year", "ehs2.tdm_cnt_jday",
1605 FT_UINT16, BASE_DEC, NULL, 0xffff,
1608 { &hf_ehs_sh_tdm_cnt_hour,
1609 { "CNT Hour", "ehs2.tdm_cnt_hour",
1610 FT_UINT8, BASE_DEC, NULL, 0xff,
1613 { &hf_ehs_sh_tdm_cnt_minute,
1614 { "CNT Minute", "ehs2.tdm_cnt_minute",
1615 FT_UINT8, BASE_DEC, NULL, 0xff,
1618 { &hf_ehs_sh_tdm_cnt_second,
1619 { "CNT Second", "ehs2.tdm_cnt_second",
1620 FT_UINT8, BASE_DEC, NULL, 0xff,
1623 { &hf_ehs_sh_tdm_cnt_tenths,
1624 { "CNT Tenths", "ehs2.tdm_cnt_tenths",
1625 FT_UINT8, BASE_DEC, NULL, 0xf0,
1629 { &hf_ehs_sh_tdm_obt_year,
1630 { "OBT Years since 1900", "ehs2.tdm_cnt_year",
1631 FT_UINT8, BASE_DEC, NULL, 0xff,
1634 { &hf_ehs_sh_tdm_obt_jday,
1635 { "OBT Julian Day of Year", "ehs2.tdm_cnt_jday",
1636 FT_UINT16, BASE_DEC, NULL, 0xffff,
1639 { &hf_ehs_sh_tdm_obt_hour,
1640 { "OBT Hour", "ehs2.tdm_cnt_hour",
1641 FT_UINT8, BASE_DEC, NULL, 0xff,
1644 { &hf_ehs_sh_tdm_obt_minute,
1645 { "OBT Minute", "ehs2.tdm_cnt_minute",
1646 FT_UINT8, BASE_DEC, NULL, 0xff,
1649 { &hf_ehs_sh_tdm_obt_second,
1650 { "OBT Second", "ehs2.tdm_cnt_second",
1651 FT_UINT8, BASE_DEC, NULL, 0xff,
1654 { &hf_ehs_sh_tdm_obt_tenths,
1655 { "OBT Tenths", "ehs2.tdm_cnt_tenths",
1656 FT_UINT8, BASE_DEC, NULL, 0xf0,
1660 { &hf_ehs_sh_tdm_obt_delta_time_flag,
1661 { "OBT is Delta Time Instead of GMT", "ehs2.tdm_obt_delta_time_flag",
1662 FT_BOOLEAN, 16, NULL, 0x8000,
1665 { &hf_ehs_sh_tdm_obt_computed_flag,
1666 { "OBT Computed", "ehs2.tdm_obt_computed_flag",
1667 FT_BOOLEAN, 16, NULL, 0x4000,
1670 { &hf_ehs_sh_tdm_obt_not_retrieved_flag,
1671 { "OBT Not Retrieved", "ehs2.tdm_obt_not_retrieved_flag",
1672 FT_BOOLEAN, 16, NULL, 0x2000,
1676 { &hf_ehs_sh_tdm_obt_reserved,
1677 { "OBT Reserved", "ehs2.tdm_obt_reserved",
1678 FT_BOOLEAN, 16, NULL, 0x1800,
1682 { &hf_ehs_sh_tdm_obt_source_apid,
1683 { "OBT Source APID", "ehs2.tdm_obt_source_apid",
1684 FT_UINT16, BASE_DEC, NULL, 0x07ff,
1688 { &hf_ehs_sh_tdm_num_major_frame_status_words,
1689 { "Number of Major Frame Status Words", "ehs2.tdm_num_major_frame_status_words",
1690 FT_UINT8, BASE_DEC, NULL, 0x0ff,
1695 { &hf_ehs_sh_tdm_mjfs_reserved,
1696 { "Reserved", "ehs2.tdm_mjfs_reserved",
1697 FT_UINT8, BASE_DEC, NULL, 0xf8,
1701 { &hf_ehs_sh_tdm_mjfs_parent_frame_error,
1702 { "Parent Frame Error", "ehs2.tdm_mjfs_parent_frame_error",
1703 FT_BOOLEAN, 8, NULL, 0x04,
1706 { &hf_ehs_sh_tdm_mjfs_checksum_error,
1707 { "Checksum Error", "ehs2.tdm_mjfs_checksum_error",
1708 FT_BOOLEAN, 8, NULL, 0x02,
1711 { &hf_ehs_sh_tdm_mjfs_fixed_value_error,
1712 { "Fixed Value Error", "ehs2.tdm_mjfs_fixed_value_error",
1713 FT_BOOLEAN, 8, NULL, 0x01,
1717 { &hf_ehs_sh_tdm_mnfs_parent_frame_error,
1718 { "Parent Frame Error", "ehs2.tdm_mnfs_parent_frame_error",
1719 FT_BOOLEAN, 8, NULL, 0x80,
1722 { &hf_ehs_sh_tdm_mnfs_data_not_available,
1723 { "Data Not Available", "ehs2.tdm_mnfs_data_not_available",
1724 FT_BOOLEAN, 8, NULL, 0x40,
1727 { &hf_ehs_sh_tdm_mnfs_checksum_error,
1728 { "Checksum Error", "ehs2.tdm_mnfs_checksum_error",
1729 FT_BOOLEAN, 8, NULL, 0x20,
1732 { &hf_ehs_sh_tdm_mnfs_fixed_value_error,
1733 { "Fixed Value Error", "ehs2.tdm_mnfs_fixed_value_error",
1734 FT_BOOLEAN, 8, NULL, 0x10,
1737 { &hf_ehs_sh_tdm_mnfs_counter_error,
1738 { "Counter Error", "ehs2.tdm_mnfs_counter_error",
1739 FT_BOOLEAN, 8, NULL, 0x08,
1742 { &hf_ehs_sh_tdm_mnfs_format_id_error,
1743 { "Format ID Error", "ehs2.tdm_mnfs_format_id_error",
1744 FT_BOOLEAN, 8, NULL, 0x04,
1747 { &hf_ehs_sh_tdm_mnfs_bit_slip_error,
1748 { "Bit Slip Error", "ehs2.tdm_mnfs_bit_slip_error",
1749 FT_BOOLEAN, 8, NULL, 0x02,
1752 { &hf_ehs_sh_tdm_mnfs_sync_error,
1753 { "Sync Error", "ehs2.tdm_mnfs_sync_error",
1754 FT_BOOLEAN, 8, NULL, 0x01,
1759 /* pseudo secondary header */
1761 { &hf_ehs_sh_pseudo_unused,
1762 { "Unused", "ehs2.pseudo_unused",
1763 FT_UINT16, BASE_DEC, NULL, 0xffff,
1767 { &hf_ehs_sh_pseudo_workstation_id,
1768 { "Workstation ID", "ehs2.pseudo_workstation_id",
1769 FT_UINT16, BASE_DEC, NULL, 0xffff,
1772 { &hf_ehs_sh_pseudo_user_id,
1773 { "User ID", "ehs2.pseudo_user_id",
1774 FT_UINT16, BASE_DEC, NULL, 0xffff,
1777 { &hf_ehs_sh_pseudo_comp_id,
1778 { "Comp ID", "ehs2.pseudo_comp_id",
1779 FT_UINT16, BASE_DEC, NULL, 0xffff,
1784 /* aos/los protocol data zone */
1785 { &hf_ehs_dz_aoslos_indicator,
1786 { "AOS/LOS Indicator", "ehs.dz.aoslos_indicator",
1787 FT_UINT8, BASE_DEC, VALS(ehs_data_zone_aoslos_indicator), 0x03,
1792 /* udsm protocol data zone */
1793 { &hf_ehs_dz_udsm_ccsds_vs_bpdu,
1794 { "CCSDS vs BPDU", "ehs.dz.udsm_ccsds_vs_bpdu",
1795 FT_UINT8, BASE_DEC, VALS(ehs_data_zone_udsm_ccsds_vs_bpdu), 0x80,
1799 { &hf_ehs_dz_udsm_unused1,
1800 { "Unused 1", "ehs.dz.udsm_unused1",
1801 FT_UINT8, BASE_DEC, NULL, 0x7f,
1805 { &hf_ehs_dz_udsm_unused2,
1806 { "Unused 2", "ehs.dz.udsm_unused2",
1807 FT_UINT8, BASE_DEC, NULL, 0xff,
1811 { &hf_ehs_dz_udsm_unused3,
1812 { "Unused 3", "ehs.dz.udsm_unused3",
1813 FT_UINT16, BASE_DEC, NULL, 0xe000,
1817 { &hf_ehs_dz_udsm_gse_pkt_id,
1818 { "GSE Pkt ID", "ehs.dz.udsm_gse_pkt_id",
1819 FT_BOOLEAN, 16, NULL, 0x1000,
1822 { &hf_ehs_dz_udsm_payload_vs_core,
1823 { "Payload vs Core", "ehs.dz.udsm_payload_vs_core",
1824 FT_UINT16, BASE_DEC, VALS(ehs_data_zone_udsm_payload_vs_core), 0x0800,
1827 { &hf_ehs_dz_udsm_apid,
1828 { "APID", "ehs.dz.udsm_apid",
1829 FT_UINT16, BASE_DEC, NULL, 0x07ff,
1833 { &hf_ehs_dz_udsm_start_time_year,
1834 { "Start Time Years since 1900", "ehs.dz.udsm_start_time_year",
1835 FT_UINT8, BASE_DEC, NULL, 0xff,
1838 { &hf_ehs_dz_udsm_start_time_jday,
1839 { "Start Time Julian Day", "ehs.dz.udsm_start_time_jday",
1840 FT_UINT16, BASE_DEC, NULL, 0xffff,
1843 { &hf_ehs_dz_udsm_start_time_hour,
1844 { "Start Time Hour", "ehs.dz.udsm_start_time_hour",
1845 FT_UINT8, BASE_DEC, NULL, 0xff,
1848 { &hf_ehs_dz_udsm_start_time_minute,
1849 { "Start Time Minute", "ehs.dz.udsm_start_time_minute",
1850 FT_UINT8, BASE_DEC, NULL, 0xff,
1853 { &hf_ehs_dz_udsm_start_time_second,
1854 { "Start Time Second", "ehs.dz.udsm_start_time_second",
1855 FT_UINT8, BASE_DEC, NULL, 0xff,
1859 { &hf_ehs_dz_udsm_stop_time_year,
1860 { "Stop Time Years since 1900", "ehs.dz.udsm_stop_time_year",
1861 FT_UINT8, BASE_DEC, NULL, 0xff,
1864 { &hf_ehs_dz_udsm_stop_time_jday,
1865 { "Stop Time Julian Day", "ehs.dz.udsm_stop_time_jday",
1866 FT_UINT16, BASE_DEC, NULL, 0xffff,
1869 { &hf_ehs_dz_udsm_stop_time_hour,
1870 { "Stop Time Hour", "ehs.dz.udsm_stop_time_hour",
1871 FT_UINT8, BASE_DEC, NULL, 0xff,
1874 { &hf_ehs_dz_udsm_stop_time_minute,
1875 { "Stop Time Minute", "ehs.dz.udsm_stop_time_minute",
1876 FT_UINT8, BASE_DEC, NULL, 0xff,
1879 { &hf_ehs_dz_udsm_stop_time_second,
1880 { "Stop Time Second", "ehs.dz.udsm_stop_time_second",
1881 FT_UINT8, BASE_DEC, NULL, 0xff,
1886 { &hf_ehs_dz_udsm_unused4,
1887 { "Unused 4", "ehs.dz.udsm_unused4",
1888 FT_UINT16, BASE_DEC, NULL, 0xffff,
1893 { &hf_ehs_dz_udsm_num_pkts_xmtd,
1894 { "Num Pkts Transmitted", "ehs.dz.udsm_num_pkts_xmtd",
1895 FT_UINT16, BASE_DEC, NULL, 0xffff,
1899 { &hf_ehs_dz_udsm_num_vcdu_seqerrs,
1900 { "Num VCDU Sequence Errors", "ehs.dz.udsm_num_vcdu_seqerrs",
1901 FT_UINT16, BASE_DEC, NULL, 0xffff,
1905 { &hf_ehs_dz_udsm_num_pkt_seqerrs,
1906 { "Num Packet Sequence Errors", "ehs.dz.udsm_num_pkt_seqerrs",
1907 FT_UINT16, BASE_DEC, NULL, 0xffff,
1911 { &hf_ehs_dz_udsm_num_pktlen_errors,
1912 { "Num Pkt Length Errors", "ehs.dz.udsm_num_pktlen_errors",
1913 FT_UINT16, BASE_DEC, NULL, 0xffff,
1917 { &hf_ehs_dz_udsm_event,
1918 { "UDSM Event Code", "ehs.dz.udsm_event",
1919 FT_UINT8, BASE_DEC, VALS(ehs_data_zone_udsm_event), 0xff,
1923 { &hf_ehs_dz_udsm_num_pkts_xmtd_rollover,
1924 { "Num Pkts Transmitted Rollover Counter", "ehs.dz.udsm_num_pkts_xmtd_rollover",
1925 FT_UINT8, BASE_DEC, NULL, 0xff,
1931 /* Setup protocol subtree array */
1932 static gint *ett[] = {
1934 &ett_ehs_primary_header,
1935 &ett_ehs_secondary_header,
1939 &ett_ehs_udsm_start_time,
1940 &ett_ehs_udsm_stop_time,
1941 &ett_ehs_ground_receipt_time,
1942 &ett_ehs_major_frame,
1943 &ett_ehs_minor_frame,
1946 /* Register the protocol name and description */
1947 proto_ehs = proto_register_protocol("EHS", "EHS", "ehs");
1949 /* Required function calls to register the header fields and subtrees used */
1950 proto_register_field_array(proto_ehs, hf, array_length(hf));
1951 proto_register_subtree_array(ett, array_length(ett));
1953 /* XX: Does this dissector need to be publicly registered ?? */
1954 register_dissector ( "ehs", dissect_ehs, proto_ehs );
1959 proto_reg_handoff_ehs(void)
1961 dissector_add_for_decode_as ( "udp.port", find_dissector("ehs") );
1962 ccsds_handle = find_dissector ( "ccsds" );
1966 * Editor modelines - http://www.wireshark.org/tools/modelines.html
1971 * indent-tabs-mode: nil
1974 * ex: set shiftwidth=2 tabstop=8 expandtab:
1975 * :indentSize=2:tabSize=8:noTabs=true: