Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 2059] New: packet-sccp -> XUDTS

Date: Sun, 2 Dec 2007 12:05:19 +0000 (GMT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2059

           Summary: packet-sccp -> XUDTS
           Product: Wireshark
           Version: 0.99.6
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Low
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: shmulik.bezalel@xxxxxxxxx


Build Information:
Version 0.99.6a (SVN Rev 22276)

Copyright 1998-2007 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled with GTK+ 2.10.12, with GLib 2.12.12, with WinPcap (version unknown),
with libz 1.2.3, with libpcre 6.4, with Net-SNMP 5.4, with ADNS, with Lua 5.1,
with GnuTLS 1.6.1, with Gcrypt 1.2.3, with MIT Kerberos, with PortAudio
PortAudio V19-devel, with AirPcap.

Running on Windows XP Service Pack 2, build 2600, with WinPcap version 4.0.1
(packet.dll version 4.0.0.901), based on libpcap version 0.9.5, without
AirPcap.

Built using Microsoft Visual C++ 6.0 build 8804

Wireshark is Open Source Software released under the GNU General Public
License.

Check the man page and http://www.wireshark.org for more information.
--
The XUDTS layer does not support segmentation
case SCCP_MSG_TYPE_XUDTS:
    pinfo->sccp_info =  sccp_msg = new_ud_msg(pinfo,message_type);
    offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
                                     PARAMETER_RETURN_CAUSE, offset,
                                     RETURN_CAUSE_LENGTH);
    offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
                                     PARAMETER_HOP_COUNTER, offset,
                                     HOP_COUNTER_LENGTH);

    VARIABLE_POINTER(variable_pointer1, hf_sccp_variable_pointer1,
POINTER_LENGTH)
    VARIABLE_POINTER(variable_pointer2, hf_sccp_variable_pointer2,
POINTER_LENGTH)
    VARIABLE_POINTER(variable_pointer3, hf_sccp_variable_pointer3,
POINTER_LENGTH)
    OPTIONAL_POINTER(POINTER_LENGTH)

      assoc = get_sccp_assoc(pinfo, msg_offset,  slr, dlr, message_type);

    dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree,
                                    PARAMETER_CALLED_PARTY_ADDRESS,
                                    variable_pointer1);
    dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree,
                                    PARAMETER_CALLING_PARTY_ADDRESS,
                                    variable_pointer2);
    dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree,
PARAMETER_DATA,
                                    variable_pointer3);
    break;

to support segmentation change TO:
case SCCP_MSG_TYPE_XUDTS:

        offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
                                     PARAMETER_RETURN_CAUSE, offset,
                                     RETURN_CAUSE_LENGTH);
    offset += dissect_sccp_parameter(tvb, pinfo, sccp_tree, tree,
                                     PARAMETER_HOP_COUNTER, offset,
                                     HOP_COUNTER_LENGTH);

    VARIABLE_POINTER(variable_pointer1, hf_sccp_variable_pointer1,
POINTER_LENGTH)
    VARIABLE_POINTER(variable_pointer2, hf_sccp_variable_pointer2,
POINTER_LENGTH)
    VARIABLE_POINTER(variable_pointer3, hf_sccp_variable_pointer3,
POINTER_LENGTH)
    OPTIONAL_POINTER(POINTER_LENGTH)

        /* Optional parameters are Segmentation and Importance 
         * NOTE 2 - Segmentation Should not be present in case of a single XUDT
message.
         */

         assoc = get_sccp_assoc(pinfo, msg_offset,  slr, dlr, message_type);
     //assoc = sccp_assoc(&(pinfo->src), &(pinfo->dst), slr, dlr);

    dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree,
                                    PARAMETER_CALLED_PARTY_ADDRESS,
                                    variable_pointer1);
    dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree,
                                    PARAMETER_CALLING_PARTY_ADDRESS,
                                    variable_pointer2);

        if ((parameter_type = tvb_get_guint8(tvb, optional_pointer)) ==
PARAMETER_SEGMENTATION)
        {
                if (!sccp_xudt_desegment){
                        proto_tree_add_text(sccp_tree, tvb, variable_pointer3,
tvb_get_guint8(tvb, variable_pointer3)+1, "Segmented Data"  );

                }else{
                        guint8 octet;
                        gboolean more_frag = TRUE;


                        /* Get the first octet of parameter Segmentation, Ch
3.17 in Q.713
                         * Bit 8 of octet 1 is used for First segment
indication
                         * Bit 7 of octet 1 is used to keep in the message in
sequence delivery option required by the SCCP user
                         * Bits 6 and 5 in octet 1 are spare bits.
                         * Bits 4-1 of octet 1 are used to indicate the number
of remaining segments. 
                         * The values 0000 to 1111 are possible; the value 0000
indicates the last segment.
                         */
                        octet = tvb_get_guint8(tvb,optional_pointer+2);
                        source_local_ref = tvb_get_letoh24(tvb,
optional_pointer+3);
                        if ((octet&0x0f) == 0) 
                                more_frag = FALSE;
                        save_fragmented = pinfo->fragmented;
                        pinfo->fragmented = TRUE;
                        frag_msg = fragment_add_seq_next(tvb, variable_pointer3
+ 1, pinfo,
                                source_local_ref,                              
                                        /* ID for fragments belonging together
*/  
                                sccp_xudt_msg_fragment_table,                  
                        /* list of message fragments */
                                sccp_xudt_msg_reassembled_table,               
                        /* list of reassembled messages */
                                tvb_get_guint8(tvb,variable_pointer3),         
                /* fragment length - to the end */
                                more_frag);                                    
                                                /* More fragments? */

                        if ((octet&0x80) == 0x80)/*First segment, set number of
segments*/
                                fragment_set_tot_len(pinfo, source_local_ref,
sccp_xudt_msg_fragment_table,(octet & 0xf));

                        new_tvb = process_reassembled_data(tvb,
variable_pointer3 + 1, pinfo,
                                "Reassembled Message", frag_msg,
&sccp_xudt_msg_frag_items,
                                NULL, tree);

                        if (frag_msg) { /* Reassembled */
                                if (check_col(pinfo->cinfo, COL_INFO))
                                        col_append_str(pinfo->cinfo, COL_INFO, 
                                        " (Message Reassembled)");
                        } else { /* Not last packet of reassembled Short
Message */
                                if (check_col(pinfo->cinfo, COL_INFO))
                                        col_append_fstr(pinfo->cinfo, COL_INFO,
                                        " (Message fragment )");
                        }               
                        pinfo->fragmented = save_fragmented;
                        if (new_tvb)
                                dissect_sccp_data_param(new_tvb, pinfo, tree);
                }
        }
        else
        {
            dissect_sccp_variable_parameter(tvb, pinfo, sccp_tree, tree,
PARAMETER_DATA,
                                    variable_pointer3);
        }
    break;


-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.