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>
18 void proto_register_ehs(void);
19 void proto_reg_handoff_ehs(void);
21 /* Initialize the protocol and registered fields */
24 static int hf_ehs_ph_version
;
25 static int hf_ehs_ph_project
;
26 static int hf_ehs_ph_support_mode
;
27 static int hf_ehs_ph_data_mode
;
28 static int hf_ehs_ph_mission
;
29 static int hf_ehs_ph_protocol
;
31 static int hf_ehs_ph_year
; /* numeric year as years since 1900 */
32 static int hf_ehs_ph_jday
; /* julian day of year */
33 static int hf_ehs_ph_hour
;
34 static int hf_ehs_ph_minute
;
35 static int hf_ehs_ph_second
;
36 static int hf_ehs_ph_tenths
;
38 static int hf_ehs_ph_new_data_flag
; /* indicates the time has changed */
39 /* static int hf_ehs_ph_pad1; */
40 static int hf_ehs_ph_hold_flag
; /* indicates a hold condition */
41 static int hf_ehs_ph_sign_flag
; /* indicates pre-mission, i.e. countdown, time */
43 /* static int hf_ehs_ph_pad2; */
44 /* static int hf_ehs_ph_pad3; */
45 /* static int hf_ehs_ph_pad4; */
47 static int hf_ehs_ph_hosc_packet_size
;
49 /* generic ehs secondary header values */
50 static int hf_ehs_sh_version
;
51 static int hf_ehs_sh_data_status_bit_5
;
52 static int hf_ehs_sh_data_status_bit_4
;
53 static int hf_ehs_sh_data_status_bit_3
;
54 static int hf_ehs_sh_data_status_bit_2
;
55 static int hf_ehs_sh_data_status_bit_1
;
56 static int hf_ehs_sh_data_status_bit_0
;
58 /* other common remappings of the data status bits specific to certain secondary ehs header values */
59 static int hf_ehs_sh_parent_stream_error
; /* data status bit 3 */
60 static int hf_ehs_sh_vcdu_sequence_error
; /* data status bit 2 */
61 static int hf_ehs_sh_packet_sequence_error
; /* data status bit 1 */
63 /* common ehs secondary header values */
64 static int hf_ehs_sh_vcdu_sequence_number
;
65 static int hf_ehs_sh_data_stream_id
;
66 /* static int hf_ehs_sh_pdss_reserved_1; */
67 /* static int hf_ehs_sh_pdss_reserved_2; */
68 /* static int hf_ehs_sh_pdss_reserved_3; */
69 static int hf_ehs_sh_gse_pkt_id
;
70 static int hf_ehs_sh_payload_vs_core_id
;
71 static int hf_ehs_sh_apid
;
72 static int hf_ehs_sh_virtual_channel
;
73 static int hf_ehs_sh_pdss_reserved_sync
;
75 /* tdm ehs secondary header values */
76 static int hf_ehs_sh_tdm_secondary_header_length
;
78 static int hf_ehs_sh_tdm_extra_data_packet
;
79 static int hf_ehs_sh_tdm_backup_stream_id_number
;
80 static int hf_ehs_sh_tdm_end_of_data_flag
;
81 static int hf_ehs_sh_tdm_parent_frame_error
;
82 static int hf_ehs_sh_tdm_checksum_error
;
83 static int hf_ehs_sh_tdm_fixed_value_error
;
85 static int hf_ehs_sh_tdm_minor_frame_counter_error
;
86 static int hf_ehs_sh_tdm_format_id_error
;
87 static int hf_ehs_sh_tdm_bit_slip_error
;
88 static int hf_ehs_sh_tdm_sync_error
;
89 static int hf_ehs_sh_tdm_aoslos_flag
;
90 static int hf_ehs_sh_tdm_override_errors_flag
;
91 static int hf_ehs_sh_tdm_data_status
;
93 static int hf_ehs_sh_tdm_idq
;
94 static int hf_ehs_sh_tdm_cdq
;
95 static int hf_ehs_sh_tdm_adq
;
96 static int hf_ehs_sh_tdm_data_dq
;
97 /* static int hf_ehs_sh_tdm_unused; */
98 static int hf_ehs_sh_tdm_format_id
;
100 static int hf_ehs_sh_tdm_major_frame_packet_index
;
101 static int hf_ehs_sh_tdm_numpkts_per_major_frame
;
102 static int hf_ehs_sh_tdm_num_minor_frames_per_packet
;
104 static int hf_ehs_sh_tdm_cntmet_present
;
105 static int hf_ehs_sh_tdm_obt_present
;
106 static int hf_ehs_sh_tdm_major_frame_status_present
;
107 /* static int hf_ehs_sh_tdm_reserved; */
109 static int hf_ehs_sh_tdm_cnt_year
; /* numeric year as years since 1900 */
110 static int hf_ehs_sh_tdm_cnt_jday
; /* julian day of year */
111 static int hf_ehs_sh_tdm_cnt_hour
;
112 static int hf_ehs_sh_tdm_cnt_minute
;
113 static int hf_ehs_sh_tdm_cnt_second
;
114 static int hf_ehs_sh_tdm_cnt_tenths
;
116 static int hf_ehs_sh_tdm_obt_year
; /* numeric year as years since 1900 */
117 static int hf_ehs_sh_tdm_obt_jday
; /* julian day of year */
118 static int hf_ehs_sh_tdm_obt_hour
;
119 static int hf_ehs_sh_tdm_obt_minute
;
120 static int hf_ehs_sh_tdm_obt_second
;
121 static int hf_ehs_sh_tdm_obt_tenths
;
123 static int hf_ehs_sh_tdm_obt_delta_time_flag
;
124 static int hf_ehs_sh_tdm_obt_computed_flag
;
125 static int hf_ehs_sh_tdm_obt_not_retrieved_flag
;
126 /* static int hf_ehs_sh_tdm_obt_reserved; */
127 static int hf_ehs_sh_tdm_obt_source_apid
;
129 static int hf_ehs_sh_tdm_num_major_frame_status_words
;
131 /* static int hf_ehs_sh_tdm_mjfs_reserved; */
132 static int hf_ehs_sh_tdm_mjfs_parent_frame_error
;
133 static int hf_ehs_sh_tdm_mjfs_checksum_error
;
134 static int hf_ehs_sh_tdm_mjfs_fixed_value_error
;
136 static int hf_ehs_sh_tdm_mnfs_parent_frame_error
;
137 static int hf_ehs_sh_tdm_mnfs_data_not_available
;
138 static int hf_ehs_sh_tdm_mnfs_checksum_error
;
139 static int hf_ehs_sh_tdm_mnfs_fixed_value_error
;
140 static int hf_ehs_sh_tdm_mnfs_counter_error
;
141 static int hf_ehs_sh_tdm_mnfs_format_id_error
;
142 static int hf_ehs_sh_tdm_mnfs_bit_slip_error
;
143 static int hf_ehs_sh_tdm_mnfs_sync_error
;
145 /* pseudo ehs secondary header values */
146 /* static int hf_ehs_sh_pseudo_unused; */
147 static int hf_ehs_sh_pseudo_workstation_id
;
148 static int hf_ehs_sh_pseudo_user_id
;
149 static int hf_ehs_sh_pseudo_comp_id
;
151 /* data zone values for well known protocol AOS/LOS */
152 static int hf_ehs_dz_aoslos_indicator
;
154 /* data zone values for well known protocol UDSM */
155 static int hf_ehs_dz_udsm_ccsds_vs_bpdu
;
156 /* static int hf_ehs_dz_udsm_unused1; */
158 /* static int hf_ehs_dz_udsm_unused2; */
160 /* static int hf_ehs_dz_udsm_unused3; */
161 static int hf_ehs_dz_udsm_gse_pkt_id
;
162 static int hf_ehs_dz_udsm_payload_vs_core
;
163 static int hf_ehs_dz_udsm_apid
;
165 static int hf_ehs_dz_udsm_start_time_year
;
166 static int hf_ehs_dz_udsm_start_time_jday
;
167 static int hf_ehs_dz_udsm_start_time_hour
;
168 static int hf_ehs_dz_udsm_start_time_minute
;
169 static int hf_ehs_dz_udsm_start_time_second
;
171 static int hf_ehs_dz_udsm_stop_time_year
;
172 static int hf_ehs_dz_udsm_stop_time_jday
;
173 static int hf_ehs_dz_udsm_stop_time_hour
;
174 static int hf_ehs_dz_udsm_stop_time_minute
;
175 static int hf_ehs_dz_udsm_stop_time_second
;
177 /* static int hf_ehs_dz_udsm_unused4; */
179 static int hf_ehs_dz_udsm_num_pkts_xmtd
;
181 static int hf_ehs_dz_udsm_num_vcdu_seqerrs
;
183 static int hf_ehs_dz_udsm_num_pkt_seqerrs
;
185 static int hf_ehs_dz_udsm_num_pktlen_errors
;
187 static int hf_ehs_dz_udsm_event
;
189 static int hf_ehs_dz_udsm_num_pkts_xmtd_rollover
;
192 static dissector_handle_t ehs_handle
;
194 /* handle to ccsds packet dissector */
195 static dissector_handle_t ccsds_handle
;
197 /* Initialize the subtree pointers */
199 static int ett_ehs_primary_header
;
200 static int ett_ehs_secondary_header
;
201 static int ett_ehs_data_zone
;
202 static int ett_ehs_cnt_time
;
203 static int ett_ehs_obt_time
;
204 static int ett_ehs_udsm_start_time
;
205 static int ett_ehs_udsm_stop_time
;
206 static int ett_ehs_ground_receipt_time
;
207 static int ett_ehs_major_frame
;
208 static int ett_ehs_minor_frame
;
210 /* EHS protocol types */
211 typedef enum EHS_Protocol_Type
213 EHS_PROTOCOL__ALL_PROTOCOLS
,
214 EHS_PROTOCOL__TDM_TELEMETRY
,
215 EHS_PROTOCOL__NASCOM_TELEMETRY
,
216 EHS_PROTOCOL__PSEUDO_TELEMETRY
,
217 EHS_PROTOCOL__TDS_DATA
,
218 EHS_PROTOCOL__TEST_DATA
,
219 EHS_PROTOCOL__GSE_DATA
,
220 EHS_PROTOCOL__CUSTOM_DATA
,
221 EHS_PROTOCOL__HDRS_DQ
,
223 EHS_PROTOCOL__AOS_LOS
,
224 EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET
,
225 EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET
,
226 EHS_PROTOCOL__PDSS_PAYLOAD_BPDU
,
227 EHS_PROTOCOL__PDSS_UDSM
,
228 EHS_PROTOCOL__PDSS_RPSM
,
229 NUMBER_PROTOCOLS
= 15
230 } EHS_Protocol_Type_t
;
233 /* some basic sizing parameters */
236 IP_HEADER_LENGTH
= 48,
237 CCSDS_PRIMARY_HEADER_LENGTH
= 6,
238 CCSDS_SECONDARY_HEADER_LENGTH
= 10,
239 EHS_PRIMARY_HEADER_SIZE
= 16,
240 EHS_SECONDARY_HEADER_SIZE
= 12
243 /* determine if a ccsds primary header indicates a secondary exists */
244 #define HDR_SECHDR 0x0800
247 static const value_string ehs_primary_header_project
[] =
257 static const value_string ehs_primary_header_support_mode
[] =
264 { 5, "Development" },
270 static const value_string ehs_primary_header_data_mode
[] =
286 { 14, "Playback10" },
287 { 15, "Playback11" },
288 { 16, "Mode Independent" },
292 static const value_string ehs_primary_header_protocol
[] =
301 { 7, "Custom_Data" },
305 { 11, "PDSS_PAYLOAD_CCSDS" },
306 { 12, "PDSS_CORE_CCSDS" },
307 { 13, "PDSS_PAYLOAD_BPDU" },
313 static const value_string ehs_secondary_header_data_stream_id
[] =
320 static const value_string ehs_secondary_header_payload_vs_core_id
[] =
327 static const value_string ehs_secondary_header_tdm_backup_stream_id
[] =
329 { 0, "Stream A / KMTS-A" },
330 { 1, "Stream B / KMTS-B" },
335 static const value_string ehs_secondary_header_tdm_end_of_data_flag
[] =
338 { 1, "Loss of Clock" },
339 { 2, "Watchdog Timeout" },
340 { 3, "Loss of Sync" },
344 static const true_false_string ehs_tfs_secondary_header_tdm_aoslos_flag
=
350 static const value_string ehs_secondary_header_tdm_data_status
[] =
359 static const value_string ehs_data_zone_aoslos_indicator
[] =
363 { 2, "Ku-band LOS" },
364 { 3, "Ku-band AOS" },
368 static const value_string ehs_data_zone_udsm_ccsds_vs_bpdu
[] =
375 static const value_string ehs_data_zone_udsm_payload_vs_core
[] =
382 static const value_string ehs_data_zone_udsm_event
[] =
386 { 2, "Scheduled End of Data" },
387 { 3, "Operator Requested" },
392 /* function to return EHS secondary header size according to protocol.
393 * the buffer pointer tvb should be pointing to the packets ehs primary
394 * header, and the offset should be set to the start of the ehs secondary
398 ehs_secondary_header_size ( int protocol
, tvbuff_t
* tvb
, int offset
)
400 /* for most protocols the ehs secondary header is a standard size */
401 int size
= EHS_SECONDARY_HEADER_SIZE
;
405 case EHS_PROTOCOL__TDM_TELEMETRY
:
406 /* the TDM secondary header size is variable. its value is actually
407 * contained in the first two bytes of the secondary header itself.
409 size
= tvb_get_ntohs ( tvb
, offset
);
412 case EHS_PROTOCOL__NASCOM_TELEMETRY
:
415 case EHS_PROTOCOL__PSEUDO_TELEMETRY
:
419 case EHS_PROTOCOL__TDS_DATA
:
422 case EHS_PROTOCOL__TEST_DATA
:
425 case EHS_PROTOCOL__GSE_DATA
:
429 case EHS_PROTOCOL__CUSTOM_DATA
:
432 case EHS_PROTOCOL__HDRS_DQ
:
435 case EHS_PROTOCOL__CSS
:
438 case EHS_PROTOCOL__AOS_LOS
:
441 case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET
:
444 case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET
:
447 case EHS_PROTOCOL__PDSS_PAYLOAD_BPDU
:
450 case EHS_PROTOCOL__PDSS_UDSM
:
453 case EHS_PROTOCOL__PDSS_RPSM
:
465 /* common EHS secondary header dissector */
467 common_secondary_header_dissector ( proto_tree
* ehs_secondary_header_tree
, tvbuff_t
* tvb
, int* offset
)
469 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_vcdu_sequence_number
, tvb
, *offset
, 3, ENC_BIG_ENDIAN
);
472 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_stream_id
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
473 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_1, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
476 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_2, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
479 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pdss_reserved_3, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
480 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_gse_pkt_id
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
481 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_payload_vs_core_id
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
482 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_apid
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
485 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_virtual_channel
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
488 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_pdss_reserved_sync
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
494 /* AOS/LOS EHS secondary header dissector */
496 aoslos_secondary_header_dissector ( proto_tree
* ehs_secondary_header_tree
, tvbuff_t
* tvb
, int* offset
)
498 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_version
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
499 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_5
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
500 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_4
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
501 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_3
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
502 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_2
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
503 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_1
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
504 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_0
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
507 common_secondary_header_dissector ( ehs_secondary_header_tree
, tvb
, offset
);
511 /* payload ccsds secondary header dissector */
513 payload_ccsds_secondary_header_dissector ( proto_tree
* ehs_secondary_header_tree
, tvbuff_t
* tvb
, int* offset
)
515 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_version
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
516 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_5
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
517 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_4
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
518 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_3
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
519 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_vcdu_sequence_error
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
520 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_packet_sequence_error
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
521 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_0
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
524 common_secondary_header_dissector ( ehs_secondary_header_tree
, tvb
, offset
);
528 /* core ccsds secondary header dissector */
530 core_ccsds_secondary_header_dissector ( proto_tree
* ehs_secondary_header_tree
, tvbuff_t
* tvb
, int* offset
)
532 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_version
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
533 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_5
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
534 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_4
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
535 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_parent_stream_error
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
536 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_vcdu_sequence_error
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
537 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_packet_sequence_error
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
538 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_0
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
541 common_secondary_header_dissector ( ehs_secondary_header_tree
, tvb
, offset
);
545 /* payload bpdu secondary header dissector */
547 payload_bpdu_secondary_header_dissector ( proto_tree
* ehs_secondary_header_tree
, tvbuff_t
* tvb
, int* offset
)
549 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_version
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
550 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_5
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
551 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_4
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
552 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_3
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
553 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_vcdu_sequence_error
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
554 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_1
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
555 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_0
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
558 common_secondary_header_dissector ( ehs_secondary_header_tree
, tvb
, offset
);
562 /* udsm secondary header dissector */
564 udsm_secondary_header_dissector ( proto_tree
* ehs_secondary_header_tree
, tvbuff_t
* tvb
, int* offset
)
566 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_version
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
567 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_5
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
568 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_4
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
569 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_3
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
570 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_2
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
571 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_1
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
572 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_data_status_bit_0
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
575 common_secondary_header_dissector ( ehs_secondary_header_tree
, tvb
, offset
);
579 /* tdm secondary header dissector */
581 tdm_secondary_header_dissector ( proto_tree
* ehs_secondary_header_tree
, tvbuff_t
* tvb
, int* offset
)
584 int num_major_frames
= 0;
585 int num_minor_frames
= 0;
586 int cntmet_present
= 0;
588 int mjfs_present
= 0;
590 proto_tree
* time_tree
;
591 proto_item
* time_item
;
592 int year
, jday
, hour
, minute
, second
, tenths
;
594 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_secondary_header_length
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
597 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_extra_data_packet
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
598 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_backup_stream_id_number
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
599 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_end_of_data_flag
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
600 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_parent_frame_error
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
601 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_checksum_error
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
602 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_fixed_value_error
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
605 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_minor_frame_counter_error
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
606 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_format_id_error
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
607 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_bit_slip_error
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
608 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_sync_error
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
609 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_aoslos_flag
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
610 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_override_errors_flag
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
611 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_data_status
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
614 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_idq
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
617 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_cdq
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
620 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_adq
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
623 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_data_dq
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
626 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_unused, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
629 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_format_id
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
632 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_major_frame_packet_index
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
635 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_numpkts_per_major_frame
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
638 num_minor_frames
= 1 + tvb_get_uint8 ( tvb
, *offset
);
639 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_num_minor_frames_per_packet
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
642 cntmet_present
= tvb_get_uint8 ( tvb
, *offset
) & 0x80;
643 obt_present
= tvb_get_uint8 ( tvb
, *offset
) & 0x40;
644 mjfs_present
= tvb_get_uint8 ( tvb
, *offset
) & 0x20;
645 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_cntmet_present
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
646 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_obt_present
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
647 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_major_frame_status_present
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
648 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_reserved, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
651 if ( cntmet_present
)
653 time_tree
= proto_tree_add_subtree(ehs_secondary_header_tree
, tvb
, *offset
, 7, ett_ehs_cnt_time
, &time_item
, "CNT/MET Time: ");
655 year
= tvb_get_uint8 ( tvb
, *offset
);
656 proto_tree_add_item ( time_tree
, hf_ehs_sh_tdm_cnt_year
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
659 jday
= tvb_get_ntohs ( tvb
, *offset
);
660 proto_tree_add_item ( time_tree
, hf_ehs_sh_tdm_cnt_jday
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
663 hour
= tvb_get_uint8 ( tvb
, *offset
);
664 proto_tree_add_item ( time_tree
, hf_ehs_sh_tdm_cnt_hour
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
667 minute
= tvb_get_uint8 ( tvb
, *offset
);
668 proto_tree_add_item ( time_tree
, hf_ehs_sh_tdm_cnt_minute
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
671 second
= tvb_get_uint8 ( tvb
, *offset
);
672 proto_tree_add_item ( time_tree
, hf_ehs_sh_tdm_cnt_second
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
675 tenths
= tvb_get_uint8 ( tvb
, *offset
) >> 4;
676 proto_tree_add_item ( time_tree
, hf_ehs_sh_tdm_cnt_tenths
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
679 /* format a more readable time */
680 proto_item_append_text(time_item
, "%04d/%03d:%02d:%02d:%02d.%1d", year
+ 1900, jday
, hour
, minute
, second
, tenths
);
686 time_tree
= proto_tree_add_subtree(ehs_secondary_header_tree
, tvb
, *offset
, 7, ett_ehs_obt_time
, &time_item
, "OBT Time: ");
688 year
= tvb_get_uint8 ( tvb
, *offset
);
689 proto_tree_add_item ( time_tree
, hf_ehs_sh_tdm_obt_year
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
692 jday
= tvb_get_ntohs ( tvb
, *offset
);
693 proto_tree_add_item ( time_tree
, hf_ehs_sh_tdm_obt_jday
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
696 hour
= tvb_get_uint8 ( tvb
, *offset
);
697 proto_tree_add_item ( time_tree
, hf_ehs_sh_tdm_obt_hour
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
700 minute
= tvb_get_uint8 ( tvb
, *offset
);
701 proto_tree_add_item ( time_tree
, hf_ehs_sh_tdm_obt_minute
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
704 second
= tvb_get_uint8 ( tvb
, *offset
);
705 proto_tree_add_item ( time_tree
, hf_ehs_sh_tdm_obt_second
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
708 tenths
= tvb_get_uint8 ( tvb
, *offset
) >> 4;
709 proto_tree_add_item ( time_tree
, hf_ehs_sh_tdm_obt_tenths
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
712 /* format a more readable time */
713 proto_item_append_text ( time_item
, "%04d/%03d:%02d:%02d:%02d.%1d", year
+ 1900, jday
, hour
, minute
, second
, tenths
);
715 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_obt_delta_time_flag
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
716 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_obt_computed_flag
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
717 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_obt_not_retrieved_flag
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
718 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_tdm_obt_reserved, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
719 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_obt_source_apid
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
724 num_major_frames
= 1 + tvb_get_uint8 ( tvb
, *offset
);
725 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_tdm_num_major_frame_status_words
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
728 for ( j
=0; j
< num_major_frames
; ++j
)
730 proto_tree
* major_tree
;
731 static int * const major_fields
[] = {
732 /* &hf_ehs_sh_tdm_mjfs_reserved, */
733 &hf_ehs_sh_tdm_mjfs_parent_frame_error
,
734 &hf_ehs_sh_tdm_mjfs_checksum_error
,
735 &hf_ehs_sh_tdm_mjfs_fixed_value_error
,
739 major_tree
= proto_tree_add_subtree_format( ehs_secondary_header_tree
, tvb
, *offset
, 1, ett_ehs_major_frame
, NULL
, "Major Frame Status Byte# %d", j
);
740 proto_tree_add_bitmask_list(major_tree
, tvb
, *offset
, 1, major_fields
, ENC_BIG_ENDIAN
);
745 for ( j
=0; j
< num_minor_frames
; ++j
)
747 proto_tree
* minor_tree
;
748 static int * const minor_fields
[] = {
749 &hf_ehs_sh_tdm_mnfs_parent_frame_error
,
750 &hf_ehs_sh_tdm_mnfs_data_not_available
,
751 &hf_ehs_sh_tdm_mnfs_checksum_error
,
752 &hf_ehs_sh_tdm_mnfs_fixed_value_error
,
753 &hf_ehs_sh_tdm_mnfs_counter_error
,
754 &hf_ehs_sh_tdm_mnfs_format_id_error
,
755 &hf_ehs_sh_tdm_mnfs_bit_slip_error
,
756 &hf_ehs_sh_tdm_mnfs_sync_error
,
760 minor_tree
= proto_tree_add_subtree_format( ehs_secondary_header_tree
, tvb
, *offset
, 1, ett_ehs_minor_frame
, NULL
, "Minor Frame Status Byte# %d", j
);
761 proto_tree_add_bitmask_list(minor_tree
, tvb
, *offset
, 1, minor_fields
, ENC_BIG_ENDIAN
);
768 /* pseudo secondary header dissector */
770 pseudo_secondary_header_dissector ( proto_tree
* ehs_secondary_header_tree
, tvbuff_t
* tvb
, int* offset
)
772 /* proto_tree_add_item ( ehs_secondary_header_tree, hf_ehs_sh_pseudo_unused, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
775 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_pseudo_workstation_id
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
778 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_pseudo_user_id
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
781 proto_tree_add_item ( ehs_secondary_header_tree
, hf_ehs_sh_pseudo_comp_id
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
789 /* EHS secondary header dissector */
791 ehs_secondary_header_dissector ( int protocol
, proto_tree
* ehs_secondary_header_tree
, tvbuff_t
* tvb
, int* offset
)
793 /* the ehs secondary header structure is potentially different for each and every
794 * protocol type, including its size. we support certain protocols but not all.
795 * for those protocols which are not supported we simply increment the offset
796 * and return. support for these other protocols can easily be added at a later
797 * time if and when it becomes necessary to do so. but for right now, we're only
798 * going to dissect those protocols that we work with on a regular basis in pdss.
802 case EHS_PROTOCOL__TDM_TELEMETRY
:
803 tdm_secondary_header_dissector ( ehs_secondary_header_tree
, tvb
, offset
);
806 case EHS_PROTOCOL__NASCOM_TELEMETRY
:
807 *offset
+= ehs_secondary_header_size ( protocol
, tvb
, *offset
);
810 case EHS_PROTOCOL__PSEUDO_TELEMETRY
:
811 pseudo_secondary_header_dissector ( ehs_secondary_header_tree
, tvb
, offset
);
814 case EHS_PROTOCOL__TDS_DATA
:
815 *offset
+= ehs_secondary_header_size ( protocol
, tvb
, *offset
);
818 case EHS_PROTOCOL__TEST_DATA
:
819 *offset
+= ehs_secondary_header_size ( protocol
, tvb
, *offset
);
822 case EHS_PROTOCOL__GSE_DATA
:
823 *offset
+= ehs_secondary_header_size ( protocol
, tvb
, *offset
);
826 case EHS_PROTOCOL__CUSTOM_DATA
:
827 *offset
+= ehs_secondary_header_size ( protocol
, tvb
, *offset
);
830 case EHS_PROTOCOL__HDRS_DQ
:
831 *offset
+= ehs_secondary_header_size ( protocol
, tvb
, *offset
);
834 case EHS_PROTOCOL__CSS
:
835 *offset
+= ehs_secondary_header_size ( protocol
, tvb
, *offset
);
838 case EHS_PROTOCOL__AOS_LOS
:
839 aoslos_secondary_header_dissector ( ehs_secondary_header_tree
, tvb
, offset
);
842 case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET
:
843 payload_ccsds_secondary_header_dissector ( ehs_secondary_header_tree
, tvb
, offset
);
846 case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET
:
847 core_ccsds_secondary_header_dissector ( ehs_secondary_header_tree
, tvb
, offset
);
850 case EHS_PROTOCOL__PDSS_PAYLOAD_BPDU
:
851 payload_bpdu_secondary_header_dissector ( ehs_secondary_header_tree
, tvb
, offset
);
854 case EHS_PROTOCOL__PDSS_UDSM
:
855 udsm_secondary_header_dissector ( ehs_secondary_header_tree
, tvb
, offset
);
858 case EHS_PROTOCOL__PDSS_RPSM
:
859 *offset
+= ehs_secondary_header_size ( protocol
, tvb
, *offset
);
863 *offset
+= ehs_secondary_header_size ( protocol
, tvb
, *offset
);
869 /* AOS/LOS data zone dissector */
871 aoslos_data_zone_dissector ( proto_tree
* ehs_tree
, tvbuff_t
* tvb
, int* offset
, packet_info
* pinfo _U_
)
873 proto_tree
*ehs_data_zone_tree
;
875 /* create the data zone tree */
876 ehs_data_zone_tree
= proto_tree_add_subtree( ehs_tree
, tvb
, *offset
, tvb_reported_length(tvb
) - *offset
,
877 ett_ehs_data_zone
, NULL
, "AOS/LOS Data Zone" );
879 /* since the aos/los EHS packet data zone is well known, format it for display as well
881 * The AOS/LOS packet data zone is only 2 bytes in
882 * length and only 2 bits in the first byte are
883 * meaningful -- Ku band or S band and AOS or LOS
886 * 1-0 - band + AOS/LOS indicator
888 * bit 1 - 0=sband 1=kuband
889 * bit 0 - 0=LOS 1=AOS
896 proto_tree_add_item ( ehs_data_zone_tree
, hf_ehs_dz_aoslos_indicator
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
901 /* UDSM data zone dissector */
903 udsm_data_zone_dissector ( proto_tree
* ehs_tree
, tvbuff_t
* tvb
, int* offset
, packet_info
* pinfo _U_
)
905 proto_tree
*ehs_data_zone_tree
;
907 proto_tree
* time_tree
;
908 proto_item
* time_item
;
909 int year
, jday
, hour
, minute
, second
;
911 /* create the data zone tree */
912 ehs_data_zone_tree
= proto_tree_add_subtree( ehs_tree
, tvb
, *offset
, tvb_reported_length(tvb
) - *offset
,
913 ett_ehs_data_zone
, NULL
, "UDSM Data Zone" );
915 proto_tree_add_item ( ehs_data_zone_tree
, hf_ehs_dz_udsm_ccsds_vs_bpdu
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
916 /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused1, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
919 /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused2, tvb, *offset, 1, ENC_BIG_ENDIAN ); */
922 /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused3, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
923 proto_tree_add_item ( ehs_data_zone_tree
, hf_ehs_dz_udsm_gse_pkt_id
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
924 proto_tree_add_item ( ehs_data_zone_tree
, hf_ehs_dz_udsm_payload_vs_core
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
925 proto_tree_add_item ( ehs_data_zone_tree
, hf_ehs_dz_udsm_apid
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
928 time_tree
= proto_tree_add_subtree(ehs_data_zone_tree
, tvb
, *offset
, 7, ett_ehs_udsm_start_time
, &time_item
, "UDSM Start Time: ");
929 year
= tvb_get_uint8 ( tvb
, *offset
);
930 proto_tree_add_item ( time_tree
, hf_ehs_dz_udsm_start_time_year
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
933 jday
= tvb_get_ntohs ( tvb
, *offset
);
934 proto_tree_add_item ( time_tree
, hf_ehs_dz_udsm_start_time_jday
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
937 hour
= tvb_get_uint8 ( tvb
, *offset
);
938 proto_tree_add_item ( time_tree
, hf_ehs_dz_udsm_start_time_hour
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
941 minute
= tvb_get_uint8 ( tvb
, *offset
);
942 proto_tree_add_item ( time_tree
, hf_ehs_dz_udsm_start_time_minute
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
945 second
= tvb_get_uint8 ( tvb
, *offset
);
946 proto_tree_add_item ( time_tree
, hf_ehs_dz_udsm_start_time_second
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
949 /* format a more readable time */
950 proto_item_append_text( time_item
, "%04d/%03d:%02d:%02d:%02d = UDSM Start Time", year
+ 1900, jday
, hour
, minute
, second
);
952 time_tree
= proto_tree_add_subtree(ehs_data_zone_tree
, tvb
, *offset
, 7, ett_ehs_udsm_stop_time
, &time_item
, "UDSM Stop Time: ");
953 year
= tvb_get_uint8 ( tvb
, *offset
);
954 proto_tree_add_item ( time_tree
, hf_ehs_dz_udsm_stop_time_year
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
957 jday
= tvb_get_ntohs ( tvb
, *offset
);
958 proto_tree_add_item ( time_tree
, hf_ehs_dz_udsm_stop_time_jday
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
961 hour
= tvb_get_uint8 ( tvb
, *offset
);
962 proto_tree_add_item ( time_tree
, hf_ehs_dz_udsm_stop_time_hour
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
965 minute
= tvb_get_uint8 ( tvb
, *offset
);
966 proto_tree_add_item ( time_tree
, hf_ehs_dz_udsm_stop_time_minute
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
969 second
= tvb_get_uint8 ( tvb
, *offset
);
970 proto_tree_add_item ( time_tree
, hf_ehs_dz_udsm_stop_time_second
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
973 /* format a more readable time */
974 proto_item_append_text ( time_item
, "%04d/%03d:%02d:%02d:%02d", year
+ 1900, jday
, hour
, minute
, second
);
976 /* proto_tree_add_item ( ehs_data_zone_tree, hf_ehs_dz_udsm_unused4, tvb, *offset, 2, ENC_BIG_ENDIAN ); */
979 proto_tree_add_item ( ehs_data_zone_tree
, hf_ehs_dz_udsm_num_pkts_xmtd
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
982 proto_tree_add_item ( ehs_data_zone_tree
, hf_ehs_dz_udsm_num_vcdu_seqerrs
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
985 proto_tree_add_item ( ehs_data_zone_tree
, hf_ehs_dz_udsm_num_pkt_seqerrs
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
988 proto_tree_add_item ( ehs_data_zone_tree
, hf_ehs_dz_udsm_num_pktlen_errors
, tvb
, *offset
, 2, ENC_BIG_ENDIAN
);
991 proto_tree_add_item ( ehs_data_zone_tree
, hf_ehs_dz_udsm_event
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
994 proto_tree_add_item ( ehs_data_zone_tree
, hf_ehs_dz_udsm_num_pkts_xmtd_rollover
, tvb
, *offset
, 1, ENC_BIG_ENDIAN
);
1000 /* data zone dissector */
1002 ehs_data_zone_dissector ( int protocol
, proto_tree
* ehs_tree
, tvbuff_t
* tvb
, int* offset
, packet_info
* pinfo
)
1004 /* the data zone of certain protocols such as AOS/LOS and UDSM is well known.
1008 case EHS_PROTOCOL__TDM_TELEMETRY
:
1011 case EHS_PROTOCOL__NASCOM_TELEMETRY
:
1014 case EHS_PROTOCOL__PSEUDO_TELEMETRY
:
1017 case EHS_PROTOCOL__TDS_DATA
:
1020 case EHS_PROTOCOL__TEST_DATA
:
1023 case EHS_PROTOCOL__GSE_DATA
:
1026 case EHS_PROTOCOL__CUSTOM_DATA
:
1029 case EHS_PROTOCOL__HDRS_DQ
:
1032 case EHS_PROTOCOL__CSS
:
1035 case EHS_PROTOCOL__AOS_LOS
:
1036 aoslos_data_zone_dissector ( ehs_tree
, tvb
, offset
, pinfo
);
1039 case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET
:
1042 case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET
:
1045 case EHS_PROTOCOL__PDSS_PAYLOAD_BPDU
:
1048 case EHS_PROTOCOL__PDSS_UDSM
:
1049 udsm_data_zone_dissector ( ehs_tree
, tvb
, offset
, pinfo
);
1052 case EHS_PROTOCOL__PDSS_RPSM
:
1061 /* Code to actually dissect the packets */
1063 dissect_ehs(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
1066 uint16_t first_word
;
1070 proto_item
*ehs_packet
;
1071 proto_tree
*ehs_tree
;
1073 proto_tree
* time_tree
;
1074 proto_item
* time_item
;
1075 proto_tree
*ehs_primary_header_tree
;
1076 proto_tree
*ehs_secondary_header_tree
;
1079 int year
, jday
, hour
, minute
, second
, tenths
;
1081 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "EHS");
1082 col_set_str(pinfo
->cinfo
, COL_INFO
, "EHS");
1084 ehs_packet
= proto_tree_add_item ( tree
, proto_ehs
, tvb
, 0, -1, ENC_NA
);
1085 ehs_tree
= proto_item_add_subtree ( ehs_packet
, ett_ehs
);
1087 /* build the ehs primary header tree */
1088 ehs_primary_header_tree
= proto_tree_add_subtree( ehs_tree
, tvb
, offset
, EHS_PRIMARY_HEADER_SIZE
,
1089 ett_ehs_primary_header
, NULL
, "Primary EHS Header" );
1091 proto_tree_add_item ( ehs_primary_header_tree
, hf_ehs_ph_version
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1092 proto_tree_add_item ( ehs_primary_header_tree
, hf_ehs_ph_project
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1095 proto_tree_add_item ( ehs_primary_header_tree
, hf_ehs_ph_support_mode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1096 proto_tree_add_item ( ehs_primary_header_tree
, hf_ehs_ph_data_mode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1099 proto_tree_add_item ( ehs_primary_header_tree
, hf_ehs_ph_mission
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1102 /* save protocol for use later on */
1103 protocol
= tvb_get_uint8 ( tvb
, offset
);
1104 proto_tree_add_item ( ehs_primary_header_tree
, hf_ehs_ph_protocol
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1107 time_tree
= proto_tree_add_subtree(ehs_primary_header_tree
, tvb
, offset
, 7, ett_ehs_ground_receipt_time
, &time_item
, "EHS Ground Receipt Time: ");
1108 year
= tvb_get_uint8 ( tvb
, offset
);
1109 proto_tree_add_item ( time_tree
, hf_ehs_ph_year
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1112 jday
= tvb_get_ntohs ( tvb
, offset
);
1113 proto_tree_add_item ( time_tree
, hf_ehs_ph_jday
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1116 hour
= tvb_get_uint8 ( tvb
, offset
);
1117 proto_tree_add_item ( time_tree
, hf_ehs_ph_hour
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1120 minute
= tvb_get_uint8 ( tvb
, offset
);
1121 proto_tree_add_item ( time_tree
, hf_ehs_ph_minute
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1124 second
= tvb_get_uint8 ( tvb
, offset
);
1125 proto_tree_add_item ( time_tree
, hf_ehs_ph_second
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1128 tenths
= tvb_get_uint8 ( tvb
, offset
) >> 4;
1129 proto_tree_add_item ( time_tree
, hf_ehs_ph_tenths
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1131 /* format a more readable ground receipt time string */
1132 proto_item_append_text ( time_item
, "%04d/%03d:%02d:%02d:%02d.%1d", year
+ 1900, jday
, hour
, minute
, second
, tenths
);
1134 proto_tree_add_item ( ehs_primary_header_tree
, hf_ehs_ph_new_data_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1135 /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad1, tvb, offset, 1, ENC_BIG_ENDIAN ); */
1136 proto_tree_add_item ( ehs_primary_header_tree
, hf_ehs_ph_hold_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1137 proto_tree_add_item ( ehs_primary_header_tree
, hf_ehs_ph_sign_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1140 /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad2, tvb, offset, 1, ENC_BIG_ENDIAN ); */
1142 /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad3, tvb, offset, 1, ENC_BIG_ENDIAN ); */
1144 /* proto_tree_add_item ( ehs_primary_header_tree, hf_ehs_ph_pad4, tvb, offset, 1, ENC_BIG_ENDIAN ); */
1147 proto_tree_add_item ( ehs_primary_header_tree
, hf_ehs_ph_hosc_packet_size
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
1150 /* build the ehs secondary header tree */
1151 ehs_secondary_header_tree
= proto_tree_add_subtree( ehs_tree
, tvb
, offset
, ehs_secondary_header_size ( protocol
, tvb
, offset
),
1152 ett_ehs_secondary_header
, NULL
, "Secondary EHS Header" );
1154 /* since each protocol can have a different ehs secondary header structure, we will offload
1155 * this processing to lower levels of code so we don't have to insert all of that complexity
1156 * directly inline here, which would no doubt make this difficult to read at best.
1158 ehs_secondary_header_dissector ( protocol
, ehs_secondary_header_tree
, tvb
, &offset
);
1160 /* for ccsds protocol types pass the remaining packet off to the ccsds packet dissector */
1163 case EHS_PROTOCOL__TDM_TELEMETRY
:
1164 case EHS_PROTOCOL__PSEUDO_TELEMETRY
:
1165 case EHS_PROTOCOL__AOS_LOS
:
1166 case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET
:
1167 case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET
:
1168 case EHS_PROTOCOL__PDSS_UDSM
:
1169 new_tvb
= tvb_new_subset_remaining ( tvb
, offset
);
1170 call_dissector ( ccsds_handle
, new_tvb
, pinfo
, ehs_tree
);
1172 /* bump the offset to the data zone area */
1173 first_word
= tvb_get_ntohs ( tvb
, offset
);
1175 offset
+= CCSDS_PRIMARY_HEADER_LENGTH
;
1176 if ( first_word
& HDR_SECHDR
) offset
+= CCSDS_SECONDARY_HEADER_LENGTH
;
1184 /* build the ehs data zone tree for well known protocols such as AOS/LOS and UDSM */
1185 ehs_data_zone_dissector ( protocol
, ehs_tree
, tvb
, &offset
, pinfo
);
1187 return tvb_captured_length(tvb
);
1191 /* Register the protocol with Wireshark
1192 * this format is require because a script is used to build the C function
1193 * that calls all the protocol registration.
1196 proto_register_ehs(void)
1198 /* Setup list of header fields See Section 1.6.1 for details*/
1199 static hf_register_info hf
[] =
1201 /* primary ehs header */
1202 { &hf_ehs_ph_version
,
1203 { "Version", "ehs.version",
1204 FT_UINT8
, BASE_DEC
, NULL
, 0xf0,
1207 { &hf_ehs_ph_project
,
1208 { "Project", "ehs.project",
1209 FT_UINT8
, BASE_DEC
, VALS(ehs_primary_header_project
), 0x0f,
1213 { &hf_ehs_ph_support_mode
,
1214 { "Support Mode", "ehs.support_mode",
1215 FT_UINT8
, BASE_DEC
, VALS(ehs_primary_header_support_mode
), 0xf0,
1218 { &hf_ehs_ph_data_mode
,
1219 { "Data Mode", "ehs.data_mode",
1220 FT_UINT8
, BASE_DEC
, VALS(ehs_primary_header_data_mode
), 0x0f,
1224 { &hf_ehs_ph_mission
,
1225 { "Mission", "ehs.mission",
1226 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1230 { &hf_ehs_ph_protocol
,
1231 { "Protocol", "ehs.protocol",
1232 FT_UINT8
, BASE_DEC
, VALS(ehs_primary_header_protocol
), 0x0,
1237 { "Years since 1900", "ehs.year",
1238 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1243 { "Julian Day of Year", "ehs.jday",
1244 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1249 { "Hour", "ehs.hour",
1250 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1254 { &hf_ehs_ph_minute
,
1255 { "Minute", "ehs.minute",
1256 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1260 { &hf_ehs_ph_second
,
1261 { "Second", "ehs.second",
1262 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1266 { &hf_ehs_ph_tenths
,
1267 { "Tenths", "ehs.tenths",
1268 FT_UINT8
, BASE_DEC
, NULL
, 0xf0,
1271 { &hf_ehs_ph_new_data_flag
,
1272 { "New Data Flag", "ehs.new_data_flag",
1273 FT_BOOLEAN
, 8, NULL
, 0x08,
1278 { "Pad1", "ehs.pad1",
1279 FT_UINT8
, BASE_DEC
, NULL
, 0x04,
1283 { &hf_ehs_ph_hold_flag
,
1284 { "Hold Flag", "ehs.hold_flag",
1285 FT_BOOLEAN
, 8, NULL
, 0x02,
1288 { &hf_ehs_ph_sign_flag
,
1289 { "Sign Flag (1->CDT)", "ehs.sign_flag",
1290 FT_UINT8
, BASE_DEC
, NULL
, 0x01,
1296 { "Pad2", "ehs.pad2",
1297 FT_UINT8
, BASE_DEC
, NULL
, 0xff,
1302 { "Pad3", "ehs.pad3",
1303 FT_UINT8
, BASE_DEC
, NULL
, 0xff,
1308 { "Pad4", "ehs.pad4",
1309 FT_UINT8
, BASE_DEC
, NULL
, 0xff,
1314 { &hf_ehs_ph_hosc_packet_size
,
1315 { "HOSC Packet Size", "ehs.hosc_packet_size",
1316 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1321 /* secondary ehs header */
1322 { &hf_ehs_sh_version
,
1323 { "Version", "ehs2.version",
1324 FT_UINT8
, BASE_DEC
, NULL
, 0xc0,
1327 { &hf_ehs_sh_data_status_bit_5
,
1328 { "Data Status Bit 5", "ehs2.data_status_bit_5",
1329 FT_UINT8
, BASE_DEC
, NULL
, 0x20,
1332 { &hf_ehs_sh_data_status_bit_4
,
1333 { "Data Status Bit 4", "ehs2.data_status_bit_4",
1334 FT_UINT8
, BASE_DEC
, NULL
, 0x10,
1337 { &hf_ehs_sh_data_status_bit_3
,
1338 { "Data Status Bit 3", "ehs2.data_status_bit_3",
1339 FT_UINT8
, BASE_DEC
, NULL
, 0x08,
1342 { &hf_ehs_sh_data_status_bit_2
,
1343 { "Data Status Bit 2", "ehs2.data_status_bit_2",
1344 FT_UINT8
, BASE_DEC
, NULL
, 0x04,
1347 { &hf_ehs_sh_data_status_bit_1
,
1348 { "Data Status Bit 1", "ehs2.data_status_bit_1",
1349 FT_UINT8
, BASE_DEC
, NULL
, 0x02,
1352 { &hf_ehs_sh_data_status_bit_0
,
1353 { "Data Status Bit 0", "ehs2.data_status_bit_0",
1354 FT_UINT8
, BASE_DEC
, NULL
, 0x01,
1359 /* other common remappings of the data status bits specific to certain secondary ehs header values */
1360 { &hf_ehs_sh_parent_stream_error
,
1361 { "Parent Stream Error", "ehs2.parent_stream_error",
1362 FT_BOOLEAN
, 8, NULL
, 0x08,
1365 { &hf_ehs_sh_vcdu_sequence_error
,
1366 { "VCDU Sequence Error", "ehs2.vcdu_sequence_error",
1367 FT_BOOLEAN
, 8, NULL
, 0x04,
1370 { &hf_ehs_sh_packet_sequence_error
,
1371 { "Packet Sequence Error", "ehs2.packet_sequence_error",
1372 FT_UINT8
, BASE_DEC
, NULL
, 0x02,
1377 /* common ehs secondary header values */
1378 { &hf_ehs_sh_vcdu_sequence_number
,
1379 { "VCDU Sequence Number", "ehs2.vcdu_seqno",
1380 FT_UINT24
, BASE_DEC
, NULL
, 0x0,
1384 { &hf_ehs_sh_data_stream_id
,
1385 { "Data Stream ID", "ehs2.data_stream_id",
1386 FT_UINT8
, BASE_DEC
, VALS(ehs_secondary_header_data_stream_id
), 0x80,
1390 { &hf_ehs_sh_pdss_reserved_1
,
1391 { "Pdss Reserved 1", "ehs2.pdss_reserved_1",
1392 FT_UINT8
, BASE_DEC
, NULL
, 0x7f,
1396 { &hf_ehs_sh_pdss_reserved_2
,
1397 { "Pdss Reserved 2", "ehs2.pdss_reserved_2",
1398 FT_UINT8
, BASE_DEC
, NULL
, 0xff,
1402 { &hf_ehs_sh_pdss_reserved_3
,
1403 { "Pdss Reserved 3", "ehs2.pdss_reserved_3",
1404 FT_UINT16
, BASE_DEC
, NULL
, 0xe000,
1408 { &hf_ehs_sh_gse_pkt_id
,
1409 { "GSE Packet ID (1=GSE)", "ehs2.gse_pkt_id",
1410 FT_UINT16
, BASE_DEC
, NULL
, 0x1000,
1413 { &hf_ehs_sh_payload_vs_core_id
,
1414 { "Payload vs Core ID", "ehs2.payload_vs_core_id",
1415 FT_UINT16
, BASE_DEC
, VALS(ehs_secondary_header_payload_vs_core_id
), 0x0800,
1419 { "APID", "ehs2.apid",
1420 FT_UINT16
, BASE_DEC
, NULL
, 0x07ff,
1424 { &hf_ehs_sh_virtual_channel
,
1425 { "Virtual Channel", "ehs2.vcid",
1426 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1430 { &hf_ehs_sh_pdss_reserved_sync
,
1431 { "Pdss Reserved Sync", "ehs2.sync",
1432 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1437 /* tdm ehs secondary header values */
1438 { &hf_ehs_sh_tdm_secondary_header_length
,
1439 { "Secondary Header Length", "ehs2.tdm_secondary_header_length",
1440 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1444 { &hf_ehs_sh_tdm_extra_data_packet
,
1445 { "Extra Data Packet", "ehs2.tdm_extra_data_packet",
1446 FT_BOOLEAN
, 8, NULL
, 0x80,
1449 { &hf_ehs_sh_tdm_backup_stream_id_number
,
1450 { "Backup Stream ID Number", "ehs2.tdm_backup_stream_id_number",
1451 FT_UINT8
, BASE_DEC
, VALS(ehs_secondary_header_tdm_backup_stream_id
), 0x60,
1454 { &hf_ehs_sh_tdm_end_of_data_flag
,
1455 { "End of Data Flag", "ehs2.tdm_end_of_data_flag",
1456 FT_UINT8
, BASE_DEC
, VALS(ehs_secondary_header_tdm_end_of_data_flag
), 0x18,
1459 { &hf_ehs_sh_tdm_parent_frame_error
,
1460 { "Parent Frame Error", "ehs2.tdm_parent_frame_error",
1461 FT_BOOLEAN
, 8, NULL
, 0x04,
1464 { &hf_ehs_sh_tdm_checksum_error
,
1465 { "Checksum Error", "ehs2.tdm_checksum_error",
1466 FT_BOOLEAN
, 8, NULL
, 0x02,
1469 { &hf_ehs_sh_tdm_fixed_value_error
,
1470 { "Fixed Value Error", "ehs2.tdm_fixed_value_error",
1471 FT_BOOLEAN
, 8, NULL
, 0x01,
1475 { &hf_ehs_sh_tdm_minor_frame_counter_error
,
1476 { "Minor Frame Counter Error", "ehs2.tdm_minor_frame_counter_error",
1477 FT_BOOLEAN
, 8, NULL
, 0x80,
1480 { &hf_ehs_sh_tdm_format_id_error
,
1481 { "Format ID Error", "ehs2.tdm_format_id_error",
1482 FT_BOOLEAN
, 8, NULL
, 0x40,
1485 { &hf_ehs_sh_tdm_bit_slip_error
,
1486 { "Bit Slip Error", "ehs2.tdm_bit_slip_error",
1487 FT_BOOLEAN
, 8, NULL
, 0x20,
1490 { &hf_ehs_sh_tdm_sync_error
,
1491 { "Sync Error", "ehs2.tdm_sync_error",
1492 FT_BOOLEAN
, 8, NULL
, 0x10,
1495 { &hf_ehs_sh_tdm_aoslos_flag
,
1496 { "AOS/LOS Flag", "ehs2.tdm_aoslos_flag",
1497 FT_BOOLEAN
, 8, TFS(&ehs_tfs_secondary_header_tdm_aoslos_flag
), 0x08,
1500 { &hf_ehs_sh_tdm_override_errors_flag
,
1501 { "Override Errors", "ehs2.tdm_override_errors_flag",
1502 FT_BOOLEAN
, 8, NULL
, 0x04,
1505 { &hf_ehs_sh_tdm_data_status
,
1506 { "Data Status", "ehs2.tdm_data_status",
1507 FT_UINT8
, BASE_DEC
, VALS(ehs_secondary_header_tdm_data_status
), 0x03,
1511 { &hf_ehs_sh_tdm_idq
,
1512 { "IDQ", "ehs2.tdm_idq",
1513 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1517 { &hf_ehs_sh_tdm_cdq
,
1518 { "CDQ", "ehs2.tdm_cdq",
1519 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1523 { &hf_ehs_sh_tdm_adq
,
1524 { "ADQ", "ehs2.tdm_adq",
1525 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1529 { &hf_ehs_sh_tdm_data_dq
,
1530 { "Data DQ", "ehs2.tdm_data_dq",
1531 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1536 { &hf_ehs_sh_tdm_unused
,
1537 { "Unused", "ehs2.tdm_unused",
1538 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1543 { &hf_ehs_sh_tdm_format_id
,
1544 { "Format ID", "ehs2.tdm_format_id",
1545 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
1549 { &hf_ehs_sh_tdm_major_frame_packet_index
,
1550 { "Major Frame Packet Index", "ehs2.tdm_major_frame_packet_index",
1551 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1555 { &hf_ehs_sh_tdm_numpkts_per_major_frame
,
1556 { "Num Packets per Major Frame", "ehs2.tdm_numpkts_per_major_frame",
1557 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1561 { &hf_ehs_sh_tdm_num_minor_frames_per_packet
,
1562 { "Num Minor Frames per Packet", "ehs2.tdm_num_minor_frame_per_packet",
1563 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1567 { &hf_ehs_sh_tdm_cntmet_present
,
1568 { "CNT or MET Present", "ehs2.tdm_cntmet_present",
1569 FT_BOOLEAN
, 8, NULL
, 0x80,
1572 { &hf_ehs_sh_tdm_obt_present
,
1573 { "OBT Present", "ehs2.tdm_obt_present",
1574 FT_BOOLEAN
, 8, NULL
, 0x40,
1577 { &hf_ehs_sh_tdm_major_frame_status_present
,
1578 { "Major Frame Status Present", "ehs2.tdm_major_frame_status_present",
1579 FT_BOOLEAN
, 8, NULL
, 0x20,
1583 { &hf_ehs_sh_tdm_reserved
,
1584 { "Reserved", "ehs2.tdm_reserved",
1585 FT_UINT8
, BASE_DEC
, NULL
, 0x1f,
1590 { &hf_ehs_sh_tdm_cnt_year
,
1591 { "CNT Years since 1900", "ehs2.tdm_cnt_year",
1592 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1595 { &hf_ehs_sh_tdm_cnt_jday
,
1596 { "CNT Julian Day of Year", "ehs2.tdm_cnt_jday",
1597 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1600 { &hf_ehs_sh_tdm_cnt_hour
,
1601 { "CNT Hour", "ehs2.tdm_cnt_hour",
1602 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1605 { &hf_ehs_sh_tdm_cnt_minute
,
1606 { "CNT Minute", "ehs2.tdm_cnt_minute",
1607 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1610 { &hf_ehs_sh_tdm_cnt_second
,
1611 { "CNT Second", "ehs2.tdm_cnt_second",
1612 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1615 { &hf_ehs_sh_tdm_cnt_tenths
,
1616 { "CNT Tenths", "ehs2.tdm_cnt_tenths",
1617 FT_UINT8
, BASE_DEC
, NULL
, 0xf0,
1621 { &hf_ehs_sh_tdm_obt_year
,
1622 { "OBT Years since 1900", "ehs2.tdm_cnt_year",
1623 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1626 { &hf_ehs_sh_tdm_obt_jday
,
1627 { "OBT Julian Day of Year", "ehs2.tdm_cnt_jday",
1628 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1631 { &hf_ehs_sh_tdm_obt_hour
,
1632 { "OBT Hour", "ehs2.tdm_cnt_hour",
1633 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1636 { &hf_ehs_sh_tdm_obt_minute
,
1637 { "OBT Minute", "ehs2.tdm_cnt_minute",
1638 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1641 { &hf_ehs_sh_tdm_obt_second
,
1642 { "OBT Second", "ehs2.tdm_cnt_second",
1643 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1646 { &hf_ehs_sh_tdm_obt_tenths
,
1647 { "OBT Tenths", "ehs2.tdm_cnt_tenths",
1648 FT_UINT8
, BASE_DEC
, NULL
, 0xf0,
1652 { &hf_ehs_sh_tdm_obt_delta_time_flag
,
1653 { "OBT is Delta Time Instead of GMT", "ehs2.tdm_obt_delta_time_flag",
1654 FT_BOOLEAN
, 16, NULL
, 0x8000,
1657 { &hf_ehs_sh_tdm_obt_computed_flag
,
1658 { "OBT Computed", "ehs2.tdm_obt_computed_flag",
1659 FT_BOOLEAN
, 16, NULL
, 0x4000,
1662 { &hf_ehs_sh_tdm_obt_not_retrieved_flag
,
1663 { "OBT Not Retrieved", "ehs2.tdm_obt_not_retrieved_flag",
1664 FT_BOOLEAN
, 16, NULL
, 0x2000,
1668 { &hf_ehs_sh_tdm_obt_reserved
,
1669 { "OBT Reserved", "ehs2.tdm_obt_reserved",
1670 FT_BOOLEAN
, 16, NULL
, 0x1800,
1674 { &hf_ehs_sh_tdm_obt_source_apid
,
1675 { "OBT Source APID", "ehs2.tdm_obt_source_apid",
1676 FT_UINT16
, BASE_DEC
, NULL
, 0x07ff,
1680 { &hf_ehs_sh_tdm_num_major_frame_status_words
,
1681 { "Number of Major Frame Status Words", "ehs2.tdm_num_major_frame_status_words",
1682 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1687 { &hf_ehs_sh_tdm_mjfs_reserved
,
1688 { "Reserved", "ehs2.tdm_mjfs_reserved",
1689 FT_UINT8
, BASE_DEC
, NULL
, 0xf8,
1693 { &hf_ehs_sh_tdm_mjfs_parent_frame_error
,
1694 { "Parent Frame Error", "ehs2.tdm_mjfs_parent_frame_error",
1695 FT_BOOLEAN
, 8, NULL
, 0x04,
1698 { &hf_ehs_sh_tdm_mjfs_checksum_error
,
1699 { "Checksum Error", "ehs2.tdm_mjfs_checksum_error",
1700 FT_BOOLEAN
, 8, NULL
, 0x02,
1703 { &hf_ehs_sh_tdm_mjfs_fixed_value_error
,
1704 { "Fixed Value Error", "ehs2.tdm_mjfs_fixed_value_error",
1705 FT_BOOLEAN
, 8, NULL
, 0x01,
1709 { &hf_ehs_sh_tdm_mnfs_parent_frame_error
,
1710 { "Parent Frame Error", "ehs2.tdm_mnfs_parent_frame_error",
1711 FT_BOOLEAN
, 8, NULL
, 0x80,
1714 { &hf_ehs_sh_tdm_mnfs_data_not_available
,
1715 { "Data Not Available", "ehs2.tdm_mnfs_data_not_available",
1716 FT_BOOLEAN
, 8, NULL
, 0x40,
1719 { &hf_ehs_sh_tdm_mnfs_checksum_error
,
1720 { "Checksum Error", "ehs2.tdm_mnfs_checksum_error",
1721 FT_BOOLEAN
, 8, NULL
, 0x20,
1724 { &hf_ehs_sh_tdm_mnfs_fixed_value_error
,
1725 { "Fixed Value Error", "ehs2.tdm_mnfs_fixed_value_error",
1726 FT_BOOLEAN
, 8, NULL
, 0x10,
1729 { &hf_ehs_sh_tdm_mnfs_counter_error
,
1730 { "Counter Error", "ehs2.tdm_mnfs_counter_error",
1731 FT_BOOLEAN
, 8, NULL
, 0x08,
1734 { &hf_ehs_sh_tdm_mnfs_format_id_error
,
1735 { "Format ID Error", "ehs2.tdm_mnfs_format_id_error",
1736 FT_BOOLEAN
, 8, NULL
, 0x04,
1739 { &hf_ehs_sh_tdm_mnfs_bit_slip_error
,
1740 { "Bit Slip Error", "ehs2.tdm_mnfs_bit_slip_error",
1741 FT_BOOLEAN
, 8, NULL
, 0x02,
1744 { &hf_ehs_sh_tdm_mnfs_sync_error
,
1745 { "Sync Error", "ehs2.tdm_mnfs_sync_error",
1746 FT_BOOLEAN
, 8, NULL
, 0x01,
1751 /* pseudo secondary header */
1753 { &hf_ehs_sh_pseudo_unused
,
1754 { "Unused", "ehs2.pseudo_unused",
1755 FT_UINT16
, BASE_DEC
, NULL
, 0xffff,
1759 { &hf_ehs_sh_pseudo_workstation_id
,
1760 { "Workstation ID", "ehs2.pseudo_workstation_id",
1761 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1764 { &hf_ehs_sh_pseudo_user_id
,
1765 { "User ID", "ehs2.pseudo_user_id",
1766 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1769 { &hf_ehs_sh_pseudo_comp_id
,
1770 { "Comp ID", "ehs2.pseudo_comp_id",
1771 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1776 /* aos/los protocol data zone */
1777 { &hf_ehs_dz_aoslos_indicator
,
1778 { "AOS/LOS Indicator", "ehs.dz.aoslos_indicator",
1779 FT_UINT8
, BASE_DEC
, VALS(ehs_data_zone_aoslos_indicator
), 0x03,
1784 /* udsm protocol data zone */
1785 { &hf_ehs_dz_udsm_ccsds_vs_bpdu
,
1786 { "CCSDS vs BPDU", "ehs.dz.udsm_ccsds_vs_bpdu",
1787 FT_UINT8
, BASE_DEC
, VALS(ehs_data_zone_udsm_ccsds_vs_bpdu
), 0x80,
1791 { &hf_ehs_dz_udsm_unused1
,
1792 { "Unused 1", "ehs.dz.udsm_unused1",
1793 FT_UINT8
, BASE_DEC
, NULL
, 0x7f,
1797 { &hf_ehs_dz_udsm_unused2
,
1798 { "Unused 2", "ehs.dz.udsm_unused2",
1799 FT_UINT8
, BASE_DEC
, NULL
, 0xff,
1803 { &hf_ehs_dz_udsm_unused3
,
1804 { "Unused 3", "ehs.dz.udsm_unused3",
1805 FT_UINT16
, BASE_DEC
, NULL
, 0xe000,
1809 { &hf_ehs_dz_udsm_gse_pkt_id
,
1810 { "GSE Pkt ID", "ehs.dz.udsm_gse_pkt_id",
1811 FT_BOOLEAN
, 16, NULL
, 0x1000,
1814 { &hf_ehs_dz_udsm_payload_vs_core
,
1815 { "Payload vs Core", "ehs.dz.udsm_payload_vs_core",
1816 FT_UINT16
, BASE_DEC
, VALS(ehs_data_zone_udsm_payload_vs_core
), 0x0800,
1819 { &hf_ehs_dz_udsm_apid
,
1820 { "APID", "ehs.dz.udsm_apid",
1821 FT_UINT16
, BASE_DEC
, NULL
, 0x07ff,
1825 { &hf_ehs_dz_udsm_start_time_year
,
1826 { "Start Time Years since 1900", "ehs.dz.udsm_start_time_year",
1827 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1830 { &hf_ehs_dz_udsm_start_time_jday
,
1831 { "Start Time Julian Day", "ehs.dz.udsm_start_time_jday",
1832 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1835 { &hf_ehs_dz_udsm_start_time_hour
,
1836 { "Start Time Hour", "ehs.dz.udsm_start_time_hour",
1837 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1840 { &hf_ehs_dz_udsm_start_time_minute
,
1841 { "Start Time Minute", "ehs.dz.udsm_start_time_minute",
1842 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1845 { &hf_ehs_dz_udsm_start_time_second
,
1846 { "Start Time Second", "ehs.dz.udsm_start_time_second",
1847 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1851 { &hf_ehs_dz_udsm_stop_time_year
,
1852 { "Stop Time Years since 1900", "ehs.dz.udsm_stop_time_year",
1853 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1856 { &hf_ehs_dz_udsm_stop_time_jday
,
1857 { "Stop Time Julian Day", "ehs.dz.udsm_stop_time_jday",
1858 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1861 { &hf_ehs_dz_udsm_stop_time_hour
,
1862 { "Stop Time Hour", "ehs.dz.udsm_stop_time_hour",
1863 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1866 { &hf_ehs_dz_udsm_stop_time_minute
,
1867 { "Stop Time Minute", "ehs.dz.udsm_stop_time_minute",
1868 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1871 { &hf_ehs_dz_udsm_stop_time_second
,
1872 { "Stop Time Second", "ehs.dz.udsm_stop_time_second",
1873 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1878 { &hf_ehs_dz_udsm_unused4
,
1879 { "Unused 4", "ehs.dz.udsm_unused4",
1880 FT_UINT16
, BASE_DEC
, NULL
, 0xffff,
1885 { &hf_ehs_dz_udsm_num_pkts_xmtd
,
1886 { "Num Pkts Transmitted", "ehs.dz.udsm_num_pkts_xmtd",
1887 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1891 { &hf_ehs_dz_udsm_num_vcdu_seqerrs
,
1892 { "Num VCDU Sequence Errors", "ehs.dz.udsm_num_vcdu_seqerrs",
1893 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1897 { &hf_ehs_dz_udsm_num_pkt_seqerrs
,
1898 { "Num Packet Sequence Errors", "ehs.dz.udsm_num_pkt_seqerrs",
1899 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1903 { &hf_ehs_dz_udsm_num_pktlen_errors
,
1904 { "Num Pkt Length Errors", "ehs.dz.udsm_num_pktlen_errors",
1905 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
1909 { &hf_ehs_dz_udsm_event
,
1910 { "UDSM Event Code", "ehs.dz.udsm_event",
1911 FT_UINT8
, BASE_DEC
, VALS(ehs_data_zone_udsm_event
), 0x0,
1915 { &hf_ehs_dz_udsm_num_pkts_xmtd_rollover
,
1916 { "Num Pkts Transmitted Rollover Counter", "ehs.dz.udsm_num_pkts_xmtd_rollover",
1917 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
1923 /* Setup protocol subtree array */
1924 static int *ett
[] = {
1926 &ett_ehs_primary_header
,
1927 &ett_ehs_secondary_header
,
1931 &ett_ehs_udsm_start_time
,
1932 &ett_ehs_udsm_stop_time
,
1933 &ett_ehs_ground_receipt_time
,
1934 &ett_ehs_major_frame
,
1935 &ett_ehs_minor_frame
,
1938 /* Register the protocol name and description */
1939 proto_ehs
= proto_register_protocol("EHS", "EHS", "ehs");
1941 /* Required function calls to register the header fields and subtrees used */
1942 proto_register_field_array(proto_ehs
, hf
, array_length(hf
));
1943 proto_register_subtree_array(ett
, array_length(ett
));
1945 /* XX: Does this dissector need to be publicly registered ?? */
1946 ehs_handle
= register_dissector ( "ehs", dissect_ehs
, proto_ehs
);
1950 proto_reg_handoff_ehs(void)
1952 dissector_add_for_decode_as_with_preference( "udp.port", ehs_handle
);
1953 ccsds_handle
= find_dissector_add_dependency ( "ccsds", proto_ehs
);
1957 * Editor modelines - https://www.wireshark.org/tools/modelines.html
1962 * indent-tabs-mode: nil
1965 * ex: set shiftwidth=2 tabstop=8 expandtab:
1966 * :indentSize=2:tabSize=8:noTabs=true: