2 * Routines for SIMPLE dissection
3 * Copyright 2015 Peter Ross
5 * SPDX-License-Identifier: GPL-2.0-or-later
8 /* SIMPLE (Standard Interface for Multiple Platform Link Evaluation)
9 * is a protocol for exchanging tactical data link messages, such as Link 16,
10 * over Internet Protocols.
12 * The protocol is described in STANAG 5602. See:
13 * http://assistdoc1.dla.mil/qsDocDetails.aspx?ident_number=213042
18 #include <epan/packet.h>
20 #include <wsutil/array.h>
21 #include <epan/expert.h>
22 #include "packet-link16.h"
24 void proto_reg_handoff_simple(void);
26 void proto_register_simple(void);
28 static const range_string Node_Strings
[] = {
29 { 1, 128, "Unicast" },
30 { 129, 129, "Broadcast" },
31 { 160, 168, "Multicast" },
32 { 169, 169, "Adjacent" },
36 static const value_string Subnode_Strings
[] = {
38 { 2, "Terminal-Host Interface" },
39 { 4, "File & Mail Transfers" },
41 { 6, "Status & Control" },
42 { 7, "Time Synchronisation" },
43 { 202, "Scenario (Script)" },
50 { 209, "Voice Group A" },
51 { 210, "Voice Group B" },
61 static const value_string PacketType_Strings
[] = {
62 { SIMPLE_LINK16
, "Link 16" },
66 { 5, "Interim JTIDS Message Standard (IJMS)" },
67 { 8, "Variable Message Format (VMF)" },
68 { 10, "MIDS Terminal Specific Messages (MTSM)" },
69 { 13, "MIDS/JTIDS Voice" },
71 { 32, "DIS Protocol Data Unit (PDU)" },
72 { SIMPLE_STATUS
, "Status/Configuration" },
73 { 62, "E-mail/File Transfer Protocol (FTP)" },
74 { 63, "Round Trip Timing (RTT)" },
75 { 65, "Time Synchronisation" },
77 { 100, "National Message" },
82 SIMPLE_LINK16_FIXED_FORMAT
= 2
85 static const value_string Link16_Subtype_Strings
[] = {
86 { 0, "Uncoded Free Text" },
87 { 1, "Coded Free Text" },
88 { SIMPLE_LINK16_FIXED_FORMAT
, "Fixed Format" },
92 static const value_string Status_Subtype_Strings
[] = {
97 static const value_string Security_Level_Strings
[] = {
98 { 0, "Unclassified" },
99 { 1, "NATO Unclassified" },
100 { 2, "Confidential" },
101 { 3, "NATO Confidential" },
103 { 5, "NATO Secret" },
104 { 6, "National Only" },
111 static const value_string Link16_Terminal_Type
[] = {
113 { 1, "US Navy Air (JTIDS)" },
114 { 2, "US Navy Ship (JTIDS)" },
115 { 3, "US F-15 (JTIDS)" },
116 { 4, "US F/A-18 (MIDS)" },
117 { 5, "US Army Class 2M (JTIDS)" },
118 { 6, "US MCE (JTIDS)" },
119 { 7, "E-3 (JTIDS)" },
120 { 8, "UK Tornado F3 (JTIDS)" },
121 { 9, "UK UKADGE (JTIDS)" },
122 { 10, "Low Volume Terminal - Generic (MIDS)" },
123 { 11, "Low Volume Terminal - Platform Type A (MIDS)" },
124 { 12, "Low Volume Terminal - Platform Type B (MIDS)" },
125 { 13, "Low Volume Terminal - Platform Type C (MIDS)" },
126 { 14, "Low Volume Terminal - Platform Type D (MIDS)" },
127 { 15, "Low Volume Terminal - Platform Type E (MIDS)" },
128 { 16, "Low Volume Terminal - Platform Type F (MIDS)" },
129 { 17, "Low Volume Terminal - Platform Type G (MIDS)" },
130 { 18, "Low Volume Terminal 2, US Army (MIDS)" },
131 { 19, "Low Volume Terminal MIDS on Ship (MOS) (MIDS)" },
132 { 20, "US Fighter Data Link (FDL) (MIDS)" },
133 { 21, "AN/URC-138" },
134 { 22, "Low Volume Terminal Platform Type H (MIDS)" },
135 { 23, "Low Volume Terminal Platform Type I (MIDS)" },
139 static const value_string Link16_Role
[] = {
141 { 1, "SIMPLE Host (SH)" },
142 { 2, "SIMPLE Terminal Emulator (STE)" },
143 { 3, "SIMPLE Network Monitor (SNM)" },
144 { 4, "SIMPLE Virtual Host (SVH)" },
145 { 5, "SIMPLE Virtual Terminal (SVT)" },
149 static const value_string Link16_Sync_Status
[] = {
151 { 1, "Net Entry in Progress" },
152 { 2, "Coarse Sync" },
157 static const value_string Link_Terminal_Host_Status
[] = {
163 static const value_string Link11_DTS_Type
[] = {
165 { 1, "MIL-STD-1397 parallel" },
166 { 2, "MIL-STD-188-203-1A serial" },
170 static const value_string Link11_Role
[] = {
172 { 1, "SIMPLE DTS EMULATOR (SDE) Picket"},
173 { 2, "SDE Net Control Station (NCS)" },
174 { 3, "SIMPLE Participating Unit (PU) Emulator (SPE)" },
178 static int proto_simple
;
180 static dissector_handle_t simple_dissector_handle
;
181 static dissector_handle_t link16_handle
;
183 static int hf_simple_sync_byte_1
;
184 static int hf_simple_sync_byte_2
;
185 static int hf_simple_length
;
186 static int hf_simple_sequence_number
;
187 static int hf_simple_src_node
;
188 static int hf_simple_src_subnode
;
189 static int hf_simple_dst_node
;
190 static int hf_simple_dst_subnode
;
191 static int hf_simple_packet_size
;
192 static int hf_simple_packet_type
;
193 static int hf_simple_transit_time
;
194 static int hf_simple_link16_subtype
;
195 static int hf_simple_link16_rc
;
196 static int hf_simple_link16_network
;
197 static int hf_simple_link16_ssc2
;
198 static int hf_simple_link16_npg
;
199 static int hf_simple_link16_ssc1
;
200 static int hf_simple_link16_stn
;
201 static int hf_simple_link16_word_count
;
202 static int hf_simple_link16_loopback_id
;
203 static int hf_simple_status_subtype
;
204 static int hf_simple_status_word_count
;
205 static int hf_simple_status_name
;
206 static int hf_simple_status_time_hours
;
207 static int hf_simple_status_node_id
;
208 static int hf_simple_status_time_seconds
;
209 static int hf_simple_status_time_minutes
;
210 static int hf_simple_status_security_level
;
211 static int hf_simple_status_node_entry_flag
;
212 static int hf_simple_status_relay_hop
;
213 static int hf_simple_status_dx_flag_system_messages
;
214 static int hf_simple_status_dx_flag_common_tims_bims
;
215 static int hf_simple_status_dx_flag_common_toms_boms
;
216 static int hf_simple_status_dx_flag_simple_receive
;
217 static int hf_simple_status_dx_flag_simple_transmit
;
218 static int hf_simple_status_dx_flag_all_tims_bims
;
219 static int hf_simple_status_dx_flag_all_toms_boms
;
220 static int hf_simple_status_dx_file_id
;
221 static int hf_simple_status_spare_1
;
222 static int hf_simple_status_link16_terminal_type
;
223 static int hf_simple_status_link16_role
;
224 static int hf_simple_status_link16_sync_status
;
225 static int hf_simple_status_link16_terminal_host_status
;
226 static int hf_simple_status_link16_stn
;
227 static int hf_simple_status_spare_2
;
228 static int hf_simple_status_link11_dts_type
;
229 static int hf_simple_status_link11_role
;
230 static int hf_simple_status_link11_pu
;
231 static int hf_simple_status_link11_dts_host_status
;
232 static int hf_simple_status_spare_3
;
233 static int hf_simple_checksum
;
234 static int hf_simple_checksum_status
;
236 static int ett_simple
;
237 static int ett_packet
;
238 static int ett_simple_status_dx_flag
;
240 static expert_field ei_simple_sync_bytes_bad
;
241 static expert_field ei_simple_length_bad
;
242 static expert_field ei_simple_packet_size_bad
;
243 static expert_field ei_simple_checksum_bad
;
245 static void dissect_simple_link16(tvbuff_t
*tvb
, packet_info
*pinfo _U_
, proto_tree
*tree
, int offset
)
247 unsigned subtype
, stn
, word_count
, i
;
251 proto_tree_add_item(tree
, hf_simple_link16_subtype
, tvb
, offset
, 1, ENC_NA
);
252 subtype
= tvb_get_uint8(tvb
, offset
);
255 proto_tree_add_item(tree
, hf_simple_link16_rc
, tvb
, offset
, 1, ENC_NA
);
258 proto_tree_add_item(tree
, hf_simple_link16_network
, tvb
, offset
, 1, ENC_NA
);
261 proto_tree_add_item(tree
, hf_simple_link16_ssc2
, tvb
, offset
, 1, ENC_NA
);
264 proto_tree_add_item(tree
, hf_simple_link16_npg
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
267 proto_tree_add_item(tree
, hf_simple_link16_ssc1
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
270 proto_tree_add_item(tree
, hf_simple_link16_stn
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
271 stn
= tvb_get_letohs(tvb
, offset
);
274 proto_tree_add_item(tree
, hf_simple_link16_word_count
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
275 word_count
= tvb_get_uint8(tvb
, offset
);
278 proto_tree_add_item(tree
, hf_simple_link16_loopback_id
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
281 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", STN: %05o, Words:", stn
);
284 case SIMPLE_LINK16_FIXED_FORMAT
:
285 memset(&state
, 0, sizeof(state
));
286 for (i
= 0; i
< word_count
; i
+= 5) {
287 newtvb
= tvb_new_subset_length_caplen(tvb
, offset
, 10, -1);
288 add_new_data_source(pinfo
, newtvb
, "Link 16 Word");
289 call_dissector_with_data(link16_handle
, newtvb
, pinfo
, tree
, &state
);
296 static int * const simple_status_dx_flag_fields
[] = {
297 &hf_simple_status_dx_flag_system_messages
,
298 &hf_simple_status_dx_flag_common_tims_bims
,
299 &hf_simple_status_dx_flag_common_toms_boms
,
300 &hf_simple_status_dx_flag_simple_receive
,
301 &hf_simple_status_dx_flag_simple_transmit
,
302 &hf_simple_status_dx_flag_all_tims_bims
,
303 &hf_simple_status_dx_flag_all_toms_boms
,
307 #define SIMPLE_STATUS_NAME_LEN 10
309 static void dissect_simple_status(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
312 int link16_status
, pu
;
314 proto_tree_add_item(tree
, hf_simple_status_subtype
, tvb
, offset
, 1, ENC_NA
);
317 proto_tree_add_item(tree
, hf_simple_status_word_count
, tvb
, offset
, 1, ENC_NA
);
320 name
= tvb_get_stringzpad(pinfo
->pool
, tvb
, offset
, SIMPLE_STATUS_NAME_LEN
, ENC_ASCII
|ENC_NA
);
321 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", Name: %s", name
);
322 proto_tree_add_item(tree
, hf_simple_status_name
, tvb
, offset
, SIMPLE_STATUS_NAME_LEN
, ENC_ASCII
);
323 offset
+= SIMPLE_STATUS_NAME_LEN
;
325 proto_tree_add_item(tree
, hf_simple_status_time_hours
, tvb
, offset
, 1, ENC_NA
);
328 proto_tree_add_item(tree
, hf_simple_status_node_id
, tvb
, offset
, 1, ENC_NA
);
331 proto_tree_add_item(tree
, hf_simple_status_time_seconds
, tvb
, offset
, 1, ENC_NA
);
334 proto_tree_add_item(tree
, hf_simple_status_time_minutes
, tvb
, offset
, 1, ENC_NA
);
337 proto_tree_add_item(tree
, hf_simple_status_security_level
, tvb
, offset
, 1, ENC_NA
);
340 proto_tree_add_item(tree
, hf_simple_status_node_entry_flag
, tvb
, offset
, 1, ENC_NA
);
343 proto_tree_add_item(tree
, hf_simple_status_relay_hop
, tvb
, offset
, 16, ENC_NA
);
346 proto_tree_add_bitmask_text(tree
, tvb
, offset
, 2, "Data Extraction Flags", NULL
, ett_simple_status_dx_flag
, simple_status_dx_flag_fields
, ENC_LITTLE_ENDIAN
, 0);
349 proto_tree_add_item(tree
, hf_simple_status_dx_file_id
, tvb
, offset
, 8, ENC_ASCII
);
352 proto_tree_add_item(tree
, hf_simple_status_spare_1
, tvb
, offset
, 2, ENC_NA
);
355 proto_tree_add_item(tree
, hf_simple_status_link16_terminal_type
, tvb
, offset
, 1, ENC_NA
);
358 proto_tree_add_item(tree
, hf_simple_status_link16_role
, tvb
, offset
, 1, ENC_NA
);
361 proto_tree_add_item(tree
, hf_simple_status_link16_sync_status
, tvb
, offset
, 1, ENC_NA
);
364 proto_tree_add_item(tree
, hf_simple_status_link16_terminal_host_status
, tvb
, offset
, 1, ENC_NA
);
365 link16_status
= tvb_get_uint8(tvb
, offset
);
368 proto_tree_add_item(tree
, hf_simple_status_link16_stn
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
370 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", STN: %05o", tvb_get_letohs(tvb
, offset
));
373 proto_tree_add_item(tree
, hf_simple_status_spare_2
, tvb
, offset
, 2, ENC_NA
);
376 proto_tree_add_item(tree
, hf_simple_status_link11_dts_type
, tvb
, offset
, 1, ENC_NA
);
379 proto_tree_add_item(tree
, hf_simple_status_link11_role
, tvb
, offset
, 1, ENC_NA
);
382 proto_tree_add_item(tree
, hf_simple_status_link11_pu
, tvb
, offset
, 1, ENC_NA
);
383 pu
= tvb_get_uint8(tvb
, offset
);
386 proto_tree_add_item(tree
, hf_simple_status_link11_dts_host_status
, tvb
, offset
, 1, ENC_NA
);
387 if (tvb_get_uint8(tvb
, offset
))
388 col_append_fstr(pinfo
->cinfo
, COL_INFO
, ", PU: %03o", pu
);
391 proto_tree_add_item(tree
, hf_simple_status_spare_3
, tvb
, offset
, 4, ENC_NA
);
394 static void dissect_checksum(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, int offset
)
396 const uint8_t * v
= tvb_get_ptr(tvb
, 0, offset
);
397 uint16_t expected_checksum
= 0;
400 for (i
= 0; i
< offset
; i
++)
401 expected_checksum
+= v
[i
];
403 proto_tree_add_checksum(tree
, tvb
, offset
, hf_simple_checksum
, hf_simple_checksum_status
, &ei_simple_checksum_bad
, pinfo
, expected_checksum
,
404 ENC_LITTLE_ENDIAN
, PROTO_CHECKSUM_VERIFY
);
407 static int dissect_simple(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void *data _U_
)
409 proto_item
*simple_item
= NULL
, *item
;
410 proto_tree
*simple_tree
= NULL
, *packet_tree
= NULL
;
411 unsigned offset
= 0, length
, packet_size
, packet_type
;
412 const char *packet_type_string
;
413 uint8_t sync_bytes_bad
= 0;
415 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "SIMPLE");
418 simple_item
= proto_tree_add_item(tree
, proto_simple
, tvb
, 0, -1, ENC_NA
);
419 simple_tree
= proto_item_add_subtree(simple_item
, ett_simple
);
422 proto_tree_add_item(simple_tree
, hf_simple_sync_byte_1
, tvb
, offset
, 1, ENC_NA
);
423 sync_bytes_bad
|= tvb_get_uint8(tvb
, offset
) ^ 0x49;
426 proto_tree_add_item(simple_tree
, hf_simple_sync_byte_2
, tvb
, offset
, 1, ENC_NA
);
427 sync_bytes_bad
|= tvb_get_uint8(tvb
, offset
) ^ 0x36;
431 expert_add_info(pinfo
, simple_item
, &ei_simple_sync_bytes_bad
);
433 item
= proto_tree_add_item(simple_tree
, hf_simple_length
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
434 length
= tvb_get_letohs(tvb
, offset
);
437 if (length
< 16 || length
>= 518 || length
> tvb_reported_length(tvb
))
438 expert_add_info(pinfo
, item
, &ei_simple_length_bad
);
440 proto_tree_add_item(simple_tree
, hf_simple_sequence_number
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
443 proto_tree_add_item(simple_tree
, hf_simple_src_node
, tvb
, offset
, 1, ENC_NA
);
446 proto_tree_add_item(simple_tree
, hf_simple_src_subnode
, tvb
, offset
, 1, ENC_NA
);
449 proto_tree_add_item(simple_tree
, hf_simple_dst_node
, tvb
, offset
, 1, ENC_NA
);
452 proto_tree_add_item(simple_tree
, hf_simple_dst_subnode
, tvb
, offset
, 1, ENC_NA
);
455 item
= proto_tree_add_item(simple_tree
, hf_simple_packet_size
, tvb
, offset
, 1, ENC_NA
);
456 packet_size
= tvb_get_uint8(tvb
, offset
) * 2;
457 if (packet_size
< 8 || packet_size
- 8 > tvb_reported_length(tvb
))
458 expert_add_info(pinfo
, item
, &ei_simple_packet_size_bad
);
462 proto_tree_add_item(simple_tree
, hf_simple_packet_type
, tvb
, offset
, 1, ENC_NA
);
463 packet_type
= tvb_get_uint8(tvb
, offset
);
466 proto_tree_add_item(simple_tree
, hf_simple_transit_time
, tvb
, offset
, 2, ENC_LITTLE_ENDIAN
);
469 packet_type_string
= val_to_str_const(packet_type
, PacketType_Strings
, "Unknown");
470 col_add_str(pinfo
->cinfo
, COL_INFO
, packet_type_string
);
471 packet_tree
= proto_tree_add_subtree_format(simple_tree
, tvb
, offset
, packet_size
, ett_packet
, NULL
, "%s Packet", packet_type_string
);
473 switch(packet_type
) {
475 dissect_simple_link16(tvb
, pinfo
, packet_tree
, offset
);
478 dissect_simple_status(tvb
, pinfo
, packet_tree
, offset
);
482 dissect_checksum(tvb
, pinfo
, simple_tree
, length
- 2);
484 return tvb_captured_length(tvb
);
487 void proto_register_simple(void)
489 static hf_register_info hf
[] = {
490 { &hf_simple_sync_byte_1
,
491 { "Sync Byte 1", "simple.sync_byte_1", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
493 { &hf_simple_sync_byte_2
,
494 { "Sync Byte 2", "simple.sync_byte_2", FT_UINT8
, BASE_HEX
, NULL
, 0x0,
497 { "Length", "simple.length", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
499 { &hf_simple_sequence_number
,
500 { "Sequence Number", "simple.sequence_number", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
502 { &hf_simple_src_node
,
503 { "Source Node", "simple.src_node", FT_UINT8
, BASE_RANGE_STRING
| BASE_DEC
, RVALS(Node_Strings
), 0x0,
505 { &hf_simple_src_subnode
,
506 { "Source Subnode", "simple.src_subnode", FT_UINT8
, BASE_DEC
, VALS(Subnode_Strings
), 0x0,
508 { &hf_simple_dst_node
,
509 { "Destination Node", "simple.dst_node", FT_UINT8
, BASE_RANGE_STRING
| BASE_DEC
, RVALS(Node_Strings
), 0x0,
511 { &hf_simple_dst_subnode
,
512 { "Destination Subnode", "simple.dst_subnode", FT_UINT8
, BASE_DEC
, VALS(Subnode_Strings
), 0x0,
514 { &hf_simple_packet_size
,
515 { "Packet Size", "simple.packet_size", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
517 { &hf_simple_packet_type
,
518 { "Packet Type", "simple.packet_type", FT_UINT8
, BASE_DEC
, VALS(PacketType_Strings
), 0x0,
520 { &hf_simple_transit_time
,
521 { "Transit Time", "simple.transit_time", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
523 { &hf_simple_link16_subtype
,
524 { "Subtype", "simple.link16.subtype", FT_UINT8
, BASE_DEC
, VALS(Link16_Subtype_Strings
), 0x0,
526 { &hf_simple_link16_rc
,
527 { "R/C Flag", "simple.link16.rc", FT_BOOLEAN
, BASE_NONE
, TFS(&tfs_required_not_required
), 0x0,
529 { &hf_simple_link16_network
,
530 { "Network", "simple.link16.network", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
532 { &hf_simple_link16_ssc2
,
533 { "Sequential Slot Count 2", "simple.link16.ssc2", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
535 { &hf_simple_link16_npg
,
536 { "NPG Number", "simple.link16.npg", FT_UINT16
, BASE_DEC
, VALS(Link16_NPG_Strings
), 0x0,
538 { &hf_simple_link16_ssc1
,
539 { "Sequential Slot Count 1", "simple.link16.ssc1", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
541 { &hf_simple_link16_stn
,
542 { "Source Track Number", "simple.link16.stn", FT_UINT16
, BASE_OCT
, NULL
, 0x0,
544 { &hf_simple_link16_word_count
,
545 { "Word Count", "simple.link16.word_count", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
547 { &hf_simple_link16_loopback_id
,
548 { "Loopback ID", "simple.link16.loopback_id", FT_UINT16
, BASE_DEC
, NULL
, 0x0,
550 { &hf_simple_status_subtype
,
551 { "Subtype", "simple.status.subtype", FT_UINT8
, BASE_HEX
, VALS(Status_Subtype_Strings
), 0x0,
553 { &hf_simple_status_word_count
,
554 { "Word Count", "simple.status.word_count", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
556 { &hf_simple_status_name
,
557 { "Name", "simple.status.name", FT_STRING
, BASE_NONE
, NULL
, 0x0,
559 { &hf_simple_status_time_hours
,
560 { "Time (Hours)", "simple.status.time_hours", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
562 { &hf_simple_status_node_id
,
563 { "Node Id", "simple.status.node_id", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
565 { &hf_simple_status_time_seconds
,
566 { "Time (Seconds)", "simple.status.time_seconds", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
568 { &hf_simple_status_time_minutes
,
569 { "Time (Minutes)", "simple.status.time_minutes", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
571 { &hf_simple_status_security_level
,
572 { "Security Level", "simple.status.security_level", FT_UINT8
, BASE_DEC
, VALS(Security_Level_Strings
), 0x0,
574 { &hf_simple_status_node_entry_flag
,
575 { "Node Entry Flag", "simple.status.node_entry_flag", FT_BOOLEAN
, BASE_NONE
, NULL
, 0x0,
577 { &hf_simple_status_relay_hop
,
578 { "Relay Hop", "simple.status.relay_hop", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
580 { &hf_simple_status_dx_flag_system_messages
,
581 { "DX System Messages", "simple.status.dx_flag.system_messages", FT_BOOLEAN
, 16, NULL
, 0x0001,
583 { &hf_simple_status_dx_flag_common_tims_bims
,
584 { "DX Common TIMS/BIMS", "simple.status.dx_flag.common_tims_bims", FT_BOOLEAN
, 16, NULL
, 0x0002,
586 { &hf_simple_status_dx_flag_common_toms_boms
,
587 { "DX Common TOMS/BOMS", "simple.status.dx_flag.common_toms_boms", FT_BOOLEAN
, 16, NULL
, 0x0004,
589 { &hf_simple_status_dx_flag_simple_receive
,
590 { "DX SIMPLE Receive", "simple.status.dx_flag.simple_receive", FT_BOOLEAN
, 16, NULL
, 0x8,
592 { &hf_simple_status_dx_flag_simple_transmit
,
593 { "DX SIMPLE Transmit", "simple.status.dx_flag.simple_transmit", FT_BOOLEAN
, 16, NULL
, 0x0010,
595 { &hf_simple_status_dx_flag_all_tims_bims
,
596 { "DX All TIMS/BIMS", "simple.status.dx_flag.all_tims_bims", FT_BOOLEAN
, 16, NULL
, 0x0020,
598 { &hf_simple_status_dx_flag_all_toms_boms
,
599 { "DX All TOMS/BOMS", "simple.status.dx_flag.all_toms_boms", FT_BOOLEAN
, 16, NULL
, 0x0040,
601 { &hf_simple_status_dx_file_id
,
602 { "DX File Id", "simple.status.dx_file_id", FT_STRING
, BASE_NONE
, NULL
, 0x0,
604 { &hf_simple_status_spare_1
,
605 { "Spare1", "simple.status.spare_1", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
607 { &hf_simple_status_link16_terminal_type
,
608 { "Link 16 Type", "simple.status.link16.terminal_type", FT_UINT8
, BASE_DEC
, VALS(Link16_Terminal_Type
), 0x0,
610 { &hf_simple_status_link16_role
,
611 { "Link 16 Role", "simple.status.link16.role", FT_UINT8
, BASE_DEC
, VALS(Link16_Role
), 0x0,
613 { &hf_simple_status_link16_sync_status
,
614 { "Link 16 Sync Status", "simple.status.link16.sync_status", FT_UINT8
, BASE_DEC
, VALS(Link16_Sync_Status
), 0x0,
616 { &hf_simple_status_link16_terminal_host_status
,
617 { "Link 16 Terminal/Host Status", "simple.status.link16.terminal_host_status", FT_UINT8
, BASE_DEC
, VALS(Link_Terminal_Host_Status
), 0x0,
619 { &hf_simple_status_link16_stn
,
620 { "Link 16 STN", "simple.status.link16.stn", FT_UINT16
, BASE_OCT
, NULL
, 0x0,
622 { &hf_simple_status_spare_2
,
623 { "Spare2", "simple.status.spare_2", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
625 { &hf_simple_status_link11_dts_type
,
626 { "Link 11 DTS Type", "simple.status.link11.dts_type", FT_UINT8
, BASE_DEC
, VALS(Link11_DTS_Type
), 0x0,
628 { &hf_simple_status_link11_role
,
629 { "Link 11 Role", "simple.status.link11.role", FT_UINT8
, BASE_DEC
, VALS(Link11_Role
), 0x0,
631 { &hf_simple_status_link11_pu
,
632 { "Link 11 PU", "simple.status.link11.pu", FT_UINT8
, BASE_OCT
, NULL
, 0x0,
634 { &hf_simple_status_link11_dts_host_status
,
635 { "Link 11 DTS/Host Status", "simple.status.link11.dts_host_status", FT_UINT8
, BASE_DEC
, VALS(Link_Terminal_Host_Status
), 0x0,
637 { &hf_simple_status_spare_3
,
638 { "Spare3", "simple.status.spare_3", FT_BYTES
, BASE_NONE
, NULL
, 0x0,
640 { &hf_simple_checksum
,
641 { "Checksum", "simple.checksum", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
643 { &hf_simple_checksum_status
,
644 { "Checksum Status", "simple.checksum.status", FT_UINT8
, BASE_NONE
, VALS(proto_checksum_vals
), 0x0,
647 static int *ett
[] = {
650 &ett_simple_status_dx_flag
,
652 static ei_register_info ei
[] = {
653 { &ei_simple_sync_bytes_bad
, { "simple.sync_bytes.bad", PI_MALFORMED
, PI_ERROR
, "Bad sync bytes", EXPFILL
}},
654 { &ei_simple_length_bad
, { "simple.length.bad", PI_MALFORMED
, PI_ERROR
, "Bad length", EXPFILL
}},
655 { &ei_simple_packet_size_bad
, { "simple.packet_size.bad", PI_MALFORMED
, PI_ERROR
, "Bad packet length", EXPFILL
}},
656 { &ei_simple_checksum_bad
, { "simple.checksum.bad.expert", PI_CHECKSUM
, PI_ERROR
, "Bad checksum", EXPFILL
}},
658 expert_module_t
* expert_simple
;
660 proto_simple
= proto_register_protocol("Standard Interface for Multiple Platform Link Evaluation", "SIMPLE", "simple");
661 proto_register_field_array(proto_simple
, hf
, array_length(hf
));
662 proto_register_subtree_array(ett
, array_length(ett
));
663 expert_simple
= expert_register_protocol(proto_simple
);
664 expert_register_field_array(expert_simple
, ei
, array_length(ei
));
665 simple_dissector_handle
= register_dissector("simple", dissect_simple
, proto_simple
);
668 void proto_reg_handoff_simple(void)
670 dissector_add_for_decode_as_with_preference("udp.port", simple_dissector_handle
);
671 dissector_add_for_decode_as_with_preference("tcp.port", simple_dissector_handle
);
673 link16_handle
= find_dissector_add_dependency("link16", proto_simple
);
677 * Editor modelines - https://www.wireshark.org/tools/modelines.html
682 * indent-tabs-mode: nil
685 * vi: set shiftwidth=4 tabstop=8 expandtab:
686 * :indentSize=4:tabSize=8:noTabs=true: