2007-05-04 07:10:15 +00:00
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
2007-10-17 10:25:21 +00:00
/* packet-t38.c */
2011-10-15 19:27:27 +00:00
/* ../../tools/asn2wrs.py -p t38 -c ./t38.cnf -s ./packet-t38-template -D . -O ../../epan/dissectors T38_2002.asn */
2007-05-04 07:10:15 +00:00
/* Input file: packet-t38-template.c */
2011-04-12 20:45:25 +00:00
# line 1 ".. / .. / asn1 / t38 / packet-t38-template.c"
2003-09-11 13:36:04 +00:00
/* packet-t38.c
* Routines for T .38 packet dissection
* 2003 Hans Viens
2004-10-22 06:19:00 +00:00
* 2004 Alejandro Vaquero , add support Conversations for SDP
2006-01-15 15:01:14 +00:00
* 2006 Alejandro Vaquero , add T30 reassemble and dissection
2003-09-11 13:36:04 +00:00
*
2004-07-18 00:24:25 +00:00
* $ Id $
2003-09-11 13:36:04 +00:00
*
2006-05-21 04:49:01 +00:00
* Wireshark - Network traffic analyzer
* By Gerald Combs < gerald @ wireshark . org >
2003-09-11 13:36:04 +00:00
* 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 . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
2004-01-26 22:16:43 +00:00
/* Depending on what ASN.1 specification is used you may have to change
* the preference setting regarding Pre - Corrigendum ASN .1 specification :
* http : //www.itu.int/ITU-T/asn1/database/itu-t/t/t38/1998/T38.html (Pre-Corrigendum=TRUE)
* http : //www.itu.int/ITU-T/asn1/database/itu-t/t/t38/2003/T38(1998).html (Pre-Corrigendum=TRUE)
*
* http : //www.itu.int/ITU-T/asn1/database/itu-t/t/t38/2003/T38(2002).html (Pre-Corrigendum=FALSE)
* http : //www.itu.int/ITU-T/asn1/database/itu-t/t/t38/2002/t38.html (Pre-Corrigendum=FALSE)
* http : //www.itu.int/ITU-T/asn1/database/itu-t/t/t38/2002-Amd1/T38.html (Pre-Corrigendum=FALSE)
*/
/* TO DO:
* - TCP desegmentation is currently not supported for T .38 IFP directly over TCP .
2004-10-22 06:19:00 +00:00
* - H .245 dissectors should be updated to start conversations for T .38 similar to RTP .
2004-01-09 23:24:54 +00:00
* - Sometimes the last octet is not high - lighted when selecting something in the tree . Bug in PER dissector ?
2004-01-26 22:16:43 +00:00
* - Add support for RTP payload audio / t38 ( draft - jones - avt - audio - t38 - 03. txt ) , i . e . T38 in RTP packets .
2004-01-09 23:24:54 +00:00
*/
2003-09-11 13:36:04 +00:00
# ifdef HAVE_CONFIG_H
# include "config.h"
# endif
# include <glib.h>
# include <epan/packet.h>
2006-01-15 15:01:14 +00:00
# include <epan/reassemble.h>
2003-09-11 13:36:04 +00:00
# include <epan/conversation.h>
2005-10-03 05:55:26 +00:00
# include <epan/tap.h>
2006-01-15 15:01:14 +00:00
# include <epan/expert.h>
2003-09-11 13:36:04 +00:00
# include <string.h>
2004-10-22 06:19:00 +00:00
# include "packet-t38.h"
2004-09-27 22:55:15 +00:00
# include <epan/prefs.h>
2004-09-29 00:52:45 +00:00
# include <epan/ipproto.h>
2007-05-01 22:05:11 +00:00
# include <epan/asn1.h>
2003-09-11 13:36:04 +00:00
# include "packet-per.h"
2004-01-26 22:16:43 +00:00
# include "packet-tpkt.h"
2005-08-12 22:12:32 +00:00
# include <epan/emem.h>
2008-03-01 17:23:39 +00:00
# include <epan/strutil.h>
2003-09-11 13:36:04 +00:00
2004-01-09 23:24:54 +00:00
# define PORT_T38 6004
static guint global_t38_tcp_port = PORT_T38 ;
static guint global_t38_udp_port = PORT_T38 ;
2005-10-03 05:55:26 +00:00
static int t38_tap = - 1 ;
2004-01-09 23:24:54 +00:00
/* dissect using the Pre Corrigendum T.38 ASN.1 specification (1998) */
static gboolean use_pre_corrigendum_asn1_specification = TRUE ;
/* dissect packets that looks like RTP version 2 packets as RTP */
/* instead of as T.38. This may result in that some T.38 UPTL */
/* packets with sequence number values higher than 32767 may be */
/* shown as RTP packets. */
static gboolean dissect_possible_rtpv2_packets_as_rtp = FALSE ;
2003-09-11 13:36:04 +00:00
2004-01-26 22:16:43 +00:00
/* Reassembly of T.38 PDUs over TPKT over TCP */
static gboolean t38_tpkt_reassembly = TRUE ;
/* Preference setting whether TPKT header is used when sending T.38 over TCP.
* The default setting is Maybe where the dissector will look on the first
* bytes to try to determine whether TPKT header is used or not . This may not
* work so well in some cases . You may want to change the setting to Always or
* Newer .
*/
# define T38_TPKT_NEVER 0 /* Assume that there is never a TPKT header */
# define T38_TPKT_ALWAYS 1 /* Assume that there is always a TPKT header */
# define T38_TPKT_MAYBE 2 /* Assume TPKT if first octets are 03-00-xx-xx */
static gint t38_tpkt_usage = T38_TPKT_MAYBE ;
static const enum_val_t t38_tpkt_options [ ] = {
2004-05-24 02:25:21 +00:00
{ " never " , " Never " , T38_TPKT_NEVER } ,
{ " always " , " Always " , T38_TPKT_ALWAYS } ,
{ " maybe " , " Maybe " , T38_TPKT_MAYBE } ,
{ NULL , NULL , - 1 }
2004-01-26 22:16:43 +00:00
} ;
2006-01-15 15:01:14 +00:00
/* T38 */
2004-01-26 22:52:22 +00:00
static dissector_handle_t t38_udp_handle ;
static dissector_handle_t t38_tcp_handle ;
2004-01-26 22:16:43 +00:00
static dissector_handle_t t38_tcp_pdu_handle ;
2004-01-09 23:24:54 +00:00
static dissector_handle_t rtp_handle ;
2007-04-30 06:40:07 +00:00
static dissector_handle_t t30_hdlc_handle ;
static dissector_handle_t data_handle ;
2003-09-11 13:36:04 +00:00
2008-07-26 15:28:04 +00:00
static gint32 Type_of_msg_value ;
2003-09-11 13:36:04 +00:00
static guint32 Data_Field_field_type_value ;
2004-01-09 23:24:54 +00:00
static guint32 Data_value ;
static guint32 T30ind_value ;
2006-01-15 15:01:14 +00:00
static guint32 Data_Field_item_num ;
2003-09-11 13:36:04 +00:00
static int proto_t38 = - 1 ;
2007-05-04 07:10:15 +00:00
/*--- Included file: packet-t38-hf.c ---*/
2011-04-12 20:45:25 +00:00
# line 1 ".. / .. / asn1 / t38 / packet-t38-hf.c"
2007-05-04 07:10:15 +00:00
static int hf_t38_IFPPacket_PDU = - 1 ; /* IFPPacket */
static int hf_t38_UDPTLPacket_PDU = - 1 ; /* UDPTLPacket */
static int hf_t38_type_of_msg = - 1 ; /* Type_of_msg */
static int hf_t38_data_field = - 1 ; /* Data_Field */
static int hf_t38_t30_indicator = - 1 ; /* T30_indicator */
static int hf_t38_t30_data = - 1 ; /* T30_data */
static int hf_t38_Data_Field_item = - 1 ; /* Data_Field_item */
static int hf_t38_field_type = - 1 ; /* T_field_type */
static int hf_t38_field_data = - 1 ; /* T_field_data */
static int hf_t38_seq_number = - 1 ; /* T_seq_number */
static int hf_t38_primary_ifp_packet = - 1 ; /* T_primary_ifp_packet */
static int hf_t38_error_recovery = - 1 ; /* T_error_recovery */
static int hf_t38_secondary_ifp_packets = - 1 ; /* T_secondary_ifp_packets */
static int hf_t38_secondary_ifp_packets_item = - 1 ; /* OpenType_IFPPacket */
static int hf_t38_fec_info = - 1 ; /* T_fec_info */
static int hf_t38_fec_npackets = - 1 ; /* INTEGER */
static int hf_t38_fec_data = - 1 ; /* T_fec_data */
static int hf_t38_fec_data_item = - 1 ; /* OCTET_STRING */
/*--- End of included file: packet-t38-hf.c ---*/
2011-04-12 20:45:25 +00:00
# line 124 ".. / .. / asn1 / t38 / packet-t38-template.c"
2003-09-11 13:36:04 +00:00
2004-10-22 06:19:00 +00:00
/* T38 setup fields */
static int hf_t38_setup = - 1 ;
static int hf_t38_setup_frame = - 1 ;
static int hf_t38_setup_method = - 1 ;
2006-01-15 15:01:14 +00:00
/* T38 Data reassemble fields */
2008-04-20 13:24:58 +00:00
static int hf_t38_fragments = - 1 ;
static int hf_t38_fragment = - 1 ;
static int hf_t38_fragment_overlap = - 1 ;
static int hf_t38_fragment_overlap_conflicts = - 1 ;
static int hf_t38_fragment_multiple_tails = - 1 ;
static int hf_t38_fragment_too_long_fragment = - 1 ;
static int hf_t38_fragment_error = - 1 ;
2011-01-30 21:01:07 +00:00
static int hf_t38_fragment_count = - 1 ;
2008-04-20 13:24:58 +00:00
static int hf_t38_reassembled_in = - 1 ;
2010-02-02 16:01:52 +00:00
static int hf_t38_reassembled_length = - 1 ;
2006-01-15 15:01:14 +00:00
2003-09-11 13:36:04 +00:00
static gint ett_t38 = - 1 ;
2007-05-04 07:10:15 +00:00
/*--- Included file: packet-t38-ett.c ---*/
2011-04-12 20:45:25 +00:00
# line 1 ".. / .. / asn1 / t38 / packet-t38-ett.c"
2003-09-11 13:36:04 +00:00
static gint ett_t38_IFPPacket = - 1 ;
static gint ett_t38_Type_of_msg = - 1 ;
static gint ett_t38_Data_Field = - 1 ;
static gint ett_t38_Data_Field_item = - 1 ;
static gint ett_t38_UDPTLPacket = - 1 ;
2007-05-04 07:10:15 +00:00
static gint ett_t38_T_error_recovery = - 1 ;
static gint ett_t38_T_secondary_ifp_packets = - 1 ;
static gint ett_t38_T_fec_info = - 1 ;
static gint ett_t38_T_fec_data = - 1 ;
/*--- End of included file: packet-t38-ett.c ---*/
2011-04-12 20:45:25 +00:00
# line 144 ".. / .. / asn1 / t38 / packet-t38-template.c"
2004-10-22 06:19:00 +00:00
static gint ett_t38_setup = - 1 ;
2003-09-11 13:36:04 +00:00
2006-01-15 15:01:14 +00:00
static gint ett_data_fragment = - 1 ;
static gint ett_data_fragments = - 1 ;
2004-01-09 23:24:54 +00:00
static gboolean primary_part = TRUE ;
static guint32 seq_number = 0 ;
2006-01-15 15:01:14 +00:00
/* Tables for reassembly of Data fragments. */
static GHashTable * data_fragment_table = NULL ;
static const fragment_items data_frag_items = {
/* Fragment subtrees */
& ett_data_fragment ,
& ett_data_fragments ,
/* Fragment fields */
2008-04-20 13:24:58 +00:00
& hf_t38_fragments ,
& hf_t38_fragment ,
& hf_t38_fragment_overlap ,
& hf_t38_fragment_overlap_conflicts ,
& hf_t38_fragment_multiple_tails ,
& hf_t38_fragment_too_long_fragment ,
& hf_t38_fragment_error ,
2011-01-30 21:01:07 +00:00
& hf_t38_fragment_count ,
2006-01-15 15:01:14 +00:00
/* Reassembled in field */
2008-04-20 13:24:58 +00:00
& hf_t38_reassembled_in ,
2010-02-02 16:01:52 +00:00
/* Reassembled length field */
& hf_t38_reassembled_length ,
2006-01-15 15:01:14 +00:00
/* Tag */
" Data fragments "
} ;
typedef struct _fragment_key {
address src ;
address dst ;
guint32 id ;
} fragment_key ;
static conversation_t * p_conv = NULL ;
static t38_conv * p_t38_conv = NULL ;
static t38_conv * p_t38_packet_conv = NULL ;
static t38_conv_info * p_t38_conv_info = NULL ;
static t38_conv_info * p_t38_packet_conv_info = NULL ;
2004-01-09 23:24:54 +00:00
/* RTP Version is the first 2 bits of the first octet in the UDP payload*/
# define RTP_VERSION(octet) ((octet) >> 6)
void proto_reg_handoff_t38 ( void ) ;
2007-03-21 08:32:15 +00:00
static void show_setup_info ( tvbuff_t * tvb , proto_tree * tree , t38_conv * p_t38_conv ) ;
2004-10-22 06:19:00 +00:00
/* Preferences bool to control whether or not setup info should be shown */
static gboolean global_t38_show_setup_info = TRUE ;
2006-01-15 15:01:14 +00:00
/* Can tap up to 4 T38 packets within same packet */
/* We only tap the primary part, not the redundancy */
# define MAX_T38_MESSAGES_IN_PACKET 4
static t38_packet_info t38_info_arr [ MAX_T38_MESSAGES_IN_PACKET ] ;
static int t38_info_current = 0 ;
static t38_packet_info * t38_info = NULL ;
static void t38_defragment_init ( void )
{
/* Init reassemble tables */
fragment_table_init ( & data_fragment_table ) ;
}
2004-10-22 06:19:00 +00:00
/* Set up an T38 conversation */
void t38_add_address ( packet_info * pinfo ,
address * addr , int port ,
int other_port ,
2005-08-05 00:23:22 +00:00
const gchar * setup_method , guint32 setup_frame_number )
2004-10-22 06:19:00 +00:00
{
address null_addr ;
2010-01-22 16:34:54 +00:00
conversation_t * p_conversation ;
t38_conv * p_conversation_data = NULL ;
2004-10-22 06:19:00 +00:00
/*
* If this isn ' t the first time this packet has been processed ,
* we ' ve already done this work , so we don ' t need to do it
* again .
*/
if ( pinfo - > fd - > flags . visited )
{
return ;
}
SET_ADDRESS ( & null_addr , AT_NONE , 0 , NULL ) ;
/*
* Check if the ip address and port combination is not
* already registered as a conversation .
*/
2010-01-22 16:34:54 +00:00
p_conversation = find_conversation ( setup_frame_number , addr , & null_addr , PT_UDP , port , other_port ,
2004-10-22 06:19:00 +00:00
NO_ADDR_B | ( ! other_port ? NO_PORT_B : 0 ) ) ;
/*
* If not , create a new conversation .
*/
2010-01-22 16:34:54 +00:00
if ( ! p_conversation | | p_conversation - > setup_frame ! = setup_frame_number ) {
p_conversation = conversation_new ( setup_frame_number , addr , & null_addr , PT_UDP ,
2004-10-22 06:19:00 +00:00
( guint32 ) port , ( guint32 ) other_port ,
NO_ADDR2 | ( ! other_port ? NO_PORT2 : 0 ) ) ;
}
/* Set dissector */
2010-01-22 16:34:54 +00:00
conversation_set_dissector ( p_conversation , t38_udp_handle ) ;
2004-10-22 06:19:00 +00:00
/*
* Check if the conversation has data associated with it .
*/
2010-01-22 16:34:54 +00:00
p_conversation_data = conversation_get_proto_data ( p_conversation , proto_t38 ) ;
2004-10-22 06:19:00 +00:00
/*
* If not , add a new data item .
*/
2010-01-22 16:34:54 +00:00
if ( ! p_conversation_data ) {
2004-10-22 06:19:00 +00:00
/* Create conversation data */
2010-01-22 16:34:54 +00:00
p_conversation_data = se_alloc ( sizeof ( t38_conv ) ) ;
2004-10-22 06:19:00 +00:00
2010-01-22 16:34:54 +00:00
conversation_add_proto_data ( p_conversation , proto_t38 , p_conversation_data ) ;
2004-10-22 06:19:00 +00:00
}
/*
* Update the conversation data .
*/
2010-01-22 16:34:54 +00:00
g_strlcpy ( p_conversation_data - > setup_method , setup_method , MAX_T38_SETUP_METHOD_SIZE ) ;
p_conversation_data - > setup_frame_number = setup_frame_number ;
p_conversation_data - > src_t38_info . reass_ID = 0 ;
p_conversation_data - > src_t38_info . reass_start_seqnum = - 1 ;
p_conversation_data - > src_t38_info . reass_data_type = 0 ;
p_conversation_data - > src_t38_info . last_seqnum = - 1 ;
p_conversation_data - > src_t38_info . packet_lost = 0 ;
p_conversation_data - > src_t38_info . burst_lost = 0 ;
p_conversation_data - > src_t38_info . time_first_t4_data = 0 ;
p_conversation_data - > dst_t38_info . reass_ID = 0 ;
p_conversation_data - > dst_t38_info . reass_start_seqnum = - 1 ;
p_conversation_data - > dst_t38_info . reass_data_type = 0 ;
p_conversation_data - > dst_t38_info . last_seqnum = - 1 ;
p_conversation_data - > dst_t38_info . packet_lost = 0 ;
p_conversation_data - > dst_t38_info . burst_lost = 0 ;
p_conversation_data - > dst_t38_info . time_first_t4_data = 0 ;
2004-10-22 06:19:00 +00:00
}
2003-09-11 13:36:04 +00:00
2006-01-15 15:01:14 +00:00
fragment_data *
2007-03-21 08:32:15 +00:00
force_reassemble_seq ( packet_info * pinfo , guint32 id ,
GHashTable * fragment_table )
2006-01-15 15:01:14 +00:00
{
fragment_key key ;
fragment_data * fd_head ;
fragment_data * fd_i ;
fragment_data * last_fd ;
guint32 dfpos , size , packet_lost , burst_lost , seq_num ;
/* create key to search hash with */
key . src = pinfo - > src ;
key . dst = pinfo - > dst ;
key . id = id ;
fd_head = g_hash_table_lookup ( fragment_table , & key ) ;
/* have we already seen this frame ?*/
if ( pinfo - > fd - > flags . visited ) {
if ( fd_head ! = NULL & & fd_head - > flags & FD_DEFRAGMENTED ) {
return fd_head ;
} else {
return NULL ;
}
}
if ( fd_head = = NULL ) {
/* we must have it to continue */
return NULL ;
}
/* check for packet lost and count the burst of packet lost */
packet_lost = 0 ;
burst_lost = 0 ;
seq_num = 0 ;
for ( fd_i = fd_head - > next ; fd_i ; fd_i = fd_i - > next ) {
if ( seq_num ! = fd_i - > offset ) {
packet_lost + = fd_i - > offset - seq_num ;
if ( ( fd_i - > offset - seq_num ) > burst_lost ) {
burst_lost = fd_i - > offset - seq_num ;
}
}
seq_num = fd_i - > offset + 1 ;
}
/* we have received an entire packet, defragment it and
* free all fragments
*/
size = 0 ;
last_fd = NULL ;
for ( fd_i = fd_head - > next ; fd_i ; fd_i = fd_i - > next ) {
if ( ! last_fd | | last_fd - > offset ! = fd_i - > offset ) {
size + = fd_i - > len ;
}
last_fd = fd_i ;
}
fd_head - > data = g_malloc ( size ) ;
fd_head - > len = size ; /* record size for caller */
/* add all data fragments */
dfpos = 0 ;
last_fd = NULL ;
for ( fd_i = fd_head - > next ; fd_i & & fd_i - > len + dfpos < = size ; fd_i = fd_i - > next ) {
if ( fd_i - > len ) {
if ( ! last_fd | | last_fd - > offset ! = fd_i - > offset ) {
memcpy ( fd_head - > data + dfpos , fd_i - > data , fd_i - > len ) ;
dfpos + = fd_i - > len ;
} else {
/* duplicate/retransmission/overlap */
fd_i - > flags | = FD_OVERLAP ;
fd_head - > flags | = FD_OVERLAP ;
if ( ( last_fd - > len ! = fd_i - > datalen )
| | memcmp ( last_fd - > data , fd_i - > data , last_fd - > len ) ) {
2006-01-17 06:39:57 +00:00
fd_i - > flags | = FD_OVERLAPCONFLICT ;
2006-01-15 15:01:14 +00:00
fd_head - > flags | = FD_OVERLAPCONFLICT ;
}
}
}
last_fd = fd_i ;
}
/* we have defragmented the pdu, now free all fragments*/
for ( fd_i = fd_head - > next ; fd_i ; fd_i = fd_i - > next ) {
if ( fd_i - > data ) {
g_free ( fd_i - > data ) ;
fd_i - > data = NULL ;
}
}
/* mark this packet as defragmented */
fd_head - > flags | = FD_DEFRAGMENTED ;
fd_head - > reassembled_in = pinfo - > fd - > num ;
2011-09-27 12:05:32 +00:00
col_append_fstr ( pinfo - > cinfo , COL_INFO , " (t4-data Reassembled: %d pack lost, %d pack burst lost) " , packet_lost , burst_lost ) ;
2006-01-15 15:01:14 +00:00
p_t38_packet_conv_info - > packet_lost = packet_lost ;
p_t38_packet_conv_info - > burst_lost = burst_lost ;
return fd_head ;
}
2007-05-04 07:10:15 +00:00
/* T38 Routines */
/*--- Included file: packet-t38-fn.c ---*/
2011-04-12 20:45:25 +00:00
# line 1 ".. / .. / asn1 / t38 / packet-t38-fn.c"
2007-05-04 07:10:15 +00:00
const value_string t38_T30_indicator_vals [ ] = {
{ 0 , " no-signal " } ,
{ 1 , " cng " } ,
{ 2 , " ced " } ,
{ 3 , " v21-preamble " } ,
{ 4 , " v27-2400-training " } ,
{ 5 , " v27-4800-training " } ,
{ 6 , " v29-7200-training " } ,
{ 7 , " v29-9600-training " } ,
{ 8 , " v17-7200-short-training " } ,
{ 9 , " v17-7200-long-training " } ,
{ 10 , " v17-9600-short-training " } ,
{ 11 , " v17-9600-long-training " } ,
{ 12 , " v17-12000-short-training " } ,
{ 13 , " v17-12000-long-training " } ,
{ 14 , " v17-14400-short-training " } ,
{ 15 , " v17-14400-long-training " } ,
{ 16 , " v8-ansam " } ,
{ 17 , " v8-signal " } ,
{ 18 , " v34-cntl-channel-1200 " } ,
{ 19 , " v34-pri-channel " } ,
{ 20 , " v34-CC-retrain " } ,
{ 21 , " v33-12000-training " } ,
{ 22 , " v33-14400-training " } ,
{ 0 , NULL }
} ;
2003-09-11 13:36:04 +00:00
static int
2007-05-04 07:10:15 +00:00
dissect_t38_T30_indicator ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_enumerated ( tvb , offset , actx , tree , hf_index ,
16 , & T30ind_value , TRUE , 7 , NULL ) ;
2011-04-12 20:45:25 +00:00
# line 31 ".. / .. / asn1 / t38 / t38.cnf"
2011-09-27 12:05:32 +00:00
if ( primary_part ) {
2007-05-04 07:10:15 +00:00
col_append_fstr ( actx - > pinfo - > cinfo , COL_INFO , " t30ind: %s " ,
val_to_str ( T30ind_value , t38_T30_indicator_vals , " <unknown> " ) ) ;
}
/* info for tap */
if ( primary_part )
t38_info - > t30ind_value = T30ind_value ;
return offset ;
}
const value_string t38_T30_data_vals [ ] = {
{ 0 , " v21 " } ,
{ 1 , " v27-2400 " } ,
{ 2 , " v27-4800 " } ,
{ 3 , " v29-7200 " } ,
{ 4 , " v29-9600 " } ,
{ 5 , " v17-7200 " } ,
{ 6 , " v17-9600 " } ,
{ 7 , " v17-12000 " } ,
{ 8 , " v17-14400 " } ,
{ 9 , " v8 " } ,
{ 10 , " v34-pri-rate " } ,
{ 11 , " v34-CC-1200 " } ,
{ 12 , " v34-pri-ch " } ,
{ 13 , " v33-12000 " } ,
{ 14 , " v33-14400 " } ,
{ 0 , NULL }
} ;
static int
dissect_t38_T30_data ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_enumerated ( tvb , offset , actx , tree , hf_index ,
9 , & Data_value , TRUE , 6 , NULL ) ;
2011-04-12 20:45:25 +00:00
# line 43 ".. / .. / asn1 / t38 / t38.cnf"
2011-09-27 12:05:32 +00:00
if ( primary_part ) {
2007-05-04 07:10:15 +00:00
col_append_fstr ( actx - > pinfo - > cinfo , COL_INFO , " data:%s: " ,
val_to_str ( Data_value , t38_T30_data_vals , " <unknown> " ) ) ;
}
2011-11-08 18:39:11 +00:00
2007-05-04 07:10:15 +00:00
/* info for tap */
if ( primary_part )
t38_info - > data_value = Data_value ;
return offset ;
}
static const value_string t38_Type_of_msg_vals [ ] = {
{ 0 , " t30-indicator " } ,
{ 1 , " t30-data " } ,
{ 0 , NULL }
} ;
static const per_choice_t Type_of_msg_choice [ ] = {
{ 0 , & hf_t38_t30_indicator , ASN1_NO_EXTENSIONS , dissect_t38_T30_indicator } ,
{ 1 , & hf_t38_t30_data , ASN1_NO_EXTENSIONS , dissect_t38_T30_data } ,
{ 0 , NULL , 0 , NULL }
} ;
static int
dissect_t38_Type_of_msg ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_choice ( tvb , offset , actx , tree , hf_index ,
ett_t38_Type_of_msg , Type_of_msg_choice ,
& Type_of_msg_value ) ;
2011-04-12 20:45:25 +00:00
# line 24 ".. / .. / asn1 / t38 / t38.cnf"
2007-05-04 07:10:15 +00:00
/* info for tap */
if ( primary_part )
t38_info - > type_msg = Type_of_msg_value ;
return offset ;
}
static const value_string t38_T_field_type_vals [ ] = {
{ 0 , " hdlc-data " } ,
{ 1 , " hdlc-sig-end " } ,
{ 2 , " hdlc-fcs-OK " } ,
{ 3 , " hdlc-fcs-BAD " } ,
{ 4 , " hdlc-fcs-OK-sig-end " } ,
{ 5 , " hdlc-fcs-BAD-sig-end " } ,
{ 6 , " t4-non-ecm-data " } ,
{ 7 , " t4-non-ecm-sig-end " } ,
{ 8 , " cm-message " } ,
{ 9 , " jm-message " } ,
{ 10 , " ci-message " } ,
{ 11 , " v34rate " } ,
{ 0 , NULL }
} ;
static int
dissect_t38_T_field_type ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_enumerated ( tvb , offset , actx , tree , hf_index ,
8 , & Data_Field_field_type_value , ( use_pre_corrigendum_asn1_specification ) ? FALSE : TRUE , ( use_pre_corrigendum_asn1_specification ) ? 0 : 4 , NULL ) ;
2004-01-09 23:24:54 +00:00
2011-04-12 20:45:25 +00:00
# line 63 ".. / .. / asn1 / t38 / t38.cnf"
2011-09-27 12:05:32 +00:00
if ( primary_part ) {
2006-05-22 11:49:50 +00:00
col_append_fstr ( actx - > pinfo - > cinfo , COL_INFO , " %s " ,
2007-05-04 07:10:15 +00:00
val_to_str ( Data_Field_field_type_value , t38_T_field_type_vals , " <unknown> " ) ) ;
}
2004-01-09 23:24:54 +00:00
2007-05-04 07:10:15 +00:00
/* We only reassmeble packets in the Primary part and in the first two Items. */
/* There maybe be t38 packets with more than two Items, but reassemble those packets is not easy */
/* using the current ressaemble functions. */
/* TODO: reassemble all the Items in one frame */
if ( primary_part & & ( Data_Field_item_num < 2 ) ) {
if ( Data_Field_field_type_value = = 2 | | Data_Field_field_type_value = = 4 | | Data_Field_field_type_value = = 7 ) { /* hdlc-fcs-OK or hdlc-fcs-OK-sig-end or t4-non-ecm-sig-end*/
fragment_data * frag_msg = NULL ;
tvbuff_t * new_tvb = NULL ;
gboolean save_fragmented = actx - > pinfo - > fragmented ;
actx - > pinfo - > fragmented = TRUE ;
/* if reass_start_seqnum=-1 it means we have received the end of the fragmente, without received any fragment data */
if ( p_t38_packet_conv_info - > reass_start_seqnum ! = - 1 ) {
frag_msg = fragment_add_seq ( tvb , offset , actx - > pinfo ,
p_t38_packet_conv_info - > reass_ID , /* ID for fragments belonging together */
data_fragment_table , /* list of message fragments */
2012-02-05 16:19:21 +00:00
seq_number + Data_Field_item_num - ( guint32 ) p_t38_packet_conv_info - > reass_start_seqnum + ( guint32 ) p_t38_packet_conv_info - > additional_hdlc_data_field_counter , /* fragment sequence number */
2007-05-04 07:10:15 +00:00
/*0,*/
0 , /* fragment length */
FALSE ) ; /* More fragments */
if ( Data_Field_field_type_value = = 7 ) {
/* if there was packet lost or other errors during the defrag then frag_msg is NULL. This could also means
2011-11-08 18:39:11 +00:00
* there are out of order packets ( e . g , got the tail frame t4 - non - ecm - sig - end before the last fragment ) ,
2007-05-04 07:10:15 +00:00
* but we will assume there was packet lost instead , which is more usual . So , we are going to reassemble the packet
* and get some stat , like packet lost and burst number of packet lost
*/
if ( ! frag_msg ) {
force_reassemble_seq ( actx - > pinfo ,
p_t38_packet_conv_info - > reass_ID , /* ID for fragments belonging together */
data_fragment_table /* list of message fragments */
) ;
} else {
2011-11-08 18:39:11 +00:00
col_append_str ( actx - > pinfo - > cinfo , COL_INFO , " (t4-data Reassembled: No packet lost) " ) ;
2007-05-04 07:10:15 +00:00
g_snprintf ( t38_info - > desc_comment , MAX_T38_DESC , " No packet lost " ) ;
}
2011-11-08 18:39:11 +00:00
2007-05-04 07:10:15 +00:00
if ( p_t38_packet_conv_info - > packet_lost ) {
g_snprintf ( t38_info - > desc_comment , MAX_T38_DESC , " Pack lost: %d, Pack burst lost: %d " , p_t38_packet_conv_info - > packet_lost , p_t38_packet_conv_info - > burst_lost ) ;
} else {
g_snprintf ( t38_info - > desc_comment , MAX_T38_DESC , " No packet lost " ) ;
}
2012-01-13 16:24:44 +00:00
process_reassembled_data ( tvb , offset , actx - > pinfo ,
2010-02-06 18:20:21 +00:00
" Reassembled T38 " , frag_msg , & data_frag_items , NULL , tree ) ;
2007-05-04 07:10:15 +00:00
/* Now reset fragmentation information in pinfo */
actx - > pinfo - > fragmented = save_fragmented ;
2011-11-08 18:39:11 +00:00
t38_info - > time_first_t4_data = p_t38_packet_conv_info - > time_first_t4_data ;
2007-05-04 07:10:15 +00:00
t38_info - > frame_num_first_t4_data = p_t38_packet_conv_info - > reass_ID ; /* The reass_ID is the Frame number of the first t4 fragment */
} else {
new_tvb = process_reassembled_data ( tvb , offset , actx - > pinfo ,
2010-02-06 18:20:21 +00:00
" Reassembled T38 " , frag_msg , & data_frag_items , NULL , tree ) ;
2007-05-04 07:10:15 +00:00
/* Now reset fragmentation information in pinfo */
actx - > pinfo - > fragmented = save_fragmented ;
2007-04-30 06:40:07 +00:00
actx - > pinfo - > private_data = t38_info ;
2006-01-15 15:01:14 +00:00
2007-05-04 07:10:15 +00:00
if ( new_tvb ) call_dissector ( ( t30_hdlc_handle ) ? t30_hdlc_handle : data_handle , new_tvb , actx - > pinfo , tree ) ;
}
} else {
if ( tree ) {
proto_tree_add_text ( tree , tvb , offset , tvb_reported_length_remaining ( tvb , offset ) ,
" [RECEIVED END OF FRAGMENT W/OUT ANY FRAGMENT DATA] " ) ;
}
2009-09-24 20:00:21 +00:00
col_append_str ( actx - > pinfo - > cinfo , COL_INFO , " [Malformed?] " ) ;
2007-05-04 07:10:15 +00:00
actx - > pinfo - > fragmented = save_fragmented ;
}
}
2005-10-03 05:55:26 +00:00
2007-05-04 07:10:15 +00:00
/* reset the reassemble ID and the start seq number if it is not HDLC data */
if ( p_t38_conv & & ( ( ( Data_Field_field_type_value > 0 ) & & ( Data_Field_field_type_value < 6 ) ) | | ( Data_Field_field_type_value = = 7 ) ) ) {
p_t38_conv_info - > reass_ID = 0 ;
p_t38_conv_info - > reass_start_seqnum = - 1 ;
2012-02-05 16:19:21 +00:00
p_t38_conv_info - > additional_hdlc_data_field_counter = 0 ;
p_t38_conv_info - > seqnum_prev_data_field = - 1 ;
2007-05-04 07:10:15 +00:00
}
t38_info - > Data_Field_field_type_value = Data_Field_field_type_value ;
}
return offset ;
2003-09-11 13:36:04 +00:00
}
2007-05-04 07:10:15 +00:00
2003-09-11 13:36:04 +00:00
static int
2007-05-04 07:10:15 +00:00
dissect_t38_T_field_data ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2012-02-05 16:19:21 +00:00
# line 154 ".. / .. / asn1 / t38 / t38.cnf"
2007-05-04 07:10:15 +00:00
tvbuff_t * value_tvb = NULL ;
guint32 value_len ;
offset = dissect_per_octet_string ( tvb , offset , actx , tree , hf_index ,
2007-10-29 19:25:37 +00:00
1 , 65535 , FALSE , & value_tvb ) ;
2007-05-04 07:10:15 +00:00
value_len = tvb_length ( value_tvb ) ;
2004-01-09 23:24:54 +00:00
2007-05-04 07:10:15 +00:00
2012-02-05 16:19:21 +00:00
# line 161 ".. / .. / asn1 / t38 / t38.cnf"
2011-09-27 12:05:32 +00:00
if ( primary_part ) {
2004-01-09 23:24:54 +00:00
if ( value_len < 8 ) {
2007-05-04 07:10:15 +00:00
col_append_fstr ( actx - > pinfo - > cinfo , COL_INFO , " [%s] " ,
2005-07-04 09:35:25 +00:00
tvb_bytes_to_str ( value_tvb , 0 , value_len ) ) ;
2004-01-09 23:24:54 +00:00
}
else {
2007-05-04 07:10:15 +00:00
col_append_fstr ( actx - > pinfo - > cinfo , COL_INFO , " [%s...] " ,
2005-07-04 09:35:25 +00:00
tvb_bytes_to_str ( value_tvb , 0 , 7 ) ) ;
2004-01-09 23:24:54 +00:00
}
2007-05-04 07:10:15 +00:00
}
2006-01-15 15:01:14 +00:00
2007-05-04 07:10:15 +00:00
/* We only reassmeble packets in the Primary part and in the first two Items. */
/* There maybe be t38 packets with more than two Items, but reassemble those packets is not easy */
/* using the current ressaemble functions. */
/* TODO: reassemble all the Items in one frame */
if ( primary_part & & ( Data_Field_item_num < 2 ) ) {
fragment_data * frag_msg = NULL ;
2011-11-08 18:39:11 +00:00
2007-05-04 07:10:15 +00:00
/* HDLC Data or t4-non-ecm-data */
if ( Data_Field_field_type_value = = 0 | | Data_Field_field_type_value = = 6 ) { /* 0=HDLC Data or 6=t4-non-ecm-data*/
gboolean save_fragmented = actx - > pinfo - > fragmented ;
actx - > pinfo - > fragmented = TRUE ;
/* if we have not reassembled this packet and it is the first fragment, reset the reassemble ID and the start seq number*/
if ( p_t38_packet_conv & & p_t38_conv & & ( p_t38_packet_conv_info - > reass_ID = = 0 ) ) {
/* we use the first fragment's frame_number as fragment ID because the protocol doesn't provide it */
p_t38_conv_info - > reass_ID = actx - > pinfo - > fd - > num ;
p_t38_conv_info - > reass_start_seqnum = seq_number ;
p_t38_conv_info - > time_first_t4_data = nstime_to_sec ( & actx - > pinfo - > fd - > rel_ts ) ;
2012-02-05 16:19:21 +00:00
p_t38_conv_info - > additional_hdlc_data_field_counter = 0 ;
2007-05-04 07:10:15 +00:00
p_t38_packet_conv_info - > reass_ID = p_t38_conv_info - > reass_ID ;
p_t38_packet_conv_info - > reass_start_seqnum = p_t38_conv_info - > reass_start_seqnum ;
2012-02-05 16:19:21 +00:00
p_t38_packet_conv_info - > seqnum_prev_data_field = p_t38_conv_info - > seqnum_prev_data_field ;
p_t38_packet_conv_info - > additional_hdlc_data_field_counter = p_t38_conv_info - > additional_hdlc_data_field_counter ;
2007-05-04 07:10:15 +00:00
p_t38_packet_conv_info - > time_first_t4_data = p_t38_conv_info - > time_first_t4_data ;
}
2012-02-05 16:19:21 +00:00
if ( seq_number = = ( guint32 ) p_t38_packet_conv_info - > seqnum_prev_data_field ) {
p_t38_packet_conv_info - > additional_hdlc_data_field_counter + + ;
if ( p_t38_conv ) {
p_t38_conv_info - > additional_hdlc_data_field_counter = p_t38_packet_conv_info - > additional_hdlc_data_field_counter ;
}
}
2007-05-04 07:10:15 +00:00
frag_msg = fragment_add_seq ( value_tvb , 0 , actx - > pinfo ,
p_t38_packet_conv_info - > reass_ID , /* ID for fragments belonging together */
data_fragment_table , /* list of message fragments */
2012-02-05 16:19:21 +00:00
seq_number - ( guint32 ) p_t38_packet_conv_info - > reass_start_seqnum + ( guint32 ) p_t38_packet_conv_info - > additional_hdlc_data_field_counter , /* fragment sequence number */
2007-05-04 07:10:15 +00:00
value_len , /* fragment length */
TRUE ) ; /* More fragments */
2012-02-05 16:19:21 +00:00
p_t38_packet_conv_info - > seqnum_prev_data_field = ( gint32 ) seq_number ;
2012-01-09 16:36:56 +00:00
process_reassembled_data ( tvb , offset , actx - > pinfo ,
2010-02-06 18:20:21 +00:00
" Reassembled T38 " , frag_msg , & data_frag_items , NULL , tree ) ;
2007-05-04 07:10:15 +00:00
if ( ! frag_msg ) { /* Not last packet of reassembled */
if ( Data_Field_field_type_value = = 0 ) {
2012-02-05 16:19:21 +00:00
col_append_fstr ( actx - > pinfo - > cinfo , COL_INFO , " (HDLC fragment %u) " ,
seq_number + ( guint32 ) p_t38_packet_conv_info - > additional_hdlc_data_field_counter
- ( guint32 ) p_t38_packet_conv_info - > reass_start_seqnum ) ;
2007-05-04 07:10:15 +00:00
} else {
2011-09-27 12:05:32 +00:00
col_append_fstr ( actx - > pinfo - > cinfo , COL_INFO , " (t4-data fragment %u) " , seq_number - ( guint32 ) p_t38_packet_conv_info - > reass_start_seqnum ) ;
2007-05-04 07:10:15 +00:00
}
}
/* Now reset fragmentation information in pinfo */
actx - > pinfo - > fragmented = save_fragmented ;
}
}
2005-10-03 05:55:26 +00:00
2007-05-04 07:10:15 +00:00
return offset ;
2003-09-11 13:36:04 +00:00
}
2007-05-04 07:10:15 +00:00
2004-10-11 06:51:19 +00:00
static const per_sequence_t Data_Field_item_sequence [ ] = {
2007-05-04 07:10:15 +00:00
{ & hf_t38_field_type , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL , dissect_t38_T_field_type } ,
{ & hf_t38_field_data , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_t38_T_field_data } ,
{ NULL , 0 , 0 , NULL }
2003-09-11 13:36:04 +00:00
} ;
static int
2007-05-04 07:10:15 +00:00
dissect_t38_Data_Field_item ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index ,
ett_t38_Data_Field_item , Data_Field_item_sequence ) ;
2006-01-15 15:01:14 +00:00
2011-04-12 20:45:25 +00:00
# line 55 ".. / .. / asn1 / t38 / t38.cnf"
2007-05-04 07:10:15 +00:00
if ( primary_part ) Data_Field_item_num + + ;
2006-01-15 15:01:14 +00:00
2007-05-04 07:10:15 +00:00
return offset ;
2003-09-11 13:36:04 +00:00
}
2007-05-04 07:10:15 +00:00
static const per_sequence_t Data_Field_sequence_of [ 1 ] = {
{ & hf_t38_Data_Field_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL , dissect_t38_Data_Field_item } ,
2005-07-16 21:34:19 +00:00
} ;
2003-09-11 13:36:04 +00:00
static int
2007-05-04 07:10:15 +00:00
dissect_t38_Data_Field ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2006-05-22 11:49:50 +00:00
offset = dissect_per_sequence_of ( tvb , offset , actx , tree , hf_index ,
2007-05-04 07:10:15 +00:00
ett_t38_Data_Field , Data_Field_sequence_of ) ;
2005-07-16 21:34:19 +00:00
return offset ;
}
2003-09-11 13:36:04 +00:00
2007-05-04 07:10:15 +00:00
2004-10-11 06:51:19 +00:00
static const per_sequence_t IFPPacket_sequence [ ] = {
2007-05-04 07:10:15 +00:00
{ & hf_t38_type_of_msg , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL , dissect_t38_Type_of_msg } ,
{ & hf_t38_data_field , ASN1_NO_EXTENSIONS , ASN1_OPTIONAL , dissect_t38_Data_Field } ,
2006-07-03 07:03:57 +00:00
{ NULL , 0 , 0 , NULL }
2003-09-11 13:36:04 +00:00
} ;
static int
2007-05-04 07:10:15 +00:00
dissect_t38_IFPPacket ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index ,
ett_t38_IFPPacket , IFPPacket_sequence ) ;
return offset ;
2003-09-11 13:36:04 +00:00
}
2007-05-04 07:10:15 +00:00
2003-09-11 13:36:04 +00:00
static int
2007-05-04 07:10:15 +00:00
dissect_t38_T_seq_number ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_constrained_integer ( tvb , offset , actx , tree , hf_index ,
2008-01-24 23:01:37 +00:00
0U , 65535U , & seq_number , FALSE ) ;
2007-05-04 07:10:15 +00:00
2012-02-05 16:19:21 +00:00
# line 238 ".. / .. / asn1 / t38 / t38.cnf"
2007-05-04 07:10:15 +00:00
/* info for tap */
if ( primary_part )
t38_info - > seq_num = seq_number ;
2004-01-09 23:24:54 +00:00
2011-09-27 12:05:32 +00:00
col_append_fstr ( actx - > pinfo - > cinfo , COL_INFO , " Seq=%05u " , seq_number ) ;
2007-05-04 07:10:15 +00:00
return offset ;
2003-09-11 13:36:04 +00:00
}
2006-01-15 15:01:14 +00:00
2003-09-11 13:36:04 +00:00
2007-05-04 07:10:15 +00:00
static int
dissect_t38_T_primary_ifp_packet ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2012-02-05 16:19:21 +00:00
# line 246 ".. / .. / asn1 / t38 / t38.cnf"
2007-05-04 07:10:15 +00:00
primary_part = TRUE ;
offset = dissect_per_open_type ( tvb , offset , actx , tree , hf_index , dissect_t38_IFPPacket ) ;
2006-01-15 15:01:14 +00:00
2012-02-05 16:19:21 +00:00
# line 248 ".. / .. / asn1 / t38 / t38.cnf"
2007-05-04 07:10:15 +00:00
/* if is a valid t38 packet, add to tap */
2011-11-08 18:39:11 +00:00
if ( p_t38_packet_conv & & ( ! actx - > pinfo - > flags . in_error_pkt ) & & ( ( gint32 ) seq_number ! = p_t38_packet_conv_info - > last_seqnum ) )
2007-05-04 07:10:15 +00:00
tap_queue_packet ( t38_tap , actx - > pinfo , t38_info ) ;
2006-01-15 15:01:14 +00:00
2007-05-04 07:10:15 +00:00
if ( p_t38_conv ) p_t38_conv_info - > last_seqnum = ( gint32 ) seq_number ;
2006-01-15 15:01:14 +00:00
2007-05-04 07:10:15 +00:00
return offset ;
2003-09-11 13:36:04 +00:00
}
2007-05-04 07:10:15 +00:00
2003-09-11 13:36:04 +00:00
static int
2007-05-04 07:10:15 +00:00
dissect_t38_OpenType_IFPPacket ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_open_type ( tvb , offset , actx , tree , hf_index , dissect_t38_IFPPacket ) ;
2003-09-11 13:36:04 +00:00
2007-05-04 07:10:15 +00:00
return offset ;
2003-09-11 13:36:04 +00:00
}
2007-05-04 07:10:15 +00:00
static const per_sequence_t T_secondary_ifp_packets_sequence_of [ 1 ] = {
{ & hf_t38_secondary_ifp_packets_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL , dissect_t38_OpenType_IFPPacket } ,
2005-07-16 21:34:19 +00:00
} ;
2003-09-11 13:36:04 +00:00
static int
2007-05-04 07:10:15 +00:00
dissect_t38_T_secondary_ifp_packets ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence_of ( tvb , offset , actx , tree , hf_index ,
ett_t38_T_secondary_ifp_packets , T_secondary_ifp_packets_sequence_of ) ;
2003-09-11 13:36:04 +00:00
2007-05-04 07:10:15 +00:00
return offset ;
2003-09-11 13:36:04 +00:00
}
2007-05-04 07:10:15 +00:00
2003-09-11 13:36:04 +00:00
static int
2007-05-04 07:10:15 +00:00
dissect_t38_INTEGER ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_integer ( tvb , offset , actx , tree , hf_index , NULL ) ;
return offset ;
2003-09-11 13:36:04 +00:00
}
2007-05-04 07:10:15 +00:00
2003-09-11 13:36:04 +00:00
static int
2007-05-04 07:10:15 +00:00
dissect_t38_OCTET_STRING ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_octet_string ( tvb , offset , actx , tree , hf_index ,
2007-10-29 19:25:37 +00:00
NO_BOUND , NO_BOUND , FALSE , NULL ) ;
2007-05-04 07:10:15 +00:00
return offset ;
2003-09-11 13:36:04 +00:00
}
2007-05-04 07:10:15 +00:00
static const per_sequence_t T_fec_data_sequence_of [ 1 ] = {
{ & hf_t38_fec_data_item , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL , dissect_t38_OCTET_STRING } ,
2005-07-16 21:34:19 +00:00
} ;
2007-05-04 07:10:15 +00:00
2003-09-11 13:36:04 +00:00
static int
2007-05-04 07:10:15 +00:00
dissect_t38_T_fec_data ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence_of ( tvb , offset , actx , tree , hf_index ,
ett_t38_T_fec_data , T_fec_data_sequence_of ) ;
return offset ;
2003-09-11 13:36:04 +00:00
}
2007-05-04 07:10:15 +00:00
static const per_sequence_t T_fec_info_sequence [ ] = {
{ & hf_t38_fec_npackets , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL , dissect_t38_INTEGER } ,
{ & hf_t38_fec_data , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL , dissect_t38_T_fec_data } ,
{ NULL , 0 , 0 , NULL }
2003-09-11 13:36:04 +00:00
} ;
static int
2007-05-04 07:10:15 +00:00
dissect_t38_T_fec_info ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index ,
ett_t38_T_fec_info , T_fec_info_sequence ) ;
return offset ;
2003-09-11 13:36:04 +00:00
}
2007-05-04 07:10:15 +00:00
static const value_string t38_T_error_recovery_vals [ ] = {
{ 0 , " secondary-ifp-packets " } ,
{ 1 , " fec-info " } ,
{ 0 , NULL }
2003-09-11 13:36:04 +00:00
} ;
2007-05-04 07:10:15 +00:00
static const per_choice_t T_error_recovery_choice [ ] = {
{ 0 , & hf_t38_secondary_ifp_packets , ASN1_NO_EXTENSIONS , dissect_t38_T_secondary_ifp_packets } ,
{ 1 , & hf_t38_fec_info , ASN1_NO_EXTENSIONS , dissect_t38_T_fec_info } ,
{ 0 , NULL , 0 , NULL }
2003-09-11 13:36:04 +00:00
} ;
static int
2007-05-04 07:10:15 +00:00
dissect_t38_T_error_recovery ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2012-02-05 16:19:21 +00:00
# line 256 ".. / .. / asn1 / t38 / t38.cnf"
2007-05-04 07:10:15 +00:00
primary_part = FALSE ;
2004-01-09 23:24:54 +00:00
2007-05-04 07:10:15 +00:00
offset = dissect_per_choice ( tvb , offset , actx , tree , hf_index ,
ett_t38_T_error_recovery , T_error_recovery_choice ,
NULL ) ;
2004-01-09 23:24:54 +00:00
2012-02-05 16:19:21 +00:00
# line 258 ".. / .. / asn1 / t38 / t38.cnf"
2007-05-04 07:10:15 +00:00
primary_part = TRUE ;
2004-01-09 23:24:54 +00:00
2007-05-04 07:10:15 +00:00
return offset ;
2003-09-11 13:36:04 +00:00
}
2007-05-04 07:10:15 +00:00
2004-10-11 06:51:19 +00:00
static const per_sequence_t UDPTLPacket_sequence [ ] = {
2007-05-04 07:10:15 +00:00
{ & hf_t38_seq_number , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL , dissect_t38_T_seq_number } ,
{ & hf_t38_primary_ifp_packet , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL , dissect_t38_T_primary_ifp_packet } ,
{ & hf_t38_error_recovery , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL , dissect_t38_T_error_recovery } ,
{ NULL , 0 , 0 , NULL }
2003-09-11 13:36:04 +00:00
} ;
static int
2007-05-04 07:10:15 +00:00
dissect_t38_UDPTLPacket ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
2012-02-05 16:19:21 +00:00
# line 232 ".. / .. / asn1 / t38 / t38.cnf"
2003-09-11 13:36:04 +00:00
/* Initialize to something else than data type */
Data_Field_field_type_value = 1 ;
2007-05-04 07:10:15 +00:00
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index ,
ett_t38_UDPTLPacket , UDPTLPacket_sequence ) ;
return offset ;
}
/*--- PDUs ---*/
static int dissect_IFPPacket_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
int offset = 0 ;
asn1_ctx_t asn1_ctx ;
asn1_ctx_init ( & asn1_ctx , ASN1_ENC_PER , TRUE , pinfo ) ;
offset = dissect_t38_IFPPacket ( tvb , offset , & asn1_ctx , tree , hf_t38_IFPPacket_PDU ) ;
offset + = 7 ; offset > > = 3 ;
return offset ;
}
static int dissect_UDPTLPacket_PDU ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ ) {
int offset = 0 ;
asn1_ctx_t asn1_ctx ;
asn1_ctx_init ( & asn1_ctx , ASN1_ENC_PER , TRUE , pinfo ) ;
offset = dissect_t38_UDPTLPacket ( tvb , offset , & asn1_ctx , tree , hf_t38_UDPTLPacket_PDU ) ;
offset + = 7 ; offset > > = 3 ;
return offset ;
2003-09-11 13:36:04 +00:00
}
2007-05-04 07:10:15 +00:00
/*--- End of included file: packet-t38-fn.c ---*/
2011-09-27 12:05:32 +00:00
# line 394 ".. / .. / asn1 / t38 / packet-t38-template.c"
2007-05-04 07:10:15 +00:00
2006-01-23 07:12:26 +00:00
/* initialize the tap t38_info and the conversation */
2003-09-11 13:36:04 +00:00
static void
2006-01-23 07:12:26 +00:00
init_t38_info_conv ( packet_info * pinfo )
2003-09-11 13:36:04 +00:00
{
2006-01-15 15:01:14 +00:00
/* tap info */
t38_info_current + + ;
if ( t38_info_current = = MAX_T38_MESSAGES_IN_PACKET ) {
t38_info_current = 0 ;
}
t38_info = & t38_info_arr [ t38_info_current ] ;
t38_info - > seq_num = 0 ;
t38_info - > type_msg = 0 ;
t38_info - > data_value = 0 ;
t38_info - > t30ind_value = 0 ;
t38_info - > setup_frame_number = 0 ;
t38_info - > Data_Field_field_type_value = 0 ;
t38_info - > desc [ 0 ] = ' \0 ' ;
t38_info - > desc_comment [ 0 ] = ' \0 ' ;
t38_info - > time_first_t4_data = 0 ;
t38_info - > frame_num_first_t4_data = 0 ;
2003-09-11 13:36:04 +00:00
2006-01-15 15:01:14 +00:00
/*
p_t38_packet_conv hold the conversation info in each of the packets .
p_t38_conv hold the conversation info used to reassemble the HDLC packets , and also the Setup info ( e . g SDP )
If we already have p_t38_packet_conv in the packet , it means we already reassembled the HDLC packets , so we don ' t
need to use p_t38_conv
*/
p_t38_packet_conv = NULL ;
p_t38_conv = NULL ;
/* Use existing packet info if available */
2006-01-22 23:14:58 +00:00
p_t38_packet_conv = p_get_proto_data ( pinfo - > fd , proto_t38 ) ;
2006-01-15 15:01:14 +00:00
/* find the conversation used for Reassemble and Setup Info */
2009-08-26 15:10:31 +00:00
p_conv = find_conversation ( pinfo - > fd - > num , & pinfo - > net_dst , & pinfo - > net_src ,
2006-01-15 15:01:14 +00:00
pinfo - > ptype ,
2009-08-26 15:10:31 +00:00
pinfo - > destport , pinfo - > srcport , NO_ADDR_B | NO_PORT_B ) ;
2006-01-15 15:01:14 +00:00
/* create a conv if it doen't exist */
if ( ! p_conv ) {
p_conv = conversation_new ( pinfo - > fd - > num , & pinfo - > net_src , & pinfo - > net_dst ,
pinfo - > ptype , pinfo - > srcport , pinfo - > destport , NO_ADDR_B | NO_PORT_B ) ;
/* Set dissector */
2006-01-22 23:14:58 +00:00
conversation_set_dissector ( p_conv , t38_udp_handle ) ;
2006-01-15 15:01:14 +00:00
}
if ( ! p_t38_packet_conv ) {
p_t38_conv = conversation_get_proto_data ( p_conv , proto_t38 ) ;
/* create the conversation if it doen't exist */
if ( ! p_t38_conv ) {
p_t38_conv = se_alloc ( sizeof ( t38_conv ) ) ;
2006-01-22 23:14:58 +00:00
p_t38_conv - > setup_method [ 0 ] = ' \0 ' ;
p_t38_conv - > setup_frame_number = 0 ;
2006-01-15 15:01:14 +00:00
p_t38_conv - > src_t38_info . reass_ID = 0 ;
p_t38_conv - > src_t38_info . reass_start_seqnum = - 1 ;
p_t38_conv - > src_t38_info . reass_data_type = 0 ;
p_t38_conv - > src_t38_info . last_seqnum = - 1 ;
p_t38_conv - > src_t38_info . packet_lost = 0 ;
p_t38_conv - > src_t38_info . burst_lost = 0 ;
p_t38_conv - > src_t38_info . time_first_t4_data = 0 ;
2012-02-05 16:19:21 +00:00
p_t38_conv - > src_t38_info . additional_hdlc_data_field_counter = 0 ;
p_t38_conv - > src_t38_info . seqnum_prev_data_field = - 1 ;
2006-01-15 15:01:14 +00:00
p_t38_conv - > dst_t38_info . reass_ID = 0 ;
p_t38_conv - > dst_t38_info . reass_start_seqnum = - 1 ;
p_t38_conv - > dst_t38_info . reass_data_type = 0 ;
p_t38_conv - > dst_t38_info . last_seqnum = - 1 ;
p_t38_conv - > dst_t38_info . packet_lost = 0 ;
p_t38_conv - > dst_t38_info . burst_lost = 0 ;
p_t38_conv - > dst_t38_info . time_first_t4_data = 0 ;
2012-02-05 16:19:21 +00:00
p_t38_conv - > dst_t38_info . additional_hdlc_data_field_counter = 0 ;
p_t38_conv - > dst_t38_info . seqnum_prev_data_field = - 1 ;
2006-01-15 15:01:14 +00:00
conversation_add_proto_data ( p_conv , proto_t38 , p_t38_conv ) ;
}
/* copy the t38 conversation info to the packet t38 conversation */
p_t38_packet_conv = se_alloc ( sizeof ( t38_conv ) ) ;
2008-03-01 17:23:39 +00:00
g_strlcpy ( p_t38_packet_conv - > setup_method , p_t38_conv - > setup_method , MAX_T38_SETUP_METHOD_SIZE ) ;
2006-01-22 23:14:58 +00:00
p_t38_packet_conv - > setup_frame_number = p_t38_conv - > setup_frame_number ;
2006-01-15 15:01:14 +00:00
memcpy ( & ( p_t38_packet_conv - > src_t38_info ) , & ( p_t38_conv - > src_t38_info ) , sizeof ( t38_conv_info ) ) ;
memcpy ( & ( p_t38_packet_conv - > dst_t38_info ) , & ( p_t38_conv - > dst_t38_info ) , sizeof ( t38_conv_info ) ) ;
p_add_proto_data ( pinfo - > fd , proto_t38 , p_t38_packet_conv ) ;
}
if ( ADDRESSES_EQUAL ( & p_conv - > key_ptr - > addr1 , & pinfo - > net_src ) ) {
p_t38_conv_info = & ( p_t38_conv - > src_t38_info ) ;
p_t38_packet_conv_info = & ( p_t38_packet_conv - > src_t38_info ) ;
} else {
p_t38_conv_info = & ( p_t38_conv - > dst_t38_info ) ;
p_t38_packet_conv_info = & ( p_t38_packet_conv - > dst_t38_info ) ;
}
2006-01-23 07:12:26 +00:00
/* update t38_info */
t38_info - > setup_frame_number = p_t38_packet_conv - > setup_frame_number ;
}
/* Entry point for dissection */
static void
dissect_t38_udp ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree )
{
guint8 octet1 ;
proto_item * it ;
proto_tree * tr ;
guint32 offset = 0 ;
/*
* XXX - heuristic to check for misidentified packets .
*/
if ( dissect_possible_rtpv2_packets_as_rtp ) {
octet1 = tvb_get_guint8 ( tvb , offset ) ;
if ( RTP_VERSION ( octet1 ) = = 2 ) {
call_dissector ( rtp_handle , tvb , pinfo , tree ) ;
return ;
}
}
2009-08-09 07:59:51 +00:00
col_set_str ( pinfo - > cinfo , COL_PROTOCOL , " T.38 " ) ;
2009-08-09 08:14:59 +00:00
col_clear ( pinfo - > cinfo , COL_INFO ) ;
2006-01-23 07:12:26 +00:00
primary_part = TRUE ;
/* This indicate the item number in the primary part of the T38 message, it is used for the reassemble of T30 packets */
Data_Field_item_num = 0 ;
it = proto_tree_add_protocol_format ( tree , proto_t38 , tvb , 0 , - 1 , " ITU-T Recommendation T.38 " ) ;
tr = proto_item_add_subtree ( it , ett_t38 ) ;
/* init tap and conv info */
init_t38_info_conv ( pinfo ) ;
2006-01-22 23:14:58 +00:00
/* Show Conversation setup info if exists*/
if ( global_t38_show_setup_info ) {
2007-03-21 08:32:15 +00:00
show_setup_info ( tvb , tr , p_t38_packet_conv ) ;
2006-01-15 15:01:14 +00:00
}
2009-09-24 20:00:21 +00:00
col_append_str ( pinfo - > cinfo , COL_INFO , " UDP: UDPTLPacket " ) ;
2004-01-09 23:24:54 +00:00
2007-05-04 07:10:15 +00:00
offset = dissect_UDPTLPacket_PDU ( tvb , pinfo , tr ) ;
2003-09-11 13:36:04 +00:00
2007-05-04 07:10:15 +00:00
if ( tvb_length_remaining ( tvb , offset ) > 0 ) {
2006-01-23 07:12:26 +00:00
if ( tr ) {
2004-01-26 22:16:43 +00:00
proto_tree_add_text ( tr , tvb , offset , tvb_reported_length_remaining ( tvb , offset ) ,
" [MALFORMED PACKET or wrong preference settings] " ) ;
}
2009-09-24 20:00:21 +00:00
col_append_str ( pinfo - > cinfo , COL_INFO , " [Malformed?] " ) ;
2004-01-26 22:16:43 +00:00
}
2003-09-11 13:36:04 +00:00
}
static void
2004-01-26 22:52:22 +00:00
dissect_t38_tcp_pdu ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree )
2003-09-11 13:36:04 +00:00
{
2004-01-26 22:52:22 +00:00
proto_item * it ;
2003-09-11 13:36:04 +00:00
proto_tree * tr ;
2004-01-26 22:52:22 +00:00
guint32 offset = 0 ;
2007-05-04 07:10:15 +00:00
tvbuff_t * next_tvb ;
2004-01-26 22:16:43 +00:00
guint16 ifp_packet_number = 1 ;
2005-10-04 14:41:39 +00:00
2009-08-09 07:59:51 +00:00
col_set_str ( pinfo - > cinfo , COL_PROTOCOL , " T.38 " ) ;
2009-08-09 08:14:59 +00:00
col_clear ( pinfo - > cinfo , COL_INFO ) ;
2003-09-11 13:36:04 +00:00
2006-01-23 07:12:26 +00:00
primary_part = TRUE ;
/* This indicate the item number in the primary part of the T38 message, it is used for the reassemble of T30 packets */
Data_Field_item_num = 0 ;
it = proto_tree_add_protocol_format ( tree , proto_t38 , tvb , 0 , - 1 , " ITU-T Recommendation T.38 " ) ;
2003-09-11 13:36:04 +00:00
tr = proto_item_add_subtree ( it , ett_t38 ) ;
2006-01-23 07:12:26 +00:00
/* init tap and conv info */
init_t38_info_conv ( pinfo ) ;
/* Show Conversation setup info if exists*/
if ( global_t38_show_setup_info ) {
2007-03-21 08:32:15 +00:00
show_setup_info ( tvb , tr , p_t38_packet_conv ) ;
2006-01-23 07:12:26 +00:00
}
2009-09-24 20:00:21 +00:00
col_append_str ( pinfo - > cinfo , COL_INFO , " TCP: IFPPacket " ) ;
2004-01-09 23:24:54 +00:00
2007-05-04 07:10:15 +00:00
while ( tvb_length_remaining ( tvb , offset ) > 0 )
2004-01-26 22:16:43 +00:00
{
2009-08-16 12:36:22 +00:00
next_tvb = tvb_new_subset_remaining ( tvb , offset ) ;
2007-05-04 07:10:15 +00:00
offset + = dissect_IFPPacket_PDU ( next_tvb , pinfo , tr ) ;
2004-01-26 22:16:43 +00:00
ifp_packet_number + + ;
2007-05-04 07:10:15 +00:00
if ( tvb_length_remaining ( tvb , offset ) > 0 ) {
2004-01-26 22:16:43 +00:00
if ( t38_tpkt_usage = = T38_TPKT_ALWAYS ) {
if ( tr ) {
proto_tree_add_text ( tr , tvb , offset , tvb_reported_length_remaining ( tvb , offset ) ,
" [MALFORMED PACKET or wrong preference settings] " ) ;
}
2009-09-24 20:00:21 +00:00
col_append_str ( pinfo - > cinfo , COL_INFO , " [Malformed?] " ) ;
2004-01-26 22:16:43 +00:00
break ;
2011-09-27 12:05:32 +00:00
} else {
col_append_fstr ( pinfo - > cinfo , COL_INFO , " IFPPacket#%u " , ifp_packet_number ) ;
2004-01-26 22:16:43 +00:00
}
}
}
2003-09-11 13:36:04 +00:00
}
static void
2004-01-26 22:52:22 +00:00
dissect_t38_tcp ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree )
2003-09-11 13:36:04 +00:00
{
2004-01-09 23:24:54 +00:00
primary_part = TRUE ;
2004-01-26 22:52:22 +00:00
if ( t38_tpkt_usage = = T38_TPKT_ALWAYS ) {
dissect_tpkt_encap ( tvb , pinfo , tree , t38_tpkt_reassembly , t38_tcp_pdu_handle ) ;
}
else if ( ( t38_tpkt_usage = = T38_TPKT_NEVER ) | | ( is_tpkt ( tvb , 1 ) = = - 1 ) ) {
dissect_t38_tcp_pdu ( tvb , pinfo , tree ) ;
}
else {
dissect_tpkt_encap ( tvb , pinfo , tree , t38_tpkt_reassembly , t38_tcp_pdu_handle ) ;
}
}
static void
dissect_t38 ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree )
{
2003-09-11 13:36:04 +00:00
if ( pinfo - > ipproto = = IP_PROTO_TCP )
{
2004-01-26 22:52:22 +00:00
dissect_t38_tcp ( tvb , pinfo , tree ) ;
2003-09-11 13:36:04 +00:00
}
else if ( pinfo - > ipproto = = IP_PROTO_UDP )
2004-01-09 23:24:54 +00:00
{
2003-09-11 13:36:04 +00:00
dissect_t38_udp ( tvb , pinfo , tree ) ;
}
}
2004-10-22 06:19:00 +00:00
/* Look for conversation info and display any setup info found */
2007-03-21 08:32:15 +00:00
void
2010-01-22 16:34:54 +00:00
show_setup_info ( tvbuff_t * tvb , proto_tree * tree , t38_conv * p_t38_conversation )
2004-10-22 06:19:00 +00:00
{
2006-01-15 15:01:14 +00:00
proto_tree * t38_setup_tree ;
proto_item * ti ;
2004-10-22 06:19:00 +00:00
2010-01-22 16:34:54 +00:00
if ( ! p_t38_conversation | | p_t38_conversation - > setup_frame_number = = 0 ) {
2006-01-15 15:01:14 +00:00
/* there is no Setup info */
return ;
}
2004-10-22 06:19:00 +00:00
2006-01-15 15:01:14 +00:00
ti = proto_tree_add_string_format ( tree , hf_t38_setup , tvb , 0 , 0 ,
" " ,
" Stream setup by %s (frame %u) " ,
2010-01-22 16:34:54 +00:00
p_t38_conversation - > setup_method ,
p_t38_conversation - > setup_frame_number ) ;
2006-01-15 15:01:14 +00:00
PROTO_ITEM_SET_GENERATED ( ti ) ;
t38_setup_tree = proto_item_add_subtree ( ti , ett_t38_setup ) ;
if ( t38_setup_tree )
{
/* Add details into subtree */
proto_item * item = proto_tree_add_uint ( t38_setup_tree , hf_t38_setup_frame ,
2010-01-22 16:34:54 +00:00
tvb , 0 , 0 , p_t38_conversation - > setup_frame_number ) ;
2006-01-15 15:01:14 +00:00
PROTO_ITEM_SET_GENERATED ( item ) ;
item = proto_tree_add_string ( t38_setup_tree , hf_t38_setup_method ,
2010-01-22 16:34:54 +00:00
tvb , 0 , 0 , p_t38_conversation - > setup_method ) ;
2006-01-15 15:01:14 +00:00
PROTO_ITEM_SET_GENERATED ( item ) ;
}
2004-10-22 06:19:00 +00:00
}
2006-05-21 04:49:01 +00:00
/* Wireshark Protocol Registration */
2003-09-11 13:36:04 +00:00
void
proto_register_t38 ( void )
{
static hf_register_info hf [ ] =
{
2007-05-04 07:10:15 +00:00
/*--- Included file: packet-t38-hfarr.c ---*/
2011-04-12 20:45:25 +00:00
# line 1 ".. / .. / asn1 / t38 / packet-t38-hfarr.c"
2007-05-04 07:10:15 +00:00
{ & hf_t38_IFPPacket_PDU ,
{ " IFPPacket " , " t38.IFPPacket " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2010-05-11 02:58:27 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_UDPTLPacket_PDU ,
{ " UDPTLPacket " , " t38.UDPTLPacket " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2010-05-11 02:58:27 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_type_of_msg ,
{ " type-of-msg " , " t38.type_of_msg " ,
FT_UINT32 , BASE_DEC , VALS ( t38_Type_of_msg_vals ) , 0 ,
2010-05-11 02:58:27 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_data_field ,
{ " data-field " , " t38.data_field " ,
FT_UINT32 , BASE_DEC , NULL , 0 ,
2010-05-11 02:58:27 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_t30_indicator ,
{ " t30-indicator " , " t38.t30_indicator " ,
FT_UINT32 , BASE_DEC , VALS ( t38_T30_indicator_vals ) , 0 ,
2010-05-11 02:58:27 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_t30_data ,
{ " t30-data " , " t38.t30_data " ,
FT_UINT32 , BASE_DEC , VALS ( t38_T30_data_vals ) , 0 ,
2010-05-11 02:58:27 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_Data_Field_item ,
2009-05-16 22:07:03 +00:00
{ " Data-Field item " , " t38.Data_Field_item " ,
2007-05-04 07:10:15 +00:00
FT_NONE , BASE_NONE , NULL , 0 ,
2010-05-11 03:53:31 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_field_type ,
{ " field-type " , " t38.field_type " ,
FT_UINT32 , BASE_DEC , VALS ( t38_T_field_type_vals ) , 0 ,
2010-05-11 03:53:31 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_field_data ,
{ " field-data " , " t38.field_data " ,
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
FT_BYTES , BASE_NONE , NULL , 0 ,
2010-05-11 03:53:31 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_seq_number ,
{ " seq-number " , " t38.seq_number " ,
FT_UINT32 , BASE_DEC , NULL , 0 ,
2010-05-11 03:53:31 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_primary_ifp_packet ,
{ " primary-ifp-packet " , " t38.primary_ifp_packet " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2010-05-11 03:53:31 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_error_recovery ,
{ " error-recovery " , " t38.error_recovery " ,
FT_UINT32 , BASE_DEC , VALS ( t38_T_error_recovery_vals ) , 0 ,
2010-05-11 03:53:31 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_secondary_ifp_packets ,
{ " secondary-ifp-packets " , " t38.secondary_ifp_packets " ,
FT_UINT32 , BASE_DEC , NULL , 0 ,
2010-05-11 03:53:31 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_secondary_ifp_packets_item ,
2009-05-16 22:07:03 +00:00
{ " secondary-ifp-packets item " , " t38.secondary_ifp_packets_item " ,
2007-05-04 07:10:15 +00:00
FT_NONE , BASE_NONE , NULL , 0 ,
2010-05-11 02:58:27 +00:00
" OpenType_IFPPacket " , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_fec_info ,
{ " fec-info " , " t38.fec_info " ,
FT_NONE , BASE_NONE , NULL , 0 ,
2010-05-11 03:53:31 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_fec_npackets ,
{ " fec-npackets " , " t38.fec_npackets " ,
FT_INT32 , BASE_DEC , NULL , 0 ,
2010-05-11 02:58:27 +00:00
" INTEGER " , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_fec_data ,
{ " fec-data " , " t38.fec_data " ,
FT_UINT32 , BASE_DEC , NULL , 0 ,
2010-05-11 03:53:31 +00:00
NULL , HFILL } } ,
2007-05-04 07:10:15 +00:00
{ & hf_t38_fec_data_item ,
2009-05-16 22:07:03 +00:00
{ " fec-data item " , " t38.fec_data_item " ,
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
FT_BYTES , BASE_NONE , NULL , 0 ,
2010-05-11 02:58:27 +00:00
" OCTET_STRING " , HFILL } } ,
2007-05-04 07:10:15 +00:00
/*--- End of included file: packet-t38-hfarr.c ---*/
2012-02-05 16:19:21 +00:00
# line 673 ".. / .. / asn1 / t38 / packet-t38-template.c"
2006-01-15 15:01:14 +00:00
{ & hf_t38_setup ,
{ " Stream setup " , " t38.setup " , FT_STRING , BASE_NONE ,
NULL , 0x0 , " Stream setup, method and frame number " , HFILL } } ,
{ & hf_t38_setup_frame ,
2004-10-22 06:19:00 +00:00
{ " Stream frame " , " t38.setup-frame " , FT_FRAMENUM , BASE_NONE ,
NULL , 0x0 , " Frame that set up this stream " , HFILL } } ,
{ & hf_t38_setup_method ,
{ " Stream Method " , " t38.setup-method " , FT_STRING , BASE_NONE ,
NULL , 0x0 , " Method used to set up this stream " , HFILL } } ,
2008-04-20 13:24:58 +00:00
{ & hf_t38_fragments ,
{ " Message fragments " , " t38.fragments " ,
2006-01-15 15:01:14 +00:00
FT_NONE , BASE_NONE , NULL , 0x00 , NULL , HFILL } } ,
2008-04-20 13:24:58 +00:00
{ & hf_t38_fragment ,
{ " Message fragment " , " t38.fragment " ,
2006-01-15 15:01:14 +00:00
FT_FRAMENUM , BASE_NONE , NULL , 0x00 , NULL , HFILL } } ,
2008-04-20 13:24:58 +00:00
{ & hf_t38_fragment_overlap ,
{ " Message fragment overlap " , " t38.fragment.overlap " ,
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
FT_BOOLEAN , BASE_NONE , NULL , 0x0 , NULL , HFILL } } ,
2008-04-20 13:24:58 +00:00
{ & hf_t38_fragment_overlap_conflicts ,
2006-01-15 15:01:14 +00:00
{ " Message fragment overlapping with conflicting data " ,
2008-04-20 13:24:58 +00:00
" t38.fragment.overlap.conflicts " ,
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
FT_BOOLEAN , BASE_NONE , NULL , 0x0 , NULL , HFILL } } ,
2008-04-20 13:24:58 +00:00
{ & hf_t38_fragment_multiple_tails ,
2006-01-15 15:01:14 +00:00
{ " Message has multiple tail fragments " ,
2008-04-20 13:24:58 +00:00
" t38.fragment.multiple_tails " ,
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
FT_BOOLEAN , BASE_NONE , NULL , 0x0 , NULL , HFILL } } ,
2008-04-20 13:24:58 +00:00
{ & hf_t38_fragment_too_long_fragment ,
{ " Message fragment too long " , " t38.fragment.too_long_fragment " ,
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
FT_BOOLEAN , BASE_NONE , NULL , 0x0 , NULL , HFILL } } ,
2008-04-20 13:24:58 +00:00
{ & hf_t38_fragment_error ,
{ " Message defragmentation error " , " t38.fragment.error " ,
2006-01-15 15:01:14 +00:00
FT_FRAMENUM , BASE_NONE , NULL , 0x00 , NULL , HFILL } } ,
2011-01-30 21:01:07 +00:00
{ & hf_t38_fragment_count ,
{ " Message fragment count " , " t38.fragment.count " ,
FT_UINT32 , BASE_DEC , NULL , 0x00 , NULL , HFILL } } ,
2008-04-20 13:24:58 +00:00
{ & hf_t38_reassembled_in ,
{ " Reassembled in " , " t38.reassembled.in " ,
2006-01-15 15:01:14 +00:00
FT_FRAMENUM , BASE_NONE , NULL , 0x00 , NULL , HFILL } } ,
2010-02-02 16:01:52 +00:00
{ & hf_t38_reassembled_length ,
2010-02-06 18:20:21 +00:00
{ " Reassembled T38 length " , " t38.reassembled.length " ,
2010-02-02 16:01:52 +00:00
FT_UINT32 , BASE_DEC , NULL , 0x00 , NULL , HFILL } } ,
2006-01-15 15:01:14 +00:00
} ;
2003-09-11 13:36:04 +00:00
static gint * ett [ ] =
{
& ett_t38 ,
2007-05-04 07:10:15 +00:00
/*--- Included file: packet-t38-ettarr.c ---*/
2011-04-12 20:45:25 +00:00
# line 1 ".. / .. / asn1 / t38 / packet-t38-ettarr.c"
2007-05-04 07:10:15 +00:00
& ett_t38_IFPPacket ,
& ett_t38_Type_of_msg ,
& ett_t38_Data_Field ,
& ett_t38_Data_Field_item ,
& ett_t38_UDPTLPacket ,
& ett_t38_T_error_recovery ,
& ett_t38_T_secondary_ifp_packets ,
& ett_t38_T_fec_info ,
& ett_t38_T_fec_data ,
/*--- End of included file: packet-t38-ettarr.c ---*/
2012-02-05 16:19:21 +00:00
# line 720 ".. / .. / asn1 / t38 / packet-t38-template.c"
2004-10-22 06:19:00 +00:00
& ett_t38_setup ,
2006-01-15 15:01:14 +00:00
& ett_data_fragment ,
& ett_data_fragments
2003-09-11 13:36:04 +00:00
} ;
2006-01-15 15:01:14 +00:00
2004-01-09 23:24:54 +00:00
module_t * t38_module ;
2003-09-11 13:36:04 +00:00
2004-10-22 06:19:00 +00:00
proto_t38 = proto_register_protocol ( " T.38 " , " T.38 " , " t38 " ) ;
2003-09-11 13:36:04 +00:00
proto_register_field_array ( proto_t38 , hf , array_length ( hf ) ) ;
proto_register_subtree_array ( ett , array_length ( ett ) ) ;
register_dissector ( " t38 " , dissect_t38 , proto_t38 ) ;
2004-01-09 23:24:54 +00:00
2006-01-15 15:01:14 +00:00
/* Init reassemble tables for HDLC */
2008-11-04 22:28:52 +00:00
register_init_routine ( t38_defragment_init ) ;
2006-01-15 15:01:14 +00:00
2005-10-03 05:55:26 +00:00
t38_tap = register_tap ( " t38 " ) ;
2004-01-09 23:24:54 +00:00
t38_module = prefs_register_protocol ( proto_t38 , proto_reg_handoff_t38 ) ;
prefs_register_bool_preference ( t38_module , " use_pre_corrigendum_asn1_specification " ,
" Use the Pre-Corrigendum ASN.1 specification " ,
" Whether the T.38 dissector should decode using the Pre-Corrigendum T.38 "
" ASN.1 specification (1998). " ,
& use_pre_corrigendum_asn1_specification ) ;
prefs_register_bool_preference ( t38_module , " dissect_possible_rtpv2_packets_as_rtp " ,
" Dissect possible RTP version 2 packets with RTP dissector " ,
" Whether a UDP packet that looks like RTP version 2 packet will "
" be dissected as RTP packet or T.38 packet. If enabled there is a risk that T.38 UDPTL "
" packets with sequence number higher than 32767 may be dissected as RTP. " ,
& dissect_possible_rtpv2_packets_as_rtp ) ;
prefs_register_uint_preference ( t38_module , " tcp.port " ,
" T.38 TCP Port " ,
" Set the TCP port for T.38 messages " ,
10 , & global_t38_tcp_port ) ;
prefs_register_uint_preference ( t38_module , " udp.port " ,
" T.38 UDP Port " ,
" Set the UDP port for T.38 messages " ,
10 , & global_t38_udp_port ) ;
2004-01-26 22:16:43 +00:00
prefs_register_bool_preference ( t38_module , " reassembly " ,
" Reassemble T.38 PDUs over TPKT over TCP " ,
" Whether the dissector should reassemble T.38 PDUs spanning multiple TCP segments "
2004-08-21 09:02:52 +00:00
" when TPKT is used over TCP. "
2008-11-04 22:28:52 +00:00
" To use this option, you must also enable \" Allow subdissectors to reassemble "
" TCP streams \" in the TCP protocol settings. " ,
2004-01-26 22:16:43 +00:00
& t38_tpkt_reassembly ) ;
prefs_register_enum_preference ( t38_module , " tpkt_usage " ,
" TPKT used over TCP " ,
" Whether T.38 is used with TPKT for TCP " ,
( gint * ) & t38_tpkt_usage , t38_tpkt_options , FALSE ) ;
2004-10-22 06:19:00 +00:00
prefs_register_bool_preference ( t38_module , " show_setup_info " ,
" Show stream setup information " ,
" Where available, show which protocol and frame caused "
" this T.38 stream to be created " ,
& global_t38_show_setup_info ) ;
2003-09-11 13:36:04 +00:00
}
void
proto_reg_handoff_t38 ( void )
{
2008-11-04 22:28:52 +00:00
static gboolean t38_prefs_initialized = FALSE ;
static guint tcp_port ;
static guint udp_port ;
2004-01-09 23:24:54 +00:00
if ( ! t38_prefs_initialized ) {
2004-01-26 22:52:22 +00:00
t38_udp_handle = create_dissector_handle ( dissect_t38_udp , proto_t38 ) ;
t38_tcp_handle = create_dissector_handle ( dissect_t38_tcp , proto_t38 ) ;
t38_tcp_pdu_handle = create_dissector_handle ( dissect_t38_tcp_pdu , proto_t38 ) ;
2008-11-04 22:28:52 +00:00
rtp_handle = find_dissector ( " rtp " ) ;
t30_hdlc_handle = find_dissector ( " t30.hdlc " ) ;
data_handle = find_dissector ( " data " ) ;
2004-01-09 23:24:54 +00:00
t38_prefs_initialized = TRUE ;
}
else {
2010-12-20 05:35:29 +00:00
dissector_delete_uint ( " tcp.port " , tcp_port , t38_tcp_handle ) ;
dissector_delete_uint ( " udp.port " , udp_port , t38_udp_handle ) ;
2004-01-09 23:24:54 +00:00
}
tcp_port = global_t38_tcp_port ;
udp_port = global_t38_udp_port ;
2010-12-20 05:35:29 +00:00
dissector_add_uint ( " tcp.port " , tcp_port , t38_tcp_handle ) ;
dissector_add_uint ( " udp.port " , udp_port , t38_udp_handle ) ;
2004-01-09 23:24:54 +00:00
2003-09-11 13:36:04 +00:00
}
2006-01-15 15:01:14 +00:00