Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-bpv6.c
blob6ea9661948fc0e5dda01010c0581d45476337e72
1 /* packet-bpv6.c
2 * References:
3 * RFC 5050: https://tools.ietf.org/html/rfc5050
5 * Copyright 2006-2007 The MITRE Corporation.
6 * All Rights Reserved.
7 * Approved for Public Release; Distribution Unlimited.
8 * Tracking Number 07-0090.
10 * The US Government will not be charged any license fee and/or royalties
11 * related to this software. Neither name of The MITRE Corporation; nor the
12 * names of its contributors may be used to endorse or promote products
13 * derived from this software without specific prior written permission.
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * SPDX-License-Identifier: GPL-2.0-or-later
21 * Specification reference:
22 * RFC 5050
23 * https://tools.ietf.org/html/rfc5050
27 * Modifications were made to this file under designation MFS-33289-1 and
28 * are Copyright 2015 United States Government as represented by NASA
29 * Marshall Space Flight Center. All Rights Reserved.
31 * Released under the GNU GPL with NASA legal approval granted 2016-06-10.
33 * The subject software is provided "AS IS" WITHOUT ANY WARRANTY of any kind,
34 * either expressed, implied or statutory and this agreement does not,
35 * in any manner, constitute an endorsement by government agency of any
36 * results, designs or products resulting from use of the subject software.
37 * See the Agreement for the specific language governing permissions and
38 * limitations.
41 #include "config.h"
43 #include <epan/packet.h>
44 #include <epan/expert.h>
45 #include <epan/tfs.h>
46 #include <epan/wscbor.h>
47 #include "packet-bpv6.h"
48 #include "packet-cfdp.h"
50 void proto_register_bpv6(void);
51 void proto_reg_handoff_bpv6(void);
53 static int dissect_admin_record(proto_tree *primary_tree, tvbuff_t *tvb, packet_info *pinfo,
54 int offset, int payload_length, bool* success);
56 extern void
57 dissect_amp_as_subtree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset);
60 static int evaluate_sdnv(tvbuff_t *tvb, int offset, int *bytecount);
62 /// Return an error_info index if not valid
63 static int evaluate_sdnv_ei(tvbuff_t *tvb, int offset, int *bytecount, expert_field **error);
65 static int add_sdnv_time_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_sdnv_time);
67 static int64_t
68 evaluate_sdnv_64(tvbuff_t *tvb, int offset, int *bytecount);
70 static int proto_bundle;
71 static dissector_handle_t bundle_handle;
72 static dissector_handle_t bpv6_handle;
73 static dissector_handle_t bpv7_handle;
75 static int hf_bundle_pdu_version;
77 /* Primary Header Processing Flag Variables */
78 static int hf_bundle_procflags;
79 static int hf_bundle_procflags_fragment;
80 static int hf_bundle_procflags_admin;
81 static int hf_bundle_procflags_dont_fragment;
82 static int hf_bundle_procflags_cust_xfer_req;
83 static int hf_bundle_procflags_dest_singleton;
84 static int hf_bundle_procflags_application_ack;
86 /* Additions for Version 5 */
87 static int hf_bundle_control_flags;
88 static int hf_bundle_procflags_general;
89 static int hf_bundle_procflags_cos;
90 static int hf_bundle_procflags_status;
92 /* Primary Header COS Flag Variables */
93 static int hf_bundle_cosflags;
94 static int hf_bundle_cosflags_priority;
96 /* Primary Header Status Report Request Flag Variables */
97 static int hf_bundle_srrflags;
98 static int hf_bundle_srrflags_report_receipt;
99 static int hf_bundle_srrflags_report_cust_accept;
100 static int hf_bundle_srrflags_report_forward;
101 static int hf_bundle_srrflags_report_delivery;
102 static int hf_bundle_srrflags_report_deletion;
103 static int hf_bundle_srrflags_report_ack;
105 /* Primary Header Fields*/
106 static int hf_bundle_primary_header_len;
107 static int hf_bundle_primary_dictionary_len;
108 static int hf_bundle_primary_timestamp;
109 static int hf_bundle_primary_fragment_offset;
110 static int hf_bundle_primary_total_adu_len;
111 static int hf_bundle_primary_timestamp_seq_num64;
112 static int hf_bundle_primary_timestamp_seq_num32;
114 static int hf_bundle_dest_scheme_offset_u16;
115 static int hf_bundle_dest_scheme_offset_i32;
116 static int hf_bundle_dest_ssp_offset_u16;
117 static int hf_bundle_dest_ssp_offset_i32;
118 static int hf_bundle_source_scheme_offset_u16;
119 static int hf_bundle_source_scheme_offset_i32;
120 static int hf_bundle_source_ssp_offset_u16;
121 static int hf_bundle_source_ssp_offset_i32;
122 static int hf_bundle_report_scheme_offset_u16;
123 static int hf_bundle_report_scheme_offset_i32;
124 static int hf_bundle_report_ssp_offset_u16;
125 static int hf_bundle_report_ssp_offset_i32;
126 static int hf_bundle_cust_scheme_offset_u16;
127 static int hf_bundle_cust_scheme_offset_i32;
128 static int hf_bundle_cust_ssp_offset_u16;
129 static int hf_bundle_cust_ssp_offset_i32;
131 /* Dictionary EIDs */
132 static int hf_bundle_dest_scheme;
133 static int hf_bundle_dest_ssp;
134 static int hf_bundle_source_scheme;
135 static int hf_bundle_source_ssp;
136 static int hf_bundle_report_scheme;
137 static int hf_bundle_report_ssp;
138 static int hf_bundle_custodian_scheme;
139 static int hf_bundle_custodian_ssp;
141 /* Remaining Primary Header Fields */
142 static int hf_bundle_creation_timestamp;
143 static int hf_bundle_lifetime;
144 static int hf_bundle_lifetime_sdnv;
146 /* Secondary Header Processing Flag Variables */
147 static int hf_bundle_payload_length;
148 static int hf_bundle_payload_header_type;
149 static int hf_bundle_payload_data;
150 static int hf_bundle_payload_flags;
151 static int hf_bundle_payload_flags_replicate_hdr;
152 static int hf_bundle_payload_flags_xmit_report;
153 static int hf_bundle_payload_flags_discard_on_fail;
154 static int hf_bundle_payload_flags_last_header;
156 /* Block Processing Control Flag Variables (Version 5) */
157 static int hf_block_control_flags;
158 static int hf_block_control_flags_sdnv;
159 static int hf_block_control_replicate;
160 static int hf_block_control_transmit_status;
161 static int hf_block_control_delete_bundle;
162 static int hf_block_control_last_block;
163 static int hf_block_control_discard_block;
164 static int hf_block_control_not_processed;
165 static int hf_block_control_eid_reference;
166 static int hf_block_control_block_length;
167 static int hf_block_control_block_cteb_custody_id;
168 static int hf_block_control_block_cteb_creator_custodian_eid;
170 /* Non-Primary Block Type Code Variable */
171 static int hf_bundle_block_type_code;
172 static int hf_bundle_unprocessed_block_data;
174 /* ECOS Flag Variables */
175 static int hf_ecos_flags;
176 static int hf_ecos_flags_critical;
177 static int hf_ecos_flags_streaming;
178 static int hf_ecos_flags_flowlabel;
179 static int hf_ecos_flags_reliable;
180 static int hf_ecos_flow_label;
182 static int hf_ecos_ordinal;
184 /* Administrative Record Variables */
185 static int hf_bundle_admin_record_type;
186 static int hf_bundle_admin_record_fragment;
187 static int hf_bundle_admin_statflags;
188 static int hf_bundle_admin_rcvd;
189 static int hf_bundle_admin_accepted;
190 static int hf_bundle_admin_forwarded;
191 static int hf_bundle_admin_delivered;
192 static int hf_bundle_admin_deleted;
193 static int hf_bundle_admin_acked;
194 static int hf_bundle_admin_fragment_offset;
195 static int hf_bundle_admin_fragment_length;
196 static int hf_bundle_admin_timestamp_seq_num64;
197 static int hf_bundle_admin_timestamp_seq_num32;
198 static int hf_bundle_admin_endpoint_length;
199 static int hf_bundle_admin_endpoint_id;
201 static int hf_bundle_admin_receipt_time;
202 static int hf_bundle_admin_accept_time;
203 static int hf_bundle_admin_forward_time;
204 static int hf_bundle_admin_delivery_time;
205 static int hf_bundle_admin_delete_time;
206 static int hf_bundle_admin_ack_time;
207 static int hf_bundle_admin_timestamp_copy;
208 static int hf_bundle_admin_signal_time;
209 static int hf_bundle_status_report_reason_code;
210 static int hf_bundle_custody_trf_succ_flg;
211 static int hf_bundle_custody_signal_reason;
212 static int hf_bundle_custody_id_range_start;
213 static int hf_bundle_custody_id_range_end;
215 static int hf_bundle_age_extension_block_code;
216 static int hf_bundle_block_previous_hop_scheme;
217 static int hf_bundle_block_previous_hop_eid;
219 /* Security Block Variables */
220 static int hf_bundle_target_block_type;
221 static int hf_bundle_target_block_occurrence;
222 static int hf_bundle_ciphersuite_type;
223 static int hf_bundle_ciphersuite_flags;
224 static int hf_block_ciphersuite_params;
225 static int hf_block_ciphersuite_params_length;
226 static int hf_block_ciphersuite_params_item_length;
227 static int hf_block_ciphersuite_param_type;
228 static int hf_block_ciphersuite_param_data;
229 static int hf_block_ciphersuite_result_length;
230 static int hf_block_ciphersuite_result_item_length;
231 static int hf_block_ciphersuite_result_type;
232 static int hf_block_ciphersuite_result_data;
233 static int hf_block_ciphersuite_range_offset;
234 static int hf_block_ciphersuite_range_length;
236 /* Tree Node Variables */
237 static int ett_bundle;
238 static int ett_bundle_hdr;
239 static int ett_primary_hdr;
240 static int ett_proc_flags;
241 static int ett_gen_flags;
242 static int ett_cos_flags;
243 static int ett_srr_flags;
244 static int ett_dictionary;
245 static int ett_payload_hdr;
246 static int ett_payload_flags;
247 static int ett_block_flags;
248 static int ett_admin_record;
249 static int ett_admin_rec_status;
250 static int ett_metadata_hdr;
251 static int ett_sec_block_param_data;
253 static expert_field ei_bundle_payload_length;
254 static expert_field ei_bundle_control_flags_length;
255 static expert_field ei_bundle_block_control_flags;
256 static expert_field ei_bundle_sdnv_length;
257 static expert_field ei_bundle_timestamp_seq_num;
258 static expert_field ei_bundle_offset_error;
259 static expert_field ei_block_control_block_cteb_invalid;
260 static expert_field ei_block_control_block_cteb_valid;
263 typedef struct dictionary_data {
264 int bundle_header_dict_length;
266 int dest_scheme_offset;
267 int dst_scheme_pos;
268 int dst_scheme_len;
269 int source_scheme_offset;
270 int src_scheme_pos;
271 int src_scheme_len;
272 int report_scheme_offset;
273 int rpt_scheme_pos;
274 int rpt_scheme_len;
275 int cust_scheme_offset;
276 int cust_scheme_pos;
277 int cust_scheme_len;
278 int dest_ssp_offset;
279 int dst_ssp_len;
280 int source_ssp_offset;
281 int src_ssp_len;
282 int report_ssp_offset;
283 int rpt_ssp_len;
284 int cust_ssp_offset;
285 int cust_ssp_len;
287 } dictionary_data_t;
290 static const value_string admin_record_type_vals[] = {
291 {ADMIN_REC_TYPE_STATUS_REPORT, "Bundle Status Report"},
292 {ADMIN_REC_TYPE_CUSTODY_SIGNAL, "Custody Signal"},
293 {ADMIN_REC_TYPE_AGGREGATE_CUSTODY_SIGNAL, "Aggregate Custody Signal"},
294 {ADMIN_REC_TYPE_ANNOUNCE_BUNDLE, "Announce Record (Contact)"},
295 {0, NULL}
298 static const value_string custody_signal_reason_codes[] = {
299 {0x0, "No Additional Information"},
300 {0x3, "Redundant Reception"},
301 {0x4, "Depleted Storage"},
302 {0x5, "Destination Endpoint ID Unintelligible"},
303 {0x6, "No Known Route to Destination"},
304 {0x7, "No Timely Contact with Next Node on Route"},
305 {0x8, "Header Unintelligible"},
306 {0, NULL}
309 static const value_string status_report_reason_codes[] = {
310 {0x0, "No Additional Information"},
311 {0x1, "Lifetime Expired"},
312 {0x2, "Forwarded over Unidirectional Link"},
313 {0x3, "Transmission Cancelled"},
314 {0x4, "Depleted Storage"},
315 {0x5, "Destination Endpoint ID Unintelligible"},
316 {0x6, "No Known Route to Destination"},
317 {0x7, "No Timely Contact with Next Node on Route"},
318 {0x8, "Header Unintelligible"},
319 {0, NULL}
322 static const value_string bundle_block_type_codes[] = {
323 {0x01, "Bundle Payload Block"},
324 {0x02, "Bundle Authentication Block"},
325 {0x03, "Block Integrity Block"},
326 {0x04, "Block Confidentiality Block"},
327 {0x05, "Previous-Hop Insertion Block"},
328 {0x08, "Metadata Extension Block"},
329 {0x09, "Extension Security Block"},
330 {0x0a, "Custody Transfer Enhancement Block"},
331 {0x13, "Extended Class of Service Block"},
332 {0x14, "Bundle Age Extension Block"},
333 {0, NULL}
336 static const value_string cosflags_priority_vals[] = {
337 {0x00, "Bulk"},
338 {0x01, "Normal"},
339 {0x02, "Expedited"},
340 {0x03, "Invalid (Reserved)"},
341 {0, NULL}
344 static const value_string ciphersuite_types[] = {
345 {0x01, "HMAC_SHA1"},
346 {0x05, "HMAC_SHA256"},
347 {0x06, "ARC4_AES128"},
348 {0xD1, "HMAC_SHA384"},
349 {0xD2, "ECDSA_SHA256"},
350 {0xD3, "ECDSA_SHA384"},
351 {0xD4, "SHA256_AES128"},
352 {0xD5, "SHA384_AES256"},
353 {0, NULL}
356 static const value_string res_params_types[] = {
357 {0x01, "Initialization Vector"},
358 {0x03, "Key Information"},
359 {0x04, "Content Range"},
360 {0x05, "Integrity Signature"},
361 {0x07, "Salt"},
362 {0x08, "BCB Integrity Check Value"},
363 {0, NULL}
367 * Adds the result of 2 SDNVs to tree: First SDNV is seconds, next is nanoseconds.
368 * Returns bytes in both SDNVs or 0 if something goes wrong.
370 static int
371 add_dtn_time_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_dtn_time)
373 nstime_t dtn_time;
374 int sdnv_length, sdnv2_length;
375 int sdnv_value;
376 int orig_offset;
378 orig_offset = offset;
380 sdnv_value = evaluate_sdnv(tvb, offset, &sdnv_length);
381 if (sdnv_value < 0) {
382 return 0;
385 dtn_time.secs = (time_t)(sdnv_value + 946684800);
386 offset += sdnv_length;
388 dtn_time.nsecs = evaluate_sdnv(tvb, offset, &sdnv2_length);
389 if (dtn_time.nsecs < 0) {
390 return 0;
393 proto_tree_add_time(tree, hf_dtn_time, tvb, orig_offset, sdnv_length + sdnv2_length, &dtn_time);
395 return (sdnv_length + sdnv2_length);
399 * Adds the result of SDNV which is a time since 2000 to tree.
400 * Returns bytes in SDNV or 0 if something goes wrong.
403 add_sdnv_time_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_sdnv_time)
405 nstime_t dtn_time;
406 int sdnv_length;
407 int sdnv_value;
409 sdnv_value = evaluate_sdnv(tvb, offset, &sdnv_length);
410 if (sdnv_value < 0) {
411 return 0;
414 dtn_time.secs = (time_t)(sdnv_value + 946684800);
415 dtn_time.nsecs = 0;
416 proto_tree_add_time(tree, hf_sdnv_time, tvb, offset, sdnv_length, &dtn_time);
418 return sdnv_length;
421 static int
422 add_sdnv_to_tree(proto_tree *tree, tvbuff_t *tvb, packet_info* pinfo, int offset, int hf_sdnv)
424 proto_item *ti;
425 int sdnv_length;
426 int sdnv_value;
428 sdnv_value = evaluate_sdnv(tvb, offset, &sdnv_length);
429 ti = proto_tree_add_int(tree, hf_sdnv, tvb, offset, sdnv_length, sdnv_value);
430 if (sdnv_value < 0) {
431 expert_add_info(pinfo, ti, &ei_bundle_sdnv_length);
432 return 0;
434 return sdnv_length;
438 * Pull out stuff from the dictionary
440 static int
441 dissect_dictionary(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, dictionary_data_t* dict_data,
442 uint8_t pri_hdr_procflags, char **bundle_custodian, int creation_timestamp, int timestamp_sequence)
444 proto_tree *dict_tree;
445 const char* col_text;
447 col_text = col_get_text(pinfo->cinfo, COL_INFO);
449 dict_tree = proto_tree_add_subtree(tree, tvb, offset, dict_data->bundle_header_dict_length, ett_dictionary, NULL, "Dictionary");
452 * If the dictionary length is 0, then the CBHE block compression method is applied. (RFC6260)
453 * So the scheme offset is the node number and the ssp offset is the service number.
454 * If destination scheme offset is 2 and destination ssp offset is 1, then the EID is
455 * ipn:2.1
457 if (dict_data->bundle_header_dict_length == 0)
459 const char *src_node, *dst_node;
462 * Destination info
464 if (dict_data->dest_scheme_offset == 0 && dict_data->dest_ssp_offset == 0)
466 proto_tree_add_string(dict_tree, hf_bundle_dest_scheme, tvb, 0, 0, DTN_SCHEME_STR);
467 proto_tree_add_string(dict_tree, hf_bundle_dest_ssp, tvb, dict_data->dst_scheme_pos,
468 dict_data->dst_scheme_len + dict_data->dst_ssp_len, "none");
470 dst_node = "dtn:none";
472 else
474 proto_tree_add_string(dict_tree, hf_bundle_dest_scheme, tvb, 0, 0, IPN_SCHEME_STR);
475 proto_tree_add_string(dict_tree, hf_bundle_dest_ssp, tvb, dict_data->dst_scheme_pos,
476 dict_data->dst_scheme_len + dict_data->dst_ssp_len,
477 wmem_strdup_printf(pinfo->pool, "%d.%d",dict_data->dest_scheme_offset,dict_data->dest_ssp_offset));
479 dst_node = wmem_strdup_printf(pinfo->pool, "%s:%d.%d", IPN_SCHEME_STR,
480 dict_data->dest_scheme_offset, dict_data->dest_ssp_offset);
484 * Source info
486 if (dict_data->source_scheme_offset == 0 && dict_data->source_ssp_offset == 0)
488 proto_tree_add_string(dict_tree, hf_bundle_source_scheme, tvb, 0, 0, DTN_SCHEME_STR);
489 proto_tree_add_string(dict_tree, hf_bundle_source_ssp, tvb, dict_data->src_scheme_pos,
490 dict_data->src_scheme_len + dict_data->src_ssp_len, "none");
492 src_node = "dtn:none";
494 else
496 proto_tree_add_string(dict_tree, hf_bundle_source_scheme, tvb, 0, 0, IPN_SCHEME_STR);
497 proto_tree_add_string(dict_tree, hf_bundle_source_ssp, tvb, dict_data->src_scheme_pos,
498 dict_data->src_scheme_len + dict_data->src_ssp_len,
499 wmem_strdup_printf(pinfo->pool, "%d.%d", dict_data->source_scheme_offset, dict_data->source_ssp_offset));
501 src_node = wmem_strdup_printf(pinfo->pool, "%s:%d.%d", IPN_SCHEME_STR,
502 dict_data->source_scheme_offset, dict_data->source_ssp_offset);
506 * Report to info
508 if (dict_data->report_scheme_offset == 0 && dict_data->report_ssp_offset == 0)
510 proto_tree_add_string(dict_tree, hf_bundle_report_scheme, tvb, 0, 0, DTN_SCHEME_STR);
511 proto_tree_add_string(dict_tree, hf_bundle_report_ssp, tvb, dict_data->rpt_scheme_pos,
512 dict_data->rpt_scheme_len + dict_data->rpt_ssp_len, "none");
514 else
516 proto_tree_add_string(dict_tree, hf_bundle_report_scheme, tvb, 0, 0, IPN_SCHEME_STR);
517 proto_tree_add_string(dict_tree, hf_bundle_report_ssp, tvb, dict_data->rpt_scheme_pos,
518 dict_data->rpt_scheme_len + dict_data->rpt_ssp_len,
519 wmem_strdup_printf(pinfo->pool, "%d.%d", dict_data->report_scheme_offset, dict_data->report_ssp_offset));
523 * Custodian info
525 if (dict_data->cust_scheme_offset == 0 && dict_data->cust_ssp_offset == 0)
527 proto_tree_add_string(dict_tree, hf_bundle_custodian_scheme, tvb, 0, 0, DTN_SCHEME_STR);
528 proto_tree_add_string(dict_tree, hf_bundle_custodian_ssp, tvb, dict_data->cust_scheme_pos,
529 dict_data->cust_scheme_len + dict_data->cust_ssp_len, "none");
531 else
533 proto_tree_add_string(dict_tree, hf_bundle_custodian_scheme, tvb, 0, 0, IPN_SCHEME_STR);
534 proto_tree_add_string(dict_tree, hf_bundle_custodian_ssp, tvb, dict_data->cust_scheme_pos,
535 dict_data->cust_scheme_len + dict_data->cust_ssp_len,
536 wmem_strdup_printf(pinfo->pool, "%d.%d", dict_data->cust_scheme_offset, dict_data->cust_ssp_offset));
539 /* remember custodian, for use in checking cteb validity */
540 col_set_writable(pinfo->cinfo, COL_INFO, true);
541 col_clear_fence(pinfo->cinfo, COL_INFO);
542 if (col_text && strstr(col_text, " > ")) {
543 if (! strstr(col_text, "[multiple]")) {
544 col_append_str(pinfo->cinfo, COL_INFO, ", [multiple]");
546 } else {
547 col_clear(pinfo->cinfo, COL_INFO);
548 col_add_fstr(pinfo->cinfo, COL_INFO, "%s > %s %d.%d", src_node, dst_node, creation_timestamp, timestamp_sequence);
550 col_set_fence(pinfo->cinfo, COL_INFO);
552 *bundle_custodian = wmem_strdup_printf(pinfo->pool, "%s:%d.%d", IPN_SCHEME_STR,
553 dict_data->cust_scheme_offset, dict_data->cust_ssp_offset);
557 * This pointer can be made to address outside the packet boundaries so we
558 * need to check for improperly formatted strings (no null termination).
561 else
564 * Destination info
567 proto_tree_add_item(dict_tree, hf_bundle_dest_scheme,
568 tvb, offset + dict_data->dest_scheme_offset, -1, ENC_ASCII);
569 proto_tree_add_item(dict_tree, hf_bundle_dest_ssp,
570 tvb, offset + dict_data->dest_ssp_offset, -1, ENC_ASCII);
573 * Source info
576 proto_tree_add_item(dict_tree, hf_bundle_source_scheme,
577 tvb, offset + dict_data->source_scheme_offset, -1, ENC_ASCII);
578 proto_tree_add_item(dict_tree, hf_bundle_source_ssp,
579 tvb, offset + dict_data->source_ssp_offset, -1, ENC_ASCII);
582 * Report to info
585 proto_tree_add_item(dict_tree, hf_bundle_report_scheme,
586 tvb, offset + dict_data->report_scheme_offset, -1, ENC_ASCII);
587 proto_tree_add_item(dict_tree, hf_bundle_report_ssp,
588 tvb, offset + dict_data->report_ssp_offset, -1, ENC_ASCII);
591 * Custodian info
594 proto_tree_add_item(dict_tree, hf_bundle_custodian_scheme, tvb, offset + dict_data->cust_scheme_offset, -1, ENC_ASCII);
595 proto_tree_add_item(dict_tree, hf_bundle_custodian_ssp, tvb, offset + dict_data->cust_ssp_offset, -1, ENC_ASCII);
598 * Add Source/Destination to INFO Field
601 col_set_writable(pinfo->cinfo, COL_INFO, true);
602 col_clear_fence(pinfo->cinfo, COL_INFO);
603 if (col_text && strstr(col_text, " > "))
604 col_append_str(pinfo->cinfo, COL_INFO, ", [multiple]");
605 else {
606 col_clear(pinfo->cinfo, COL_INFO);
607 col_add_fstr(pinfo->cinfo, COL_INFO, "%s:%s > %s:%s %d.%d",
608 tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->source_scheme_offset, NULL, ENC_ASCII),
609 tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->source_ssp_offset, NULL, ENC_ASCII),
610 tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->dest_scheme_offset, NULL, ENC_ASCII),
611 tvb_get_stringz_enc(pinfo->pool, tvb, offset + dict_data->dest_ssp_offset, NULL, ENC_ASCII),
612 creation_timestamp, timestamp_sequence);
614 col_set_fence(pinfo->cinfo, COL_INFO);
617 /* remember custodian, for use in checking cteb validity */
618 *bundle_custodian = wmem_strdup_printf(pinfo->pool,
619 "%s:%s",
620 tvb_get_stringz_enc(pinfo->pool,
621 tvb, offset + dict_data->cust_scheme_offset,
622 NULL, ENC_ASCII),
623 tvb_get_stringz_enc(pinfo->pool,
624 tvb, offset + dict_data->cust_ssp_offset,
625 NULL, ENC_ASCII));
627 offset += dict_data->bundle_header_dict_length; /*Skip over dictionary*/
630 * Do this only if Fragment Flag is set
633 if (pri_hdr_procflags & BUNDLE_PROCFLAGS_FRAG_MASK) {
634 int sdnv_length;
635 sdnv_length = add_sdnv_to_tree(tree, tvb, pinfo, offset, hf_bundle_primary_fragment_offset);
636 if (sdnv_length < 0) {
637 return 0;
639 offset += sdnv_length;
641 sdnv_length = add_sdnv_to_tree(tree, tvb, pinfo, offset, hf_bundle_primary_total_adu_len);
642 if (sdnv_length < 0) {
643 return 0;
645 offset += sdnv_length;
648 return offset;
652 * This routine returns 0 if header decoding fails, otherwise the length of the primary
653 * header, starting right after version number.
655 static int
656 dissect_version_4_primary_header(packet_info *pinfo, proto_tree *primary_tree, tvbuff_t *tvb,
657 uint8_t* pri_hdr_procflags, char **bundle_custodian)
659 int bundle_header_length;
660 int offset = 1; /* Version Number already displayed */
661 int sdnv_length;
662 dictionary_data_t dict_data;
664 proto_item *ti;
665 proto_tree *srr_flag_tree, *proc_flag_tree, *cos_flag_tree;
667 /* Primary Header Processing Flags */
668 *pri_hdr_procflags = tvb_get_uint8(tvb, offset);
669 ti = proto_tree_add_item(primary_tree, hf_bundle_procflags, tvb,
670 offset, 1, ENC_BIG_ENDIAN);
671 proc_flag_tree = proto_item_add_subtree(ti, ett_proc_flags);
672 proto_tree_add_item(proc_flag_tree, hf_bundle_procflags_fragment,
673 tvb, offset, 1, ENC_BIG_ENDIAN);
674 proto_tree_add_item(proc_flag_tree, hf_bundle_procflags_admin,
675 tvb, offset, 1, ENC_BIG_ENDIAN);
676 proto_tree_add_item(proc_flag_tree, hf_bundle_procflags_dont_fragment,
677 tvb, offset, 1, ENC_BIG_ENDIAN);
678 proto_tree_add_item(proc_flag_tree, hf_bundle_procflags_cust_xfer_req,
679 tvb, offset, 1, ENC_BIG_ENDIAN);
680 proto_tree_add_item(proc_flag_tree, hf_bundle_procflags_dest_singleton,
681 tvb, offset, 1, ENC_BIG_ENDIAN);
683 /* Primary Header COS Flags */
684 ++offset;
685 ti = proto_tree_add_item(primary_tree, hf_bundle_cosflags, tvb,
686 offset, 1, ENC_BIG_ENDIAN);
687 cos_flag_tree = proto_item_add_subtree(ti, ett_cos_flags);
688 proto_tree_add_item(cos_flag_tree, hf_bundle_cosflags_priority,
689 tvb, offset, 1, ENC_BIG_ENDIAN);
690 /* Status Report Request Flags */
691 ++offset;
692 ti = proto_tree_add_item(primary_tree, hf_bundle_srrflags, tvb,
693 offset, 1, ENC_BIG_ENDIAN);
694 srr_flag_tree = proto_item_add_subtree(ti, ett_srr_flags);
696 proto_tree_add_item(srr_flag_tree, hf_bundle_srrflags_report_receipt,
697 tvb, offset, 1, ENC_BIG_ENDIAN);
698 proto_tree_add_item(srr_flag_tree, hf_bundle_srrflags_report_cust_accept,
699 tvb, offset, 1, ENC_BIG_ENDIAN);
700 proto_tree_add_item(srr_flag_tree, hf_bundle_srrflags_report_forward,
701 tvb, offset, 1, ENC_BIG_ENDIAN);
702 proto_tree_add_item(srr_flag_tree, hf_bundle_srrflags_report_delivery,
703 tvb, offset, 1, ENC_BIG_ENDIAN);
704 proto_tree_add_item(srr_flag_tree, hf_bundle_srrflags_report_deletion,
705 tvb, offset, 1, ENC_BIG_ENDIAN);
706 proto_tree_add_item(srr_flag_tree, hf_bundle_srrflags_report_ack,
707 tvb, offset, 1, ENC_BIG_ENDIAN);
708 ++offset;
710 bundle_header_length = evaluate_sdnv(tvb, offset, &sdnv_length);
711 ti = proto_tree_add_int(primary_tree, hf_bundle_primary_header_len, tvb, offset, sdnv_length,
712 bundle_header_length);
713 if (bundle_header_length < 0) {
714 expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "Bundle Header Length Error");
715 return tvb_reported_length_remaining(tvb, offset);
718 offset += sdnv_length;
720 /* Ensure all fields have been initialized */
721 memset(&dict_data, 0, sizeof(dict_data));
724 * Pick up offsets into dictionary (8 of them)
727 dict_data.dest_scheme_offset = tvb_get_ntohs(tvb, offset);
728 dict_data.dst_scheme_pos = offset;
729 dict_data.dst_scheme_len = 2;
730 proto_tree_add_item(primary_tree, hf_bundle_dest_scheme_offset_u16,
731 tvb, offset, 2, ENC_BIG_ENDIAN);
732 offset += 2;
734 dict_data.dest_ssp_offset = tvb_get_ntohs(tvb, offset);
735 dict_data.dst_ssp_len = 2;
736 proto_tree_add_item(primary_tree, hf_bundle_dest_ssp_offset_u16,
737 tvb, offset, 2, ENC_BIG_ENDIAN);
738 offset += 2;
740 dict_data.source_scheme_offset = tvb_get_ntohs(tvb, offset);
741 dict_data.src_scheme_pos = offset;
742 dict_data.src_scheme_len = 2;
743 proto_tree_add_item(primary_tree, hf_bundle_source_scheme_offset_u16,
744 tvb, offset, 2, ENC_BIG_ENDIAN);
745 offset += 2;
747 dict_data.source_ssp_offset = tvb_get_ntohs(tvb, offset);
748 dict_data.src_ssp_len = 2;
749 proto_tree_add_item(primary_tree, hf_bundle_source_ssp_offset_u16,
750 tvb, offset, 2, ENC_BIG_ENDIAN);
751 offset += 2;
753 dict_data.report_scheme_offset = tvb_get_ntohs(tvb, offset);
754 dict_data.rpt_scheme_pos = offset;
755 dict_data.rpt_scheme_len = 2;
756 proto_tree_add_item(primary_tree, hf_bundle_report_scheme_offset_u16,
757 tvb, offset, 2, ENC_BIG_ENDIAN);
758 offset += 2;
760 dict_data.report_ssp_offset = tvb_get_ntohs(tvb, offset);
761 dict_data.rpt_ssp_len = 2;
762 proto_tree_add_item(primary_tree, hf_bundle_report_ssp_offset_u16,
763 tvb, offset, 2, ENC_BIG_ENDIAN);
764 offset += 2;
766 dict_data.cust_scheme_offset = tvb_get_ntohs(tvb, offset);
767 dict_data.cust_scheme_pos = offset;
768 dict_data.cust_scheme_len = 2;
769 proto_tree_add_item(primary_tree, hf_bundle_cust_scheme_offset_u16,
770 tvb, offset, 2, ENC_BIG_ENDIAN);
771 offset += 2;
773 dict_data.cust_ssp_offset = tvb_get_ntohs(tvb, offset);
774 dict_data.cust_ssp_len = 2;
775 proto_tree_add_item(primary_tree, hf_bundle_cust_ssp_offset_u16,
776 tvb, offset, 2, ENC_BIG_ENDIAN);
777 offset += 2;
779 proto_tree_add_item(primary_tree, hf_bundle_creation_timestamp,
780 tvb, offset, 8, ENC_BIG_ENDIAN);
781 offset += 8;
783 proto_tree_add_item(primary_tree, hf_bundle_lifetime, tvb, offset, 4, ENC_BIG_ENDIAN);
784 offset += 4;
786 dict_data.bundle_header_dict_length = evaluate_sdnv(tvb, offset, &sdnv_length);
787 ti = proto_tree_add_int(primary_tree, hf_bundle_primary_dictionary_len, tvb, offset, sdnv_length,
788 dict_data.bundle_header_dict_length);
789 if (dict_data.bundle_header_dict_length < 0) {
790 expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "Dictionary Header Length Error");
791 return tvb_reported_length_remaining(tvb, offset);
793 offset += sdnv_length;
795 offset = dissect_dictionary(pinfo, primary_tree, tvb, offset, &dict_data, *pri_hdr_procflags, bundle_custodian, 0, 0);
796 return offset;
801 * This routine returns 0 if header decoding fails, otherwise the length of the primary
802 * header, starting right after version number.
805 static int src_ssp;
806 static int dst_ssp;
808 static int
809 dissect_version_5_and_6_primary_header(packet_info *pinfo,
810 proto_tree *primary_tree, tvbuff_t *tvb,
811 uint8_t* pri_hdr_procflags, char **bundle_custodian)
813 uint64_t bundle_processing_control_flags;
814 uint8_t cosflags;
815 int bundle_header_length;
816 int offset = 1; /* Version Number already displayed */
817 int sdnv_length;
818 dictionary_data_t dict_data;
819 int timestamp_sequence;
820 int creation_timestamp;
821 uint8_t srrflags;
822 proto_item *ti;
823 proto_item *ti_dst_scheme_offset, *ti_dst_ssp_offset;
824 proto_item *ti_src_scheme_offset, *ti_src_ssp_offset;
825 proto_item *ti_cust_scheme_offset, *ti_cust_ssp_offset;
826 proto_item *ti_rprt_scheme_offset, *ti_rprt_ssp_offset;
827 proto_tree *gen_flag_tree, *srr_flag_tree, *proc_flag_tree, *cos_flag_tree;
828 static int * const pri_flags[] = {
829 &hf_bundle_procflags_fragment,
830 &hf_bundle_procflags_admin,
831 &hf_bundle_procflags_dont_fragment,
832 &hf_bundle_procflags_cust_xfer_req,
833 &hf_bundle_procflags_dest_singleton,
834 &hf_bundle_procflags_application_ack,
835 NULL
838 static int * const srr_flags[] = {
839 &hf_bundle_srrflags_report_receipt,
840 &hf_bundle_srrflags_report_cust_accept,
841 &hf_bundle_srrflags_report_forward,
842 &hf_bundle_srrflags_report_delivery,
843 &hf_bundle_srrflags_report_deletion,
844 NULL
847 bundle_processing_control_flags = evaluate_sdnv_64(tvb, offset, &sdnv_length);
849 /* Primary Header Processing Flags */
850 *pri_hdr_procflags = (uint8_t) (bundle_processing_control_flags & 0x7f);
852 if (sdnv_length < 1 || sdnv_length > 8) {
853 expert_add_info_format(pinfo, primary_tree, &ei_bundle_control_flags_length,
854 "Wrong bundle control flag length: %d", sdnv_length);
855 return 0;
857 ti = proto_tree_add_item(primary_tree, hf_bundle_control_flags, tvb,
858 offset, sdnv_length, ENC_BIG_ENDIAN);
859 proc_flag_tree = proto_item_add_subtree(ti, ett_proc_flags);
861 ti = proto_tree_add_uint(proc_flag_tree, hf_bundle_procflags_general, tvb, offset,
862 sdnv_length, *pri_hdr_procflags);
863 gen_flag_tree = proto_item_add_subtree(ti, ett_gen_flags);
865 /* With the variability of sdnv_length, proto_tree_add_bitmask_value
866 can't be used */
868 proto_tree_add_bitmask_list_value(gen_flag_tree, tvb, offset, sdnv_length, pri_flags, *pri_hdr_procflags);
870 /* Primary Header COS Flags */
871 cosflags = (uint8_t) ((bundle_processing_control_flags >> 7) & 0x7f);
872 ti = proto_tree_add_uint(proc_flag_tree, hf_bundle_procflags_cos, tvb, offset,
873 sdnv_length, cosflags);
874 cos_flag_tree = proto_item_add_subtree(ti, ett_cos_flags);
875 proto_tree_add_uint(cos_flag_tree, hf_bundle_cosflags_priority, tvb, offset,
876 sdnv_length, cosflags);
878 /* Status Report Request Flags */
879 srrflags = (uint8_t) ((bundle_processing_control_flags >> 14) & 0x7f);
880 ti = proto_tree_add_uint(proc_flag_tree, hf_bundle_procflags_status, tvb, offset,
881 sdnv_length, srrflags);
882 srr_flag_tree = proto_item_add_subtree(ti, ett_srr_flags);
884 proto_tree_add_bitmask_list_value(srr_flag_tree, tvb, offset, sdnv_length, srr_flags, srrflags);
885 offset += sdnv_length;
887 /* -- hdr_length -- */
888 bundle_header_length = evaluate_sdnv(tvb, offset, &sdnv_length);
889 ti = proto_tree_add_int(primary_tree, hf_bundle_primary_header_len, tvb, offset, sdnv_length,
890 bundle_header_length);
891 if (bundle_header_length < 0) {
892 expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "Bundle Header Length Error");
893 return tvb_reported_length_remaining(tvb, offset);
896 offset += sdnv_length;
899 * Pick up offsets into dictionary (8 of them). Do rough sanity check that SDNV
900 * hasn't told us to access way past the Primary Header.
903 /* Ensure all fields have been initialized */
904 memset(&dict_data, 0, sizeof(dict_data));
906 /* -- dest_scheme -- */
907 dict_data.dest_scheme_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
908 dict_data.dst_scheme_pos = offset;
909 dict_data.dst_scheme_len = sdnv_length;
911 ti_dst_scheme_offset = proto_tree_add_int(primary_tree, hf_bundle_dest_scheme_offset_i32, tvb, offset, sdnv_length,
912 dict_data.dest_scheme_offset);
913 offset += sdnv_length;
915 /* -- dest_ssp -- */
916 dict_data.dest_ssp_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
917 dict_data.dst_ssp_len = sdnv_length;
918 dst_ssp = dict_data.dest_ssp_offset;
920 ti_dst_ssp_offset = proto_tree_add_int(primary_tree, hf_bundle_dest_ssp_offset_i32, tvb, offset, sdnv_length,
921 dict_data.dest_ssp_offset);
922 offset += sdnv_length;
924 /* -- source_scheme -- */
925 dict_data.source_scheme_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
926 dict_data.src_scheme_pos = offset;
927 dict_data.src_scheme_len = sdnv_length;
929 ti_src_scheme_offset = proto_tree_add_int(primary_tree, hf_bundle_source_scheme_offset_i32, tvb, offset, sdnv_length,
930 dict_data.source_scheme_offset);
931 offset += sdnv_length;
933 /* -- source_ssp -- */
934 dict_data.source_ssp_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
935 dict_data.src_ssp_len = sdnv_length;
936 src_ssp = dict_data.source_ssp_offset;
938 ti_src_ssp_offset = proto_tree_add_int(primary_tree, hf_bundle_source_ssp_offset_i32, tvb, offset, sdnv_length,
939 dict_data.source_ssp_offset);
940 offset += sdnv_length;
942 /* -- report_scheme -- */
943 dict_data.report_scheme_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
944 dict_data.rpt_scheme_pos = offset;
945 dict_data.rpt_scheme_len = sdnv_length;
947 ti_rprt_scheme_offset = proto_tree_add_int(primary_tree, hf_bundle_report_scheme_offset_i32, tvb, offset,
948 sdnv_length, dict_data.report_scheme_offset);
949 offset += sdnv_length;
951 /* -- report_ssp -- */
952 dict_data.report_ssp_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
953 dict_data.rpt_ssp_len = sdnv_length;
955 ti_rprt_ssp_offset = proto_tree_add_int(primary_tree, hf_bundle_report_ssp_offset_i32, tvb, offset, sdnv_length,
956 dict_data.report_ssp_offset);
957 offset += sdnv_length;
960 /* -- cust_scheme -- */
961 dict_data.cust_scheme_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
962 dict_data.cust_scheme_pos = offset;
963 dict_data.cust_scheme_len = sdnv_length;
965 ti_cust_scheme_offset = proto_tree_add_int(primary_tree, hf_bundle_cust_scheme_offset_i32, tvb, offset, sdnv_length,
966 dict_data.cust_scheme_offset);
967 offset += sdnv_length;
969 /* -- cust_ssp -- */
970 dict_data.cust_ssp_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
971 dict_data.cust_ssp_len = sdnv_length;
973 ti_cust_ssp_offset = proto_tree_add_int(primary_tree, hf_bundle_cust_ssp_offset_i32, tvb, offset, sdnv_length,
974 dict_data.cust_ssp_offset);
975 offset += sdnv_length;
978 creation_timestamp = evaluate_sdnv(tvb, offset, &sdnv_length);
979 sdnv_length = add_sdnv_time_to_tree(primary_tree, tvb, offset, hf_bundle_primary_timestamp);
980 if (sdnv_length == 0)
981 return 0;
983 offset += sdnv_length;
985 /* -- timestamp_sequence -- */
986 timestamp_sequence = evaluate_sdnv(tvb, offset, &sdnv_length);
987 if (timestamp_sequence < 0) {
988 int64_t ts_seq = evaluate_sdnv_64(tvb, offset, &sdnv_length);
990 ti = proto_tree_add_int64(primary_tree, hf_bundle_primary_timestamp_seq_num64,
991 tvb, offset, sdnv_length, ts_seq);
992 if (ts_seq < 0) {
993 expert_add_info(pinfo, ti, &ei_bundle_timestamp_seq_num);
996 else {
997 proto_tree_add_int(primary_tree, hf_bundle_primary_timestamp_seq_num32,
998 tvb, offset, sdnv_length, timestamp_sequence);
1000 offset += sdnv_length;
1002 /* -- lifetime -- */
1003 sdnv_length = add_sdnv_to_tree(primary_tree, tvb, pinfo, offset, hf_bundle_lifetime_sdnv);
1004 offset += sdnv_length;
1006 /* -- dict_length -- */
1007 dict_data.bundle_header_dict_length = evaluate_sdnv(tvb, offset, &sdnv_length);
1008 ti = proto_tree_add_int(primary_tree, hf_bundle_primary_dictionary_len, tvb, offset, sdnv_length,
1009 dict_data.bundle_header_dict_length);
1010 if (dict_data.bundle_header_dict_length < 0) {
1011 expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "Dictionary Header Length Error");
1012 return tvb_reported_length_remaining(tvb, offset);
1014 offset += sdnv_length;
1016 if ((dict_data.dest_scheme_offset < 0) ||
1017 (dict_data.bundle_header_dict_length > 0 && (dict_data.dest_scheme_offset > bundle_header_length))) {
1018 expert_add_info_format(pinfo, ti_dst_scheme_offset, &ei_bundle_offset_error, "Destination Scheme Offset Error");
1020 if ((dict_data.dest_ssp_offset < 0) ||
1021 (dict_data.bundle_header_dict_length > 0 && (dict_data.dest_ssp_offset > bundle_header_length))) {
1022 expert_add_info_format(pinfo, ti_dst_ssp_offset, &ei_bundle_offset_error, "Destination SSP Offset Error");
1024 if ((dict_data.source_scheme_offset < 0) ||
1025 (dict_data.bundle_header_dict_length > 0 && (dict_data.source_scheme_offset > bundle_header_length))) {
1026 expert_add_info_format(pinfo, ti_src_scheme_offset, &ei_bundle_offset_error, "Source Scheme Offset Error");
1028 if ((dict_data.source_ssp_offset < 0) ||
1029 (dict_data.bundle_header_dict_length > 0 && (dict_data.source_ssp_offset > bundle_header_length))) {
1030 expert_add_info_format(pinfo, ti_src_ssp_offset, &ei_bundle_offset_error, "Source SSP Offset Error");
1032 if ((dict_data.report_scheme_offset < 0) ||
1033 (dict_data.bundle_header_dict_length > 0 && (dict_data.report_scheme_offset > bundle_header_length))) {
1034 expert_add_info_format(pinfo, ti_rprt_scheme_offset, &ei_bundle_offset_error, "Report Scheme Offset Error");
1036 if ((dict_data.report_ssp_offset < 0) ||
1037 (dict_data.bundle_header_dict_length > 0 && (dict_data.report_ssp_offset > bundle_header_length))) {
1038 expert_add_info_format(pinfo, ti_rprt_ssp_offset, &ei_bundle_offset_error, "Report SSP Offset Error");
1040 if ((dict_data.cust_scheme_offset < 0) ||
1041 (dict_data.bundle_header_dict_length > 0 && (dict_data.cust_scheme_offset > bundle_header_length))) {
1042 expert_add_info_format(pinfo, ti_cust_scheme_offset, &ei_bundle_offset_error, "Custodian Scheme Offset Error");
1044 if ((dict_data.cust_ssp_offset < 0) ||
1045 (dict_data.bundle_header_dict_length > 0 && (dict_data.cust_ssp_offset > bundle_header_length))) {
1046 expert_add_info_format(pinfo, ti_cust_ssp_offset, &ei_bundle_offset_error, "Custodian SSP Offset Error");
1049 offset = dissect_dictionary(pinfo, primary_tree, tvb, offset, &dict_data, *pri_hdr_procflags, bundle_custodian,
1050 creation_timestamp, timestamp_sequence);
1051 return offset;
1055 * offset is where the header starts.
1056 * Return new offset, and set lastheader if failure.
1058 static int
1059 dissect_payload_header(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t version,
1060 uint8_t pri_hdr_procflags, bool *lastheader)
1062 proto_item *payload_block, *payload_item, *ti;
1063 proto_tree *payload_block_tree, *payload_tree;
1064 int sdnv_length, payload_length;
1066 payload_block_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_payload_hdr, &payload_block, "Payload Block");
1068 payload_tree = proto_tree_add_subtree(payload_block_tree, tvb, offset, -1, ett_payload_hdr, &payload_item, "Payload Header");
1070 proto_tree_add_uint(payload_tree, hf_bundle_payload_header_type, tvb, offset, 1, 1);
1071 ++offset;
1073 /* Add tree for processing flags */
1074 /* This is really a SDNV but there are only 7 bits defined so leave it this way*/
1076 if (version == 4) {
1077 static int * const flags[] = {
1078 &hf_bundle_payload_flags_replicate_hdr,
1079 &hf_bundle_payload_flags_xmit_report,
1080 &hf_bundle_payload_flags_discard_on_fail,
1081 &hf_bundle_payload_flags_last_header,
1082 NULL
1084 uint8_t procflags;
1086 procflags = tvb_get_uint8(tvb, offset);
1087 if (procflags & HEADER_PROCFLAGS_LAST_HEADER) {
1088 *lastheader = true;
1090 else {
1091 *lastheader = false;
1093 proto_tree_add_bitmask(payload_tree, tvb, offset, hf_bundle_payload_flags,
1094 ett_payload_flags, flags, ENC_BIG_ENDIAN);
1095 ++offset;
1097 else { /*Bundle Protocol Version 5*/
1098 int control_flags;
1099 proto_item *block_flag_item;
1100 proto_tree *block_flag_tree;
1102 control_flags = evaluate_sdnv(tvb, offset, &sdnv_length);
1103 if (control_flags & BLOCK_CONTROL_LAST_BLOCK) {
1104 *lastheader = true;
1106 else {
1107 *lastheader = false;
1109 block_flag_item = proto_tree_add_item(payload_tree, hf_block_control_flags, tvb,
1110 offset, sdnv_length, ENC_BIG_ENDIAN);
1111 block_flag_tree = proto_item_add_subtree(block_flag_item, ett_block_flags);
1113 proto_tree_add_item(block_flag_tree, hf_block_control_replicate,
1114 tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
1115 proto_tree_add_item(block_flag_tree, hf_block_control_transmit_status,
1116 tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
1117 proto_tree_add_item(block_flag_tree, hf_block_control_delete_bundle,
1118 tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
1119 proto_tree_add_item(block_flag_tree, hf_block_control_last_block,
1120 tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
1121 proto_tree_add_item(block_flag_tree, hf_block_control_discard_block,
1122 tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
1123 proto_tree_add_item(block_flag_tree, hf_block_control_not_processed,
1124 tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
1125 proto_tree_add_item(block_flag_tree, hf_block_control_eid_reference,
1126 tvb, offset, sdnv_length, ENC_BIG_ENDIAN);
1127 offset += sdnv_length;
1130 payload_length = evaluate_sdnv(tvb, offset, &sdnv_length);
1131 ti = proto_tree_add_int(payload_tree, hf_bundle_payload_length, tvb, offset, sdnv_length, payload_length);
1132 if (payload_length < 0) {
1133 expert_add_info(pinfo, ti, &ei_bundle_payload_length);
1134 /* Force quitting */
1135 *lastheader = true;
1136 return offset;
1139 proto_item_set_len(payload_item, 2 + sdnv_length);
1140 proto_item_set_len(payload_block, 2 + sdnv_length + payload_length);
1142 offset += sdnv_length;
1143 if (pri_hdr_procflags & BUNDLE_PROCFLAGS_ADMIN_MASK) {
1144 bool success = false;
1147 * XXXX - Have not allowed for admin record spanning multiple segments!
1150 offset = dissect_admin_record(payload_block_tree, tvb, pinfo, offset, payload_length, &success);
1151 if (!success) {
1152 /* Force quitting */
1153 *lastheader = true;
1154 return offset;
1156 } else {
1157 /* If Source SSP Offset is 64 and Destination SSP offset is 65, then
1158 interpret the payload-data part as CFDP. */
1159 if (src_ssp == 0x40 &&
1160 dst_ssp == 0x41)
1162 dissect_cfdp_as_subtree (tvb, pinfo, payload_block_tree, offset);
1164 /* If Source SSP Offset is 5 and Destination SSP offset is 6, then
1165 interpret the payload-data part as AMP. */
1166 else if ((src_ssp == 0x5 && dst_ssp == 0x6) ||
1167 (dst_ssp == 0x5 && src_ssp == 0x6))
1169 dissect_amp_as_subtree (tvb, pinfo, payload_block_tree, offset);
1171 else
1173 proto_tree_add_string(payload_block_tree, hf_bundle_payload_data, tvb, offset, payload_length,
1174 wmem_strdup_printf(pinfo->pool, "<%d bytes>",payload_length));
1177 offset += payload_length;
1180 return offset;
1184 * Return the offset after the Administrative Record or set success = false if analysis fails.
1186 static int
1187 dissect_admin_record(proto_tree *primary_tree, tvbuff_t *tvb, packet_info *pinfo,
1188 int offset, int payload_length, bool* success)
1190 proto_item *admin_record_item;
1191 proto_tree *admin_record_tree;
1192 proto_item *timestamp_sequence_item;
1193 uint8_t record_type;
1194 uint8_t status;
1195 int start_offset = offset;
1196 int sdnv_length;
1197 int timestamp_sequence;
1198 int endpoint_length;
1200 *success = false;
1201 admin_record_tree = proto_tree_add_subtree(primary_tree, tvb, offset, -1,
1202 ett_admin_record, &admin_record_item, "Administrative Record");
1203 record_type = tvb_get_uint8(tvb, offset);
1205 proto_tree_add_item(admin_record_tree, hf_bundle_admin_record_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1207 switch ((record_type >> 4) & 0xf)
1209 case ADMIN_REC_TYPE_STATUS_REPORT:
1211 proto_item *status_flag_item;
1212 proto_tree *status_flag_tree;
1214 proto_tree_add_item(admin_record_tree, hf_bundle_admin_record_fragment, tvb, offset, 1, ENC_NA);
1215 ++offset;
1217 /* Decode Bundle Status Report Flags */
1218 status = tvb_get_uint8(tvb, offset);
1219 status_flag_item = proto_tree_add_item(admin_record_tree,
1220 hf_bundle_admin_statflags, tvb, offset, 1, ENC_BIG_ENDIAN);
1221 status_flag_tree = proto_item_add_subtree(status_flag_item,
1222 ett_admin_rec_status);
1223 proto_tree_add_item(status_flag_tree, hf_bundle_admin_rcvd,
1224 tvb, offset, 1, ENC_BIG_ENDIAN);
1225 proto_tree_add_item(status_flag_tree, hf_bundle_admin_accepted,
1226 tvb, offset, 1, ENC_BIG_ENDIAN);
1227 proto_tree_add_item(status_flag_tree, hf_bundle_admin_forwarded,
1228 tvb, offset, 1, ENC_BIG_ENDIAN);
1229 proto_tree_add_item(status_flag_tree, hf_bundle_admin_delivered,
1230 tvb, offset, 1, ENC_BIG_ENDIAN);
1231 proto_tree_add_item(status_flag_tree, hf_bundle_admin_deleted,
1232 tvb, offset, 1, ENC_BIG_ENDIAN);
1233 proto_tree_add_item(status_flag_tree, hf_bundle_admin_acked,
1234 tvb, offset, 1, ENC_BIG_ENDIAN);
1235 ++offset;
1237 proto_tree_add_item(admin_record_tree, hf_bundle_status_report_reason_code, tvb, offset, 1, ENC_BIG_ENDIAN);
1238 ++offset;
1240 if (record_type & ADMIN_REC_FLAGS_FRAGMENT) {
1241 sdnv_length = add_sdnv_to_tree(admin_record_tree, tvb, pinfo, offset, hf_bundle_admin_fragment_offset);
1242 if (sdnv_length <= 0) {
1243 return offset;
1245 offset += sdnv_length;
1246 sdnv_length = add_sdnv_to_tree(admin_record_tree, tvb, pinfo, offset, hf_bundle_admin_fragment_length);
1247 if (sdnv_length <= 0) {
1248 return offset;
1250 offset += sdnv_length;
1252 if (status & ADMIN_STATUS_FLAGS_RECEIVED) {
1253 sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_receipt_time);
1254 if (sdnv_length <= 0) {
1255 return offset;
1257 offset += sdnv_length;
1259 if (status & ADMIN_STATUS_FLAGS_ACCEPTED) {
1260 sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_accept_time);
1261 if (sdnv_length <= 0) {
1262 return offset;
1264 offset += sdnv_length;
1266 if (status & ADMIN_STATUS_FLAGS_FORWARDED) {
1267 sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_forward_time);
1268 if (sdnv_length <= 0) {
1269 return offset;
1271 offset += sdnv_length;
1273 if (status & ADMIN_STATUS_FLAGS_DELIVERED) {
1274 sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_delivery_time);
1275 if (sdnv_length <= 0) {
1276 return offset;
1278 offset += sdnv_length;
1280 if (status & ADMIN_STATUS_FLAGS_DELETED) {
1281 sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_delete_time);
1282 if (sdnv_length <= 0) {
1283 return offset;
1285 offset += sdnv_length;
1287 if (status & ADMIN_STATUS_FLAGS_ACKNOWLEDGED) {
1288 sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_ack_time);
1289 if (sdnv_length <= 0) {
1290 return offset;
1292 offset += sdnv_length;
1295 /* Get 2 SDNVs for Creation Timestamp */
1296 sdnv_length = add_sdnv_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_timestamp_copy);
1297 if (sdnv_length <= 0) {
1298 return offset;
1300 offset += sdnv_length;
1302 timestamp_sequence = evaluate_sdnv(tvb, offset, &sdnv_length);
1303 if (timestamp_sequence < 0) {
1304 int64_t ts_seq = evaluate_sdnv_64(tvb, offset, &sdnv_length);
1306 timestamp_sequence_item = proto_tree_add_int64(admin_record_tree, hf_bundle_admin_timestamp_seq_num64,
1307 tvb, offset, sdnv_length, ts_seq);
1308 if (ts_seq < 0) {
1309 expert_add_info(pinfo, timestamp_sequence_item, &ei_bundle_timestamp_seq_num);
1310 return offset;
1313 else {
1314 proto_tree_add_int(admin_record_tree, hf_bundle_admin_timestamp_seq_num32,
1315 tvb, offset, sdnv_length, timestamp_sequence);
1317 offset += sdnv_length;
1319 endpoint_length = evaluate_sdnv(tvb, offset, &sdnv_length);
1320 if (endpoint_length < 0) {
1321 return tvb_reported_length_remaining(tvb, offset);
1323 proto_tree_add_int(admin_record_tree, hf_bundle_admin_endpoint_length, tvb, offset, sdnv_length, endpoint_length);
1324 offset += sdnv_length;
1327 * Endpoint name may not be null terminated. This routine is supposed
1328 * to add the null at the end of the string buffer.
1330 proto_tree_add_item(admin_record_tree, hf_bundle_admin_endpoint_id, tvb, offset, endpoint_length, ENC_NA|ENC_ASCII);
1331 offset += endpoint_length;
1333 break;
1334 } /* case ADMIN_REC_TYPE_STATUS_REPORT */
1335 case ADMIN_REC_TYPE_CUSTODY_SIGNAL:
1337 proto_tree_add_item(admin_record_tree, hf_bundle_admin_record_fragment, tvb, offset, 1, ENC_NA);
1338 ++offset;
1340 proto_tree_add_item(admin_record_tree, hf_bundle_custody_trf_succ_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
1341 proto_tree_add_item(admin_record_tree, hf_bundle_custody_signal_reason, tvb, offset, 1, ENC_BIG_ENDIAN);
1342 ++offset;
1344 if (record_type & ADMIN_REC_FLAGS_FRAGMENT) {
1345 sdnv_length = add_sdnv_to_tree(admin_record_tree, tvb, pinfo, offset, hf_bundle_admin_fragment_offset);
1346 if (sdnv_length <= 0) {
1347 return offset;
1349 offset += sdnv_length;
1350 sdnv_length = add_sdnv_to_tree(admin_record_tree, tvb, pinfo, offset, hf_bundle_admin_fragment_length);
1351 if (sdnv_length <= 0) {
1352 return offset;
1354 offset += sdnv_length;
1357 /* Signal Time */
1358 sdnv_length = add_dtn_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_signal_time);
1359 if (sdnv_length <= 0) {
1360 return offset;
1362 offset += sdnv_length;
1364 /* Timestamp copy */
1365 sdnv_length = add_sdnv_time_to_tree(admin_record_tree, tvb, offset, hf_bundle_admin_timestamp_copy);
1366 if (sdnv_length <= 0) {
1367 return offset;
1369 offset += sdnv_length;
1371 timestamp_sequence = evaluate_sdnv(tvb, offset, &sdnv_length);
1372 if (timestamp_sequence < 0) {
1373 int64_t ts_seq = evaluate_sdnv_64(tvb, offset, &sdnv_length);
1375 timestamp_sequence_item = proto_tree_add_int64(admin_record_tree, hf_bundle_admin_timestamp_seq_num64,
1376 tvb, offset, sdnv_length, ts_seq);
1377 if (ts_seq < 0) {
1378 expert_add_info(pinfo, timestamp_sequence_item, &ei_bundle_timestamp_seq_num);
1379 return offset;
1382 else {
1383 proto_tree_add_int(admin_record_tree, hf_bundle_admin_timestamp_seq_num32,
1384 tvb, offset, sdnv_length, timestamp_sequence);
1386 offset += sdnv_length;
1388 endpoint_length = evaluate_sdnv(tvb, offset, &sdnv_length);
1389 if (endpoint_length < 0) {
1390 return tvb_reported_length_remaining(tvb, offset);
1392 proto_tree_add_int(admin_record_tree, hf_bundle_admin_endpoint_length, tvb, offset, sdnv_length, endpoint_length);
1393 offset += sdnv_length;
1394 proto_tree_add_item(admin_record_tree, hf_bundle_admin_endpoint_id, tvb, offset, endpoint_length, ENC_NA|ENC_ASCII);
1395 offset += endpoint_length;
1396 break;
1397 } /* case ADMIN_REC_TYPE_CUSTODY_SIGNAL */
1398 case ADMIN_REC_TYPE_AGGREGATE_CUSTODY_SIGNAL:
1400 proto_item *ti;
1401 int payload_bytes_processed = 0;
1402 int right_edge = -1;
1403 int fill_start;
1404 int fill_length = -1;
1405 int sdnv_length_start = -1;
1406 int sdnv_length_gap = -1;
1407 int sdnv_length_length = -1;
1409 proto_tree_add_item(admin_record_tree, hf_bundle_admin_record_fragment, tvb, offset, 1, ENC_NA);
1410 ++offset;
1411 ++payload_bytes_processed;
1413 proto_tree_add_item(admin_record_tree, hf_bundle_custody_trf_succ_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
1414 proto_tree_add_item(admin_record_tree, hf_bundle_custody_signal_reason, tvb, offset, 1, ENC_BIG_ENDIAN);
1415 ++offset;
1416 ++payload_bytes_processed;
1418 /* process the first fill */
1419 fill_start = evaluate_sdnv(tvb, offset, &sdnv_length_start);
1420 ti = proto_tree_add_int(admin_record_tree, hf_bundle_custody_id_range_start, tvb, offset, sdnv_length_start, fill_start);
1421 if (fill_start < 0 || sdnv_length_start < 0) {
1422 expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "ACS: Unable to process CTEB Custody ID Range start SDNV");
1423 return offset;
1425 fill_length = evaluate_sdnv(tvb, offset + sdnv_length_start, &sdnv_length_length);
1426 ti = proto_tree_add_int(admin_record_tree, hf_bundle_custody_id_range_end, tvb, offset,
1427 sdnv_length_start + sdnv_length_length, fill_start + fill_length - 1);
1428 if (fill_length < 0 || sdnv_length_length < 0) {
1429 expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "ACS: Unable to process CTEB Custody ID Range length SDNV");
1430 return tvb_reported_length_remaining(tvb, offset);
1433 right_edge = fill_start + fill_length;
1434 offset += sdnv_length_start + sdnv_length_length;
1435 payload_bytes_processed += sdnv_length_start + sdnv_length_length;
1437 /* now attempt to consume all the rest of the data in the
1438 * payload as additional fills */
1439 while (payload_bytes_processed < payload_length) {
1440 int fill_gap;
1441 fill_gap = evaluate_sdnv(tvb, offset, &sdnv_length_gap);
1442 ti = proto_tree_add_int(admin_record_tree, hf_bundle_custody_id_range_start, tvb, offset, sdnv_length_gap, fill_gap);
1443 if (fill_gap < 0 || sdnv_length_gap < 0) {
1444 expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "ACS: Unable to process CTEB Custody ID Range gap SDNV");
1445 return offset;
1447 fill_length = evaluate_sdnv(tvb, offset + sdnv_length_gap, &sdnv_length_length);
1448 ti = proto_tree_add_int(admin_record_tree, hf_bundle_custody_id_range_end, tvb, offset,
1449 sdnv_length_gap + sdnv_length_length, right_edge + fill_gap + fill_length - 1);
1450 if (fill_length < 0 || sdnv_length_length < 0) {
1451 expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "ACS: Unable to process CTEB Custody ID Range length SDNV");
1452 return tvb_reported_length_remaining(tvb, offset);
1455 right_edge += fill_gap + fill_length;
1456 offset += sdnv_length_gap + sdnv_length_length;
1457 payload_bytes_processed += sdnv_length_gap + sdnv_length_length;
1460 if (payload_bytes_processed > payload_length) {
1461 expert_add_info_format(pinfo, ti, &ei_bundle_offset_error, "ACS: CTEB Custody ID Range data extends past payload length");
1462 return offset;
1465 break;
1466 } /* case ADMIN_REC_TYPE_AGGREGATE_CUSTODY_SIGNAL */
1467 case ADMIN_REC_TYPE_ANNOUNCE_BUNDLE:
1468 default:
1469 offset++;
1470 break;
1471 } /* End Switch */
1473 proto_item_set_len(admin_record_item, offset - start_offset);
1474 *success = true;
1475 return offset;
1478 static int
1479 display_extension_block(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, char *bundle_custodian, bool *lastheader)
1481 proto_item *block_item, *ti, *block_flag_replicate_item, *block_flag_eid_reference_item;
1482 proto_tree *block_tree;
1483 int sdnv_length;
1484 int block_length;
1485 int block_overhead;
1486 int bundle_age;
1487 uint8_t type;
1488 unsigned int control_flags;
1489 proto_tree *block_flag_tree;
1490 proto_item *block_flag_item;
1492 type = tvb_get_uint8(tvb, offset);
1493 block_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_metadata_hdr, &block_item, "Extension Block");
1495 proto_tree_add_item(block_tree, hf_bundle_block_type_code, tvb, offset, 1, ENC_BIG_ENDIAN);
1496 ++offset;
1497 block_overhead = 1;
1499 control_flags = (unsigned int)evaluate_sdnv(tvb, offset, &sdnv_length);
1500 if (control_flags & BLOCK_CONTROL_LAST_BLOCK) {
1501 *lastheader = true;
1502 } else {
1503 *lastheader = false;
1505 block_flag_item = proto_tree_add_uint(block_tree, hf_block_control_flags_sdnv, tvb,
1506 offset, sdnv_length, control_flags);
1507 block_flag_tree = proto_item_add_subtree(block_flag_item, ett_block_flags);
1508 block_flag_replicate_item = proto_tree_add_boolean(block_flag_tree, hf_block_control_replicate,
1509 tvb, offset, sdnv_length, control_flags);
1510 proto_tree_add_boolean(block_flag_tree, hf_block_control_transmit_status,
1511 tvb, offset, sdnv_length, control_flags);
1512 proto_tree_add_boolean(block_flag_tree, hf_block_control_delete_bundle,
1513 tvb, offset, sdnv_length, control_flags);
1514 proto_tree_add_boolean(block_flag_tree, hf_block_control_last_block,
1515 tvb, offset, sdnv_length, control_flags);
1516 proto_tree_add_boolean(block_flag_tree, hf_block_control_discard_block,
1517 tvb, offset, sdnv_length, control_flags);
1518 proto_tree_add_boolean(block_flag_tree, hf_block_control_not_processed,
1519 tvb, offset, sdnv_length, control_flags);
1520 block_flag_eid_reference_item = proto_tree_add_boolean(block_flag_tree, hf_block_control_eid_reference,
1521 tvb, offset, sdnv_length, control_flags);
1522 offset += sdnv_length;
1523 block_overhead += sdnv_length;
1525 /* TODO: if this block has EID references, add them to display tree */
1526 if (control_flags & BLOCK_CONTROL_EID_REFERENCE) {
1527 int i;
1528 int num_eid_ref;
1530 num_eid_ref = evaluate_sdnv(tvb, offset, &sdnv_length);
1531 offset += sdnv_length;
1532 block_overhead += sdnv_length;
1534 for (i = 0; i < num_eid_ref; i++)
1536 if (evaluate_sdnv(tvb, offset, &sdnv_length) < 0)
1537 break;
1538 offset += sdnv_length;
1539 block_overhead += sdnv_length;
1541 if (evaluate_sdnv(tvb, offset, &sdnv_length) < 0)
1542 break;
1543 offset += sdnv_length;
1544 block_overhead += sdnv_length;
1548 block_length = evaluate_sdnv(tvb, offset, &sdnv_length);
1549 ti = proto_tree_add_int(block_tree, hf_block_control_block_length, tvb, offset, sdnv_length, block_length);
1550 if (block_length < 0) {
1551 expert_add_info_format(pinfo, ti, &ei_bundle_offset_error, "Metadata Block Length Error");
1552 /* Force quitting */
1553 *lastheader = true;
1554 return offset;
1556 offset += sdnv_length;
1557 block_overhead += sdnv_length;
1559 /* now we have enough info to know total length of metadata block */
1560 proto_item_set_len(block_item, block_overhead + block_length);
1562 switch (type)
1564 case BUNDLE_BLOCK_TYPE_AUTHENTICATION:
1565 case BUNDLE_BLOCK_TYPE_METADATA_EXTENSION:
1566 case BUNDLE_BLOCK_TYPE_EXTENSION_SECURITY:
1568 proto_tree_add_string(block_tree, hf_bundle_unprocessed_block_data, tvb, offset, block_length, "Block data");
1569 /* not yet dissected, skip past data */
1570 offset += block_length;
1571 break;
1573 case BUNDLE_BLOCK_TYPE_BUNDLE_AGE:
1575 bundle_age = evaluate_sdnv(tvb, offset, &sdnv_length);
1576 proto_tree_add_int(block_tree, hf_bundle_age_extension_block_code, tvb, offset, sdnv_length, bundle_age/1000000);
1577 offset += block_length;
1578 break;
1580 case BUNDLE_BLOCK_TYPE_PREVIOUS_HOP_INSERT:
1582 int scheme_length;
1584 proto_tree_add_item_ret_length(block_tree, hf_bundle_block_previous_hop_scheme, tvb, offset, 4, ENC_ASCII, &scheme_length);
1585 offset += scheme_length;
1586 proto_tree_add_item(block_tree, hf_bundle_block_previous_hop_eid, tvb, offset, block_length-scheme_length, ENC_ASCII);
1587 if (block_length - scheme_length < 1) {
1588 expert_add_info_format(pinfo, ti, &ei_bundle_offset_error, "Metadata Block Length Error");
1589 *lastheader = true;
1590 return offset;
1592 offset += block_length - scheme_length;
1594 break;
1596 case BUNDLE_BLOCK_TYPE_INTEGRITY:
1597 case BUNDLE_BLOCK_TYPE_CONFIDENTIALITY:
1599 int target_block_type;
1600 int target_block_occurrence;
1601 int ciphersuite_type;
1602 unsigned int ciphersuite_flags;
1604 target_block_type = evaluate_sdnv(tvb, offset, &sdnv_length);
1605 proto_tree_add_int(block_tree, hf_bundle_target_block_type, tvb, offset, sdnv_length, target_block_type);
1606 offset += sdnv_length;
1608 target_block_occurrence = evaluate_sdnv(tvb, offset, &sdnv_length);
1609 proto_tree_add_int(block_tree, hf_bundle_target_block_occurrence, tvb, offset, sdnv_length, target_block_occurrence);
1610 offset += sdnv_length;
1612 ciphersuite_type = evaluate_sdnv(tvb, offset, &sdnv_length);
1613 proto_tree_add_int(block_tree, hf_bundle_ciphersuite_type, tvb, offset, sdnv_length, ciphersuite_type);
1614 offset += sdnv_length;
1616 ciphersuite_flags = (unsigned int)evaluate_sdnv(tvb, offset, &sdnv_length);
1617 block_flag_item = proto_tree_add_uint(block_tree, hf_bundle_ciphersuite_flags, tvb, offset, sdnv_length, ciphersuite_flags);
1618 block_flag_tree = proto_item_add_subtree(block_flag_item, ett_block_flags);
1619 proto_tree_add_boolean(block_flag_tree, hf_block_ciphersuite_params, tvb, offset, sdnv_length, ciphersuite_flags);
1620 offset += sdnv_length;
1622 int range_offset;
1623 int range_length;
1624 if (ciphersuite_flags & BLOCK_CIPHERSUITE_PARAMS) {
1625 /* Decode cipher suite parameters */
1626 int params_length;
1627 int param_type;
1628 int item_length;
1629 proto_tree *param_tree;
1630 expert_field *ei = NULL;
1632 params_length = evaluate_sdnv_ei(tvb, offset, &sdnv_length, &ei);
1633 if (ei) {
1634 proto_tree_add_expert(block_tree, pinfo, ei, tvb, offset, -1);
1635 *lastheader = true;
1636 return offset;
1638 param_tree = proto_tree_add_subtree(block_tree, tvb, offset, params_length+1, ett_sec_block_param_data, NULL, "Ciphersuite Parameters Data");
1639 proto_tree_add_int(param_tree, hf_block_ciphersuite_params_length, tvb, offset, sdnv_length, params_length);
1640 offset += sdnv_length;
1642 for(int i = 0; i < params_length; i+=item_length+2)
1644 param_type = evaluate_sdnv(tvb, offset, &sdnv_length);
1645 proto_tree_add_int(param_tree, hf_block_ciphersuite_param_type, tvb, offset, sdnv_length, param_type);
1646 offset += sdnv_length;
1648 ei = NULL;
1649 item_length = evaluate_sdnv_ei(tvb, offset, &sdnv_length, &ei);
1650 proto_tree_add_int(param_tree, hf_block_ciphersuite_params_item_length, tvb, offset, sdnv_length, item_length);
1651 if (ei) {
1652 proto_tree_add_expert(param_tree, pinfo, ei, tvb, offset, -1);
1653 *lastheader = true;
1654 return offset;
1657 offset += sdnv_length;
1659 //display item data
1660 switch (param_type)
1662 case 1:
1663 case 3:
1664 case 5:
1665 case 7:
1666 case 8:
1667 proto_tree_add_item(param_tree, hf_block_ciphersuite_param_data, tvb, offset, item_length, ENC_NA);
1668 offset += item_length;
1669 break;
1670 case 4:
1671 //pair of sdnvs offset and length
1672 range_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
1673 proto_tree_add_int(param_tree, hf_block_ciphersuite_range_offset, tvb, offset, sdnv_length, range_offset);
1674 offset += sdnv_length;
1676 range_length = evaluate_sdnv(tvb, offset, &sdnv_length);
1677 proto_tree_add_int(param_tree, hf_block_ciphersuite_range_length, tvb, offset, sdnv_length, range_length);
1678 offset += sdnv_length;
1679 break;
1680 default:
1681 break;
1685 /* Decode cipher suite results */
1686 int result_length;
1687 int result_type;
1688 int result_item_length;
1689 proto_tree *result_tree;
1691 result_length = evaluate_sdnv(tvb, offset, &sdnv_length);
1692 result_tree = proto_tree_add_subtree(block_tree, tvb, offset, result_length+1, ett_sec_block_param_data, NULL, "Security Results Data");
1693 proto_tree_add_int(result_tree, hf_block_ciphersuite_result_length, tvb, offset, sdnv_length, result_length);
1694 offset += sdnv_length;
1696 for(int i = 0; i < result_length; i+=result_item_length+2)
1698 result_type = evaluate_sdnv(tvb, offset, &sdnv_length);
1699 proto_tree_add_int(result_tree, hf_block_ciphersuite_result_type, tvb, offset, sdnv_length, result_type);
1700 offset += sdnv_length;
1702 expert_field *ei = NULL;
1703 result_item_length = evaluate_sdnv_ei(tvb, offset, &sdnv_length, &ei);
1704 proto_tree_add_int(result_tree, hf_block_ciphersuite_result_item_length, tvb, offset, sdnv_length, result_item_length);
1705 if (ei) {
1706 proto_tree_add_expert(result_tree, pinfo, ei, tvb, offset, -1);
1707 *lastheader = true;
1708 return offset;
1710 offset += sdnv_length;
1712 //display item data
1713 switch (result_type)
1715 case 1:
1716 case 3:
1717 case 5:
1718 case 7:
1719 case 8:
1720 proto_tree_add_item(result_tree, hf_block_ciphersuite_result_data, tvb, offset, result_item_length, ENC_NA);
1721 offset += result_item_length;
1722 break;
1723 case 4:
1724 //pair of sdnvs offset and length
1725 range_offset = evaluate_sdnv(tvb, offset, &sdnv_length);
1726 proto_tree_add_int(result_tree, hf_block_ciphersuite_range_offset, tvb, offset, sdnv_length, range_offset);
1727 offset += sdnv_length;
1729 range_length = evaluate_sdnv(tvb, offset, &sdnv_length);
1730 proto_tree_add_int(result_tree, hf_block_ciphersuite_range_length, tvb, offset, sdnv_length, range_length);
1731 offset += sdnv_length;
1732 break;
1733 default:
1734 break;
1738 break;
1741 case BUNDLE_BLOCK_TYPE_CUSTODY_TRANSFER:
1743 int custody_id;
1744 const uint8_t *cteb_creator_custodian_eid;
1745 int cteb_creator_custodian_eid_length;
1747 /* check requirements for Block Processing Control Flags */
1748 if ((control_flags & BLOCK_CONTROL_REPLICATE) != 0) {
1749 expert_add_info_format(pinfo, block_flag_replicate_item, &ei_bundle_block_control_flags, "ERROR: Replicate must be clear for CTEB");
1751 if ((control_flags & BLOCK_CONTROL_EID_REFERENCE) != 0) {
1752 expert_add_info_format(pinfo, block_flag_eid_reference_item, &ei_bundle_block_control_flags, "ERROR: EID-Reference must be clear for CTEB");
1755 /* there are two elements in a CTEB, first is the custody ID */
1756 custody_id = evaluate_sdnv(tvb, offset, &sdnv_length);
1757 proto_tree_add_int(block_tree, hf_block_control_block_cteb_custody_id, tvb, offset, sdnv_length, custody_id);
1758 offset += sdnv_length;
1760 /* and second is the creator custodian EID */
1761 if (block_length - sdnv_length < 1) {
1762 expert_add_info_format(pinfo, ti, &ei_bundle_offset_error, "Metadata Block Length Error");
1763 *lastheader = true;
1764 return offset;
1766 cteb_creator_custodian_eid_length = block_length - sdnv_length;
1767 ti = proto_tree_add_item_ret_string(block_tree, hf_block_control_block_cteb_creator_custodian_eid, tvb, offset,
1768 cteb_creator_custodian_eid_length, ENC_ASCII, pinfo->pool, &cteb_creator_custodian_eid);
1770 /* also check if CTEB is valid, i.e. custodians match */
1771 if (bundle_custodian == NULL) {
1772 expert_add_info_format(pinfo, ti, &ei_block_control_block_cteb_invalid,
1773 "CTEB Is NOT Valid (Bundle Custodian NULL)");
1775 else if (strlen(cteb_creator_custodian_eid) != strlen(bundle_custodian)) {
1776 expert_add_info_format(pinfo, ti, &ei_block_control_block_cteb_invalid,
1777 "CTEB Is NOT Valid (Bundle Custodian [%s] != CTEB Custodian [%s])",
1778 bundle_custodian, cteb_creator_custodian_eid);
1780 else if (memcmp(cteb_creator_custodian_eid, bundle_custodian, strlen(bundle_custodian)) != 0) {
1781 expert_add_info_format(pinfo, ti, &ei_block_control_block_cteb_invalid,
1782 "CTEB Is NOT Valid (Bundle Custodian [%s] != CTEB Custodian [%s])",
1783 bundle_custodian, cteb_creator_custodian_eid);
1785 else {
1786 expert_add_info(pinfo, ti, &ei_block_control_block_cteb_valid);
1788 offset += cteb_creator_custodian_eid_length;
1790 break;
1792 case BUNDLE_BLOCK_TYPE_EXTENDED_COS:
1794 int flags;
1795 static int * const ecos_flags_fields[] = {
1796 &hf_ecos_flags_critical,
1797 &hf_ecos_flags_streaming,
1798 &hf_ecos_flags_flowlabel,
1799 &hf_ecos_flags_reliable,
1800 NULL
1803 /* check requirements for Block Processing Control Flags */
1804 if ((control_flags & BLOCK_CONTROL_REPLICATE) == 0) {
1805 expert_add_info_format(pinfo, block_flag_replicate_item, &ei_bundle_block_control_flags, "ERROR: Replicate must be set for ECOS");
1807 if ((control_flags & BLOCK_CONTROL_EID_REFERENCE) != 0) {
1808 expert_add_info_format(pinfo, block_flag_eid_reference_item, &ei_bundle_block_control_flags, "ERROR: EID-Reference must be clear for ECOS");
1811 /* flags byte */
1812 flags = (int)tvb_get_uint8(tvb, offset);
1813 proto_tree_add_bitmask(block_tree, tvb, offset, hf_ecos_flags, ett_block_flags, ecos_flags_fields, ENC_BIG_ENDIAN);
1814 offset += 1;
1816 /* ordinal byte */
1817 proto_tree_add_item(block_tree, hf_ecos_ordinal, tvb, offset, 1, ENC_BIG_ENDIAN);
1818 offset += 1;
1820 /* optional flow label sdnv */
1821 if ((flags & ECOS_FLAGS_FLOWLABEL) != 0) {
1822 int flow_label;
1823 flow_label = evaluate_sdnv(tvb, offset, &sdnv_length);
1824 ti = proto_tree_add_int(block_tree, hf_ecos_flow_label, tvb, offset, sdnv_length, flow_label);
1825 if (flow_label < 0) {
1826 expert_add_info_format(pinfo, ti, &ei_bundle_sdnv_length, "ECOS Flow Label Error");
1827 /* Force quitting */
1828 *lastheader = true;
1829 return offset;
1831 offset += sdnv_length;
1834 break;
1836 default:
1838 proto_tree_add_string(block_tree, hf_bundle_unprocessed_block_data, tvb, offset, block_length, "Block data");
1839 /* unknown bundle type, skip past data */
1840 offset += block_length;
1841 break;
1845 return offset;
1848 /*3rd arg is number of bytes in field (returned)*/
1849 static int
1850 evaluate_sdnv(tvbuff_t *tvb, int offset, int *bytecount)
1852 uint64_t value = 0;
1853 *bytecount = tvb_get_varint(tvb, offset, FT_VARINT_MAX_LEN, &value, ENC_VARINT_SDNV);
1855 if (*bytecount == 0) {
1856 return -1;
1858 if (value > INT_MAX) {
1859 ws_warning("evaluate_sdnv decoded a value too large to fit in an int, truncating");
1860 return INT_MAX;
1862 return (int)value;
1865 static int
1866 evaluate_sdnv_ei(tvbuff_t *tvb, int offset, int *bytecount, expert_field **error) {
1867 int value = evaluate_sdnv(tvb, offset, bytecount);
1868 *error = (value < 0) ? &ei_bundle_sdnv_length : NULL;
1869 return value;
1872 /* Special Function to evaluate 64 bit SDNVs */
1873 /*3rd arg is number of bytes in field (returned)*/
1874 static int64_t
1875 evaluate_sdnv_64(tvbuff_t *tvb, int offset, int *bytecount)
1877 uint64_t val = 0;
1878 *bytecount = tvb_get_varint(tvb, offset, FT_VARINT_MAX_LEN, &val, ENC_VARINT_SDNV);
1880 if (*bytecount == 0) {
1881 return -1;
1883 return val & INT64_MAX;
1886 static int
1887 dissect_bpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1889 proto_item *ti, *ti_bundle_protocol;
1890 proto_tree *bundle_tree, *primary_tree;
1891 int primary_header_size;
1892 bool lastheader = false;
1893 int offset = 0;
1894 uint8_t version, pri_hdr_procflags;
1895 /* Custodian from Primary Block, used to validate CTEB */
1896 char *bundle_custodian = NULL;
1899 version = tvb_get_uint8(tvb, offset); /* Primary Header Version */
1900 if ((version != 4) && (version != 5) && (version != 6)) {
1901 return 0;
1904 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Bundle");
1905 /* Clear out stuff in the info column */
1906 col_clear(pinfo->cinfo,COL_INFO);
1908 ti_bundle_protocol = proto_tree_add_item(tree, proto_bundle, tvb, offset, -1, ENC_NA);
1909 // identify parent proto version
1910 proto_item_append_text(ti_bundle_protocol, " Version %d", version);
1912 bundle_tree = proto_item_add_subtree(ti_bundle_protocol, ett_bundle);
1914 primary_tree = proto_tree_add_subtree(bundle_tree, tvb, offset, -1, ett_primary_hdr, &ti, "Primary Bundle Header");
1916 proto_tree_add_item(primary_tree, hf_bundle_pdu_version, tvb, offset, 1, ENC_BIG_ENDIAN);
1917 if (version == 4) {
1918 primary_header_size = dissect_version_4_primary_header(pinfo, primary_tree, tvb,
1919 &pri_hdr_procflags, &bundle_custodian);
1921 else {
1922 primary_header_size = dissect_version_5_and_6_primary_header(pinfo, primary_tree, tvb,
1923 &pri_hdr_procflags, &bundle_custodian);
1926 if (primary_header_size == 0) { /*Couldn't parse primary header*/
1927 col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error");
1928 return 0; /*Give up*/
1931 proto_item_set_len(ti, primary_header_size);
1932 offset = primary_header_size;
1935 * Done with primary header; decode the remaining headers
1938 while (lastheader == false) {
1939 uint8_t next_header_type;
1941 next_header_type = tvb_get_uint8(tvb, offset);
1942 if (next_header_type == BUNDLE_BLOCK_TYPE_PAYLOAD) {
1945 * Returns payload size or 0 if can't parse payload
1947 offset = dissect_payload_header(bundle_tree, tvb, pinfo, offset, version, pri_hdr_procflags, &lastheader);
1949 else { /*Assume anything else is a Metadata Block*/
1950 offset = display_extension_block(bundle_tree, tvb, pinfo, offset, bundle_custodian, &lastheader);
1954 proto_item_set_len(ti_bundle_protocol, offset);
1956 return offset;
1959 /// Introspect the data to choose a dissector version
1960 static int
1961 dissect_bundle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
1963 int offset = 0;
1966 // Primary Header Version octet
1967 uint8_t version = tvb_get_uint8(tvb, offset);
1968 if ((version == 4) || (version == 5) || (version == 6)) {
1969 return call_dissector(bpv6_handle, tvb, pinfo, tree);
1973 wscbor_chunk_t *frame = wscbor_chunk_read(pinfo->pool, tvb, &offset);
1974 if (frame->type_major == CBOR_TYPE_ARRAY) {
1975 wscbor_chunk_t *primary = wscbor_chunk_read(pinfo->pool, tvb, &offset);
1976 if (primary->type_major == CBOR_TYPE_ARRAY) {
1977 wscbor_chunk_t *version = wscbor_chunk_read(pinfo->pool, tvb, &offset);
1978 if (version->type_major == CBOR_TYPE_UINT) {
1979 uint64_t vers_val = version->head_value;
1980 if (vers_val == 7) {
1981 return call_dissector(bpv7_handle, tvb, pinfo, tree);
1987 return 0;
1991 void
1992 proto_register_bpv6(void)
1995 static hf_register_info hf[] = {
1996 {&hf_bundle_pdu_version,
1997 {"Bundle Version", "bundle.version",
1998 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
2000 {&hf_bundle_procflags,
2001 {"Primary Header Processing Flags", "bundle.primary.proc.flag",
2002 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
2004 {&hf_bundle_procflags_fragment,
2005 {"Bundle is a Fragment", "bundle.primary.proc.frag",
2006 FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_FRAG_MASK, NULL, HFILL}
2008 {&hf_bundle_procflags_admin,
2009 {"Administrative Record", "bundle.primary.proc.admin",
2010 FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_ADMIN_MASK, NULL, HFILL}
2012 {&hf_bundle_procflags_dont_fragment,
2013 {"Do Not Fragment Bundle", "bundle.primary.proc.dontfrag",
2014 FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_DONTFRAG_MASK, NULL, HFILL}
2016 {&hf_bundle_procflags_cust_xfer_req,
2017 {"Request Custody Transfer", "bundle.primary.proc.xferreq",
2018 FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_XFERREQ_MASK, NULL, HFILL}
2020 {&hf_bundle_procflags_dest_singleton,
2021 {"Destination is Singleton", "bundle.primary.proc.single",
2022 FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_SINGLETON_MASK, NULL, HFILL}
2024 {&hf_bundle_procflags_application_ack,
2025 {"Request Acknowledgement by Application", "bundle.primary.proc.ack",
2026 FT_BOOLEAN, 8, NULL, BUNDLE_PROCFLAGS_APP_ACK_MASK, NULL, HFILL}
2028 {&hf_bundle_control_flags,
2029 {"Bundle Processing Control Flags", "bundle.primary.processing.control.flag",
2030 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
2032 {&hf_bundle_procflags_general,
2033 {"General Flags", "bundle.primary.proc.gen",
2034 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
2036 {&hf_bundle_procflags_cos,
2037 {"Class of Service Flags", "bundle.primary.proc.cos",
2038 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
2040 {&hf_bundle_procflags_status,
2041 {"Status Report Flags", "bundle.primary.proc.status",
2042 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
2044 {&hf_bundle_cosflags,
2045 {"Primary Header COS Flags", "bundle.primary.cos.flags",
2046 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
2048 {&hf_bundle_cosflags_priority,
2049 {"Priority", "bundle.primary.cos.priority",
2050 FT_UINT8, BASE_DEC, VALS(cosflags_priority_vals), BUNDLE_COSFLAGS_PRIORITY_MASK, NULL, HFILL}
2052 {&hf_bundle_srrflags,
2053 {"Primary Header Report Request Flags", "bundle.primary.srr.flag",
2054 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
2056 {&hf_bundle_srrflags_report_receipt,
2057 {"Request Reception Report", "bundle.primary.srr.report",
2058 FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_REPORT_MASK, NULL, HFILL}
2060 {&hf_bundle_srrflags_report_cust_accept,
2061 {"Request Report of Custody Acceptance", "bundle.primary.srr.custaccept",
2062 FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_CUSTODY_MASK, NULL, HFILL}
2064 {&hf_bundle_srrflags_report_forward,
2065 {"Request Report of Bundle Forwarding", "bundle.primary.srr.forward",
2066 FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_FORWARD_MASK, NULL, HFILL}
2068 {&hf_bundle_srrflags_report_delivery,
2069 {"Request Report of Bundle Delivery", "bundle.primary.srr.delivery",
2070 FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_DELIVERY_MASK, NULL, HFILL}
2072 {&hf_bundle_srrflags_report_deletion,
2073 {"Request Report of Bundle Deletion", "bundle.primary.srr.delete",
2074 FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_DELETION_MASK, NULL, HFILL}
2076 {&hf_bundle_srrflags_report_ack,
2077 {"Request Report of Application Ack", "bundle.primary.srr.ack",
2078 FT_BOOLEAN, 8, NULL, BUNDLE_SRRFLAGS_ACK_MASK, NULL, HFILL}
2080 {&hf_bundle_primary_header_len,
2081 {"Bundle Header Length", "bundle.primary.len",
2082 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2084 {&hf_bundle_primary_dictionary_len,
2085 {"Dictionary Length", "bundle.primary.dictionary_len",
2086 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2088 {&hf_bundle_primary_fragment_offset,
2089 {"Fragment Offset", "bundle.primary.fragment_offset",
2090 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2092 {&hf_bundle_primary_total_adu_len,
2093 {"Total Application Data Unit Length", "bundle.primary.total_adu_len",
2094 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2096 {&hf_bundle_primary_timestamp_seq_num64,
2097 {"Timestamp Sequence Number", "bundle.primary.timestamp_seq_num64",
2098 FT_INT64, BASE_DEC, NULL, 0x0, NULL, HFILL}
2100 {&hf_bundle_primary_timestamp_seq_num32,
2101 {"Timestamp Sequence Number", "bundle.primary.timestamp_seq_num32",
2102 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2104 {&hf_bundle_primary_timestamp,
2105 {"Timestamp", "bundle.primary.timestamp",
2106 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
2108 {&hf_bundle_dest_scheme_offset_u16,
2109 {"Destination Scheme Offset", "bundle.primary.destschemeoffu16",
2110 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
2112 {&hf_bundle_dest_scheme_offset_i32,
2113 {"Destination Scheme Offset", "bundle.primary.destschemeoffi32",
2114 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2116 {&hf_bundle_dest_ssp_offset_u16,
2117 {"Destination SSP Offset", "bundle.primary.destssspoffu16",
2118 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
2120 {&hf_bundle_dest_ssp_offset_i32,
2121 {"Destination SSP Offset", "bundle.primary.destssspoffi32",
2122 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2124 {&hf_bundle_source_scheme_offset_u16,
2125 {"Source Scheme Offset", "bundle.primary.srcschemeoffu16",
2126 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
2128 {&hf_bundle_source_scheme_offset_i32,
2129 {"Source Scheme Offset", "bundle.primary.srcschemeoffi32",
2130 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2132 {&hf_bundle_source_ssp_offset_u16,
2133 {"Source SSP Offset", "bundle.primary.srcsspoffu16",
2134 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
2136 {&hf_bundle_source_ssp_offset_i32,
2137 {"Source SSP Offset", "bundle.primary.srcsspoffi32",
2138 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2140 {&hf_bundle_report_scheme_offset_u16,
2141 {"Report Scheme Offset", "bundle.primary.rptschemeoffu16",
2142 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
2144 {&hf_bundle_report_scheme_offset_i32,
2145 {"Report Scheme Offset", "bundle.primary.rptschemeoffi32",
2146 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2148 {&hf_bundle_report_ssp_offset_u16,
2149 {"Report SSP Offset", "bundle.primary.rptsspoffu16",
2150 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
2152 {&hf_bundle_report_ssp_offset_i32,
2153 {"Report SSP Offset", "bundle.primary.rptsspoffi32",
2154 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2156 {&hf_bundle_cust_scheme_offset_u16,
2157 {"Custodian Scheme Offset", "bundle.primary.custschemeoffu16",
2158 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
2160 {&hf_bundle_cust_scheme_offset_i32,
2161 {"Custodian Scheme Offset", "bundle.primary.custschemeoffi32",
2162 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2164 {&hf_bundle_cust_ssp_offset_u16,
2165 {"Custodian SSP Offset", "bundle.primary.custsspoffu16",
2166 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
2168 {&hf_bundle_cust_ssp_offset_i32,
2169 {"Custodian SSP Offset", "bundle.primary.custsspoffi32",
2170 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2172 {&hf_bundle_dest_scheme,
2173 {"Destination Scheme", "bundle.primary.destination_scheme",
2174 FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
2176 {&hf_bundle_dest_ssp,
2177 {"Destination", "bundle.primary.destination",
2178 FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
2180 {&hf_bundle_source_scheme,
2181 {"Source Scheme", "bundle.primary.source_scheme",
2182 FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
2184 {&hf_bundle_source_ssp,
2185 {"Source", "bundle.primary.source",
2186 FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
2188 {&hf_bundle_report_scheme,
2189 {"Report Scheme", "bundle.primary.report_scheme",
2190 FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
2192 {&hf_bundle_report_ssp,
2193 {"Report", "bundle.primary.report",
2194 FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
2196 {&hf_bundle_custodian_scheme,
2197 {"Custodian Scheme", "bundle.primary.custodian_scheme",
2198 FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
2200 {&hf_bundle_custodian_ssp,
2201 {"Custodian", "bundle.primary.custodian",
2202 FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL}
2204 {&hf_bundle_creation_timestamp,
2205 {"Creation Timestamp", "bundle.primary.creation_timestamp",
2206 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
2208 {&hf_bundle_lifetime,
2209 {"Lifetime", "bundle.primary.lifetime",
2210 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2212 {&hf_bundle_lifetime_sdnv,
2213 {"Lifetime", "bundle.primary.lifetime_sdnv",
2214 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2216 {&hf_bundle_payload_length,
2217 {"Payload Length", "bundle.payload.length",
2218 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2220 {&hf_bundle_payload_flags,
2221 {"Payload Header Processing Flags", "bundle.payload.proc.flag",
2222 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
2224 {&hf_bundle_payload_header_type,
2225 {"Header Type", "bundle.payload.proc.header_type",
2226 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
2228 {&hf_bundle_payload_data,
2229 {"Payload Data", "bundle.payload.data",
2230 FT_STRINGZPAD, BASE_NONE, NULL, 0x0, NULL, HFILL}
2232 {&hf_bundle_payload_flags_replicate_hdr,
2233 {"Replicate Header in Every Fragment", "bundle.payload.proc.replicate",
2234 FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_REPLICATE_MASK, NULL, HFILL}
2236 {&hf_bundle_payload_flags_xmit_report,
2237 {"Report if Can't Process Header", "bundle.payload.proc.report",
2238 FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_XMIT_STATUS, NULL, HFILL}
2240 {&hf_bundle_payload_flags_discard_on_fail,
2241 {"Discard if Can't Process Header", "bundle.payload.proc.discard",
2242 FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_DISCARD_FAILURE, NULL, HFILL}
2244 {&hf_bundle_payload_flags_last_header,
2245 {"Last Header", "bundle.payload.proc.lastheader",
2246 FT_BOOLEAN, 8, NULL, PAYLOAD_PROCFLAGS_LAST_HEADER, NULL, HFILL}
2248 {&hf_bundle_admin_record_type,
2249 {"Administrative Record Type", "bundle.admin.record_type",
2250 FT_UINT8, BASE_DEC, VALS(admin_record_type_vals), 0xF0, NULL, HFILL}
2252 {&hf_bundle_admin_record_fragment,
2253 {"Administrative Record for Fragment", "bundle.admin.record_fragment",
2254 FT_BOOLEAN, 8, TFS(&tfs_yes_no), ADMIN_REC_FLAGS_FRAGMENT, NULL, HFILL}
2256 {&hf_bundle_admin_statflags,
2257 {"Administrative Record Status Flags", "bundle.admin.status.flag",
2258 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
2260 {&hf_bundle_admin_rcvd,
2261 {"Reporting Node Received Bundle", "bundle.admin.status.rcvd",
2262 FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_RECEIVED, NULL, HFILL}
2264 {&hf_bundle_admin_accepted,
2265 {"Reporting Node Accepted Custody", "bundle.admin.status.accept",
2266 FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_ACCEPTED, NULL, HFILL}
2268 {&hf_bundle_admin_forwarded,
2269 {"Reporting Node Forwarded Bundle", "bundle.admin.status.forward",
2270 FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_FORWARDED, NULL, HFILL}
2272 {&hf_bundle_admin_delivered,
2273 {"Reporting Node Delivered Bundle", "bundle.admin.status.delivered",
2274 FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_DELIVERED, NULL, HFILL}
2276 {&hf_bundle_admin_deleted,
2277 {"Reporting Node Deleted Bundle", "bundle.admin.status.delete",
2278 FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_DELETED, NULL, HFILL}
2280 {&hf_bundle_admin_acked,
2281 {"Acknowledged by Application", "bundle.admin.status.ack",
2282 FT_BOOLEAN, 8, NULL, ADMIN_STATUS_FLAGS_ACKNOWLEDGED, NULL, HFILL}
2284 {&hf_bundle_admin_fragment_offset,
2285 {"Fragment Offset", "bundle.admin.fragment_offset",
2286 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2288 {&hf_bundle_admin_fragment_length,
2289 {"Fragment Length", "bundle.admin.fragment_length",
2290 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2292 {&hf_bundle_admin_timestamp_seq_num64,
2293 {"Timestamp Sequence Number", "bundle.admin.timestamp_seq_num64",
2294 FT_INT64, BASE_DEC, NULL, 0x0, NULL, HFILL}
2296 {&hf_bundle_admin_timestamp_seq_num32,
2297 {"Timestamp Sequence Number", "bundle.admin.timestamp_seq_num32",
2298 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2300 {&hf_bundle_admin_endpoint_length,
2301 {"Endpoint Length", "bundle.admin.endpoint_length",
2302 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2304 {&hf_bundle_admin_endpoint_id,
2305 {"Bundle Endpoint ID", "bundle.admin.endpoint_id",
2306 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
2308 {&hf_bundle_admin_receipt_time,
2309 {"Bundle Received Time", "bundle.admin.status.receipttime",
2310 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
2312 {&hf_bundle_admin_accept_time,
2313 {"Bundle Accepted Time", "bundle.admin.status.accepttime",
2314 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
2316 {&hf_bundle_admin_forward_time,
2317 {"Bundle Forwarded Time", "bundle.admin.status.forwardtime",
2318 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
2320 {&hf_bundle_admin_delivery_time,
2321 {"Bundle Delivered Time", "bundle.admin.status.deliverytime",
2322 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
2324 {&hf_bundle_admin_delete_time,
2325 {"Bundle Deleted Time", "bundle.admin.status.deletetime",
2326 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
2328 {&hf_bundle_admin_ack_time,
2329 {"Bundle Acknowledged Time", "bundle.admin.status.acktime",
2330 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
2332 {&hf_bundle_admin_timestamp_copy,
2333 {"Bundle Creation Timestamp", "bundle.admin.status.timecopy",
2334 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
2336 {&hf_bundle_admin_signal_time,
2337 {"Bundle Signal Time", "bundle.admin.signal.time",
2338 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, NULL, HFILL}
2340 {&hf_block_control_flags,
2341 {"Block Processing Control Flags", "bundle.block.control.flags",
2342 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
2344 {&hf_block_control_flags_sdnv,
2345 {"Block Processing Control Flags", "bundle.block.control.flags",
2346 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
2348 {&hf_block_control_block_length,
2349 {"Block Length", "bundle.block.length",
2350 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2352 {&hf_block_control_block_cteb_custody_id,
2353 {"CTEB Custody ID", "bundle.block.cteb_custody_id",
2354 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2356 {&hf_block_control_block_cteb_creator_custodian_eid,
2357 {"CTEB Creator Custodian EID", "bundle.block.cteb_creator_custodian_eid",
2358 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
2360 {&hf_block_control_replicate,
2361 {"Replicate Block in Every Fragment", "bundle.block.control.replicate",
2362 FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_REPLICATE, NULL, HFILL}
2364 {&hf_block_control_transmit_status,
2365 {"Transmit Status if Block Can't be Processed", "bundle.block.control.status",
2366 FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_TRANSMIT_STATUS, NULL, HFILL}
2368 {&hf_block_control_delete_bundle,
2369 {"Delete Bundle if Block Can't be Processed", "bundle.block.control.delete",
2370 FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_DELETE_BUNDLE, NULL, HFILL}
2372 {&hf_block_control_last_block,
2373 {"Last Block", "bundle.block.control.last",
2374 FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_LAST_BLOCK, NULL, HFILL}
2376 {&hf_block_control_discard_block,
2377 {"Discard Block If Can't Process", "bundle.block.control.discard",
2378 FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_DISCARD_BLOCK, NULL, HFILL}
2380 {&hf_block_control_not_processed,
2381 {"Block Was Forwarded Without Processing", "bundle.block.control.process",
2382 FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_NOT_PROCESSED, NULL, HFILL}
2384 {&hf_block_control_eid_reference,
2385 {"Block Contains an EID-reference Field", "bundle.block.control.eid",
2386 FT_BOOLEAN, 8, NULL, BLOCK_CONTROL_EID_REFERENCE, NULL, HFILL}
2388 {&hf_bundle_status_report_reason_code,
2389 {"Status Report Reason Code", "bundle.status_report_reason_code",
2390 FT_UINT8, BASE_DEC, VALS(status_report_reason_codes), 0x0, NULL, HFILL}
2392 {&hf_bundle_custody_trf_succ_flg,
2393 {"Custody Transfer Succeeded Flag", "bundle.custody_trf_succ_flg",
2394 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
2396 {&hf_bundle_custody_signal_reason,
2397 {"Custody Signal Reason Code", "bundle.custody_signal_reason_code",
2398 FT_UINT8, BASE_DEC, VALS(custody_signal_reason_codes), ADMIN_REC_CUSTODY_REASON_MASK, NULL, HFILL}
2400 {&hf_bundle_custody_id_range_start,
2401 {"CTEB Custody ID Range Start", "bundle.custody_id_range_start",
2402 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2404 {&hf_bundle_custody_id_range_end,
2405 {"CTEB Custody ID Range End", "bundle.custody_id_range_end",
2406 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2408 {&hf_bundle_block_type_code,
2409 {"Block Type Code", "bundle.block_type_code",
2410 FT_UINT8, BASE_DEC, VALS(bundle_block_type_codes), 0x0, NULL, HFILL}
2412 {&hf_bundle_unprocessed_block_data,
2413 {"Block Data", "bundle.block_data",
2414 FT_STRINGZPAD, BASE_NONE, NULL, 0x0, NULL, HFILL}
2416 {&hf_ecos_flags,
2417 {"ECOS Flags", "bundle.block.ecos.flags",
2418 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
2420 {&hf_ecos_flags_critical,
2421 {"Critical", "bundle.block.ecos.flags.critical",
2422 FT_BOOLEAN, 8, NULL, ECOS_FLAGS_CRITICAL, NULL, HFILL}
2424 {&hf_ecos_flags_streaming,
2425 {"Streaming", "bundle.block.ecos.flags.streaming",
2426 FT_BOOLEAN, 8, NULL, ECOS_FLAGS_STREAMING, NULL, HFILL}
2428 {&hf_ecos_flags_flowlabel,
2429 {"Flow Label", "bundle.block.ecos.flags.flowlabel",
2430 FT_BOOLEAN, 8, NULL, ECOS_FLAGS_FLOWLABEL, NULL, HFILL}
2432 {&hf_ecos_flags_reliable,
2433 {"Reliable", "bundle.block.ecos.flags.reliable",
2434 FT_BOOLEAN, 8, NULL, ECOS_FLAGS_RELIABLE, NULL, HFILL}
2436 {&hf_ecos_flow_label,
2437 {"ECOS Flow Label", "bundle.block.ecos.flow_label",
2438 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2440 {&hf_ecos_ordinal,
2441 {"ECOS Ordinal", "bundle.block.ecos.ordinal",
2442 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
2444 {&hf_bundle_age_extension_block_code,
2445 {"Bundle Age in seconds", "bundle.age_extension_block_code",
2446 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2448 {&hf_bundle_block_previous_hop_scheme,
2449 {"Previous Hop Scheme", "bundle.block.previous_hop_scheme",
2450 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
2452 {&hf_bundle_block_previous_hop_eid,
2453 {"Previous Hop EID", "bundle.block.previous_hop_eid",
2454 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
2456 {&hf_bundle_target_block_type,
2457 {"Target Block Type", "bundle.target_block_type",
2458 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2460 {&hf_bundle_target_block_occurrence,
2461 {"Target Block Occurrence", "bundle.target_block_occurrence",
2462 FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
2464 {&hf_bundle_ciphersuite_type,
2465 {"Ciphersuite Type", "bundle.ciphersuite_type",
2466 FT_INT32, BASE_DEC, VALS(ciphersuite_types), 0x0, NULL, HFILL}
2468 {&hf_bundle_ciphersuite_flags,
2469 {"Ciphersuite Flags", "bundle.ciphersuite_flags",
2470 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
2472 {&hf_block_ciphersuite_params,
2473 {"Block Contains Ciphersuite Parameters", "bundle.block.ciphersuite_params",
2474 FT_BOOLEAN, 8, NULL, BLOCK_CIPHERSUITE_PARAMS, NULL, HFILL}
2476 {&hf_block_ciphersuite_params_length,
2477 {"Ciphersuite Parameters Length", "bundle.block.ciphersuite_params_length",
2478 FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
2480 {&hf_block_ciphersuite_params_item_length,
2481 {"Parameter Length", "bundle.block.ciphersuite_params_item_length",
2482 FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
2484 {&hf_block_ciphersuite_param_type,
2485 {"Ciphersuite Parameter Type", "bundle.block.ciphersuite_param_type",
2486 FT_INT8, BASE_DEC, VALS(res_params_types), 0x0, NULL, HFILL}
2488 {&hf_block_ciphersuite_param_data,
2489 {"Ciphersuite Parameter Data", "bundle.block.ciphersuite_param_data",
2490 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
2492 {&hf_block_ciphersuite_result_length,
2493 {"Security Results Length", "bundle.block.ciphersuite_result_length",
2494 FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
2496 {&hf_block_ciphersuite_result_item_length,
2497 {"Security Result Item Length", "bundle.block.ciphersuite_result_item_length",
2498 FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
2500 {&hf_block_ciphersuite_result_type,
2501 {"Security Result Item Type", "bundle.block.ciphersuite_result_type",
2502 FT_INT8, BASE_DEC, VALS(res_params_types), 0x0, NULL, HFILL}
2504 {&hf_block_ciphersuite_result_data,
2505 {"Security Result Item Data", "bundle.block.ciphersuite_result_data",
2506 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
2508 {&hf_block_ciphersuite_range_offset,
2509 {"Content Range Offset", "bundle.block.ciphersuite_range_offset",
2510 FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
2512 {&hf_block_ciphersuite_range_length,
2513 {"Content Range Length", "bundle.block.ciphersuite_range_length",
2514 FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
2518 static int *ett[] = {
2519 &ett_bundle,
2520 &ett_bundle_hdr,
2521 &ett_primary_hdr,
2522 &ett_proc_flags,
2523 &ett_gen_flags,
2524 &ett_cos_flags,
2525 &ett_srr_flags,
2526 &ett_dictionary,
2527 &ett_payload_hdr,
2528 &ett_payload_flags,
2529 &ett_block_flags,
2530 &ett_admin_record,
2531 &ett_admin_rec_status,
2532 &ett_metadata_hdr,
2533 &ett_sec_block_param_data
2536 static ei_register_info ei[] = {
2537 { &ei_bundle_control_flags_length,
2538 { "bundle.block.control.flags.length", PI_UNDECODED, PI_WARN, "Wrong bundle control flag length", EXPFILL }
2540 { &ei_bundle_payload_length,
2541 { "bundle.payload.length.invalid", PI_PROTOCOL, PI_ERROR, "Payload length error", EXPFILL }
2543 { &ei_bundle_sdnv_length,
2544 { "bundle.sdnv_length_invalid", PI_PROTOCOL, PI_ERROR, "SDNV length error", EXPFILL }
2546 { &ei_bundle_timestamp_seq_num,
2547 { "bundle.timestamp_seq_num_invalid", PI_PROTOCOL, PI_ERROR, "Timestamp Sequence Number error", EXPFILL }
2549 { &ei_bundle_offset_error,
2550 { "bundle.offset_error", PI_PROTOCOL, PI_WARN, "Offset field error", EXPFILL }
2552 { &ei_bundle_block_control_flags,
2553 { "bundle.block.control.flags.error", PI_PROTOCOL, PI_WARN, "Control flag error", EXPFILL }
2555 { &ei_block_control_block_cteb_invalid,
2556 { "bundle.block.control.cteb_invalid", PI_PROTOCOL, PI_WARN, "CTEB Is Invalid", EXPFILL }
2558 { &ei_block_control_block_cteb_valid,
2559 { "bundle.block.control.cteb_valid", PI_PROTOCOL, PI_NOTE, "CTEB Is Valid", EXPFILL }
2563 expert_module_t *expert_bundle;
2565 proto_bundle = proto_register_protocol("Bundle Protocol", "BP", "bundle");
2566 bpv6_handle = register_dissector("bpv6", dissect_bpv6, proto_bundle);
2567 bundle_handle = register_dissector("bundle", dissect_bundle, proto_bundle);
2569 proto_register_field_array(proto_bundle, hf, array_length(hf));
2570 proto_register_subtree_array(ett, array_length(ett));
2571 expert_bundle = expert_register_protocol(proto_bundle);
2572 expert_register_field_array(expert_bundle, ei, array_length(ei));
2575 void
2576 proto_reg_handoff_bpv6(void)
2578 bpv7_handle = find_dissector("bpv7");
2580 dissector_add_uint_with_preference("udp.port", BUNDLE_PORT, bundle_handle);
2584 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2586 * Local variables:
2587 * c-basic-offset: 4
2588 * tab-width: 8
2589 * indent-tabs-mode: nil
2590 * End:
2592 * vi: set shiftwidth=4 tabstop=8 expandtab:
2593 * :indentSize=4:tabSize=8:noTabs=true: