2 * Routines for CCSDS 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.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
15 #include <epan/packet.h>
16 #include <epan/expert.h>
17 #include <epan/prefs.h>
18 #include <epan/to_str.h>
20 void proto_register_ccsds(void);
21 void proto_reg_handoff_ccsds(void);
26 * https://public.ccsds.org/Pubs/133x0b1s.pdf section 4.1 -- CCSDS 133.0-B-1 replaces CCSDS 701.0-B-2
27 * http://everyspec.com/NASA/NASA-JSC/NASA-SSP-PUBS/download.php?spec=SSP_52050E.003096.pdf section 3.1.3
29 * for some information.
33 /* Initialize the protocol and registered fields */
34 static int proto_ccsds
;
36 /* primary ccsds header */
37 static int hf_ccsds_header_flags
;
38 static int hf_ccsds_apid
;
39 static int hf_ccsds_version
;
40 static int hf_ccsds_secheader
;
41 static int hf_ccsds_type
;
42 static int hf_ccsds_seqnum
;
43 static int hf_ccsds_seqflag
;
44 static int hf_ccsds_length
;
46 /* common ccsds secondary header */
47 static int hf_ccsds_coarse_time
;
48 static int hf_ccsds_fine_time
;
49 static int hf_ccsds_timeid
;
50 static int hf_ccsds_checkword_flag
;
52 /* payload specific ccsds secondary header */
53 static int hf_ccsds_zoe
;
54 static int hf_ccsds_packet_type_unused
;
55 static int hf_ccsds_vid
;
56 static int hf_ccsds_dcc
;
58 /* core specific ccsds secondary header */
59 /* static int hf_ccsds_spare1; */
60 static int hf_ccsds_packet_type
;
61 /* static int hf_ccsds_spare2; */
62 static int hf_ccsds_element_id
;
63 static int hf_ccsds_cmd_data_packet
;
64 static int hf_ccsds_format_version_id
;
65 static int hf_ccsds_extended_format_id
;
66 /* static int hf_ccsds_spare3; */
67 static int hf_ccsds_frame_id
;
68 static int hf_ccsds_embedded_time
;
69 static int hf_ccsds_user_data
;
71 /* ccsds checkword (checksum) */
72 static int hf_ccsds_checkword
;
73 static int hf_ccsds_checkword_good
;
74 static int hf_ccsds_checkword_bad
;
76 /* Initialize the subtree pointers */
77 static int ett_ccsds_primary_header_flags
;
79 static int ett_ccsds_primary_header
;
80 static int ett_ccsds_secondary_header
;
81 static int ett_ccsds_checkword
;
83 static expert_field ei_ccsds_length_error
;
84 static expert_field ei_ccsds_checkword
;
86 static dissector_handle_t ccsds_handle
;
88 static dissector_table_t ccsds_dissector_table
;
90 static const enum_val_t dissect_checkword
[] = {
91 { "hdr", "Use header flag", 2 },
92 { "no", "Override header flag to be false", 0 },
93 { "yes", "Override header flag to be true", 1 },
97 /* Global preferences */
98 /* As defined above, default is to use header flag */
99 static int global_dissect_checkword
= 2;
102 * Bits in the first 16-bit header word
104 #define HDR_VERSION 0xe000
105 #define HDR_TYPE 0x1000
106 #define HDR_SECHDR 0x0800
107 #define HDR_APID 0x07ff
109 /* some basic sizing parameters */
112 IP_HEADER_LENGTH
= 48,
113 VCDU_HEADER_LENGTH
= 6,
114 CCSDS_PRIMARY_HEADER_LENGTH
= 6,
115 CCSDS_SECONDARY_HEADER_LENGTH
= 10
118 /* leap year macro */
120 # define Leap(yr) ( ( 0 == (yr)%4 && 0 != (yr)%100 ) || ( 0 == (yr)%400 ) )
124 static const value_string ccsds_primary_header_sequence_flags
[] = {
125 { 0, "Continuation segment" },
126 { 1, "First segment" },
127 { 2, "Last segment" },
128 { 3, "Unsegmented data" },
132 static const value_string ccsds_secondary_header_type
[] = {
138 static const value_string ccsds_secondary_header_packet_type
[] = {
145 { 6, "Payload Private/Science" },
146 { 7, "Ancillary Data" },
147 { 8, "Essential Cmd" },
149 { 10, "Payload Cmd" },
150 { 11, "Data Load/File Transfer" },
158 static const value_string ccsds_secondary_header_element_id
[] = {
159 { 0, "NASA (Ground Test Only)" },
178 static const value_string ccsds_secondary_header_cmd_data_packet
[] = {
179 { 0, "Command Packet" },
180 { 1, "Data Packet" },
184 static const value_string ccsds_secondary_header_format_id
[] = {
186 { 1, "Essential Telemetry" },
187 { 2, "Housekeeping Tlm - 1" },
188 { 3, "Housekeeping Tlm - 2" },
190 { 5, "CCS S-Band Command Response" },
191 { 6, "Contingency Telemetry via the SMCC" },
192 { 7, "Normal Data Dump" },
193 { 8, "Extended Data Dump" },
196 { 11, "Broadcast Ancillary Data" },
198 { 13, "NCS to OIU Telemetry and ECOMM Telemetry" },
199 { 14, "CCS to OIU Telemetry - Direct" },
201 { 16, "Normal File Dump" },
202 { 17, "Extended File Dump" },
203 { 18, "NCS to FGB Telemetry" },
205 { 20, "ZOE Normal Dump (S-Band)" },
206 { 21, "ZOE Extended Dump (S-Band)" },
207 { 22, "EMU S-Band TLM Packet" },
211 { 26, "CCS to OIU Telemetry via UHF" },
212 { 27, "OSTP Telemetry (After Flight 1E, CCS R5)" },
251 static value_string_ext ccsds_secondary_header_format_id_ext
= VALUE_STRING_EXT_INIT(ccsds_secondary_header_format_id
);
255 /* convert ccsds embedded time to a human readable string - NOT THREAD SAFE */
256 static const char* embedded_time_to_string ( wmem_allocator_t
*pool
, int coarse_time
, int fine_time
)
258 static int utcdiff
= 0;
262 int multiplier
= 1000;
264 /* compute the static constant difference in seconds
265 * between midnight 5-6 January 1980 (GPS time) and
266 * seconds since 1/1/1970 (UTC time) just this once
270 for ( yr
= 1970; yr
< 1980; ++yr
)
272 utcdiff
+= ( Leap(yr
) ? 366 : 365 ) * 24 * 60 * 60;
275 utcdiff
+= 5 * 24 * 60 * 60; /* five days of January 1980 */
278 t
.secs
= coarse_time
+ utcdiff
;
279 fraction
= ( multiplier
* ( (int)fine_time
& 0xff ) ) / 256;
280 t
.nsecs
= fraction
*1000000; /* msecs to nsecs */
282 return abs_time_to_str(pool
, &t
, ABSOLUTE_TIME_DOY_UTC
, true);
286 /* Code to actually dissect the packets */
288 dissect_ccsds(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
291 proto_item
*ccsds_packet
;
292 proto_tree
*ccsds_tree
;
293 proto_item
*primary_header
;
294 proto_tree
*primary_header_tree
;
296 uint32_t coarse_time
;
298 proto_item
*secondary_header
;
299 proto_tree
*secondary_header_tree
;
300 const char *time_string
;
304 uint8_t checkword_flag
= 0;
306 proto_item
*item
, *checkword_item
= NULL
;
307 proto_tree
*checkword_tree
;
308 uint16_t checkword_field
= 0;
309 uint16_t checkword_sum
= 0;
311 static int * const header_flags
[] = {
319 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "CCSDS");
320 col_set_str(pinfo
->cinfo
, COL_INFO
, "CCSDS Packet");
322 first_word
= tvb_get_ntohs(tvb
, 0);
323 col_add_fstr(pinfo
->cinfo
, COL_INFO
, "APID %4d (0x%03X)", first_word
&HDR_APID
, first_word
&HDR_APID
);
325 reported_length
= tvb_reported_length_remaining(tvb
, 0);
326 ccsds_length
= tvb_get_ntohs(tvb
, 4) + CCSDS_PRIMARY_HEADER_LENGTH
+ 1;
329 /* Min length is size of headers, whereas max length is reported length.
330 * If the length field in the CCSDS header is outside of these bounds,
331 * use the value it violates. Otherwise, use the length field value.
333 if (ccsds_length
> reported_length
)
334 length
= reported_length
;
335 else if (ccsds_length
< CCSDS_PRIMARY_HEADER_LENGTH
+ CCSDS_SECONDARY_HEADER_LENGTH
)
336 length
= CCSDS_PRIMARY_HEADER_LENGTH
+ CCSDS_SECONDARY_HEADER_LENGTH
;
338 length
= ccsds_length
;
340 ccsds_packet
= proto_tree_add_item(tree
, proto_ccsds
, tvb
, 0, length
, ENC_NA
);
341 ccsds_tree
= proto_item_add_subtree(ccsds_packet
, ett_ccsds
);
343 /* build the ccsds primary header tree */
344 primary_header_tree
= proto_tree_add_subtree(ccsds_tree
, tvb
, offset
, CCSDS_PRIMARY_HEADER_LENGTH
,
345 ett_ccsds_primary_header
, &primary_header
, "Primary CCSDS Header");
347 proto_tree_add_bitmask(primary_header_tree
, tvb
, offset
, hf_ccsds_header_flags
,
348 ett_ccsds_primary_header_flags
, header_flags
, ENC_BIG_ENDIAN
);
351 proto_tree_add_item(primary_header_tree
, hf_ccsds_seqflag
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
352 proto_tree_add_item(primary_header_tree
, hf_ccsds_seqnum
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
355 item
= proto_tree_add_item(primary_header_tree
, hf_ccsds_length
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
357 if (ccsds_length
> reported_length
) {
358 expert_add_info(pinfo
, item
, &ei_ccsds_length_error
);
362 proto_item_set_end(primary_header
, tvb
, offset
);
364 /* build the ccsds secondary header tree */
365 if ( first_word
& HDR_SECHDR
)
367 secondary_header_tree
= proto_tree_add_subtree(ccsds_tree
, tvb
, offset
, CCSDS_SECONDARY_HEADER_LENGTH
,
368 ett_ccsds_secondary_header
, &secondary_header
, "Secondary CCSDS Header");
370 /* command ccsds secondary header flags */
371 coarse_time
= tvb_get_ntohl(tvb
, offset
);
372 proto_tree_add_item(secondary_header_tree
, hf_ccsds_coarse_time
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
375 fine_time
= tvb_get_uint8(tvb
, offset
);
376 proto_tree_add_item(secondary_header_tree
, hf_ccsds_fine_time
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
379 time_string
= embedded_time_to_string ( pinfo
->pool
, coarse_time
, fine_time
);
380 proto_tree_add_string(secondary_header_tree
, hf_ccsds_embedded_time
, tvb
, offset
-5, 5, time_string
);
382 proto_tree_add_item(secondary_header_tree
, hf_ccsds_timeid
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
383 checkword_item
= proto_tree_add_item(secondary_header_tree
, hf_ccsds_checkword_flag
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
385 /* Global Preference: how to handle checkword flag */
386 switch (global_dissect_checkword
) {
388 /* force checkword presence flag to be false */
392 /* force checkword presence flag to be true */
396 /* use value of checkword presence flag from header */
397 checkword_flag
= (tvb_get_uint8(tvb
, offset
)&0x20) >> 5;
401 /* payload specific ccsds secondary header flags */
402 if ( first_word
& HDR_TYPE
)
404 proto_tree_add_item(secondary_header_tree
, hf_ccsds_zoe
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
405 proto_tree_add_item(secondary_header_tree
, hf_ccsds_packet_type_unused
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
408 proto_tree_add_item(secondary_header_tree
, hf_ccsds_vid
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
411 proto_tree_add_item(secondary_header_tree
, hf_ccsds_dcc
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
415 /* core specific ccsds secondary header flags */
418 /* proto_tree_add_item(secondary_header_tree, hf_ccsds_spare1, tvb, offset, 1, ENC_BIG_ENDIAN); */
419 proto_tree_add_item(secondary_header_tree
, hf_ccsds_packet_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
422 /* proto_tree_add_item(secondary_header_tree, hf_ccsds_spare2, tvb, offset, 2, ENC_BIG_ENDIAN); */
423 proto_tree_add_item(secondary_header_tree
, hf_ccsds_element_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
424 proto_tree_add_item(secondary_header_tree
, hf_ccsds_cmd_data_packet
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
425 proto_tree_add_item(secondary_header_tree
, hf_ccsds_format_version_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
426 proto_tree_add_item(secondary_header_tree
, hf_ccsds_extended_format_id
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
429 /* proto_tree_add_item(secondary_header_tree, hf_ccsds_spare3, tvb, offset, 1, ENC_BIG_ENDIAN); */
432 proto_tree_add_item(secondary_header_tree
, hf_ccsds_frame_id
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
436 /* finish the ccsds secondary header */
437 proto_item_set_end(secondary_header
, tvb
, offset
);
440 /* If there wasn't a full packet, then don't allow a tree item for checkword. */
441 if (reported_length
< ccsds_length
|| ccsds_length
< CCSDS_PRIMARY_HEADER_LENGTH
+ CCSDS_SECONDARY_HEADER_LENGTH
) {
442 /* Label CCSDS payload 'User Data' */
444 proto_tree_add_item(ccsds_tree
, hf_ccsds_user_data
, tvb
, offset
, length
-offset
, ENC_NA
);
445 offset
+= length
-offset
;
446 if (checkword_flag
== 1)
447 expert_add_info(pinfo
, checkword_item
, &ei_ccsds_checkword
);
449 /* Handle checkword according to CCSDS preference setting. */
451 next_tvb
= tvb_new_subset_remaining(tvb
, offset
);
452 /* Look for a subdissector for the CCSDS payload */
453 if (!dissector_try_uint(ccsds_dissector_table
, first_word
&HDR_APID
, next_tvb
, pinfo
, tree
)) {
454 /* If no subdissector is found, label the CCSDS payload as 'User Data' */
455 proto_tree_add_item(ccsds_tree
, hf_ccsds_user_data
, tvb
, offset
, length
-offset
-2*checkword_flag
, ENC_NA
);
457 offset
+= length
-offset
-2*checkword_flag
;
459 /* If checkword is present, calculate packet checksum (16-bit running sum) for comparison */
460 if (checkword_flag
== 1) {
461 /* don't count the checkword as part of the checksum */
462 while (counter
< ccsds_length
-2) {
463 checkword_sum
+= tvb_get_ntohs(tvb
, counter
);
466 checkword_field
= tvb_get_ntohs(tvb
, offset
);
468 /* Report checkword status */
469 if (checkword_sum
== checkword_field
) {
470 item
= proto_tree_add_uint_format_value(ccsds_tree
, hf_ccsds_checkword
, tvb
, offset
, 2, checkword_field
,
471 "0x%04x [correct]", checkword_field
);
472 checkword_tree
= proto_item_add_subtree(item
, ett_ccsds_checkword
);
473 item
= proto_tree_add_boolean(checkword_tree
, hf_ccsds_checkword_good
, tvb
, offset
, 2, true);
474 proto_item_set_generated(item
);
475 item
= proto_tree_add_boolean(checkword_tree
, hf_ccsds_checkword_bad
, tvb
, offset
, 2, false);
476 proto_item_set_generated(item
);
478 item
= proto_tree_add_uint_format_value(ccsds_tree
, hf_ccsds_checkword
, tvb
, offset
, 2, checkword_field
,
479 "0x%04x [incorrect, should be 0x%04x]", checkword_field
, checkword_sum
);
480 checkword_tree
= proto_item_add_subtree(item
, ett_ccsds_checkword
);
481 item
= proto_tree_add_boolean(checkword_tree
, hf_ccsds_checkword_good
, tvb
, offset
, 2, false);
482 proto_item_set_generated(item
);
483 item
= proto_tree_add_boolean(checkword_tree
, hf_ccsds_checkword_bad
, tvb
, offset
, 2, true);
484 proto_item_set_generated(item
);
490 /* Give the data dissector any bytes past the CCSDS packet length */
491 call_data_dissector(tvb_new_subset_remaining(tvb
, offset
), pinfo
, tree
);
492 return tvb_captured_length(tvb
);
497 proto_register_ccsds(void)
499 static hf_register_info hf
[] = {
501 /* primary ccsds header flags */
502 { &hf_ccsds_header_flags
,
503 { "Header Flags", "ccsds.header_flags",
504 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
508 { "Version", "ccsds.version",
509 FT_UINT16
, BASE_DEC
, NULL
, HDR_VERSION
,
513 { "Type", "ccsds.type",
514 FT_UINT16
, BASE_DEC
, VALS(ccsds_secondary_header_type
), HDR_TYPE
,
517 { &hf_ccsds_secheader
,
518 { "Secondary Header", "ccsds.secheader",
519 FT_BOOLEAN
, 16, NULL
, HDR_SECHDR
,
520 "Secondary Header Present", HFILL
}
523 { "APID", "ccsds.apid",
524 FT_UINT16
, BASE_DEC
, NULL
, HDR_APID
,
528 { "Sequence Flags", "ccsds.seqflag",
529 FT_UINT16
, BASE_DEC
, VALS(ccsds_primary_header_sequence_flags
), 0xc000,
533 { "Sequence Number", "ccsds.seqnum",
534 FT_UINT16
, BASE_DEC
, NULL
, 0x3fff,
538 { "Packet Length", "ccsds.length",
539 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
544 /* common ccsds secondary header flags */
545 { &hf_ccsds_coarse_time
,
546 { "Coarse Time", "ccsds.coarse_time",
547 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
550 { &hf_ccsds_fine_time
,
551 { "Fine Time", "ccsds.fine_time",
552 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
556 { "Time Identifier", "ccsds.timeid",
557 FT_UINT8
, BASE_DEC
, NULL
, 0xc0,
560 { &hf_ccsds_checkword_flag
,
561 { "Checkword Indicator", "ccsds.checkword_flag",
562 FT_BOOLEAN
, 8, NULL
, 0x20,
563 "Checkword present", HFILL
}
567 /* payload specific ccsds secondary header flags */
569 { "ZOE TLM", "ccsds.zoe",
570 FT_UINT8
, BASE_DEC
, NULL
, 0x10,
571 "Contains S-band ZOE Packets", HFILL
}
573 { &hf_ccsds_packet_type_unused
,
574 { "Packet Type (unused for Ku-band)", "ccsds.packet_type",
575 FT_UINT8
, BASE_DEC
, NULL
, 0x0f,
579 { "Version Identifier", "ccsds.vid",
580 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
584 { "Data Cycle Counter", "ccsds.dcc",
585 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
590 /* core specific ccsds secondary header flags */
593 { "Spare Bit 1", "ccsds.spare1",
594 FT_UINT8
, BASE_DEC
, NULL
, 0x10,
595 "unused spare bit 1", HFILL
}
598 { &hf_ccsds_packet_type
,
599 { "Packet Type", "ccsds.packet_type",
600 FT_UINT8
, BASE_DEC
, VALS(ccsds_secondary_header_packet_type
), 0x0f,
605 { "Spare Bit 2", "ccsds.spare2",
606 FT_UINT16
, BASE_DEC
, NULL
, 0x8000,
610 { &hf_ccsds_element_id
,
611 { "Element ID", "ccsds.element_id",
612 FT_UINT16
, BASE_DEC
, VALS(ccsds_secondary_header_element_id
), 0x7800,
615 { &hf_ccsds_cmd_data_packet
,
616 { "Cmd/Data Packet Indicator", "ccsds.cmd_data_packet",
617 FT_UINT16
, BASE_DEC
, VALS(ccsds_secondary_header_cmd_data_packet
), 0x0400,
620 { &hf_ccsds_format_version_id
,
621 { "Format Version ID", "ccsds.format_version_id",
622 FT_UINT16
, BASE_DEC
, NULL
, 0x03c0,
625 { &hf_ccsds_extended_format_id
,
626 { "Extended Format ID", "ccsds.extended_format_id",
627 FT_UINT16
, BASE_DEC
| BASE_EXT_STRING
, &ccsds_secondary_header_format_id_ext
, 0x003f,
632 { "Spare Bits 3", "ccsds.spare3",
633 FT_UINT8
, BASE_DEC
, NULL
, 0xff,
637 { &hf_ccsds_frame_id
,
638 { "Frame ID", "ccsds.frame_id",
639 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
642 { &hf_ccsds_embedded_time
,
643 { "Embedded Time", "ccsds.embedded_time",
644 FT_STRING
, BASE_NONE
, NULL
, 0x0,
647 { &hf_ccsds_user_data
,
648 { "User Data", "ccsds.user_data",
649 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
652 { &hf_ccsds_checkword
,
653 { "CCSDS checkword", "ccsds.checkword",
654 FT_UINT16
, BASE_HEX
, NULL
, 0x0,
655 "CCSDS checkword: 16-bit running sum of all bytes excluding the checkword", HFILL
}
657 { &hf_ccsds_checkword_good
,
658 { "Good", "ccsds.checkword_good",
659 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
660 "True: checkword matches packet content; False: doesn't match content", HFILL
}
662 { &hf_ccsds_checkword_bad
,
663 { "Bad", "ccsds.checkword_bad",
664 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
665 "True: checkword doesn't match packet content; False: matches content", HFILL
}
669 /* Setup protocol subtree array */
670 static int *ett
[] = {
671 &ett_ccsds_primary_header_flags
,
673 &ett_ccsds_primary_header
,
674 &ett_ccsds_secondary_header
,
678 static ei_register_info ei
[] = {
679 { &ei_ccsds_length_error
, { "ccsds.length.error", PI_MALFORMED
, PI_ERROR
, "Length field value is greater than the packet seen on the wire", EXPFILL
}},
680 { &ei_ccsds_checkword
, { "ccsds.no_checkword", PI_PROTOCOL
, PI_WARN
, "Packet does not contain a Checkword", EXPFILL
}},
683 /* Define the CCSDS preferences module */
684 module_t
*ccsds_module
;
685 expert_module_t
* expert_ccsds
;
687 /* Register the protocol name and description */
688 proto_ccsds
= proto_register_protocol("CCSDS", "CCSDS", "ccsds");
690 /* Required function calls to register the header fields and subtrees used */
691 proto_register_field_array(proto_ccsds
, hf
, array_length(hf
));
692 proto_register_subtree_array(ett
, array_length(ett
));
693 expert_ccsds
= expert_register_protocol(proto_ccsds
);
694 expert_register_field_array(expert_ccsds
, ei
, array_length(ei
));
696 ccsds_handle
= register_dissector ( "ccsds", dissect_ccsds
, proto_ccsds
);
698 /* Register preferences module */
699 ccsds_module
= prefs_register_protocol(proto_ccsds
, NULL
);
701 prefs_register_enum_preference(ccsds_module
, "global_pref_checkword",
702 "How to handle the CCSDS checkword",
703 "Specify how the dissector should handle the CCSDS checkword",
704 &global_dissect_checkword
, dissect_checkword
, false);
706 /* Dissector table for sub-dissectors */
707 ccsds_dissector_table
= register_dissector_table("ccsds.apid", "CCSDS apid", proto_ccsds
, FT_UINT16
, BASE_DEC
);
712 proto_reg_handoff_ccsds(void)
714 dissector_add_for_decode_as_with_preference( "udp.port", ccsds_handle
);
718 * Editor modelines - https://www.wireshark.org/tools/modelines.html
723 * indent-tabs-mode: nil
726 * vi: set shiftwidth=4 tabstop=8 expandtab:
727 * :indentSize=4:tabSize=8:noTabs=true: