func: static dissect_iax2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item * iax2_item ; proto_tree * iax2_tree ; guint32 offset = 0 , len ; guint16 scallno = 0 ; guint16 stmp ; packet_type type ; proto_item * full_mini_base ; iax2_item = proto_tree_add_item ( tree , proto_iax2 , tvb , offset , - 1 , ENC_NA ); iax2_tree = proto_item_add_subtree ( iax2_item , ett_iax2 ); stmp = tvb_get_ntohs ( tvb , offset ); if ( stmp == 0 )  offset += 2; stmp = tvb_get_ntohs ( tvb , offset ); if ( stmp & 0x8000 )  type = IAX2_MINI_VIDEO_PACKET; scallno = stmp & 0x7FFF; offset += 2; type = IAX2_TRUNK_PACKET; scallno = tvb_get_ntohs ( tvb , offset ); offset += 2; if ( scallno & 0x8000 )  type = IAX2_FULL_PACKET; type = IAX2_MINI_VOICE_PACKET; scallno &= 0x7FFF; full_mini_base = proto_tree_add_uint ( iax2_tree , hf_iax2_packet_type , tvb , 0 , offset , type ); full_mini_subtree = proto_item_add_subtree ( full_mini_base , ett_iax2_full_mini_subtree ); switch ( type )  len = dissect_fullpacket ( tvb , offset , scallno , pinfo , full_mini_subtree , tree ); static dissect_fullpacket(tvbuff_t *tvb, guint32 guint16 packet_info *pinfo, proto_tree proto_tree *main_tree) guint16 dcallno ; guint32 ts ; guint8 type ; guint8 csub ; guint32 codec ; proto_tree * packet_type_tree = NULL ; iax_call_data * iax_call ; iax_packet_data * iax_packet ; gboolean reversed ; dcallno = tvb_get_ntohs ( tvb , offset ) & 0x7FFF; ts = tvb_get_ntohl ( tvb , offset + 2 ); type = tvb_get_guint8 ( tvb , offset + 8 ); csub = tvb_get_guint8 ( tvb , offset + 9 ); iax_packet = ( iax_packet_data * ) p_get_proto_data ( wmem_file_scope ( ) , pinfo , proto_iax2 , 0 ); if ( ! iax_packet )  if ( type == AST_FRAME_IAX && csub == IAX_COMMAND_NEW )  iax_call = iax_new_call ( pinfo , scallno ); static iax_call_data *iax_new_call( packet_info guint32 scallno) iax_call_data * call ; call = wmem_new ( wmem_file_scope ( ) , iax_call_data ); call -> dataformat = AST_DATAFORMAT_NULL; call -> src_codec = 0; call -> dst_codec = 0; call -> n_forward_circuit_ids = 0; call -> n_reverse_circuit_ids = 0; call -> subdissector = NULL; call -> start_time = pinfo -> fd -> abs_ts; return call ; reversed = FALSE; iax_call = iax_lookup_call ( pinfo , scallno , dcallno , & reversed ); static iax_call_data *iax_lookup_call( packet_info guint32 guint32 gboolean *reversed_p) iax_call_data * iax_call = NULL ; guint src_circuit_id ; src_circuit_id = iax_circuit_lookup ( & pinfo -> src , pinfo -> ptype , pinfo -> srcport , scallno ); if ( dcallno != 0 )  guint dst_circuit_id ; dst_circuit_id = iax_circuit_lookup ( & pinfo -> dst , pinfo -> ptype , pinfo -> destport , dcallno ); iax_call = iax_lookup_call_from_dest ( pinfo , NULL , src_circuit_id , dst_circuit_id , pinfo -> fd -> num , & reversed ); circuit_t * src_circuit ; src_circuit = find_circuit ( CT_IAX2 , src_circuit_id , pinfo -> fd -> num ); if ( src_circuit )  iax_call = ( iax_call_data * ) circuit_get_proto_data ( src_circuit , proto_iax2 ); return iax_call ; iax_packet = iax_new_packet_data ( iax_call , reversed ); static iax_packet_data *iax_new_packet_data(iax_call_data *call, gboolean reversed) iax_packet_data * p = wmem_new ( wmem_file_scope ( ) , iax_packet_data ) ; p -> first_time = TRUE; p -> call_data = call; p -> codec = 0; p -> reversed = reversed; p -> abstime . secs = - 1; p -> abstime . nsecs = - 1; return p ; if ( iax2_tree )  proto_item * packet_type_base ; packet_type_base = proto_tree_add_uint ( iax2_tree , hf_iax2_type , tvb , offset + 8 , 1 , type ); packet_type_tree = proto_item_add_subtree ( packet_type_base , ett_iax2_type ); switch ( type )  offset = dissect_iax2_command ( tvb , offset + 9 , pinfo , packet_type_tree , iax_packet ); static guint32 dissect_iax2_command(tvbuff_t *tvb, guint32 packet_info *pinfo, proto_tree iax_packet_data *iax_packet) guint8 csub = tvb_get_guint8 ( tvb , offset ) ; guint8 address_data [ MAX_ADDRESS ] ; proto_item * ti ; iax2_ie_data ie_data ; ie_data . peer_address . type = AT_NONE; ie_data . peer_address . len = 0; ie_data . peer_address . data = address_data; ie_data . peer_ptype = PT_NONE; ie_data . peer_port = 0; ie_data . peer_callno = 0; ie_data . dataformat = ( guint32 ) - 1; ti = proto_tree_add_uint ( tree , hf_iax2_iax_csub , tvb , offset , 1 , csub ); offset ++; if ( offset >= tvb_reported_length ( tvb ) )  return offset ; offset = dissect_ies ( tvb , pinfo , offset , tree , ti , & ie_data ); static guint32 dissect_ies(tvbuff_t *tvb, packet_info *pinfo, guint32 proto_tree *iax_tree, proto_item * iax2_ie_data *ie_data) while ( offset < tvb_reported_length ( tvb ) )  int ies_len = tvb_get_guint8 ( tvb , offset + 1 ) ; offset += ies_len + 2; return offset ; return offset ; offset += 10; offset += 10; iax_packet -> codec = codec = uncompress_subclass ( csub ); static guint32 uncompress_subclass(guint8 csub) if ( csub & 0x80 )  if ( csub == 0xff )  return ( guint32 ) - 1 ; return 1 << ( csub & 0x1F ) ; return ( guint32 ) csub ; offset += 10; iax_packet -> codec = codec = uncompress_subclass ( ( guint8 ) ( csub & ~40 ) ); static guint32 uncompress_subclass(guint8 csub) if ( csub & 0x80 )  if ( csub == 0xff )  return ( guint32 ) - 1 ; return 1 << ( csub & 0x1F ) ; return ( guint32 ) csub ; offset += 10; dissect_payload ( tvb , offset , pinfo , iax2_tree , main_tree , ts , TRUE , iax_packet ); static void dissect_payload(tvbuff_t *tvb, guint32 packet_info *pinfo, proto_tree proto_tree *tree, guint32 ts _U_, gboolean iax_packet_data *iax_packet) tvbuff_t * sub_tvb ; if ( offset >= tvb_reported_length ( tvb ) )  sub_tvb = tvb_new_subset_remaining ( tvb , offset ); if ( iax_packet -> call_data )  process_iax_pdu ( sub_tvb , pinfo , tree , video , iax_packet ); static void process_iax_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree gboolean video, iax_packet_data *iax_packet) iax_call_data * iax_call = iax_packet -> call_data ; if ( ! video && iax_call && iax_call -> subdissector )  iax2_dissector_info_t dissector_info ; if ( iax_packet -> call_data == NULL )  memset ( & dissector_info , 0 , sizeof ( dissector_info ) ); 