2 * Copyright 2006-2007 The MITRE Corporation.
4 * Approved for Public Release; Distribution Unlimited.
5 * Tracking Number 07-0090.
7 * The US Government will not be charged any license fee and/or royalties
8 * related to this software. Neither name of The MITRE Corporation; nor the
9 * names of its contributors may be used to endorse or promote products
10 * derived from this software without specific prior written permission.
14 * Wireshark - Network traffic analyzer
15 * By Gerald Combs <gerald@wireshark.org>
16 * Copyright 1998 Gerald Combs
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version 2
21 * of the License, or (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33 /* TCP Convergence Layer - Message Types */
34 #define TCP_CONV_MSG_TYPE_DATA 0x01
35 #define TCP_CONV_MSG_TYPE_ACK 0x02
36 #define TCP_CONV_MSG_TYPE_KEEP_ALIVE 0x03
37 #define TCP_CONV_MSG_TYPE_SHUTDOWN 0x04
39 /* TCP Convergence Layer (3) - Message Types */
40 #define TCP_CONVERGENCE_TYPE_MASK 0xf0
41 #define TCP_CONVERGENCE_DATA_SEGMENT 0x10
42 #define TCP_CONVERGENCE_ACK_SEGMENT 0x20
43 #define TCP_CONVERGENCE_REFUSE_BUNDLE 0x30
44 #define TCP_CONVERGENCE_KEEP_ALIVE 0x40
45 #define TCP_CONVERGENCE_SHUTDOWN 0x50
47 /* TCP Convergence Layer - Contact Header Flags */
48 #define TCP_CONV_BUNDLE_ACK_FLAG 0x01
49 #define TCP_CONV_REACTIVE_FRAG_FLAG 0x02
50 #define TCP_CONV_CONNECTOR_RCVR_FLAG 0x04
52 /* TCP Convergence Layer - Data Segment Flags */
53 #define TCP_CONVERGENCE_DATA_FLAGS 0x03
54 #define TCP_CONVERGENCE_DATA_END_FLAG 0x01
55 #define TCP_CONVERGENCE_DATA_START_FLAG 0x02
57 /* TCP Convergence Layer - Shutdown Segment Flags */
58 #define TCP_CONVERGENCE_SHUTDOWN_FLAGS 0x03
59 #define TCP_CONVERGENCE_SHUTDOWN_REASON 0x02
60 #define TCP_CONVERGENCE_SHUTDOWN_DELAY 0x01
63 * TCP Convergence Layer - Minimum buffer sizes
64 * For Data Packet require 5 bytes fixed plus
65 * up to 4 additional for length SDV
68 #define TCP_CONV_MIN_DATA_BUFFER 9
71 #define BUNDLE_PROCFLAGS_FRAG_MASK 0x01
72 #define BUNDLE_PROCFLAGS_ADMIN_MASK 0x02
73 #define BUNDLE_PROCFLAGS_DONTFRAG_MASK 0x04
74 #define BUNDLE_PROCFLAGS_XFERREQ_MASK 0x08
75 #define BUNDLE_PROCFLAGS_SINGLETON_MASK 0x10
76 #define BUNDLE_PROCFLAGS_APP_ACK_MASK 0x20
78 #define BUNDLE_COSFLAGS_PRIORITY_MASK 0x03
79 #define BUNDLE_COSFLAGS_PRIORITY_BULK 0x00
80 #define BUNDLE_COSFLAGS_PRIORITY_NORMAL 0x01
81 #define BUNDLE_COSFLAGS_PRIORITY_EXP 0x02
83 #define BUNDLE_SRRFLAGS_REPORT_MASK 0x01
84 #define BUNDLE_SRRFLAGS_CUSTODY_MASK 0x02
85 #define BUNDLE_SRRFLAGS_FORWARD_MASK 0x04
86 #define BUNDLE_SRRFLAGS_DELIVERY_MASK 0x08
87 #define BUNDLE_SRRFLAGS_DELETION_MASK 0x10
88 #define BUNDLE_SRRFLAGS_ACK_MASK 0x20
90 /* Header Processing Flags (non-primary) */
91 #define HEADER_PROCFLAGS_REPLICATE 0x01
92 #define HEADER_PROCFLAGS_XMIT_STATUS 0x02
93 #define HEADER_PROCFLAGS_DISCARD 0x04
94 #define HEADER_PROCFLAGS_LAST_HEADER 0x08
96 /* Header Types (excluding Primary Header) */
97 #define BUNDLE_BLOCK_TYPE_PAYLOAD 0x01 /* RFC5050 */
98 #define BUNDLE_BLOCK_TYPE_AUTHENTICATION 0x02 /* RFC6257 */
99 #define BUNDLE_BLOCK_TYPE_INTEGRITY 0x03 /* RFC6257 */
100 #define BUNDLE_BLOCK_TYPE_CONFIDENTIALITY 0x04 /* RFC6257 */
101 #define BUNDLE_BLOCK_TYPE_PREVIOUS_HOP_INSERT 0x05 /* RFC6259 */
102 #define BUNDLE_BLOCK_TYPE_METADATA_EXTENSION 0x08 /* RFC6258 */
103 #define BUNDLE_BLOCK_TYPE_EXTENSION_SECURITY 0x09 /* RFC6257 */
104 #define BUNDLE_BLOCK_TYPE_CUSTODY_TRANSFER 0x0a /* http://bioserve.colorado.edu/bp-acs/ */
105 #define BUNDLE_BLOCK_TYPE_EXTENDED_COS 0x13 /* http://tools.ietf.org/html/draft-irtf-dtnrg-ecos-02 */
107 /* Payload Header Processing Flags */
108 #define PAYLOAD_PROCFLAGS_REPLICATE_MASK 0x01
109 #define PAYLOAD_PROCFLAGS_XMIT_STATUS 0x02
110 #define PAYLOAD_PROCFLAGS_DISCARD_FAILURE 0x04
111 #define PAYLOAD_PROCFLAGS_LAST_HEADER 0x08
113 /* Header Fixed Sizes */
114 #define TCP_CONV_HDR_DATA_FIXED_LENGTH 5
115 #define TCP_CONV_HDR_ACK_LENGTH 9
116 #define TCP_CONV_HDR_KEEP_ALIVE_LENGTH 1
117 #define TCP_CONV_HDR_SHUTDOWN_LENGTH 1
119 /* Administrative Record Definitions */
120 #define ADMIN_REC_TYPE_STATUS_REPORT 0x01
121 #define ADMIN_REC_TYPE_CUSTODY_SIGNAL 0x02
122 #define ADMIN_REC_TYPE_AGGREGATE_CUSTODY_SIGNAL 0x04
123 #define ADMIN_REC_TYPE_ANNOUNCE_BUNDLE 0x05
125 #define ADMIN_REC_FLAGS_FRAGMENT 0x01
126 #define ADMIN_REC_CUSTODY_REASON_MASK 0x7f
128 /* Bundle Status Report Flags */
129 #define ADMIN_STATUS_FLAGS_RECEIVED 0x01
130 #define ADMIN_STATUS_FLAGS_ACCEPTED 0x02
131 #define ADMIN_STATUS_FLAGS_FORWARDED 0x04
132 #define ADMIN_STATUS_FLAGS_DELIVERED 0x08
133 #define ADMIN_STATUS_FLAGS_DELETED 0x10
134 #define ADMIN_STATUS_FLAGS_ACKNOWLEDGED 0x20
136 /* Block Processing Control Flags (Version 5) */
137 #define BLOCK_CONTROL_REPLICATE 0x01
138 #define BLOCK_CONTROL_TRANSMIT_STATUS 0x02
139 #define BLOCK_CONTROL_DELETE_BUNDLE 0x04
140 #define BLOCK_CONTROL_LAST_BLOCK 0x08
141 #define BLOCK_CONTROL_DISCARD_BLOCK 0x10
142 #define BLOCK_CONTROL_NOT_PROCESSED 0x20
143 #define BLOCK_CONTROL_EID_REFERENCE 0x40
146 #define ECOS_FLAGS_CRITICAL 0x01
147 #define ECOS_FLAGS_STREAMING 0x02
148 #define ECOS_FLAGS_ORDINAL 0x04
150 #define IPN_SCHEME_STR "ipn"
152 int evaluate_sdnv(tvbuff_t
*tvb
, int offset
, int *bytecount
);
153 gint64
evaluate_sdnv_64(tvbuff_t
*tvb
, int offset
, int *bytecount
);