2 * Routines for Transparent Inter Process Communication packet dissection
6 * Copyright 2005, Anders Broman <anders.broman@ericsson.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 * http://tipc.sourceforge.net/
39 #include <epan/prefs.h>
42 #include <epan/packet.h>
43 #include <epan/etypes.h>
44 #include <epan/emem.h>
45 #include <epan/reassemble.h>
47 static int proto_tipc = -1;
49 static int hf_tipc_msg_fragments = -1;
50 static int hf_tipc_msg_fragment = -1;
51 static int hf_tipc_msg_fragment_overlap = -1;
52 static int hf_tipc_msg_fragment_overlap_conflicts = -1;
53 static int hf_tipc_msg_fragment_multiple_tails = -1;
54 static int hf_tipc_msg_fragment_too_long_fragment = -1;
55 static int hf_tipc_msg_fragment_error = -1;
56 static int hf_tipc_msg_reassembled_in = -1;
58 static int hf_tipc_ver = -1;
59 static int hf_tipc_usr = -1;
60 static int hf_tipcv2_usr = -1;
61 static int hf_tipc_hdr_size = -1;
62 static int hf_tipc_nonsequenced = -1;
63 static int hf_tipc_destdrop;
64 static int hf_tipc_unused = -1;
65 static int hf_tipc_msg_size = -1;
66 static int hf_tipc_ack_link_lev_seq = -1;
67 static int hf_tipc_link_lev_seq = -1;
68 static int hf_tipc_prev_proc = -1;
69 static int hf_tipc_org_port = -1;
70 static int hf_tipc_dst_port = -1;
71 static int hf_tipc_data_msg_type = -1;
72 static int hf_tipc_err_code = -1;
73 static int hf_tipc_reroute_cnt = -1;
74 static int hf_tipc_act_id = -1;
75 static int hf_tipc_org_proc = -1;
76 static int hf_tipc_dst_proc = -1;
77 static int hf_tipc_unused2 = -1;
78 static int hf_tipc_importance = -1;
79 static int hf_tipc_link_selector = -1;
80 static int hf_tipc_msg_cnt = -1;
81 static int hf_tipc_probe = -1;
82 static int hf_tipc_bearer_id = -1;
83 static int hf_tipc_link_selector2 = -1;
84 static int hf_tipc_remote_addr = -1;
85 static int hf_tipc_rm_msg_type = -1;
86 static int hf_tipc_nd_msg_type = -1;
87 static int hf_tipc_cm_msg_type = -1;
88 static int hf_tipc_lp_msg_type = -1;
89 static int hf_tipc_cng_prot_msg_type = -1;
90 static int hf_tipc_sm_msg_type = -1;
91 static int hf_tipc_unknown_msg_type = -1;
92 static int hf_tipc_seq_gap = -1;
93 static int hf_tipc_nxt_snt_pkg = -1;
94 static int hf_tipc_unused3 = -1;
95 static int hf_tipc_bearer_name = -1;
97 static int hf_tipc_name_dist_type = -1;
98 static int hf_tipc_name_dist_lower = -1;
99 static int hf_tipc_name_dist_upper = -1;
100 static int hf_tipc_name_dist_port = -1;
101 static int hf_tipc_name_dist_key = -1;
103 static int hf_tipcv2_data_msg_type = -1;
104 static int hf_tipcv2_bcast_mtype = -1;
105 static int hf_tipcv2_link_mtype = -1;
106 static int hf_tipcv2_connmgr_mtype = -1;
107 static int hf_tipcv2_route_mtype = -1;
108 static int hf_tipcv2_changeover_mtype = -1;
109 static int hf_tipcv2_naming_mtype = -1;
110 static int hf_tipcv2_fragmenter_mtype = -1;
111 static int hf_tipcv2_neighbour_mtype = -1;
112 static int hf_tipcv2_errorcode = -1;
113 static int hf_tipcv2_rer_cnt = -1;
114 static int hf_tipcv2_lookup_scope = -1;
115 static int hf_tipcv2_opt_p = -1;
116 static int hf_tipcv2_broadcast_ack_no = -1;
117 static int hf_tipcv2_link_level_ack_no = -1;
118 static int hf_tipcv2_link_level_seq_no = -1;
119 static int hf_tipcv2_bcast_seq_no = -1;
120 static int hf_tipcv2_prev_node = -1;
121 static int hf_tipcv2_orig_node = -1;
122 static int hf_tipcv2_dest_node = -1;
123 static int hf_tipcv2_port_name_type = -1;
124 static int hf_tipcv2_port_name_instance = -1;
126 static int hf_tipcv2_bcast_seq_gap = -1;
127 static int hf_tipcv2_sequence_gap = -1;
128 static int hf_tipcv2_next_sent_broadcast = -1;
129 static int hf_tipcv2_fragment_number = -1;
130 static int hf_tipcv2_next_sent_packet = -1;
131 static int hf_tipcv2_session_no = -1;
132 static int hf_tipcv2_link_prio = -1;
133 static int hf_tipcv2_network_plane = -1;
134 static int hf_tipcv2_probe = -1;
135 static int hf_tipcv2_link_tolerance = -1;
136 static int hf_tipcv2_bearer_instance = -1;
137 static int hf_tipcv2_bearer_level_orig_addr = -1;
138 static int hf_tipcv2_cluster_address = -1;
139 static int hf_tipcv2_bitmap = -1;
140 static int hf_tipcv2_node_address = -1;
141 static int hf_tipcv2_destination_domain = -1;
142 static int hf_tipcv2_network_id = -1;
144 static gint ett_tipc_msg_fragment = -1;
145 static gint ett_tipc_msg_fragments = -1;
147 /* Initialize the subtree pointer */
148 static gint ett_tipc = -1;
149 static gint ett_tipc_data = -1;
151 static gboolean tipc_defragment = TRUE;
152 static gboolean dissect_tipc_data = FALSE;
154 static gboolean extra_ethertype = FALSE;
156 #define ETHERTYPE_TIPC2 0x0807
158 dissector_handle_t ip_handle;
160 static proto_tree *top_tree;
162 static const fragment_items tipc_msg_frag_items = {
163 /* Fragment subtrees */
164 &ett_tipc_msg_fragment,
165 &ett_tipc_msg_fragments,
166 /* Fragment fields */
167 &hf_tipc_msg_fragments,
168 &hf_tipc_msg_fragment,
169 &hf_tipc_msg_fragment_overlap,
170 &hf_tipc_msg_fragment_overlap_conflicts,
171 &hf_tipc_msg_fragment_multiple_tails,
172 &hf_tipc_msg_fragment_too_long_fragment,
173 &hf_tipc_msg_fragment_error,
174 /* Reassembled in field */
175 &hf_tipc_msg_reassembled_in,
177 "TIPC Message fragments"
181 #define MAX_TIPC_ADDRESS_STR_LEN 15
185 #define TIPC_DATA_PRIO_0 0
186 #define TIPC_DATA_PRIO_1 1
187 #define TIPC_DATA_PRIO_2 2
188 #define TIPC_DATA_NON_REJECTABLE 3
190 #define TIPC_ROUTING_MANAGER 8
191 #define TIPC_NAME_DISTRIBUTOR 9
192 #define TIPC_CONNECTION_MANAGER 10
193 #define TIPC_LINK_PROTOCOL 11
194 #define TIPC_CHANGEOVER_PROTOCOL 13
195 #define TIPC_SEGMENTATION_MANAGER 14
196 #define TIPC_MSG_BUNDLER 15
198 #define TIPC_LINK_PROTOCO_STATE_MSG 0
200 const value_string tipc_user_values[] = {
204 { 3, "DATA_NON_REJECTABLE"},
205 { TIPC_ROUTING_MANAGER, "ROUTING_MANAGER"},
206 { TIPC_NAME_DISTRIBUTOR, "NAME_DISTRIBUTOR"},
207 { TIPC_CONNECTION_MANAGER, "CONNECTION_MANAGER"},
208 { TIPC_LINK_PROTOCOL, "LINK_PROTOCOL"},
209 { TIPC_CHANGEOVER_PROTOCOL, "CHANGEOVER_PROTOCOL"},
210 { TIPC_SEGMENTATION_MANAGER, "SEGMENTATION_MANAGER"},
211 { TIPC_MSG_BUNDLER, "MSG_BUNDLER"},
215 #define TIPCv2_BCAST_PROTOCOL 5
216 #define TIPCv2_MSG_BUNDLER 6
217 #define TIPCv2_LINK_PROTOCOL 7
218 #define TIPCv2_CONN_MANAGER 8
219 #define TIPCv2_ROUTE_DISTRIBUTOR 9
220 #define TIPCv2_CHANGEOVER_PROTOCOL 10
221 #define TIPCv2_NAME_DISTRIBUTOR 11
222 #define TIPCv2_MSG_FRAGMENTER 12
223 #define TIPCv2_LINK_CONFIGURATION 13
225 const value_string tipcv2_user_values[] = {
226 { 0, "Low Priority Payload Data"},
227 { 1, "Normal Priority Payload Data"},
228 { 2, "High Priority Payload Data"},
229 { 3, "Non-Rejectable Payload Data"},
230 { TIPCv2_BCAST_PROTOCOL, "Broadcast Maintenance Protocol"},
231 { TIPCv2_MSG_BUNDLER, "Message Bundler Protocol"},
232 { TIPCv2_LINK_PROTOCOL, "Link State Maintenance Protocol"},
233 { TIPCv2_CONN_MANAGER, "Connection Manager"},
234 { TIPCv2_ROUTE_DISTRIBUTOR, "Routing Table Update Protocol"},
235 { TIPCv2_CHANGEOVER_PROTOCOL, "Link Changeover Protocol"},
236 { TIPCv2_NAME_DISTRIBUTOR, "Name Table Update Protocol"},
237 { TIPCv2_MSG_FRAGMENTER, "Message Fragmentation Protocol"},
238 { TIPCv2_LINK_CONFIGURATION, "Link Configuration Protocol"},
242 #define TIPC_CONNECTED_MSG 0
243 #define TIPC_NAMED_MSG 2
244 #define TIPC_DIRECT_MSG 3
245 #define TIPC_OVERLOAD_W_MSG 4
247 static const value_string tipc_data_msg_type_values[] = {
251 { 4, "OVERLOAD_W_MSG"},
255 static const value_string tipcv2_data_msg_type_values[] = {
256 { 0, "Sent on connection (CONN_MSG)"},
257 { 1, "Logical multicast (MCAST_MSG)"},
258 { 2, "Port name destination address (NAMED_MSG)"},
259 { 3, "Port identity destination address (DIRECT_MSG)"},
262 static const value_string tipc_error_code_values[] = {
264 { 1, "NO_PORT_NAME"},
265 { 2, "NO_REMOTE_PORT"},
266 { 3, "NO_REMOTE_PROCESSOR"},
267 { 4, "DEST_OVERLOADED"},
268 { 6, "NO_CONNECTION"},
269 { 7, "COMMUNICATION_ERROR"},
272 static const value_string tipcv2_error_code_strings[]={
273 { 0 ,"No error (TIPC_OK)"},
274 { 1 ,"Destination port name unknown (TIPC_ERR_NO_NAME)"},
275 { 2 ,"Destination port does not exist (TIPC_ERR_NO_PORT)"},
276 { 3 ,"Destination node unavailable (TIPC_ERR_NO_NODE)"},
277 { 4 ,"Destination node overloaded (TIPC_ERR_OVERLOAD)"},
278 { 5 ,"Connection Shutdown (No error) (TIPC_CONN_SHUTDOWN)"},
279 { 6 ,"Communication Error (TIPC_CONN_ERROR)"},
283 static const value_string tipcv2_lookup_scope_strings[]={
285 { 1 ,"Cluster Scope"},
289 static const value_string tipc_routing_mgr_msg_type_values[] = {
290 { 0, "EXT_ROUTING_TABLE"},
291 { 1, "LOCAL_ROUTING_TABLE"},
292 { 2, "DP_ROUTING_TABLE"},
293 { 3, "ROUTE_ADDITION"},
294 { 4, "ROUTE_REMOVAL"},
297 static const value_string tipc_name_dist_msg_type_values[] = {
302 /* CONNECTION_MANAGER */
303 static const value_string tipc_cm_msg_type_values[] = {
304 { 0, "CONNECTION_PROBE"},
305 { 1, "CONNECTION_PROBE_REPLY"},
308 static const value_string tipc_link_prot_msg_type_values[] = {
310 { 11, "ACTIVATE_MSG"},
314 /* CHANGEOVER_PROTOCOL */
315 static const value_string tipc_cng_prot_msg_type_values[] = {
316 { 0, "DUPLICATE_MSG"},
317 { 1, "ORIGINAL_MSG"},
321 /* SEGMENTATION_MANAGER */
322 #define TIPC_FIRST_SEGMENT 1
323 #define TIPC_SEGMENT 2
324 const value_string tipc_sm_msg_type_values[] = {
325 { 1, "FIRST_SEGMENT"},
330 /* TIPCv2_BCAST_PROTOCOL - Broadcast Maintenance Protocol */
331 static const value_string tipcv2_bcast_mtype_strings[]={
332 { 0 ,"Tunneled, retransmitted broadcast packet (BCAST_MSG)"},
336 /* TIPCv2_MSG_BUNDLER - Message Bundler Protocol */
338 /* No message types */
340 /* TIPCv2_LINK_PROTOCOL - Link State Maintenance Protocol */
341 #define TIPCv2_STATE_MSG 0
342 #define TIPCv2_RESET_MSG 1
344 static const value_string tipcv2_link_mtype_strings[]={
345 { TIPCv2_STATE_MSG, "STATE_MSG"},
346 { TIPCv2_RESET_MSG, "RESET_MSG"},
347 { 2, "ACTIVATE_MSG"},
350 /* TIPCv2_CONN_MANAGER - Connection Manager */
351 static const value_string tipcv2_connmgr_mtype_strings[]={
353 { 1 ,"CONN_PROBE_REPLY"},
357 /* TIPCv2_ROUTE_DISTRIBUTOR - Routing Table Update Protocol */
359 #define TIPCv2_EXT_ROUTING_TABLE 0
360 #define TIPCv2_LOCAL_ROUTING_TABLE 1
361 #define TIPCv2_SEC_ROUTING_TABLE 2
362 #define TIPCv2_ROUTE_ADDITION 3
363 #define TIPCv2_ROUTE_REMOVAL 4
364 static const value_string tipcv2_route_mtype_strings[]={
365 { 0 ,"EXT_ROUTING_TABLE"},
366 { 1 ,"LOCAL_ROUTING_TABLE"},
367 { 2 ,"SEC_ROUTING_TABLE"},
368 { 3 ,"ROUTE_ADDITION"},
369 { 4 ,"ROUTE_REMOVAL"},
372 /* TIPCv2_CHANGEOVER_PROTOCOL - Link Changeover Protocol */
373 static const value_string tipcv2_changeover_mtype_strings[]={
374 { 0 ,"DUPLICATE_MSG"},
375 { 1 ,"ORIGINAL_MSG"},
378 /* TIPCv2_NAME_DISTRIBUTOR - Name Table Update Protocol */
379 static const value_string tipcv2_naming_mtype_strings[]={
384 /* TIPCv2_MSG_FRAGMENTER - Message Fragmentation Protocol" */
385 static const value_string tipcv2_fragmenter_mtype_strings[]={
386 { 0 ,"FIRST_FRAGMENT"},
388 { 2 ,"LAST_FRAGMENT"},
392 /* TIPCv2_LINK_CONFIGURATION - Link Configuration Protocol
393 * 4.3.9 Neighbour Detection Protocol
396 static const value_string tipcv2_neighbour_mtype_strings[]={
397 { 0 ,"Link_Request"},
398 { 1 ,"Link_Response"},
403 static const value_string tipcv2_networkplane_strings[]={
414 static void dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
417 static GHashTable *tipc_msg_fragment_table = NULL;
418 static GHashTable *tipc_msg_reassembled_table = NULL;
422 tipc_defragment_init(void)
424 fragment_table_init (&tipc_msg_fragment_table);
425 reassembled_table_init(&tipc_msg_reassembled_table);
430 tipc_addr_to_str(guint tipc_address)
437 buff=ep_alloc(MAX_TIPC_ADDRESS_STR_LEN);
439 processor = tipc_address & 0x0fff;
441 tipc_address = tipc_address >> 12;
442 subnetwork = tipc_address & 0x0fff;
444 tipc_address = tipc_address >> 12;
445 zone = tipc_address & 0xff;
447 g_snprintf(buff,MAX_TIPC_ADDRESS_STR_LEN,"%u.%u.%u",zone,subnetwork,processor);
453 All name distributor messages have a data part containing one or more table elements with
454 the following five-word structure:
455 struct DistributionItem{
456 unsigned int type; / Published port name type /
457 unsigned int lower; / Lower bound of published sequence /
458 unsigned int upper; / Upper bound of published sequence /
459 unsigned int port; / Random number part of port identity /
460 unsigned int key; / Use for verification at withdrawal /
464 dissect_tipc_name_dist_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
467 while ( tvb_reported_length_remaining(tvb,offset) > 0){
468 proto_tree_add_item(tree, hf_tipc_name_dist_type, tvb, offset, 4, FALSE);
470 proto_tree_add_item(tree, hf_tipc_name_dist_lower, tvb, offset, 4, FALSE);
472 proto_tree_add_item(tree, hf_tipc_name_dist_upper, tvb, offset, 4, FALSE);
474 proto_tree_add_item(tree, hf_tipc_name_dist_port, tvb, offset, 4, FALSE);
476 proto_tree_add_item(tree, hf_tipc_name_dist_key, tvb, offset, 4, FALSE);
481 /* Set message type in COL INFO and return type of message ( data or Internal message type */
483 tipc_v2_set_col_msgtype(packet_info *pinfo, guint8 user,guint8 msg_type){
485 gboolean datatype_hdr = FALSE;
488 case TIPC_DATA_PRIO_0:
489 case TIPC_DATA_PRIO_1:
490 case TIPC_DATA_PRIO_2:
491 case TIPC_DATA_NON_REJECTABLE:
493 * src and dest address will be found at different location depending on User ad hdr_size
496 if (check_col(pinfo->cinfo, COL_INFO))
497 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipcv2_data_msg_type_values, "unknown"),msg_type);
499 case TIPCv2_BCAST_PROTOCOL:
500 if (check_col(pinfo->cinfo, COL_INFO))
501 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipcv2_bcast_mtype_strings, "unknown"),msg_type);
503 case TIPCv2_MSG_BUNDLER:
504 /* No message types */
506 case TIPCv2_LINK_PROTOCOL:
507 if (check_col(pinfo->cinfo, COL_INFO))
508 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipcv2_link_mtype_strings, "unknown"),msg_type);
510 case TIPCv2_CONN_MANAGER:
511 if (check_col(pinfo->cinfo, COL_INFO))
512 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipcv2_connmgr_mtype_strings, "unknown"),msg_type);
514 case TIPCv2_ROUTE_DISTRIBUTOR:
515 if (check_col(pinfo->cinfo, COL_INFO))
516 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipcv2_route_mtype_strings, "unknown"),msg_type);
518 case TIPCv2_CHANGEOVER_PROTOCOL:
519 if (check_col(pinfo->cinfo, COL_INFO))
520 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipcv2_changeover_mtype_strings, "unknown"),msg_type);
522 case TIPCv2_NAME_DISTRIBUTOR:
523 if (check_col(pinfo->cinfo, COL_INFO))
524 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipcv2_naming_mtype_strings, "unknown"),msg_type);
526 case TIPCv2_MSG_FRAGMENTER:
527 if (check_col(pinfo->cinfo, COL_INFO))
528 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipcv2_fragmenter_mtype_strings, "unknown"),msg_type);
530 case TIPCv2_LINK_CONFIGURATION:
531 if (check_col(pinfo->cinfo, COL_INFO))
532 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipcv2_neighbour_mtype_strings, "unknown"),msg_type);
540 /* Set message type in COL INFO and return type of message ( data or Internal message type */
542 tipc_v1_set_col_msgtype(packet_info *pinfo, guint8 user,guint8 msg_type){
544 gboolean datatype_hdr = FALSE;
547 case TIPC_DATA_PRIO_0:
548 case TIPC_DATA_PRIO_1:
549 case TIPC_DATA_PRIO_2:
550 case TIPC_DATA_NON_REJECTABLE:
552 * src and dest address will be found at different location depending on User ad hdr_size
555 if (check_col(pinfo->cinfo, COL_INFO))
556 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_data_msg_type_values, "unknown"),msg_type);
558 case TIPC_NAME_DISTRIBUTOR:
559 if (check_col(pinfo->cinfo, COL_INFO))
560 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_name_dist_msg_type_values, "unknown"),msg_type);
562 case TIPC_CONNECTION_MANAGER:
563 if (check_col(pinfo->cinfo, COL_INFO))
564 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_cm_msg_type_values, "unknown"),msg_type);
566 case TIPC_ROUTING_MANAGER:
567 if (check_col(pinfo->cinfo, COL_INFO))
568 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_routing_mgr_msg_type_values, "unknown"),msg_type);
570 case TIPC_LINK_PROTOCOL:
571 if (check_col(pinfo->cinfo, COL_INFO))
572 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_link_prot_msg_type_values, "unknown"),msg_type);
574 case TIPC_CHANGEOVER_PROTOCOL:
575 if (check_col(pinfo->cinfo, COL_INFO))
576 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_cng_prot_msg_type_values, "unknown"),msg_type);
578 case TIPC_SEGMENTATION_MANAGER:
579 if (check_col(pinfo->cinfo, COL_INFO))
580 col_append_fstr(pinfo->cinfo, COL_INFO, "%s(%u) ", val_to_str(msg_type, tipc_sm_msg_type_values, "unknown"),msg_type);
582 case TIPC_MSG_BUNDLER:
592 Version 2(draft-maloy-tipc-01.txt):
594 4.2.1 Internal Message Header Format
599 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
600 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
601 w0:|vers |msg usr|hdr sz |n|resrv| packet size |
602 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
603 w1:|m typ|bcstsqgap| sequence gap | broadcast ack no |
604 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
605 w2:| link level ack no | broadcast/link level seq no |
606 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
608 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
609 w4:| next sent broadcast/fragm no | next sent pkt/ fragm msg no |
610 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
611 w5:| session no | res |r|berid|link prio|netpl|p|
612 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
613 w6:| originating node |
614 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
615 w7:| destination node |
616 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
617 w8:| transport sequence number |
618 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
619 w9:| msg count | link tolerance |
620 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
622 / User Specific Data /
624 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
628 dissect_tipc_v2_internal_msg(tvbuff_t *tipc_tvb, packet_info *pinfo, proto_tree *tipc_tree, int offset, guint8 user, guint32 msg_size)
636 dword = tvb_get_ntohl(tipc_tvb,offset+8);
637 addr_str_ptr = tipc_addr_to_str(dword);
638 message_type = tvb_get_guint8(tipc_tvb,offset) >>1;
641 case TIPCv2_BCAST_PROTOCOL:
643 proto_tree_add_item(tipc_tree, hf_tipcv2_bcast_mtype, tipc_tvb, offset, 4, FALSE);
648 proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr);
655 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 6 Unused for this user");
658 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 7 Unused for this user");
661 case TIPCv2_MSG_BUNDLER:
663 /* No message types */
668 proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr);
673 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 6 Unused for this user");
676 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 7 Unused for this user");
679 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 8 Unused for this user");
682 /* Message Count: 16 bits. */
685 case TIPCv2_LINK_PROTOCOL:
687 proto_tree_add_item(tipc_tree, hf_tipcv2_link_mtype, tipc_tvb, offset, 4, FALSE);
688 /* Broadcast Sequence Gap: 5 bits. */
689 proto_tree_add_item(tipc_tree, hf_tipcv2_bcast_seq_gap, tipc_tvb, offset, 4, FALSE);
690 /* Sequence Gap: 8 bits. */
691 proto_tree_add_item(tipc_tree, hf_tipcv2_sequence_gap, tipc_tvb, offset, 4, FALSE);
696 proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr);
699 /* Next Sent Broadcast: 16 bits */
700 proto_tree_add_item(tipc_tree, hf_tipcv2_next_sent_broadcast, tipc_tvb, offset, 4, FALSE);
701 /* Next Sent Packet: 16 bits. */
702 proto_tree_add_item(tipc_tree, hf_tipcv2_next_sent_packet, tipc_tvb, offset, 4, FALSE);
705 /* Session Number: 16 bits. */
706 proto_tree_add_item(tipc_tree, hf_tipcv2_session_no, tipc_tvb, offset, 4, FALSE);
707 /* Reserved: 3 bits Must be set to zero. */
708 /* Redundant Link: 1 bit */
709 /* Bearer Identity: 3 bits */
710 /* Link Priority: 5 bits. */
711 proto_tree_add_item(tipc_tree, hf_tipcv2_link_prio, tipc_tvb, offset, 4, FALSE);
712 /* Network Plane: 3 bits. */
713 proto_tree_add_item(tipc_tree, hf_tipcv2_network_plane, tipc_tvb, offset, 4, FALSE);
715 proto_tree_add_item(tipc_tree, hf_tipcv2_probe, tipc_tvb, offset, 4, FALSE);
719 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 6 Unused for this user");
722 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 7 Unused for this user");
725 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 8 Unused for this user");
728 /* Link Tolerance: 16 bits */
729 proto_tree_add_item(tipc_tree, hf_tipcv2_link_tolerance, tipc_tvb, offset, 4, FALSE);
732 if (message_type == TIPCv2_RESET_MSG)
733 proto_tree_add_item(tipc_tree, hf_tipcv2_bearer_instance, tipc_tvb, offset, -1, FALSE);
735 case TIPCv2_CONN_MANAGER:
737 proto_tree_add_item(tipc_tree, hf_tipcv2_connmgr_mtype, tipc_tvb, offset, 4, FALSE);
742 proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr);
749 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 6 Unused for this user");
752 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 7 Unused for this user");
754 case TIPCv2_ROUTE_DISTRIBUTOR:
756 proto_tree_add_item(tipc_tree, hf_tipcv2_route_mtype, tipc_tvb, offset, 4, FALSE);
761 proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr);
768 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 6 Unused for this user");
771 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 7 Unused for this user");
778 switch (message_type){
779 case TIPCv2_EXT_ROUTING_TABLE: /* 0 */
780 case TIPCv2_LOCAL_ROUTING_TABLE: /* 1 */
781 case TIPCv2_SEC_ROUTING_TABLE: /* 2 */
782 /* Cluster Address */
783 dword = tvb_get_ntohl(tipc_tvb,offset+8);
784 addr_str_ptr = tipc_addr_to_str(dword);
785 proto_tree_add_string(tipc_tree, hf_tipcv2_cluster_address, tipc_tvb, offset, 4, addr_str_ptr);
788 proto_tree_add_item(tipc_tree, hf_tipcv2_bitmap, tipc_tvb, offset, -1, FALSE);
790 case TIPCv2_ROUTE_ADDITION: /* 3 */
791 case TIPCv2_ROUTE_REMOVAL: /* 4 */
793 dword = tvb_get_ntohl(tipc_tvb,offset+8);
794 addr_str_ptr = tipc_addr_to_str(dword);
795 proto_tree_add_string(tipc_tree, hf_tipcv2_node_address, tipc_tvb, offset, 4, addr_str_ptr);
801 case TIPCv2_CHANGEOVER_PROTOCOL:
803 proto_tree_add_item(tipc_tree, hf_tipcv2_changeover_mtype, tipc_tvb, offset, 4, FALSE);
808 proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr);
815 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 6 Unused for this user");
818 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 7 Unused for this user");
823 /* Message Count: 16 bits. */
826 case TIPCv2_NAME_DISTRIBUTOR:
828 proto_tree_add_item(tipc_tree, hf_tipcv2_naming_mtype, tipc_tvb, offset, 4, FALSE);
833 proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr);
840 /* Originating Node: 32 bits. */
841 dword = tvb_get_ntohl(tipc_tvb,offset);
842 addr_str_ptr = tipc_addr_to_str(dword);
843 proto_tree_add_string(tipc_tree, hf_tipcv2_dest_node, tipc_tvb, offset, 4, addr_str_ptr);
846 /* Destination Node: 32 bits. */
847 dword = tvb_get_ntohl(tipc_tvb,offset);
848 addr_str_ptr = tipc_addr_to_str(dword);
849 proto_tree_add_string(tipc_tree, hf_tipcv2_orig_node, tipc_tvb, offset, 4, addr_str_ptr);
852 /* Transport Level Sequence Number: 32 bits */
855 /* Message Count: 16 bits. */
858 data_tvb = tvb_new_subset(tipc_tvb, offset, -1, -1);
859 dissect_tipc_name_dist_data(data_tvb, pinfo, tipc_tree);
861 case TIPCv2_MSG_FRAGMENTER:
863 proto_tree_add_item(tipc_tree, hf_tipcv2_fragmenter_mtype, tipc_tvb, offset, 4, FALSE);
865 proto_tree_add_item(tipc_tree, hf_tipcv2_fragment_number, tipc_tvb, offset, 4, FALSE);
870 proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr);
873 /* Fragment Number: 16 Bits. */
874 /* Fragment (msg?) Number: 16 bits */
879 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 6 Unused for this user");
882 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Word 7 Unused for this user");
885 case TIPCv2_LINK_CONFIGURATION:
887 The protocol for neighbour detection
888 uses a special message format, with the following generic structure:
891 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
892 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
893 w0:|vers |msg usr|hdr sz |n|resrv| packet size |
894 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
895 w1:|m typ|0| requested links | broadcast ack no |
896 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
897 w2:| destination domain |
898 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
900 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
901 w4:| network identity |
902 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
904 +-+-+-+-+-+-+- +-+-+-+-+-+-+-+
906 +-+-+-+-+-+-+- bearer level originating address +-+-+-+-+-+-+-+
908 +-+-+-+-+-+-+- +-+-+-+-+-+-+-+
910 +-+-+-+-+-+-+- +-+-+-+-+-+-+-+
912 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
914 / vendor specific data (optional) /
916 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
919 proto_tree_add_item(tipc_tree, hf_tipcv2_neighbour_mtype, tipc_tvb, offset, 4, FALSE);
920 /* Requested Links (12 bits) */
921 proto_tree_add_item(tipc_tree, hf_tipcv2_broadcast_ack_no , tipc_tvb, offset, 4, FALSE);
924 /* Destination Domain */
925 dword = tvb_get_ntohl(tipc_tvb,offset);
926 addr_str_ptr = tipc_addr_to_str(dword);
927 proto_tree_add_string(tipc_tree, hf_tipcv2_destination_domain, tipc_tvb, offset, 4, addr_str_ptr);
930 dword = tvb_get_ntohl(tipc_tvb,offset);
931 addr_str_ptr = tipc_addr_to_str(dword);
932 proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr);
935 /* Network Identity: */
936 dword = tvb_get_ntohl(tipc_tvb,offset);
937 addr_str_ptr = tipc_addr_to_str(dword);
938 proto_tree_add_string(tipc_tree, hf_tipcv2_network_id, tipc_tvb, offset, 4, addr_str_ptr);
940 /* W5 - W9 Bearer Level Originating Address: */
941 proto_tree_add_item(tipc_tree, hf_tipcv2_bearer_level_orig_addr, tipc_tvb, offset, 20, FALSE);
942 offset = offset + 20;
944 proto_tree_add_text(tipc_tree, tipc_tvb, offset, -1,"Vendor specific data");
953 /* Version 2 Header (draft-maloy-tipc-01.txt):
954 4.1.1 Payload Message Header Format
958 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
959 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
960 w0:|vers | user |hdr sz |n|d|rsv| message size |
961 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
962 w1:|mstyp| error |rer cnt|lsc|opt p| broadcast ack no |
963 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
964 w2:| link level ack no | broadcast/link level seq no |
965 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
967 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
968 w4:| originating port |
969 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
970 w5:| destination port |
971 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
972 w6:| originating node |
973 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
974 w7:| destination node |
975 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
976 w8:| name type / transport sequence number |
977 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
978 w9:| name instance/multicast lower bound |
979 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
980 wA:| multicast upper bound |
981 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
985 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
990 dissect_tipc_v2(tvbuff_t *tipc_tvb, packet_info *pinfo, proto_tree *tipc_tree, int offset, guint8 user, guint32 msg_size, guint8 hdr_size, gboolean datatype_hdr)
995 /* The unit used is 32 bit words */
996 guint8 orig_hdr_size;
998 orig_hdr_size = hdr_size;
1003 /* Version: 3 bits */
1004 proto_tree_add_item(tipc_tree, hf_tipc_ver, tipc_tvb, offset, 4, FALSE);
1006 proto_tree_add_item(tipc_tree, hf_tipcv2_usr, tipc_tvb, offset, 4, FALSE);
1007 /* Header Size: 4 bits */
1008 proto_tree_add_item(tipc_tree, hf_tipc_hdr_size, tipc_tvb, offset, 4, FALSE);
1009 /* Non-sequenced: 1 bit */
1010 proto_tree_add_item(tipc_tree,hf_tipc_nonsequenced, tipc_tvb,offset,4, FALSE);
1013 proto_tree_add_item(tipc_tree,hf_tipc_destdrop, tipc_tvb,offset,4, FALSE);
1014 /* Reserved: 2 bits */
1016 /* Message Size: 17 bits */
1017 proto_tree_add_item(tipc_tree, hf_tipc_msg_size, tipc_tvb, offset, 4, FALSE);
1018 offset = offset + 4;
1021 dissect_tipc_v2_internal_msg(tipc_tvb, pinfo, tipc_tree, offset, user, msg_size);
1026 /* Message Type: 3 bits */
1027 proto_tree_add_item(tipc_tree, hf_tipcv2_data_msg_type , tipc_tvb, offset, 4, FALSE);
1028 /* Error Code: 4 bits */
1029 proto_tree_add_item(tipc_tree, hf_tipcv2_errorcode , tipc_tvb, offset, 4, FALSE);
1030 /* Reroute Counter: 4 bits */
1031 proto_tree_add_item(tipc_tree, hf_tipcv2_rer_cnt , tipc_tvb, offset, 4, FALSE);
1032 /* Lookup Scope: 2 bits */
1033 proto_tree_add_item(tipc_tree, hf_tipcv2_lookup_scope , tipc_tvb, offset, 4, FALSE);
1035 /* Options Position: 3 bits */
1036 opt_p = tvb_get_guint8(tipc_tvb, offset+1) & 0x7;
1037 proto_tree_add_item(tipc_tree, hf_tipcv2_opt_p , tipc_tvb, offset, 4, FALSE);
1039 hdr_size = hdr_size - (opt_p << 2);
1041 /* Broadcast Acknowledge Number: 16 bits */
1042 proto_tree_add_item(tipc_tree, hf_tipcv2_broadcast_ack_no , tipc_tvb, offset, 4, FALSE);
1043 offset = offset + 4;
1046 /* Link Level Acknowledge Number: 16 bits */
1047 proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_ack_no , tipc_tvb, offset, 4, FALSE);
1048 /* broadcast/link level seq no */
1049 proto_tree_add_item(tipc_tree, hf_tipcv2_link_level_seq_no , tipc_tvb, offset, 4, FALSE);
1050 offset = offset + 4;
1051 /* W3 previous node */
1052 dword = tvb_get_ntohl(tipc_tvb,offset);
1053 addr_str_ptr = tipc_addr_to_str(dword);
1054 proto_tree_add_string(tipc_tree, hf_tipcv2_prev_node, tipc_tvb, offset, 4, addr_str_ptr);
1055 offset = offset + 4;
1057 /* W4 Originating Port: 32 bits */
1058 proto_tree_add_item(tipc_tree, hf_tipc_org_port , tipc_tvb, offset, 4, FALSE);
1059 offset = offset + 4;
1061 /* W5 Destination Port: 32 bits */
1062 proto_tree_add_item(tipc_tree, hf_tipc_dst_port , tipc_tvb, offset, 4, FALSE);
1063 offset = offset + 4;
1066 /* W6 Originating Node: 32 bits */
1067 dword = tvb_get_ntohl(tipc_tvb,offset);
1068 addr_str_ptr = tipc_addr_to_str(dword);
1069 proto_tree_add_string(tipc_tree, hf_tipcv2_orig_node, tipc_tvb, offset, 4, addr_str_ptr);
1070 offset = offset + 4;
1071 /* W7 Destination Node: 32 bits */
1072 dword = tvb_get_ntohl(tipc_tvb,offset);
1073 addr_str_ptr = tipc_addr_to_str(dword);
1074 proto_tree_add_string(tipc_tree, hf_tipcv2_dest_node, tipc_tvb, offset, 4, addr_str_ptr);
1075 offset = offset + 4;
1077 /* W8 name type / transport sequence number */
1078 /* Transport Level Sequence Number: 32 bits */
1079 /* Port Name Type: 32 bits */
1080 proto_tree_add_item(tipc_tree, hf_tipcv2_port_name_type , tipc_tvb, offset, 4, FALSE);
1081 offset = offset + 4;
1084 /* W9 name instance/multicast lower bound */
1085 /* Port Name Instance: 32 bits */
1086 proto_tree_add_item(tipc_tree, hf_tipcv2_port_name_instance , tipc_tvb, offset, 4, FALSE);
1087 /* Port Name Sequence Lower: 32 bits */
1088 offset = offset + 4;
1089 if (hdr_size > 10 ){
1091 /* W10 multicast upper bound */
1092 /* Port Name Sequence Upper: 32 bits */
1093 offset = offset + 4;
1100 proto_tree_add_text(tipc_tree, tipc_tvb, offset,(opt_p >> 2),"Options");
1101 offset = offset + (opt_p << 2);
1104 if ( msg_size > (orig_hdr_size<<2))
1105 proto_tree_add_text(tipc_tree, tipc_tvb, offset, -1,"TIPCv2 data");
1109 /* From message.h (http://cvs.sourceforge.net/viewcvs.py/tipc/source/stable_ericsson/TIPC_SCC/src/Message.h?rev=1.2&view=markup)
1110 ////////////////////////////////////////////////////////////////////
1111 TIPC internal header format, version 1:
1114 | Word 0-2: common to all users |
1116 +-------+-------+-------+-------+-------+-------+-------+-------+
1117 |netw-|imp|link | | |p|bea- |link |
1118 w3:|ork |ort|sel- | message count | |r|rer |sel- |
1119 |id |anc|ector| | |b|id |ector|
1120 +-------+-------+-------+-------+-------+-------+-------+-------+
1122 w4:| remote address |
1124 +-------+-------+-------+-------+-------+-------+-------+-------+
1126 w5:| type | gap | next sent |
1128 +-------+-------+-------+-------+-------+-------+-------+-------+
1130 w6:| reserve | prio- | link tolerance |
1132 +-------+-------+-------+-------+-------+-------+-------+-------+
1136 +-------+-------+ +-------+-------+
1140 +-------+-------+ bearer name +-------+-------+
1144 +-------+-------+ +-------+-------+
1148 +-------+-------+-------+-------+-------+-------+-------+-------+
1150 NB: Connection Manager and Name Distributor use data message format.
1157 dissect_tipc_int_prot_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tipc_tree,int offset,guint8 user, guint32 msg_size)
1161 guint16 message_count;
1162 guint32 msg_in_bundle_size;
1166 guint16 link_lev_seq_no;
1167 guint32 reassembled_msg_length = 0;
1168 guint32 no_of_segments = 0;
1170 gboolean save_fragmented;
1171 tvbuff_t* new_tvb = NULL;
1172 tvbuff_t* next_tvb = NULL;
1173 fragment_data *frag_msg = NULL;
1176 link_lev_seq_no = tvb_get_ntohl(tvb,4) & 0xffff;
1177 /* Internal Protocol Header */
1180 msg_type = tvb_get_guint8(tvb,20)>>4;
1182 dword = tvb_get_ntohl(tvb,offset);
1183 link_sel = dword & 0x7;
1184 proto_tree_add_item(tipc_tree, hf_tipc_unused2, tvb, offset, 4, FALSE);
1186 if ( user == TIPC_SEGMENTATION_MANAGER)
1187 proto_tree_add_item(tipc_tree, hf_tipc_importance, tvb, offset, 4, FALSE);
1189 if ( user == TIPC_SEGMENTATION_MANAGER || user == TIPC_NAME_DISTRIBUTOR || user == TIPC_CHANGEOVER_PROTOCOL )
1190 proto_tree_add_item(tipc_tree, hf_tipc_link_selector, tvb, offset, 4, FALSE);
1192 if ( user == TIPC_MSG_BUNDLER || user == TIPC_CHANGEOVER_PROTOCOL ){
1193 message_count = tvb_get_ntohs(tvb,offset+2);
1194 proto_tree_add_item(tipc_tree, hf_tipc_msg_cnt, tvb, offset, 4, FALSE);
1198 if ( user == TIPC_LINK_PROTOCOL )
1199 proto_tree_add_item(tipc_tree, hf_tipc_probe, tvb, offset, 4, FALSE);
1200 /* Bearer identity */
1201 if ( user == TIPC_LINK_PROTOCOL || user == TIPC_CHANGEOVER_PROTOCOL )
1202 proto_tree_add_item(tipc_tree, hf_tipc_bearer_id, tvb, offset, 4, FALSE);
1204 if ( user == TIPC_SEGMENTATION_MANAGER || user == TIPC_NAME_DISTRIBUTOR || user == TIPC_CHANGEOVER_PROTOCOL )
1205 proto_tree_add_item(tipc_tree, hf_tipc_link_selector2, tvb, offset, 4, FALSE);
1207 offset = offset + 4;
1210 /* Remote address */
1211 if ( user == TIPC_ROUTING_MANAGER )
1212 proto_tree_add_item(tipc_tree, hf_tipc_remote_addr, tvb, offset, 4, FALSE);
1213 offset = offset + 4;
1218 case TIPC_ROUTING_MANAGER:
1219 proto_tree_add_item(tipc_tree, hf_tipc_rm_msg_type, tvb, offset, 4, FALSE);
1221 case TIPC_NAME_DISTRIBUTOR:
1222 proto_tree_add_item(tipc_tree, hf_tipc_nd_msg_type, tvb, offset, 4, FALSE);
1224 case TIPC_CONNECTION_MANAGER:
1226 case TIPC_LINK_PROTOCOL:
1227 proto_tree_add_item(tipc_tree, hf_tipc_lp_msg_type, tvb, offset, 4, FALSE);
1229 case TIPC_CHANGEOVER_PROTOCOL:
1230 proto_tree_add_item(tipc_tree, hf_tipc_cng_prot_msg_type, tvb, offset, 4, FALSE);
1232 case TIPC_SEGMENTATION_MANAGER:
1233 proto_tree_add_item(tipc_tree, hf_tipc_sm_msg_type, tvb, offset, 4, FALSE);
1236 proto_tree_add_item(tipc_tree, hf_tipc_unknown_msg_type, tvb, offset, 4, FALSE);
1240 if ( user == TIPC_LINK_PROTOCOL && msg_type == TIPC_LINK_PROTOCO_STATE_MSG )
1241 proto_tree_add_item(tipc_tree, hf_tipc_seq_gap, tvb, offset, 4, FALSE);
1242 /* Next sent packet */
1243 proto_tree_add_item(tipc_tree, hf_tipc_nxt_snt_pkg, tvb, offset, 4, FALSE);
1245 offset = offset + 4;
1248 proto_tree_add_item(tipc_tree, hf_tipc_unused3, tvb, offset, 4, FALSE);
1249 offset = offset + 4;
1251 if (msg_size == 28) /* No data */
1255 case TIPC_LINK_PROTOCOL:
1256 proto_tree_add_item(tipc_tree, hf_tipc_bearer_name, tvb, offset, -1, FALSE);
1258 case TIPC_CHANGEOVER_PROTOCOL:
1260 case 0: /* DUPLICATE_MSG */
1261 case 1: /* ORIGINAL_MSG */
1262 proto_tree_add_text(tipc_tree, tvb, offset, -1,"TIPC_CHANGEOVER_PROTOCOL %s (%u)",val_to_str(msg_type, tipc_cng_prot_msg_type_values, "unknown"),msg_type);
1263 data_tvb = tvb_new_subset(tvb, offset, -1, -1);
1264 if (check_col(pinfo->cinfo, COL_INFO))
1265 col_set_fence(pinfo->cinfo, COL_INFO);
1266 dissect_tipc(data_tvb, pinfo, tipc_tree);
1269 /* INFO_MSG: Even when there are no packets in the send queue of a removed link, the other
1270 endpoint must be informed about this fact, so it can be unblocked when it has terminated its
1271 part of the changeover procedure. This message type may be regarded as an empty
1272 ORIGINAL_MSG, where message count is zero, and no packet is wrapped inside.
1274 proto_tree_add_text(tipc_tree, tvb, offset, -1,"TIPC_CHANGEOVER_PROTOCOL Protol/dissection Error");
1279 case TIPC_SEGMENTATION_MANAGER:
1280 save_fragmented = pinfo->fragmented;
1281 if (tipc_defragment){
1282 pinfo->fragmented = TRUE;
1284 frag_msg = fragment_add_seq_next(tvb, offset, pinfo,
1285 link_sel, /* ID for fragments belonging together - NEEDS IMPROVING? */
1286 tipc_msg_fragment_table, /* list of message fragments */
1287 tipc_msg_reassembled_table, /* list of reassembled messages */
1288 tvb_length_remaining(tvb, offset), /* fragment length - to the end */
1289 TRUE); /* More fragments? */
1290 if (msg_type == TIPC_FIRST_SEGMENT ){
1291 reassembled_msg_length = tvb_get_ntohl(tvb,offset) & 0x1ffff;
1292 /* The number of segments needed fot he complete message (Including header) will be
1293 * The size of the data section of the first message, divided by the complete message size
1294 * + one segment for the remainder (if any).
1296 no_of_segments = reassembled_msg_length/(msg_size - 28);
1297 if (reassembled_msg_length > (no_of_segments * (msg_size - 28)))
1299 fragment_set_tot_len(pinfo, link_sel, tipc_msg_fragment_table, no_of_segments-1);
1300 item = proto_tree_add_text(tipc_tree, tvb, offset, -1,"Segmented message size %u bytes -> No segments = %i",reassembled_msg_length,no_of_segments);
1301 PROTO_ITEM_SET_GENERATED(item);
1304 new_tvb = process_reassembled_data(tvb, offset, pinfo,
1305 "Reassembled Message", frag_msg, &tipc_msg_frag_items,
1308 if (frag_msg) { /* Reassembled */
1309 if (check_col(pinfo->cinfo, COL_INFO))
1310 col_append_str(pinfo->cinfo, COL_INFO,
1311 " (Message Reassembled)");
1312 } else { /* Not last packet of reassembled Short Message */
1313 if (check_col(pinfo->cinfo, COL_INFO))
1314 col_append_fstr(pinfo->cinfo, COL_INFO,
1315 " (Message fragment %u)", link_lev_seq_no);
1319 if (new_tvb) { /* take it all */
1321 } else { /* make a new subset */
1322 next_tvb = tvb_new_subset(tvb, offset, -1, -1);
1324 pinfo->fragmented = save_fragmented;
1326 if (check_col(pinfo->cinfo, COL_INFO))
1327 col_set_fence(pinfo->cinfo, COL_INFO);
1328 dissect_tipc(next_tvb, pinfo, tipc_tree);
1332 proto_tree_add_text(tipc_tree, next_tvb, 0, -1,"%u bytes Data Fragment",(msg_size - 28));
1335 case TIPC_MSG_BUNDLER:
1336 proto_tree_add_text(tipc_tree, tvb, offset, -1,"Message Bundle");
1337 while ((guint32)offset < msg_size ){
1339 msg_in_bundle_size = tvb_get_ntohl(tvb,offset);
1340 proto_tree_add_text(tipc_tree, tvb, offset, msg_in_bundle_size,"%u Message in Bundle",msg_no);
1341 data_tvb = tvb_new_subset(tvb, offset, msg_in_bundle_size, msg_in_bundle_size);
1342 if (check_col(pinfo->cinfo, COL_INFO))
1343 col_set_fence(pinfo->cinfo, COL_INFO);
1344 dissect_tipc(data_tvb, pinfo, tipc_tree);
1345 offset = offset + msg_in_bundle_size;
1349 proto_tree_add_text(tipc_tree, tvb, offset, -1,"%u bytes Data",(msg_size - 28));
1357 dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1360 proto_item *ti, *tipc_data_item;
1361 proto_tree *tipc_tree, *tipc_data_tree;
1363 int previous_offset;
1369 gchar *addr_str_ptr;
1370 const guchar *src_addr, *dst_addr;
1371 tvbuff_t *data_tvb, *tipc_tvb;
1372 gboolean datatype_hdr = FALSE;
1373 guint8 msg_type = 0;
1375 /* Make entry in Protocol column on summary display */
1376 if (check_col(pinfo->cinfo, COL_PROTOCOL))
1377 col_set_str(pinfo->cinfo, COL_PROTOCOL, "TIPC");
1379 if (check_col(pinfo->cinfo, COL_INFO))
1380 col_clear(pinfo->cinfo, COL_INFO);
1383 dword = tvb_get_ntohl(tvb,offset);
1384 version = (dword >>29) & 0xf;
1385 hdr_size = (dword >>21) & 0xf;
1386 user = (dword>>25) & 0xf;
1387 msg_size = dword & 0x1ffff;
1389 if ( (guint32)tvb_length_remaining(tvb,offset) < msg_size){
1392 tipc_tvb = tvb_new_subset(tvb, offset, msg_size, msg_size);
1394 /* Set User values in COL INFO different in V1 and V2 */
1398 msg_type = tvb_get_guint8(tipc_tvb,offset + 20)>>4;
1399 if (check_col(pinfo->cinfo, COL_INFO)){
1400 col_append_fstr(pinfo->cinfo, COL_INFO, " %s(%u) ", val_to_str(user, tipc_user_values, "unknown"),user);
1402 /* Set msg type in info col and find out if its a data hdr or not */
1403 datatype_hdr = tipc_v1_set_col_msgtype(pinfo, user, msg_type);
1404 if ( datatype_hdr ){
1405 /* Data type header */
1406 if ( hdr_size > 5 && user <4){
1407 /* W6 Originating Processor */
1408 src_addr = tvb_get_ptr(tipc_tvb, offset + 24, 4);
1409 SET_ADDRESS(&pinfo->src, AT_TIPC, 4, src_addr);
1411 /* W7 Destination Processor */
1412 dst_addr = tvb_get_ptr(tipc_tvb, offset + 28, 4);
1413 SET_ADDRESS(&pinfo->dst, AT_TIPC, 4, dst_addr);
1415 /* Short data hdr */
1416 /* W2 Previous Processor */
1417 src_addr = tvb_get_ptr(tipc_tvb, offset + 8, 4);
1418 SET_ADDRESS(&pinfo->src, AT_TIPC, 4, src_addr);
1421 /* W2 Previous Processor */
1422 src_addr = tvb_get_ptr(tipc_tvb, offset + 8, 4);
1423 SET_ADDRESS(&pinfo->src, AT_TIPC, 4, src_addr);
1427 msg_type = tvb_get_guint8(tipc_tvb,offset + 4)>>5;
1428 if (check_col(pinfo->cinfo, COL_INFO)){
1429 col_append_fstr(pinfo->cinfo, COL_INFO, " %s(%u) ", val_to_str(user, tipcv2_user_values, "unknown"),user);
1431 /* Set msg type in info col and find out if its a data hdr or not */
1432 datatype_hdr = tipc_v2_set_col_msgtype(pinfo, user, msg_type);
1433 if ( datatype_hdr ){
1435 /* W6 Originating Processor */
1436 src_addr = tvb_get_ptr(tipc_tvb, offset + 24, 4);
1437 SET_ADDRESS(&pinfo->src, AT_TIPC, 4, src_addr);
1439 /* W7 Destination Processor */
1440 dst_addr = tvb_get_ptr(tipc_tvb, offset + 28, 4);
1441 SET_ADDRESS(&pinfo->dst, AT_TIPC, 4, dst_addr);
1443 /* W2 Previous Processor */
1444 src_addr = tvb_get_ptr(tipc_tvb, offset + 8, 4);
1445 SET_ADDRESS(&pinfo->src, AT_TIPC, 4, src_addr);
1449 if (user != TIPCv2_LINK_CONFIGURATION){
1450 /* W6 Originating Processor */
1451 src_addr = tvb_get_ptr(tipc_tvb, offset + 24, 4);
1452 SET_ADDRESS(&pinfo->src, AT_TIPC, 4, src_addr);
1454 /* W7 Destination Processor */
1455 dst_addr = tvb_get_ptr(tipc_tvb, offset + 28, 4);
1456 SET_ADDRESS(&pinfo->dst, AT_TIPC, 4, dst_addr);
1466 ti = proto_tree_add_item(tree, proto_tipc, tipc_tvb, offset, -1, FALSE);
1467 tipc_tree = proto_item_add_subtree(ti, ett_tipc);
1468 if ( version == TIPCv2){
1469 dissect_tipc_v2(tipc_tvb, pinfo, tipc_tree, offset, user, msg_size, hdr_size, datatype_hdr);
1472 /* Word 0-2 common for all messages
1477 proto_tree_add_item(tipc_tree, hf_tipc_ver, tipc_tvb, offset, 4, FALSE);
1478 proto_tree_add_item(tipc_tree, hf_tipc_usr, tipc_tvb, offset, 4, FALSE);
1479 proto_tree_add_item(tipc_tree, hf_tipc_hdr_size, tipc_tvb, offset, 4, FALSE);
1480 proto_tree_add_item(tipc_tree, hf_tipc_unused, tipc_tvb, offset, 4, FALSE);
1481 proto_tree_add_item(tipc_tree,hf_tipc_nonsequenced, tipc_tvb,offset,4, FALSE);
1483 proto_tree_add_item(tipc_tree,hf_tipc_destdrop, tipc_tvb,offset,4, FALSE);
1485 proto_tree_add_item(tipc_tree, hf_tipc_msg_size, tipc_tvb, offset, 4, FALSE);
1486 offset = offset + 4;
1489 proto_tree_add_item(tipc_tree, hf_tipc_ack_link_lev_seq, tipc_tvb, offset, 4, FALSE);
1490 proto_tree_add_item(tipc_tree, hf_tipc_link_lev_seq, tipc_tvb, offset, 4, FALSE);
1491 offset = offset + 4;
1494 dword = tvb_get_ntohl(tipc_tvb,offset);
1495 addr_str_ptr = tipc_addr_to_str(dword);
1496 proto_tree_add_string(tipc_tree, hf_tipc_prev_proc, tipc_tvb, offset, 4, addr_str_ptr);
1498 offset = offset + 4;
1500 case TIPC_ROUTING_MANAGER:
1501 case TIPC_LINK_PROTOCOL:
1502 case TIPC_CHANGEOVER_PROTOCOL:
1503 case TIPC_SEGMENTATION_MANAGER:
1504 case TIPC_MSG_BUNDLER:
1505 dissect_tipc_int_prot_msg(tipc_tvb, pinfo, tipc_tree, offset, user, msg_size);
1512 dword = tvb_get_ntohl(tipc_tvb,offset);
1513 pinfo->ptype = PT_TIPC;
1514 pinfo->srcport = dword;
1515 proto_tree_add_item(tipc_tree, hf_tipc_org_port, tipc_tvb, offset, 4, FALSE);
1516 offset = offset + 4;
1517 if(user != TIPC_NAME_DISTRIBUTOR){
1518 dword = tvb_get_ntohl(tipc_tvb,offset);
1519 pinfo->destport = dword;
1520 proto_tree_add_item(tipc_tree, hf_tipc_dst_port, tipc_tvb, offset, 4, FALSE);
1522 offset = offset + 4;
1524 20 bytes: Used in subnetwork local, connection oriented messages, where error code, reroute
1525 counter and activity identity are zero. A recipient finding that the header size field is 20 does
1526 by default know both user (DATA), message type (CONNECTED_MSG), error code
1527 (MSG_OK), reroute counter (0), and activity identity (undefined). Since no more testing for
1528 this is needed these fields can be left out in the header. Furthermore, since such messages
1529 only will do zero or one inter-processor hop, we know that previous processor is the real
1530 origin of the message. Hence the field originating processor can be omitted. For the same
1531 reason, the recipient processor will know that it is identical to destination processor, so even
1532 this field can be skipped. Finally, because the link layer guarantees delivery and sequence
1533 order for this single hop, even the connection sequence number is redundant. So the message
1534 can just be passed directly on to the destination port. Since this type of message statistically
1535 should be by far the most frequent one this small optimization pays off.
1537 if ( hdr_size <= 5 ){
1538 proto_tree_add_text(tipc_tree, tipc_tvb, offset, -1,"%u bytes Data",(msg_size - hdr_size *4));
1541 case TIPC_NAME_DISTRIBUTOR:
1542 proto_tree_add_item(tipc_tree, hf_tipc_nd_msg_type, tipc_tvb, offset, 4, FALSE);
1544 case TIPC_CONNECTION_MANAGER:
1545 proto_tree_add_item(tipc_tree, hf_tipc_cm_msg_type, tipc_tvb, offset, 4, FALSE);
1548 proto_tree_add_item(tipc_tree, hf_tipc_data_msg_type, tipc_tvb, offset, 4, FALSE);
1551 proto_tree_add_item(tipc_tree, hf_tipc_err_code, tipc_tvb, offset, 4, FALSE);
1552 proto_tree_add_item(tipc_tree, hf_tipc_reroute_cnt, tipc_tvb, offset, 4, FALSE);
1553 proto_tree_add_item(tipc_tree, hf_tipc_act_id, tipc_tvb, offset, 4, FALSE);
1554 offset = offset + 4;
1556 dword = tvb_get_ntohl(tipc_tvb,offset);
1557 addr_str_ptr = tipc_addr_to_str(dword);
1559 proto_tree_add_string(tipc_tree, hf_tipc_org_proc, tipc_tvb, offset, 4, addr_str_ptr);
1560 offset = offset + 4;
1562 dword = tvb_get_ntohl(tipc_tvb,offset);
1563 addr_str_ptr = tipc_addr_to_str(dword);
1565 proto_tree_add_string(tipc_tree, hf_tipc_dst_proc, tipc_tvb, offset, 4, addr_str_ptr);
1566 offset = offset + 4;
1568 32 bytes: The size of all data messages containing an explicit port identity as destination
1572 if (user == TIPC_NAME_DISTRIBUTOR ){
1574 Although an internal service, the name distributor uses the full 40-byte "external" data header
1575 format when updating the naming table instances. This is because its messages may need
1576 routing, - all system processor must contain the publications from all device processors and
1577 vice versa, whether they are directly linked or not. The fields name type, name instance, and
1578 destination port of that header have no meaning for such messages
1580 offset = offset + 8;
1581 tipc_data_item = proto_tree_add_text(tipc_tree, tvb, offset, -1,"TIPC_NAME_DISTRIBUTOR %u bytes User Data",(msg_size - hdr_size *4));
1582 tipc_data_tree = proto_item_add_subtree(tipc_data_item , ett_tipc_data);
1583 data_tvb = tvb_new_subset(tipc_tvb, offset, -1, -1);
1584 dissect_tipc_name_dist_data(data_tvb, pinfo, tipc_data_tree);
1587 /* Port name type / Connection level sequence number */
1588 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Port name type / Connection level sequence number");
1589 offset = offset + 4;
1590 /* Port name instance */
1591 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 4,"Port name instance");
1592 offset = offset + 4;
1596 if (user < 4 && dissect_tipc_data){ /* DATA type user */
1598 case TIPC_CONNECTED_MSG:
1599 proto_tree_add_text(tipc_tree, tipc_tvb, offset, -1,"%u bytes Data",(msg_size - hdr_size *4));
1601 case TIPC_NAMED_MSG:
1602 data_tvb = tvb_new_subset(tipc_tvb, offset+14, -1, -1);
1603 proto_tree_add_text(tipc_tree, tipc_tvb, offset, 14,"TIPC_NAMED_MSG Hdr");
1604 proto_tree_add_text(tipc_tree, data_tvb,0, -1,"%u bytes Data",(msg_size - hdr_size *4));
1607 case TIPC_DIRECT_MSG:
1608 previous_offset = offset;
1609 while (tvb_reported_length_remaining(tipc_tvb,offset) > 0){
1610 dword = tvb_get_ntohl(tipc_tvb,offset);
1611 if ((dword & 0xff000000) == 0x45000000){ /* && ((dword & 0x0000ffff)== tvb_reported_length_remaining(tvb,offset+2)))*/
1612 data_tvb = tvb_new_subset(tipc_tvb, offset, -1, -1);
1613 call_dissector(ip_handle, data_tvb, pinfo, top_tree);
1618 proto_tree_add_text(tipc_tree, tipc_tvb, previous_offset, -1,"%u bytes Data",(msg_size - hdr_size *4));
1622 proto_tree_add_text(tipc_tree, tipc_tvb, offset, -1,"%u bytes Data",(msg_size - hdr_size *4));
1627 }/*if ( hdr_size <= 5 ) */
1635 /* Register TIPC with Wireshark */
1637 proto_register_tipc(void)
1640 static hf_register_info hf[] = {
1642 {&hf_tipc_msg_fragments,
1643 {"Message fragments", "tipc.msg.fragments",
1644 FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }
1646 {&hf_tipc_msg_fragment,
1647 {"Message fragment", "tipc.msg.fragment",
1648 FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
1650 {&hf_tipc_msg_fragment_overlap,
1651 {"Message fragment overlap", "tipc.msg.fragment.overlap",
1652 FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
1654 {&hf_tipc_msg_fragment_overlap_conflicts,
1655 {"Message fragment overlapping with conflicting data","tipc.msg.fragment.overlap.conflicts",
1656 FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
1658 {&hf_tipc_msg_fragment_multiple_tails,
1659 {"Message has multiple tail fragments", "tipc.msg.fragment.multiple_tails",
1660 FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
1662 {&hf_tipc_msg_fragment_too_long_fragment,
1663 {"Message fragment too long", "tipc.msg.fragment.too_long_fragment",
1664 FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
1666 {&hf_tipc_msg_fragment_error,
1667 {"Message defragmentation error", "tipc.msg.fragment.error",
1668 FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
1670 {&hf_tipc_msg_reassembled_in,
1671 {"Reassembled in", "tipc.msg.reassembled.in",
1672 FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
1675 { "Version", "tipc.ver",
1676 FT_UINT32, BASE_DEC, NULL, 0xe0000000,
1677 "TIPC protocol version", HFILL }
1680 { "User", "tipc.usr",
1681 FT_UINT32, BASE_DEC, VALS(tipc_user_values), 0x1e000000,
1682 "TIPC User", HFILL }
1685 { "User", "tipc.usr",
1686 FT_UINT32, BASE_DEC, VALS(tipcv2_user_values), 0x1e000000,
1687 "TIPC User", HFILL }
1689 { &hf_tipc_hdr_size,
1690 { "Header size", "tipc.hdr_size",
1691 FT_UINT32, BASE_DEC, NULL, 0x01e00000,
1692 "TIPC Header size", HFILL }
1694 { &hf_tipc_nonsequenced,
1695 { "Non-sequenced","tipc.non_sequenced",
1696 FT_UINT32,BASE_DEC,NULL,0x00100000,
1697 "Non-sequenced Bit",HFILL }
1699 { &hf_tipc_destdrop,
1700 { "Destination Droppable","tipc.destdrop",
1701 FT_UINT32,BASE_DEC,NULL,0x00080000,
1702 "Destination Droppable Bit",HFILL }
1705 { "Unused", "tipc.hdr_unused",
1706 FT_UINT32, BASE_DEC, NULL, 0x001e0000,
1707 "TIPC Unused", HFILL }
1709 { &hf_tipc_msg_size,
1710 { "Message size", "tipc.msg_size",
1711 FT_UINT32, BASE_DEC, NULL, 0x0001ffff,
1712 "TIPC Message size", HFILL }
1714 { &hf_tipc_ack_link_lev_seq,
1715 { "Acknowledged link level sequence number", "tipc.ack_link_lev_seq",
1716 FT_UINT32, BASE_DEC, NULL, 0xffff0000,
1717 "TIPC Acknowledged link level sequence number", HFILL }
1719 { &hf_tipc_link_lev_seq,
1720 { "Link level sequence number", "tipc.link_lev_seq",
1721 FT_UINT32, BASE_DEC, NULL, 0x0000ffff,
1722 "TIPC Link level sequence number", HFILL }
1724 { &hf_tipc_prev_proc,
1725 { "Previous processor", "tipc.prev_proc",
1726 FT_STRING, BASE_NONE, NULL, 0x0,
1727 "TIPC Previous processor", HFILL }
1729 { &hf_tipc_org_port,
1730 { "Originating port", "tipc.org_port",
1731 FT_UINT32, BASE_DEC, NULL, 0x0,
1732 "TIPC Oiginating port", HFILL }
1734 { &hf_tipc_dst_port,
1735 { "Destination port", "tipc.dst_port",
1736 FT_UINT32, BASE_DEC, NULL, 0x0,
1737 "TIPC Destination port", HFILL }
1739 { &hf_tipc_data_msg_type,
1740 { "Message type", "tipc.msg_type",
1741 FT_UINT32, BASE_DEC, VALS(tipc_data_msg_type_values), 0xf0000000,
1742 "TIPC Message type", HFILL }
1744 { &hf_tipc_err_code,
1745 { "Error code", "tipc.err_code",
1746 FT_UINT32, BASE_DEC, VALS(tipc_error_code_values), 0x0f000000,
1747 "TIPC Error code", HFILL }
1749 { &hf_tipc_reroute_cnt,
1750 { "Reroute counter", "tipc.route_cnt",
1751 FT_UINT32, BASE_DEC, NULL, 0x00f00000,
1752 "TIPC Reroute counter", HFILL }
1755 { "Activity identity", "tipc.act_id",
1756 FT_UINT32, BASE_DEC, NULL, 0x000fffff,
1757 "TIPC Activity identity", HFILL }
1759 { &hf_tipc_org_proc,
1760 { "Originating processor", "tipc.org_proc",
1761 FT_STRING, BASE_NONE, NULL, 0x0,
1762 "TIPC Originating processor", HFILL }
1764 { &hf_tipc_dst_proc,
1765 { "Destination processor", "tipc.dst_proc",
1766 FT_STRING, BASE_NONE, NULL, 0x0,
1767 "TIPC Destination processor", HFILL }
1770 { "Unused", "tipc.unused2",
1771 FT_UINT32, BASE_DEC, NULL, 0xe0000000,
1772 "TIPC Unused", HFILL }
1774 { &hf_tipc_importance,
1775 { "Importance", "tipc.importance",
1776 FT_UINT32, BASE_DEC, NULL, 0x18000000,
1777 "TIPC Importance", HFILL }
1779 { &hf_tipc_link_selector,
1780 { "Link selector", "tipc.link_selector",
1781 FT_UINT32, BASE_DEC, NULL, 0x07000000,
1782 "TIPC Link selector", HFILL }
1785 { "Message count", "tipc.imsg_cnt",
1786 FT_UINT32, BASE_DEC, NULL, 0x00ffff00,
1787 "TIPC Message count", HFILL }
1790 { "Probe", "tipc.probe",
1791 FT_UINT32, BASE_DEC, NULL, 0x00000040,
1792 "TIPC Probe", HFILL }
1794 { &hf_tipc_bearer_id,
1795 { "Bearer identity", "tipc.bearer_id",
1796 FT_UINT32, BASE_DEC, NULL, 0x00000038,
1797 "TIPC Bearer identity", HFILL }
1799 { &hf_tipc_link_selector2,
1800 { "Link selector", "tipc.link_selector",
1801 FT_UINT32, BASE_DEC, NULL, 0x00000007,
1802 "TIPC Link selector", HFILL }
1804 { &hf_tipc_remote_addr,
1805 { "Remote address", "tipc.remote_addr",
1806 FT_UINT32, BASE_DEC, NULL, 0x0,
1807 "TIPC Remote address", HFILL }
1809 { &hf_tipc_rm_msg_type,
1810 { "Message type", "tipc.rm_msg_type",
1811 FT_UINT32, BASE_DEC, VALS(tipc_routing_mgr_msg_type_values), 0xf0000000,
1812 "TIPC Message type", HFILL }
1814 { &hf_tipc_nd_msg_type,
1815 { "Message type", "tipc.nd_msg_type",
1816 FT_UINT32, BASE_DEC, VALS(tipc_name_dist_msg_type_values), 0xf0000000,
1817 "TIPC Message type", HFILL }
1819 { &hf_tipc_cm_msg_type,
1820 { "Message type", "tipc.nd_msg_type",
1821 FT_UINT32, BASE_DEC, VALS(tipc_cm_msg_type_values), 0xf0000000,
1822 "TIPC Message type", HFILL }
1824 { &hf_tipc_lp_msg_type,
1825 { "Message type", "tipc.lp_msg_type",
1826 FT_UINT32, BASE_DEC, VALS(tipc_link_prot_msg_type_values), 0xf0000000,
1827 "TIPC Message type", HFILL }
1829 { &hf_tipc_cng_prot_msg_type,
1830 { "Message type", "tipc.cng_prot_msg_type",
1831 FT_UINT32, BASE_DEC, VALS(tipc_cng_prot_msg_type_values), 0xf0000000,
1832 "TIPC Message type", HFILL }
1834 { &hf_tipc_sm_msg_type,
1835 { "Message type", "tipc.sm_msg_type",
1836 FT_UINT32, BASE_DEC, VALS(tipc_sm_msg_type_values), 0xf0000000,
1837 "TIPC Message type", HFILL }
1839 { &hf_tipc_unknown_msg_type,
1840 { "Message type", "tipc.unknown_msg_type",
1841 FT_UINT32, BASE_DEC, NULL, 0xf0000000,
1842 "TIPC Message type", HFILL }
1845 { "Sequence gap", "tipc.seq_gap",
1846 FT_UINT32, BASE_DEC, NULL, 0x0fff0000,
1847 "TIPC Sequence gap", HFILL }
1849 { &hf_tipc_nxt_snt_pkg,
1850 { "Next sent packet", "tipc.nxt_snt_pkg",
1851 FT_UINT32, BASE_DEC, NULL, 0x0000ffff,
1852 "TIPC Next sent packet", HFILL }
1855 { "Unused", "tipc.unused3",
1856 FT_UINT32, BASE_DEC, NULL, 0x0,
1857 "TIPC Unused", HFILL }
1859 { &hf_tipc_bearer_name,
1860 { "Bearer name", "tipc.bearer_name",
1861 FT_STRINGZ, BASE_NONE, NULL, 0x0,
1862 "TIPC Bearer name", HFILL }
1864 { &hf_tipc_name_dist_type,
1865 { "Published port name type", "tipc.name_dist_type",
1866 FT_UINT32, BASE_DEC, NULL, 0x0,
1867 "TIPC Published port name type", HFILL }
1869 { &hf_tipc_name_dist_lower,
1870 { "Lower bound of published sequence", "tipc.ame_dist_lower",
1871 FT_UINT32, BASE_DEC, NULL, 0x0,
1872 "TIPC Lower bound of published sequence", HFILL }
1874 { &hf_tipc_name_dist_upper,
1875 { "Upper bound of published sequence", "tipc.name_dist_upper",
1876 FT_UINT32, BASE_DEC, NULL, 0x0,
1877 "TIPC Upper bound of published sequence", HFILL }
1879 { &hf_tipc_name_dist_port,
1880 { "Random number part of port identity", "tipc.dist_port",
1881 FT_UINT32, BASE_DEC, NULL, 0x0,
1882 "TIPC Random number part of port identity", HFILL }
1884 { &hf_tipc_name_dist_key,
1885 { "Key (Use for verification at withdrawal)", "tipc.dist_key",
1886 FT_UINT32, BASE_DEC, NULL, 0x0,
1889 { &hf_tipcv2_data_msg_type ,
1890 { "Message type", "tipc.data_type",
1891 FT_UINT32, BASE_DEC, VALS(tipc_data_msg_type_values), 0xe0000000,
1892 "TIPC Message type", HFILL }
1894 { &hf_tipcv2_bcast_mtype ,
1895 { "Message type", "tipcv2.bcast_msg_type",
1896 FT_UINT32, BASE_DEC, VALS(tipcv2_bcast_mtype_strings), 0xe0000000,
1897 "TIPC Message type", HFILL }
1899 { &hf_tipcv2_link_mtype ,
1900 { "Message type", "tipcv2.link_msg_type",
1901 FT_UINT32, BASE_DEC, VALS(tipcv2_link_mtype_strings), 0xe0000000,
1902 "TIPC Message type", HFILL }
1904 { &hf_tipcv2_connmgr_mtype ,
1905 { "Message type", "tipcv2.connmgr_msg_type",
1906 FT_UINT32, BASE_DEC, VALS(tipcv2_connmgr_mtype_strings), 0xe0000000,
1907 "TIPC Message type", HFILL }
1909 { &hf_tipcv2_route_mtype ,
1910 { "Message type", "tipcv2.route_msg_type",
1911 FT_UINT32, BASE_DEC, VALS(tipcv2_route_mtype_strings), 0xe0000000,
1912 "TIPC Message type", HFILL }
1914 { &hf_tipcv2_changeover_mtype ,
1915 { "Message type", "tipcv2.changeover_msg_type",
1916 FT_UINT32, BASE_DEC, VALS(tipcv2_changeover_mtype_strings), 0xe0000000,
1917 "TIPC Message type", HFILL }
1919 { &hf_tipcv2_naming_mtype ,
1920 { "Message type", "tipcv2.naming_msg_type",
1921 FT_UINT32, BASE_DEC, VALS(tipcv2_naming_mtype_strings), 0xe0000000,
1922 "TIPC Message type", HFILL }
1924 { &hf_tipcv2_fragmenter_mtype ,
1925 { "Message type", "tipcv2.fragmenter_msg_type",
1926 FT_UINT32, BASE_DEC, VALS(tipcv2_fragmenter_mtype_strings), 0xe0000000,
1927 "TIPC Message type", HFILL }
1929 { &hf_tipcv2_neighbour_mtype ,
1930 { "Message type", "tipcv2.data_msg_type",
1931 FT_UINT32, BASE_DEC, VALS(tipcv2_neighbour_mtype_strings), 0xe0000000,
1932 "TIPC Message type", HFILL }
1934 { &hf_tipcv2_errorcode ,
1935 { "Error code", "tipcv2.errorcode",
1936 FT_UINT32, BASE_DEC, VALS(tipcv2_error_code_strings), 0x1e000000,
1937 "Error code", HFILL }
1939 { &hf_tipcv2_rer_cnt,
1940 { "Lookup Scope", "tipcv2.rer_cnt",
1941 FT_UINT32, BASE_DEC, NULL, 0x01e00000,
1942 "Lookup Scope", HFILL }
1944 { &hf_tipcv2_lookup_scope,
1945 { "Reroute Counter", "tipcv2.lookup_scope",
1946 FT_UINT32, BASE_DEC, VALS(tipcv2_lookup_scope_strings), 0x00180000,
1947 "Reroute Counter", HFILL }
1950 { "Options Position", "tipcv2.opt_p",
1951 FT_UINT32, BASE_DEC, NULL, 0x00070000,
1952 "Options Position", HFILL }
1954 { &hf_tipcv2_broadcast_ack_no,
1955 { "Broadcast Acknowledge Number", "tipcv2.broadcast_ack_no",
1956 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
1957 "Broadcast Acknowledge Number", HFILL }
1960 { &hf_tipcv2_link_level_ack_no,
1961 { "link level ack no", "tipcv2.link_level_ack_no",
1962 FT_UINT32, BASE_DEC, NULL, 0xFFFF0000,
1963 "link level ack no", HFILL }
1965 { &hf_tipcv2_link_level_seq_no,
1966 { "Link Level Sequence Number", "tipcv2.link_level_seq_no",
1967 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
1968 "Link Level Sequence Number", HFILL }
1970 { &hf_tipcv2_bcast_seq_no,
1971 { "Broadcast Sequence Number", "tipcv2.bcast_seq_no",
1972 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
1973 "Broadcast Sequence Number", HFILL }
1975 { &hf_tipcv2_prev_node,
1976 { "Previous Node", "tipcv2.prev_node",
1977 FT_STRING, BASE_NONE, NULL, 0x0,
1978 "TIPC Previous Node", HFILL }
1980 { &hf_tipcv2_orig_node,
1981 { "Originating Node", "tipcv2.orig_node",
1982 FT_STRING, BASE_NONE, NULL, 0x0,
1983 "TIPC Originating Node", HFILL }
1985 { &hf_tipcv2_dest_node,
1986 { "Destination Node", "tipcv2.dest_node",
1987 FT_STRING, BASE_NONE, NULL, 0x0,
1988 "TIPC Destination Node", HFILL }
1990 { &hf_tipcv2_port_name_type,
1991 { "Port name type", "tipcv2.port_name_type",
1992 FT_UINT32, BASE_DEC, NULL, 0,
1993 "Port name type", HFILL }
1995 { &hf_tipcv2_port_name_instance,
1996 { "Port name instance", "tipcv2.port_name_instance",
1997 FT_UINT32, BASE_DEC, NULL, 0,
1998 "Port name instance", HFILL }
2000 { &hf_tipcv2_bcast_seq_gap,
2001 { "Broadcast Sequence Gap", "tipcv2.bcast_seq_gap",
2002 FT_UINT32, BASE_DEC, NULL, 0x1F000000,
2003 "Broadcast Sequence Gap", HFILL }
2005 { &hf_tipcv2_sequence_gap,
2006 { "Sequence Gap", "tipcv2.seq_gap",
2007 FT_UINT32, BASE_DEC, NULL, 0x00FF0000,
2008 "Sequence Gap", HFILL }
2010 { &hf_tipcv2_next_sent_broadcast,
2011 { "Next Sent Broadcast", "tipcv2.next_sent_broadcast",
2012 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
2013 "Next Sent Broadcast", HFILL }
2015 { &hf_tipcv2_fragment_number,
2016 { "Fragment Number", "tipcv2.fragment_number",
2017 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
2018 "Fragment Number", HFILL }
2020 { &hf_tipcv2_next_sent_packet,
2021 { "Next Sent Packet", "tipcv2.next_sent_packet",
2022 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
2023 "Next Sent Packet", HFILL }
2025 { &hf_tipcv2_session_no,
2026 { "Session Number", "tipcv2.session_no",
2027 FT_UINT32, BASE_DEC, NULL, 0xFFFF0000,
2028 "Session Number", HFILL }
2030 { &hf_tipcv2_link_prio,
2031 { "Link Priority", "tipcv2.link_prio",
2032 FT_UINT32, BASE_DEC, NULL, 0x000001F0,
2033 "Link Priority", HFILL }
2035 { &hf_tipcv2_network_plane,
2036 { "Network Plane", "tipcv2.network_plane",
2037 FT_UINT32, BASE_DEC, VALS(tipcv2_networkplane_strings), 0x0000000E,
2038 "Network Plane", HFILL }
2041 { "Probe", "tipcv2.probe",
2042 FT_UINT32, BASE_DEC, NULL, 0x00000001,
2045 { &hf_tipcv2_link_tolerance,
2046 { "Link Tolerance (ms)", "tipcv2.link_tolerance",
2047 FT_UINT32, BASE_DEC, NULL, 0x0000FFFF,
2048 "Link Tolerance in ms", HFILL }
2050 { &hf_tipcv2_bearer_instance,
2051 { "Bearer Instance", "tipcv2.bearer_instance",
2052 FT_STRINGZ, BASE_NONE, NULL, 0,
2053 "Bearer instance used by the sender node for this link", HFILL }
2055 { &hf_tipcv2_bearer_level_orig_addr,
2056 { "Bearer Level Originating Address", "tipcv2.bearer_level_orig_addr",
2057 FT_BYTES, BASE_HEX, NULL, 0,
2058 "Bearer Level Originating Address", HFILL }
2060 { &hf_tipcv2_cluster_address,
2061 { "Cluster Address", "tipcv2.cluster_address",
2062 FT_STRING, BASE_NONE, NULL, 0x0,
2063 "The remote cluster concerned by the table", HFILL }
2065 { &hf_tipcv2_bitmap,
2066 { "Bitmap", "tipcv2.bitmap",
2067 FT_BYTES, BASE_HEX, NULL, 0,
2068 "Bitmap, indicating to which nodes within that cluster the sending node has direct links", HFILL }
2070 { &hf_tipcv2_node_address,
2071 { "Node Address", "tipcv2.node_address",
2072 FT_STRING, BASE_NONE, NULL, 0x0,
2073 "Which node the route addition/loss concern", HFILL }
2075 { &hf_tipcv2_destination_domain,
2076 { "Destination Domain", "tipcv2.destination_domain",
2077 FT_STRING, BASE_NONE, NULL, 0x0,
2078 "The domain to which the link request is directed", HFILL }
2080 { &hf_tipcv2_network_id,
2081 { "Network Identity", "tipcv2.network_id",
2082 FT_STRING, BASE_NONE, NULL, 0x0,
2083 "The sender node's network identity", HFILL }
2087 /* Setup protocol subtree array */
2088 static gint *ett[] = {
2091 &ett_tipc_msg_fragment,
2092 &ett_tipc_msg_fragments,
2095 module_t *tipc_module;
2097 /* Register the protocol name and description */
2098 proto_tipc = proto_register_protocol("Transparent Inter Process Communication(TIPC)",
2101 /* Required function calls to register the header fields and subtrees used */
2102 proto_register_field_array(proto_tipc, hf, array_length(hf));
2103 proto_register_subtree_array(ett, array_length(ett));
2105 register_init_routine(tipc_defragment_init);
2107 /* Register configuration options */
2108 tipc_module = prefs_register_protocol(proto_tipc, NULL);
2110 prefs_register_bool_preference(tipc_module, "defragment",
2111 "Reassemble SEGMENTATION_MANAGER datagrams",
2112 "Whether SEGMENTATION_MANAGER datagrams should be reassembled",
2115 prefs_register_bool_preference(tipc_module, "dissect_tipc_data",
2116 "Dissect TIPC data",
2117 "Whether to try to dissect TIPC data or not",
2118 &dissect_tipc_data);
2122 proto_reg_handoff_tipc(void)
2124 dissector_handle_t tipc_handle;
2126 tipc_handle = create_dissector_handle(dissect_tipc, proto_tipc);
2127 dissector_add("ethertype", ETHERTYPE_TIPC, tipc_handle);
2128 if (extra_ethertype)
2129 dissector_add("ethertype", ETHERTYPE_TIPC2, tipc_handle);
2131 ip_handle = find_dissector("ip");