2010-11-17 02:57:22 +00:00
/* packet-infiniband_sdp.c
* Routines for Infiniband Sockets Direct Protocol dissection
* Copyright 2010 , Mellanox Technologies Ltd .
* Code by Amir Vadai and Slava Koyfman .
*
* Wireshark - Network traffic analyzer
* By Gerald Combs < gerald @ wireshark . org >
* Copyright 1998 Gerald Combs
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License along
* with this program ; if not , write to the Free Software Foundation , Inc . ,
* 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA .
*/
2012-09-20 02:03:38 +00:00
# include "config.h"
2010-11-17 02:57:22 +00:00
2014-12-20 21:23:59 +00:00
# include <stdlib.h>
# include <errno.h>
2010-11-17 02:57:22 +00:00
# include <epan/packet.h>
# include <epan/prefs.h>
2013-12-21 17:23:17 +00:00
# include <epan/addr_resolv.h>
2010-11-17 02:57:22 +00:00
# include <epan/conversation.h>
# include "packet-infiniband.h"
2013-12-15 23:44:12 +00:00
void proto_register_ib_sdp ( void ) ;
void proto_reg_handoff_ib_sdp ( void ) ;
2010-11-17 02:57:22 +00:00
/* If the service-id is non-zero after being ANDed with the following mask then
this is SDP traffic */
# define SERVICE_ID_MASK 0x0000000000010000
2016-12-20 13:58:49 +00:00
static int proto_infiniband = - 1 ; /* we'll need the Infiniband protocol index for conversation data */
2010-11-17 02:57:22 +00:00
/* Initialize the protocol and registered fields... */
static int proto_ib_sdp = - 1 ;
/* IB SDP BSDH Header */
static int hf_ib_sdp_bsdh = - 1 ;
static int hf_ib_sdp_mid = - 1 ;
static int hf_ib_sdp_flags = - 1 ;
static int hf_ib_sdp_flags_oobpres = - 1 ;
static int hf_ib_sdp_flags_oob_pend = - 1 ;
static int hf_ib_sdp_flags_reqpipe = - 1 ;
static int hf_ib_sdp_len = - 1 ;
static int hf_ib_sdp_bufs = - 1 ;
static int hf_ib_sdp_mseq = - 1 ;
static int hf_ib_sdp_mseqack = - 1 ;
/* IB SDP Hello Header */
static int hf_ib_sdp_hh = - 1 ;
static int hf_ib_sdp_majv = - 1 ;
static int hf_ib_sdp_minv = - 1 ;
static int hf_ib_sdp_ipv = - 1 ;
static int hf_ib_sdp_cap = - 1 ;
static int hf_ib_sdp_cap_invalidate = - 1 ;
static int hf_ib_sdp_cap_extmaxadverts = - 1 ;
static int hf_ib_sdp_maxadverts = - 1 ;
static int hf_ib_sdp_desremrcvsz = - 1 ;
static int hf_ib_sdp_localrcvsz = - 1 ;
static int hf_ib_sdp_localport = - 1 ;
static int hf_ib_sdp_src_ip = - 1 ;
static int hf_ib_sdp_dst_ip = - 1 ;
static int hf_ib_sdp_extmaxadverts = - 1 ;
static int hf_ib_sdp_hah = - 1 ;
static int hf_ib_sdp_rwch = - 1 ;
static int hf_ib_sdp_rrch = - 1 ;
static int hf_ib_sdp_mch = - 1 ;
static int hf_ib_sdp_crbh = - 1 ;
static int hf_ib_sdp_crbah = - 1 ;
static int hf_ib_sdp_suspch = - 1 ;
static int hf_ib_sdp_sinkah = - 1 ;
static int hf_ib_sdp_srcah = - 1 ;
static int hf_ib_sdp_data = - 1 ;
/* Initialize the subtree pointers */
static gint ett_ib_sdp = - 1 ;
static gint ett_ib_sdp_bsdh = - 1 ;
static gint ett_ib_sdp_hh = - 1 ;
typedef enum {
Hello = 0x0 ,
HelloAck ,
DisConn ,
AbortConn ,
SendSm ,
RdmaWrCompl ,
RdmaRdCompl ,
ModeChange ,
SrcAvailCancel ,
SinkAvailCancel ,
SinkCancelAck ,
ChRcvBuf ,
ChRcvBufAck ,
SuspComm ,
SuspCommAck ,
SinkAvail = 0xfd ,
SrcAvail ,
Data
} message_by_mid_t ;
static const range_string mid_meanings [ ] = {
2014-09-30 23:12:26 +00:00
{ Hello , Hello , " Hello " } ,
{ HelloAck , HelloAck , " HelloAck " } ,
{ DisConn , DisConn , " DisConn " } ,
{ AbortConn , AbortConn , " AbortConn " } ,
{ SendSm , SendSm , " SendSm " } ,
{ RdmaWrCompl , RdmaWrCompl , " RdmaWrCompl " } ,
{ RdmaRdCompl , RdmaRdCompl , " RdmaRdCompl " } ,
{ ModeChange , ModeChange , " ModeChange " } ,
{ SrcAvailCancel , SrcAvailCancel , " SrcAvailCancel " } ,
{ SinkAvailCancel , SinkAvailCancel , " SinkAvailCancel " } ,
{ SinkCancelAck , SinkCancelAck , " SinkCancelAck " } ,
{ ChRcvBuf , ChRcvBuf , " ChRcvBuf " } ,
{ ChRcvBufAck , ChRcvBufAck , " ChRcvBufAck " } ,
{ SuspComm , SuspComm , " SuspComm " } ,
{ SuspCommAck , SuspCommAck , " SuspCommAck " } ,
{ SinkAvail , SinkAvail , " SinkAvail " } ,
{ SrcAvail , SrcAvail , " SrcAvail " } ,
{ Data , Data , " Data " } ,
{ 0x00001111 , 0x00111111 , " Reserved " } ,
{ 0x01000000 , 0x01111111 , " Experimental " } ,
{ 0x10000000 , 0x11111100 , " Reserved " } ,
{ 0 , 0 , NULL }
2010-11-17 02:57:22 +00:00
} ;
/* Code to actually dissect the packets */
static int
2012-09-10 21:40:21 +00:00
dissect_ib_sdp ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data _U_ )
2010-11-17 02:57:22 +00:00
{
int local_offset = 0 ;
2016-12-20 13:58:49 +00:00
proto_item * SDP_header_item ;
proto_tree * SDP_header_tree ;
proto_item * SDP_BSDH_header_item ;
proto_tree * SDP_BSDH_header_tree ;
proto_item * SDP_EH_header_item ;
proto_tree * SDP_EH_header_tree ;
2010-11-17 02:57:22 +00:00
guint8 mid ;
2015-06-24 04:30:15 +00:00
if ( tvb_captured_length ( tvb ) < 16 ) /* check this has at least enough bytes for the BSDH */
2010-11-17 02:57:22 +00:00
return 0 ;
col_set_str ( pinfo - > cinfo , COL_PROTOCOL , " SDP " ) ;
2016-02-21 19:24:11 +00:00
SDP_header_item = proto_tree_add_item ( tree , proto_ib_sdp , tvb , local_offset , - 1 , ENC_NA ) ;
2010-11-17 02:57:22 +00:00
SDP_header_tree = proto_item_add_subtree ( SDP_header_item , ett_ib_sdp ) ;
2011-10-04 22:44:31 +00:00
SDP_BSDH_header_item = proto_tree_add_item ( SDP_header_tree , hf_ib_sdp_bsdh , tvb , local_offset , 16 , ENC_NA ) ;
2010-11-17 02:57:22 +00:00
SDP_BSDH_header_tree = proto_item_add_subtree ( SDP_BSDH_header_item , ett_ib_sdp_bsdh ) ;
mid = tvb_get_guint8 ( tvb , local_offset ) ;
2011-10-06 03:35:44 +00:00
proto_tree_add_item ( SDP_BSDH_header_tree , hf_ib_sdp_mid , tvb , local_offset , 1 , ENC_BIG_ENDIAN ) ; local_offset + = 1 ;
2010-11-17 02:57:22 +00:00
2016-12-20 13:58:49 +00:00
col_append_fstr ( pinfo - > cinfo , COL_INFO , " (SDP %s) " ,
rval_to_str ( mid , mid_meanings , " Unknown " ) ) ;
2011-10-06 03:35:44 +00:00
proto_tree_add_item ( SDP_BSDH_header_tree , hf_ib_sdp_flags , tvb , local_offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( SDP_BSDH_header_tree , hf_ib_sdp_flags_oobpres , tvb , local_offset , 2 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( SDP_BSDH_header_tree , hf_ib_sdp_flags_oob_pend , tvb , local_offset , 4 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( SDP_BSDH_header_tree , hf_ib_sdp_flags_reqpipe , tvb , local_offset , 4 , ENC_BIG_ENDIAN ) ; local_offset + = 1 ;
2010-11-17 02:57:22 +00:00
2011-10-06 03:35:44 +00:00
proto_tree_add_item ( SDP_BSDH_header_tree , hf_ib_sdp_bufs , tvb , local_offset , 2 , ENC_BIG_ENDIAN ) ; local_offset + = 2 ;
proto_tree_add_item ( SDP_BSDH_header_tree , hf_ib_sdp_len , tvb , local_offset , 4 , ENC_BIG_ENDIAN ) ; local_offset + = 4 ;
proto_tree_add_item ( SDP_BSDH_header_tree , hf_ib_sdp_mseq , tvb , local_offset , 4 , ENC_BIG_ENDIAN ) ; local_offset + = 4 ;
proto_tree_add_item ( SDP_BSDH_header_tree , hf_ib_sdp_mseqack , tvb , local_offset , 4 , ENC_BIG_ENDIAN ) ; local_offset + = 4 ;
2010-11-17 02:57:22 +00:00
switch ( mid ) {
case Hello :
2011-10-04 22:44:31 +00:00
SDP_EH_header_item = proto_tree_add_item ( SDP_header_tree , hf_ib_sdp_hh , tvb , local_offset , 48 , ENC_NA ) ;
2010-11-17 02:57:22 +00:00
SDP_EH_header_tree = proto_item_add_subtree ( SDP_EH_header_item , ett_ib_sdp_hh ) ;
2011-10-06 03:35:44 +00:00
proto_tree_add_item ( SDP_EH_header_tree , hf_ib_sdp_majv , tvb , local_offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( SDP_EH_header_tree , hf_ib_sdp_minv , tvb , local_offset , 1 , ENC_BIG_ENDIAN ) ; local_offset + = 1 ;
proto_tree_add_item ( SDP_EH_header_tree , hf_ib_sdp_ipv , tvb , local_offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( SDP_EH_header_tree , hf_ib_sdp_cap , tvb , local_offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( SDP_EH_header_tree , hf_ib_sdp_cap_invalidate , tvb , local_offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( SDP_EH_header_tree , hf_ib_sdp_cap_extmaxadverts , tvb , local_offset , 1 , ENC_BIG_ENDIAN ) ; local_offset + = 1 ;
2010-11-17 02:57:22 +00:00
local_offset + = 1 ; /* skip reserved */
2011-10-06 03:35:44 +00:00
proto_tree_add_item ( SDP_EH_header_tree , hf_ib_sdp_maxadverts , tvb , local_offset , 1 , ENC_BIG_ENDIAN ) ; local_offset + = 1 ;
proto_tree_add_item ( SDP_EH_header_tree , hf_ib_sdp_desremrcvsz , tvb , local_offset , 4 , ENC_BIG_ENDIAN ) ; local_offset + = 4 ;
proto_tree_add_item ( SDP_EH_header_tree , hf_ib_sdp_localrcvsz , tvb , local_offset , 4 , ENC_BIG_ENDIAN ) ; local_offset + = 4 ;
proto_tree_add_item ( SDP_EH_header_tree , hf_ib_sdp_localport , tvb , local_offset , 2 , ENC_BIG_ENDIAN ) ; local_offset + = 2 ;
2010-11-17 02:57:22 +00:00
local_offset + = 2 ; /* skip reserved */
2011-10-10 00:39:31 +00:00
proto_tree_add_item ( SDP_EH_header_tree , hf_ib_sdp_src_ip , tvb , local_offset , 16 , ENC_NA ) ; local_offset + = 16 ;
proto_tree_add_item ( SDP_EH_header_tree , hf_ib_sdp_dst_ip , tvb , local_offset , 16 , ENC_NA ) ; local_offset + = 16 ;
2010-11-17 02:57:22 +00:00
local_offset + = 2 ; /* skip reserved */
2012-02-12 19:30:57 +00:00
proto_tree_add_item ( SDP_EH_header_tree , hf_ib_sdp_extmaxadverts , tvb , local_offset , 2 , ENC_BIG_ENDIAN ) ; /*local_offset += 2;*/
2010-11-17 02:57:22 +00:00
break ;
case HelloAck :
2011-10-04 22:44:31 +00:00
proto_tree_add_item ( SDP_header_tree , hf_ib_sdp_hah , tvb , local_offset , 48 , ENC_NA ) ;
2010-11-17 02:57:22 +00:00
break ;
case DisConn :
break ;
case AbortConn :
break ;
case SendSm :
break ;
case RdmaWrCompl :
2011-10-04 22:44:31 +00:00
proto_tree_add_item ( SDP_header_tree , hf_ib_sdp_rwch , tvb , local_offset , 48 , ENC_NA ) ;
2010-11-17 02:57:22 +00:00
break ;
case RdmaRdCompl :
2011-10-04 22:44:31 +00:00
proto_tree_add_item ( SDP_header_tree , hf_ib_sdp_rrch , tvb , local_offset , 48 , ENC_NA ) ;
2010-11-17 02:57:22 +00:00
break ;
case ModeChange :
2011-10-04 22:44:31 +00:00
proto_tree_add_item ( SDP_BSDH_header_tree , hf_ib_sdp_mch , tvb , local_offset , 48 , ENC_NA ) ;
2010-11-17 02:57:22 +00:00
break ;
case SrcAvailCancel :
break ;
case SinkAvailCancel :
break ;
case SinkCancelAck :
break ;
case ChRcvBuf :
2011-10-04 22:44:31 +00:00
proto_tree_add_item ( SDP_header_tree , hf_ib_sdp_crbh , tvb , local_offset , 48 , ENC_NA ) ;
2010-11-17 02:57:22 +00:00
break ;
case ChRcvBufAck :
2011-10-04 22:44:31 +00:00
proto_tree_add_item ( SDP_header_tree , hf_ib_sdp_crbah , tvb , local_offset , 48 , ENC_NA ) ;
2010-11-17 02:57:22 +00:00
break ;
case SuspComm :
2011-10-04 22:44:31 +00:00
proto_tree_add_item ( SDP_header_tree , hf_ib_sdp_suspch , tvb , local_offset , 48 , ENC_NA ) ;
2010-11-17 02:57:22 +00:00
break ;
case SuspCommAck :
break ;
case SinkAvail :
2011-10-04 22:44:31 +00:00
proto_tree_add_item ( SDP_header_tree , hf_ib_sdp_sinkah , tvb , local_offset , 48 , ENC_NA ) ;
2010-11-17 02:57:22 +00:00
break ;
case SrcAvail :
2011-10-04 22:44:31 +00:00
proto_tree_add_item ( SDP_header_tree , hf_ib_sdp_srcah , tvb , local_offset , 48 , ENC_NA ) ;
2010-11-17 02:57:22 +00:00
break ;
case Data :
2011-10-04 22:44:31 +00:00
proto_tree_add_item ( SDP_header_tree , hf_ib_sdp_data , tvb , local_offset , - 1 , ENC_NA ) ;
2010-11-17 02:57:22 +00:00
break ;
default :
break ;
}
2015-06-23 18:24:48 +00:00
return tvb_captured_length ( tvb ) ;
2010-11-17 02:57:22 +00:00
}
2016-12-20 13:58:49 +00:00
static gboolean
dissect_ib_sdp_heur ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data _U_ )
{
conversation_t * conv ;
conversation_infiniband_data * convo_data = NULL ;
if ( tvb_captured_length ( tvb ) < 16 ) /* check this has at least enough bytes for the BSDH */
return FALSE ;
/* first try to find a conversation between the two current hosts. in most cases this
will not work since we do not have the source QP . this WILL succeed when we ' re still
in the process of CM negotiations */
conv = find_conversation ( pinfo - > num , & pinfo - > src , & pinfo - > dst ,
PT_IBQP , pinfo - > srcport , pinfo - > destport , 0 ) ;
if ( ! conv ) {
/* if not, try to find an established RC channel. recall Infiniband conversations are
registered with one side of the channel . since the packet is only guaranteed to
contain the qpn of the destination , we ' ll use this */
conv = find_conversation ( pinfo - > num , & pinfo - > dst , & pinfo - > dst ,
PT_IBQP , pinfo - > destport , pinfo - > destport , NO_ADDR_B | NO_PORT_B ) ;
if ( ! conv )
return FALSE ; /* nothing to do with no conversation context */
}
convo_data = ( conversation_infiniband_data * ) conversation_get_proto_data ( conv , proto_infiniband ) ;
if ( ! convo_data )
return FALSE ;
if ( ! ( convo_data - > service_id & SERVICE_ID_MASK ) )
return FALSE ; /* the service id doesn't match that of SDP - nothing for us to do here */
dissect_ib_sdp ( tvb , pinfo , tree , data ) ;
return TRUE ;
}
2010-11-17 02:57:22 +00:00
void
proto_register_ib_sdp ( void )
{
module_t * ib_sdp_module ;
static hf_register_info hf [ ] = {
/* SDP BSDH Header */
{ & hf_ib_sdp_bsdh , {
2012-08-01 01:57:18 +00:00
" BSDH " , " infiniband_sdp.bsdh " ,
2010-11-17 02:57:22 +00:00
FT_NONE , BASE_NONE , NULL , 0x0 , NULL , HFILL }
} ,
{ & hf_ib_sdp_mid , {
2012-08-01 01:57:18 +00:00
" MID " , " infiniband_sdp.bsdh.mid " ,
2010-12-02 12:39:24 +00:00
FT_UINT8 , BASE_HEX | BASE_RANGE_STRING , RVALS ( mid_meanings ) , 0x0 , NULL , HFILL }
2010-11-17 02:57:22 +00:00
} ,
{ & hf_ib_sdp_flags , {
2012-08-01 01:57:18 +00:00
" Flags " , " infiniband_sdp.bsdh.flags " ,
2010-11-17 02:57:22 +00:00
FT_UINT8 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
} ,
{ & hf_ib_sdp_flags_oobpres , {
2012-08-01 01:57:18 +00:00
" OOB_PRES " , " infiniband_sdp.bsdh.oobpres " ,
2010-11-17 02:57:22 +00:00
FT_UINT8 , BASE_HEX , NULL , 0x1 , " Out-Of-Band Data is present " , HFILL }
} ,
{ & hf_ib_sdp_flags_oob_pend , {
2012-08-01 01:57:18 +00:00
" OOB_PEND " , " infiniband_sdp.bsdh.oobpend " ,
2010-11-17 02:57:22 +00:00
FT_UINT8 , BASE_HEX , NULL , 0x2 , " Out-Of-Band Data is pending " , HFILL }
} ,
{ & hf_ib_sdp_flags_reqpipe , {
2012-08-01 01:57:18 +00:00
" REQ_PIPE " , " infiniband_sdp.bsdh.reqpipe " ,
2010-11-17 02:57:22 +00:00
FT_UINT8 , BASE_HEX , NULL , 0x4 , " Request change to Pipelined Mode " , HFILL }
} ,
{ & hf_ib_sdp_bufs , {
2012-08-01 01:57:18 +00:00
" Buffers " , " infiniband_sdp.bsdh.bufs " ,
2010-11-17 02:57:22 +00:00
FT_UINT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
} ,
{ & hf_ib_sdp_len , {
2012-08-01 01:57:18 +00:00
" Length " , " infiniband_sdp.bsdh.len " ,
2010-11-17 02:57:22 +00:00
FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
} ,
{ & hf_ib_sdp_mseq , {
2012-08-01 01:57:18 +00:00
" MSeq " , " infiniband_sdp.bsdh.mseq " ,
2010-11-17 02:57:22 +00:00
FT_UINT32 , BASE_HEX , NULL , 0x0 , " Message Sequence Number " , HFILL }
} ,
{ & hf_ib_sdp_mseqack , {
2012-08-01 01:57:18 +00:00
" MSeqAck " , " infiniband_sdp.bsdh.mseqack " ,
2010-11-17 02:57:22 +00:00
FT_UINT32 , BASE_HEX , NULL , 0x0 , " Message Sequence Number Acknowledgement " , HFILL }
} ,
/* SDP Hello Header */
{ & hf_ib_sdp_hh , {
2012-08-01 01:57:18 +00:00
" Hello Header " , " infiniband_sdp.hh " ,
2010-11-17 02:57:22 +00:00
FT_NONE , BASE_NONE , NULL , 0x00 , NULL , HFILL }
} ,
{ & hf_ib_sdp_majv , {
2012-08-01 01:57:18 +00:00
" Major Protocol Version Number " , " infiniband_sdp.hh.majv " ,
2010-11-17 02:57:22 +00:00
FT_UINT8 , BASE_HEX , NULL , 0xf0 , NULL , HFILL }
} ,
{ & hf_ib_sdp_minv , {
2012-08-01 01:57:18 +00:00
" Minor Protocol Version Number " , " infiniband_sdp.hh.minv " ,
2010-11-17 02:57:22 +00:00
FT_UINT8 , BASE_HEX , NULL , 0x0f , NULL , HFILL }
} ,
{ & hf_ib_sdp_ipv ,
2012-08-01 01:57:18 +00:00
{ " IP version " , " infiniband_sdp.hh.ipv " ,
2010-11-17 02:57:22 +00:00
FT_UINT8 , BASE_HEX , NULL , 0xf0 , NULL , HFILL }
} ,
{ & hf_ib_sdp_cap , {
2012-08-01 01:57:18 +00:00
" Capabilities " , " infiniband_sdp.hh.cap " ,
2010-11-17 02:57:22 +00:00
FT_UINT8 , BASE_HEX , NULL , 0x0f , NULL , HFILL }
} ,
{ & hf_ib_sdp_cap_invalidate , {
2012-08-01 01:57:18 +00:00
" INVALIDATE_CAP " , " infiniband_sdp.hh.cap_invalidate " ,
2010-11-17 02:57:22 +00:00
FT_UINT8 , BASE_HEX , NULL , 0x1 , " Supports incoming Send w/Invalidate opcode " , HFILL }
} ,
{ & hf_ib_sdp_cap_extmaxadverts , {
2012-08-01 01:57:18 +00:00
" EXTENDED_MAXADVERTS " , " infiniband_sdp.hh.cap_extmaxadverts " ,
2010-11-17 02:57:22 +00:00
FT_UINT8 , BASE_HEX , NULL , 0x2 , " Extended MaxAdverts is used " , HFILL }
} ,
{ & hf_ib_sdp_maxadverts , {
2012-08-01 01:57:18 +00:00
" Maximum Advertisements " , " infiniband_sdp.hh.maxadverts " ,
2010-11-17 02:57:22 +00:00
FT_UINT8 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
} ,
{ & hf_ib_sdp_desremrcvsz , {
2012-08-01 01:57:18 +00:00
" DesRemRcvSz " , " infiniband_sdp.hh.desremrcvsz " ,
2010-11-17 02:57:22 +00:00
FT_UINT32 , BASE_DEC , NULL , 0x0 , " Desired Remote Receive Size " , HFILL }
} ,
{ & hf_ib_sdp_localrcvsz ,
2012-08-01 01:57:18 +00:00
{ " LocalRcvSz " , " infiniband_sdp.hh.localrcvsz " ,
2010-11-17 02:57:22 +00:00
FT_UINT32 , BASE_DEC , NULL , 0x0 , " Local Receive Size " , HFILL }
} ,
{ & hf_ib_sdp_localport , {
2012-08-01 01:57:18 +00:00
" Local Port " , " infiniband_sdp.hh.localport " ,
2010-11-17 02:57:22 +00:00
FT_UINT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
} ,
{ & hf_ib_sdp_src_ip , {
2012-08-01 01:57:18 +00:00
" Source IP " , " infiniband_sdp.hh.src_ip " ,
2010-11-17 02:57:22 +00:00
FT_IPv6 , BASE_NONE , NULL , 0x0 , NULL , HFILL }
} ,
{ & hf_ib_sdp_dst_ip , {
2012-08-01 01:57:18 +00:00
" Destination IP " , " infiniband_sdp.hh.dst_ip " ,
2010-11-17 02:57:22 +00:00
FT_IPv6 , BASE_NONE , NULL , 0x0 , NULL , HFILL }
} ,
{ & hf_ib_sdp_extmaxadverts , {
2012-08-01 01:57:18 +00:00
" Extended MaxAdverts " , " infiniband_sdp.hh.extmaxadverts " ,
2010-11-17 02:57:22 +00:00
FT_UINT16 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
} ,
/* Rest of Headers */
{ & hf_ib_sdp_hah , {
2012-08-01 01:57:18 +00:00
" HelloAck Header " , " infiniband_sdp.hah " ,
2010-11-17 02:57:22 +00:00
FT_NONE , BASE_NONE , NULL , 0x00 , NULL , HFILL }
} ,
{ & hf_ib_sdp_rwch , {
2012-08-01 01:57:18 +00:00
" RdmaWrCompl Header " , " infiniband_sdp.rwch " ,
2010-11-17 02:57:22 +00:00
FT_NONE , BASE_NONE , NULL , 0x00 , " RDMA Write Complete " , HFILL }
} ,
{ & hf_ib_sdp_rrch , {
2012-08-01 01:57:18 +00:00
" RdmaRdCompl Header " , " infiniband_sdp.rrch " ,
2010-11-17 02:57:22 +00:00
FT_NONE , BASE_NONE , NULL , 0x00 , " RDMA Read Complete " , HFILL }
} ,
{ & hf_ib_sdp_mch , {
2012-08-01 01:57:18 +00:00
" ModeChange Header " , " infiniband_sdp.mch " ,
2010-11-17 02:57:22 +00:00
FT_NONE , BASE_NONE , NULL , 0x00 , NULL , HFILL }
} ,
{ & hf_ib_sdp_crbh , {
2012-08-01 01:57:18 +00:00
" ChRcvBuf Header " , " infiniband_sdp.crbh " ,
2010-11-17 02:57:22 +00:00
FT_NONE , BASE_NONE , NULL , 0x00 , " Change Receive private Buffer size " , HFILL }
} ,
{ & hf_ib_sdp_crbah , {
2012-08-01 01:57:18 +00:00
" ChRcvBufAck Header " , " infiniband_sdp.crbah " ,
2010-11-17 02:57:22 +00:00
FT_NONE , BASE_NONE , NULL , 0x00 , " Change Receive private Buffer size Acknowledgement " , HFILL }
} ,
{ & hf_ib_sdp_suspch , {
2012-08-01 01:57:18 +00:00
" SuspComm Header " , " infiniband_sdp.suspch " ,
2010-11-17 02:57:22 +00:00
FT_NONE , BASE_NONE , NULL , 0x00 , " Suspend Communication " , HFILL }
} ,
{ & hf_ib_sdp_sinkah , {
2012-08-01 01:57:18 +00:00
" SinkAvail Header " , " infiniband_sdp.sinkah " ,
2010-11-17 02:57:22 +00:00
FT_NONE , BASE_NONE , NULL , 0x00 , " Data Sink Available " , HFILL }
} ,
{ & hf_ib_sdp_srcah , {
2012-08-01 01:57:18 +00:00
" SrcAvail Header " , " infiniband_sdp.srcah " ,
2010-11-17 02:57:22 +00:00
FT_NONE , BASE_NONE , NULL , 0x00 , " Data Source Available " , HFILL }
} ,
{ & hf_ib_sdp_data , {
2012-08-01 01:57:18 +00:00
" Data " , " infiniband_sdp.Data " ,
2010-11-17 02:57:22 +00:00
FT_NONE , BASE_NONE , NULL , 0x0 , NULL , HFILL }
}
} ;
/* Setup protocol subtree array */
static gint * ett [ ] = {
& ett_ib_sdp ,
& ett_ib_sdp_bsdh ,
& ett_ib_sdp_hh ,
} ;
2012-08-01 01:57:18 +00:00
proto_ib_sdp = proto_register_protocol ( " Infiniband Sockets Direct Protocol " , " Infiniband SDP " , " infiniband_sdp " ) ;
2010-11-17 02:57:22 +00:00
2015-12-09 04:04:01 +00:00
register_dissector ( " infiniband_sdp " , dissect_ib_sdp , proto_ib_sdp ) ;
2010-11-17 02:57:22 +00:00
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array ( proto_ib_sdp , hf , array_length ( hf ) ) ;
proto_register_subtree_array ( ett , array_length ( ett ) ) ;
/* Register preferences */
ib_sdp_module = prefs_register_protocol ( proto_ib_sdp , proto_reg_handoff_ib_sdp ) ;
2016-12-20 13:58:49 +00:00
prefs_register_static_text_preference ( ib_sdp_module , " use_decode_as " ,
" Heuristic matching preferences removed. Use Infiniband protocol preferences or Decode As. " ,
" Simple heuristics can still be enable (may generate false positives) through Infiniband protocol preferences. "
" To force Infiniband SDP dissection use Decode As " ) ;
prefs_register_obsolete_preference ( ib_sdp_module , " manual_en " ) ;
prefs_register_obsolete_preference ( ib_sdp_module , " addr_a " ) ;
prefs_register_obsolete_preference ( ib_sdp_module , " addr_a_type " ) ;
prefs_register_obsolete_preference ( ib_sdp_module , " addr_a_id " ) ;
prefs_register_obsolete_preference ( ib_sdp_module , " addr_a_qp " ) ;
prefs_register_obsolete_preference ( ib_sdp_module , " addr_b " ) ;
prefs_register_obsolete_preference ( ib_sdp_module , " addr_b_type " ) ;
prefs_register_obsolete_preference ( ib_sdp_module , " addr_b_id " ) ;
prefs_register_obsolete_preference ( ib_sdp_module , " addr_b_qp " ) ;
2010-11-17 02:57:22 +00:00
}
void
proto_reg_handoff_ib_sdp ( void )
{
2016-12-20 13:58:49 +00:00
heur_dissector_add ( " infiniband.payload " , dissect_ib_sdp_heur , " Infiniband SDP " , " sdp_infiniband " , proto_ib_sdp , HEURISTIC_ENABLE ) ;
heur_dissector_add ( " infiniband.mad.cm.private " , dissect_ib_sdp_heur , " Infiniband SDP in PrivateData of CM packets " , " sdp_ib_private " , proto_ib_sdp , HEURISTIC_ENABLE ) ;
2010-11-17 02:57:22 +00:00
2016-12-20 13:58:49 +00:00
dissector_add_for_decode_as ( " infiniband " , create_dissector_handle ( dissect_ib_sdp , proto_ib_sdp ) ) ;
2010-11-17 02:57:22 +00:00
2016-12-20 13:58:49 +00:00
proto_infiniband = proto_get_id_by_filter_name ( " infiniband " ) ;
2010-11-17 02:57:22 +00:00
}
2014-09-30 23:12:26 +00:00
/*
* Editor modelines - http : //www.wireshark.org/tools/modelines.html
*
* Local variables :
* c - basic - offset : 4
* tab - width : 8
* indent - tabs - mode : nil
* End :
*
* vi : set shiftwidth = 4 tabstop = 8 expandtab :
* : indentSize = 4 : tabSize = 8 : noTabs = true :
*/