1999-08-02 02:26:22 +00:00
|
|
|
/* packet-x25.c
|
2003-01-06 02:24:57 +00:00
|
|
|
* Routines for X.25 packet disassembly
|
2002-09-01 14:30:34 +00:00
|
|
|
* Olivier Abad <oabad@noos.fr>
|
1999-08-02 02:26:22 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1999-08-05 02:26:21 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1999-08-02 02:26:22 +00:00
|
|
|
* Copyright 1998
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-08-02 02:26:22 +00:00
|
|
|
* 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.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-08-02 02:26:22 +00:00
|
|
|
* 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.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-08-02 02:26:22 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <glib.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/llcsaps.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2002-11-08 01:00:07 +00:00
|
|
|
#include <epan/circuit.h>
|
2005-02-09 23:38:00 +00:00
|
|
|
#include <epan/reassemble.h>
|
2004-09-27 22:55:15 +00:00
|
|
|
#include <epan/prefs.h>
|
2005-08-19 23:28:23 +00:00
|
|
|
#include <epan/emem.h>
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/nlpid.h>
|
|
|
|
#include <epan/x264_prt_id.h>
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2002-04-09 08:15:04 +00:00
|
|
|
/*
|
|
|
|
* Direction of packet.
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
X25_FROM_DCE, /* DCE->DTE */
|
|
|
|
X25_FROM_DTE, /* DTE->DCE */
|
|
|
|
X25_UNKNOWN /* direction unknown */
|
|
|
|
} x25_dir_t;
|
1999-08-04 06:11:17 +00:00
|
|
|
|
2003-01-08 08:43:09 +00:00
|
|
|
/*
|
|
|
|
* 0 for data packets, 1 for non-data packets.
|
|
|
|
*/
|
|
|
|
#define X25_NONDATA_BIT 0x01
|
|
|
|
|
1999-08-02 02:26:22 +00:00
|
|
|
#define X25_CALL_REQUEST 0x0B
|
|
|
|
#define X25_CALL_ACCEPTED 0x0F
|
|
|
|
#define X25_CLEAR_REQUEST 0x13
|
|
|
|
#define X25_CLEAR_CONFIRMATION 0x17
|
|
|
|
#define X25_INTERRUPT 0x23
|
|
|
|
#define X25_INTERRUPT_CONFIRMATION 0x27
|
|
|
|
#define X25_RESET_REQUEST 0x1B
|
|
|
|
#define X25_RESET_CONFIRMATION 0x1F
|
|
|
|
#define X25_RESTART_REQUEST 0xFB
|
|
|
|
#define X25_RESTART_CONFIRMATION 0xFF
|
|
|
|
#define X25_REGISTRATION_REQUEST 0xF3
|
|
|
|
#define X25_REGISTRATION_CONFIRMATION 0xF7
|
|
|
|
#define X25_DIAGNOSTIC 0xF1
|
|
|
|
#define X25_RR 0x01
|
|
|
|
#define X25_RNR 0x05
|
|
|
|
#define X25_REJ 0x09
|
|
|
|
#define X25_DATA 0x00
|
|
|
|
|
2003-01-08 08:43:09 +00:00
|
|
|
#define PACKET_IS_DATA(type) (!(type & X25_NONDATA_BIT))
|
|
|
|
#define PACKET_TYPE_FC(type) (type & 0x1F)
|
|
|
|
|
2003-03-05 01:12:11 +00:00
|
|
|
#define X25_MBIT_MOD8 0x10
|
|
|
|
#define X25_MBIT_MOD128 0x01
|
|
|
|
|
|
|
|
#define X25_ABIT 0x8000
|
|
|
|
|
|
|
|
#define X25_QBIT 0x8000
|
|
|
|
#define X25_DBIT 0x4000
|
|
|
|
|
1999-08-02 02:26:22 +00:00
|
|
|
#define X25_FAC_CLASS_MASK 0xC0
|
|
|
|
|
|
|
|
#define X25_FAC_CLASS_A 0x00
|
|
|
|
#define X25_FAC_CLASS_B 0x40
|
|
|
|
#define X25_FAC_CLASS_C 0x80
|
|
|
|
#define X25_FAC_CLASS_D 0xC0
|
|
|
|
|
|
|
|
#define X25_FAC_COMP_MARK 0x00
|
|
|
|
#define X25_FAC_REVERSE 0x01
|
|
|
|
#define X25_FAC_THROUGHPUT 0x02
|
|
|
|
#define X25_FAC_CUG 0x03
|
2008-04-12 13:41:53 +00:00
|
|
|
#define X25_FAC_CHARGING_INFO 0x04
|
1999-08-02 02:26:22 +00:00
|
|
|
#define X25_FAC_CALLED_MODIF 0x08
|
1999-08-04 06:11:17 +00:00
|
|
|
#define X25_FAC_CUG_OUTGOING_ACC 0x09
|
1999-08-02 02:26:22 +00:00
|
|
|
#define X25_FAC_THROUGHPUT_MIN 0x0A
|
|
|
|
#define X25_FAC_EXPRESS_DATA 0x0B
|
1999-08-04 06:11:17 +00:00
|
|
|
#define X25_FAC_BILATERAL_CUG 0x41
|
1999-08-02 02:26:22 +00:00
|
|
|
#define X25_FAC_PACKET_SIZE 0x42
|
|
|
|
#define X25_FAC_WINDOW_SIZE 0x43
|
1999-08-04 06:11:17 +00:00
|
|
|
#define X25_FAC_RPOA_SELECTION 0x44
|
2008-04-12 13:41:53 +00:00
|
|
|
#define X25_FAC_CUG_EXT 0x47
|
|
|
|
#define X25_FAC_CUG_OUTGOING_ACC_EXT 0x48
|
1999-08-02 02:26:22 +00:00
|
|
|
#define X25_FAC_TRANSIT_DELAY 0x49
|
2008-04-12 13:41:53 +00:00
|
|
|
#define X25_FAC_CALL_DURATION 0xC1
|
|
|
|
#define X25_FAC_SEGMENT_COUNT 0xC2
|
1999-08-02 02:26:22 +00:00
|
|
|
#define X25_FAC_CALL_TRANSFER 0xC3
|
2008-04-12 13:41:53 +00:00
|
|
|
#define X25_FAC_RPOA_SELECTION_EXT 0xC4
|
|
|
|
#define X25_FAC_MONETARY_UNIT 0xC5
|
|
|
|
#define X25_FAC_NUI 0xC6
|
1999-08-02 02:26:22 +00:00
|
|
|
#define X25_FAC_CALLED_ADDR_EXT 0xC9
|
|
|
|
#define X25_FAC_ETE_TRANSIT_DELAY 0xCA
|
1999-12-09 13:51:08 +00:00
|
|
|
#define X25_FAC_CALLING_ADDR_EXT 0xCB
|
1999-08-04 06:11:17 +00:00
|
|
|
#define X25_FAC_CALL_DEFLECT 0xD1
|
1999-12-09 13:51:08 +00:00
|
|
|
#define X25_FAC_PRIORITY 0xD2
|
1999-08-02 02:26:22 +00:00
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static int proto_x25 = -1;
|
2001-01-03 23:30:50 +00:00
|
|
|
static int hf_x25_gfi = -1;
|
|
|
|
static int hf_x25_abit = -1;
|
1999-11-16 11:44:20 +00:00
|
|
|
static int hf_x25_qbit = -1;
|
|
|
|
static int hf_x25_dbit = -1;
|
|
|
|
static int hf_x25_mod = -1;
|
|
|
|
static int hf_x25_lcn = -1;
|
|
|
|
static int hf_x25_type = -1;
|
2003-01-08 08:43:09 +00:00
|
|
|
static int hf_x25_type_fc_mod8 = -1;
|
|
|
|
static int hf_x25_type_data = -1;
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
static int hf_x25_p_r_mod8 = -1;
|
|
|
|
static int hf_x25_p_r_mod128 = -1;
|
|
|
|
static int hf_x25_mbit_mod8 = -1;
|
|
|
|
static int hf_x25_mbit_mod128 = -1;
|
|
|
|
static int hf_x25_p_s_mod8 = -1;
|
|
|
|
static int hf_x25_p_s_mod128 = -1;
|
1999-11-16 11:44:20 +00:00
|
|
|
|
|
|
|
static gint ett_x25 = -1;
|
2001-01-03 23:30:50 +00:00
|
|
|
static gint ett_x25_gfi = -1;
|
1999-12-09 13:51:08 +00:00
|
|
|
static gint ett_x25_fac = -1;
|
1999-12-12 12:59:01 +00:00
|
|
|
static gint ett_x25_fac_unknown = -1;
|
|
|
|
static gint ett_x25_fac_mark = -1;
|
|
|
|
static gint ett_x25_fac_reverse = -1;
|
2008-04-12 13:41:53 +00:00
|
|
|
static gint ett_x25_fac_charging_info = -1;
|
1999-12-12 12:59:01 +00:00
|
|
|
static gint ett_x25_fac_throughput = -1;
|
|
|
|
static gint ett_x25_fac_cug = -1;
|
|
|
|
static gint ett_x25_fac_called_modif = -1;
|
|
|
|
static gint ett_x25_fac_cug_outgoing_acc = -1;
|
|
|
|
static gint ett_x25_fac_throughput_min = -1;
|
|
|
|
static gint ett_x25_fac_express_data = -1;
|
|
|
|
static gint ett_x25_fac_bilateral_cug = -1;
|
|
|
|
static gint ett_x25_fac_packet_size = -1;
|
|
|
|
static gint ett_x25_fac_window_size = -1;
|
|
|
|
static gint ett_x25_fac_rpoa_selection = -1;
|
2008-04-12 13:41:53 +00:00
|
|
|
static gint ett_x25_fac_cug_ext = -1;
|
|
|
|
static gint ett_x25_fac_cug_outgoing_acc_ext = -1;
|
1999-12-12 12:59:01 +00:00
|
|
|
static gint ett_x25_fac_transit_delay = -1;
|
2008-04-12 13:41:53 +00:00
|
|
|
static gint ett_x25_fac_call_duration = -1;
|
|
|
|
static gint ett_x25_fac_segment_count = -1;
|
1999-12-12 12:59:01 +00:00
|
|
|
static gint ett_x25_fac_call_transfer = -1;
|
2008-04-12 13:41:53 +00:00
|
|
|
static gint ett_x25_fac_rpoa_selection_ext = -1;
|
|
|
|
static gint ett_x25_fac_monetary_unit = -1;
|
|
|
|
static gint ett_x25_fac_nui = -1;
|
1999-12-12 12:59:01 +00:00
|
|
|
static gint ett_x25_fac_called_addr_ext = -1;
|
|
|
|
static gint ett_x25_fac_ete_transit_delay = -1;
|
|
|
|
static gint ett_x25_fac_calling_addr_ext = -1;
|
|
|
|
static gint ett_x25_fac_call_deflect = -1;
|
|
|
|
static gint ett_x25_fac_priority = -1;
|
2001-12-02 00:07:46 +00:00
|
|
|
static gint ett_x25_user_data = -1;
|
1999-10-18 01:51:34 +00:00
|
|
|
|
2003-03-04 19:50:23 +00:00
|
|
|
static gint ett_x25_segment = -1;
|
|
|
|
static gint ett_x25_segments = -1;
|
|
|
|
static gint hf_x25_segments = -1;
|
|
|
|
static gint hf_x25_segment = -1;
|
|
|
|
static gint hf_x25_segment_overlap = -1;
|
|
|
|
static gint hf_x25_segment_overlap_conflict = -1;
|
|
|
|
static gint hf_x25_segment_multiple_tails = -1;
|
|
|
|
static gint hf_x25_segment_too_long_segment = -1;
|
|
|
|
static gint hf_x25_segment_error = -1;
|
|
|
|
|
1999-10-18 01:51:34 +00:00
|
|
|
static const value_string vals_modulo[] = {
|
|
|
|
{ 1, "8" },
|
|
|
|
{ 2, "128" },
|
|
|
|
{ 0, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string vals_x25_type[] = {
|
|
|
|
{ X25_CALL_REQUEST, "Call" },
|
|
|
|
{ X25_CALL_ACCEPTED, "Call Accepted" },
|
|
|
|
{ X25_CLEAR_REQUEST, "Clear" },
|
|
|
|
{ X25_CLEAR_CONFIRMATION, "Clear Confirmation" },
|
|
|
|
{ X25_INTERRUPT, "Interrupt" },
|
|
|
|
{ X25_INTERRUPT_CONFIRMATION, "Interrupt Confirmation" },
|
|
|
|
{ X25_RESET_REQUEST, "Reset" },
|
|
|
|
{ X25_RESET_CONFIRMATION, "Reset Confirmation" },
|
|
|
|
{ X25_RESTART_REQUEST, "Restart" },
|
|
|
|
{ X25_RESTART_CONFIRMATION, "Restart Confirmation" },
|
|
|
|
{ X25_REGISTRATION_REQUEST, "Registration" },
|
|
|
|
{ X25_REGISTRATION_CONFIRMATION, "Registration Confirmation" },
|
|
|
|
{ X25_DIAGNOSTIC, "Diagnostic" },
|
|
|
|
{ X25_RR, "RR" },
|
|
|
|
{ X25_RNR, "RNR" },
|
|
|
|
{ X25_REJ, "REJ" },
|
2003-01-08 08:43:09 +00:00
|
|
|
{ X25_DATA, "Data" },
|
1999-10-18 01:51:34 +00:00
|
|
|
{ 0, NULL}
|
|
|
|
};
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2003-01-08 08:43:09 +00:00
|
|
|
static struct true_false_string m_bit_tfs = {
|
|
|
|
"More data follows",
|
|
|
|
"End of data"
|
|
|
|
};
|
|
|
|
|
2003-03-04 19:50:23 +00:00
|
|
|
static const fragment_items x25_frag_items = {
|
|
|
|
&ett_x25_segment,
|
|
|
|
&ett_x25_segments,
|
|
|
|
&hf_x25_segments,
|
|
|
|
&hf_x25_segment,
|
|
|
|
&hf_x25_segment_overlap,
|
|
|
|
&hf_x25_segment_overlap_conflict,
|
|
|
|
&hf_x25_segment_multiple_tails,
|
|
|
|
&hf_x25_segment_too_long_segment,
|
|
|
|
&hf_x25_segment_error,
|
2003-04-20 11:36:16 +00:00
|
|
|
NULL,
|
2003-03-04 19:50:23 +00:00
|
|
|
"segments"
|
|
|
|
};
|
|
|
|
|
2001-12-03 05:07:18 +00:00
|
|
|
static dissector_handle_t ip_handle;
|
2003-01-06 02:24:57 +00:00
|
|
|
static dissector_handle_t clnp_handle;
|
2000-11-19 04:14:26 +00:00
|
|
|
static dissector_handle_t ositp_handle;
|
2001-11-15 21:11:01 +00:00
|
|
|
static dissector_handle_t qllc_handle;
|
2001-11-25 22:19:25 +00:00
|
|
|
static dissector_handle_t data_handle;
|
2001-11-15 21:11:01 +00:00
|
|
|
|
|
|
|
/* Preferences */
|
2003-01-06 02:24:57 +00:00
|
|
|
static gboolean payload_is_qllc_sna = FALSE;
|
2008-03-16 10:19:51 +00:00
|
|
|
static gboolean call_request_nodata_is_cotp = FALSE;
|
|
|
|
static gboolean payload_check_data = FALSE;
|
2005-09-28 22:15:38 +00:00
|
|
|
static gboolean reassemble_x25 = TRUE;
|
2003-03-04 19:50:23 +00:00
|
|
|
|
|
|
|
/* Reassembly of X.25 */
|
|
|
|
|
|
|
|
static GHashTable *x25_segment_table = NULL;
|
|
|
|
static GHashTable *x25_reassembled_table = NULL;
|
2000-11-19 04:14:26 +00:00
|
|
|
|
2001-12-02 00:07:46 +00:00
|
|
|
static dissector_table_t x25_subdissector_table;
|
2001-12-05 08:43:26 +00:00
|
|
|
static heur_dissector_list_t x25_heur_subdissector_list;
|
2001-12-02 00:07:46 +00:00
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
static void
|
2002-11-08 01:00:07 +00:00
|
|
|
x25_hash_add_proto_start(guint16 vc, guint32 frame, dissector_handle_t dissect)
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
2002-11-08 01:00:07 +00:00
|
|
|
circuit_t *circuit;
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2002-11-08 01:00:07 +00:00
|
|
|
/*
|
|
|
|
* Is there already a circuit with this VC number?
|
|
|
|
*/
|
|
|
|
circuit = find_circuit(CT_X25, vc, frame);
|
|
|
|
if (circuit != NULL) {
|
|
|
|
/*
|
|
|
|
* Yes - close it, as we're creating a new one.
|
|
|
|
*/
|
|
|
|
close_circuit(circuit, frame - 1);
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
|
2002-11-08 01:00:07 +00:00
|
|
|
/*
|
|
|
|
* Set up a new circuit.
|
|
|
|
*/
|
|
|
|
circuit = circuit_new(CT_X25, vc, frame);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2002-11-08 01:00:07 +00:00
|
|
|
/*
|
|
|
|
* Set its dissector.
|
|
|
|
*/
|
|
|
|
circuit_set_dissector(circuit, dissect);
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
static void
|
2002-11-08 01:00:07 +00:00
|
|
|
x25_hash_add_proto_end(guint16 vc, guint32 frame)
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
2002-11-08 01:00:07 +00:00
|
|
|
circuit_t *circuit;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Try to find the circuit.
|
|
|
|
*/
|
|
|
|
circuit = find_circuit(CT_X25, vc, frame);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If we succeeded, close it.
|
|
|
|
*/
|
|
|
|
if (circuit != NULL)
|
|
|
|
close_circuit(circuit, frame);
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 13:10:58 +00:00
|
|
|
static const char *clear_code(unsigned char code)
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
2005-08-19 23:28:23 +00:00
|
|
|
static char *buffer;
|
1999-08-02 02:26:22 +00:00
|
|
|
|
|
|
|
if (code == 0x00 || (code & 0x80) == 0x80)
|
|
|
|
return "DTE Originated";
|
|
|
|
if (code == 0x01)
|
|
|
|
return "Number Busy";
|
2001-07-14 09:30:01 +00:00
|
|
|
if (code == 0x03)
|
|
|
|
return "Invalid Facility Requested";
|
|
|
|
if (code == 0x05)
|
|
|
|
return "Network Congestion";
|
1999-08-02 02:26:22 +00:00
|
|
|
if (code == 0x09)
|
|
|
|
return "Out Of Order";
|
2001-07-14 09:30:01 +00:00
|
|
|
if (code == 0x0B)
|
|
|
|
return "Access Barred";
|
|
|
|
if (code == 0x0D)
|
|
|
|
return "Not Obtainable";
|
1999-08-02 02:26:22 +00:00
|
|
|
if (code == 0x11)
|
|
|
|
return "Remote Procedure Error";
|
2001-07-14 09:30:01 +00:00
|
|
|
if (code == 0x13)
|
|
|
|
return "Local Procedure Error";
|
|
|
|
if (code == 0x15)
|
|
|
|
return "RPOA Out Of Order";
|
1999-08-02 02:26:22 +00:00
|
|
|
if (code == 0x19)
|
|
|
|
return "Reverse Charging Acceptance Not Subscribed";
|
|
|
|
if (code == 0x21)
|
|
|
|
return "Incompatible Destination";
|
|
|
|
if (code == 0x29)
|
|
|
|
return "Fast Select Acceptance Not Subscribed";
|
|
|
|
if (code == 0x39)
|
|
|
|
return "Destination Absent";
|
|
|
|
|
2005-08-19 23:28:23 +00:00
|
|
|
buffer=ep_alloc(32);
|
|
|
|
g_snprintf(buffer, 32, "Unknown %02X", code);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
|
2005-08-05 13:10:58 +00:00
|
|
|
static const char *clear_diag(unsigned char code)
|
1999-08-04 06:11:17 +00:00
|
|
|
{
|
2005-08-19 23:28:23 +00:00
|
|
|
static char *buffer;
|
1999-08-04 06:11:17 +00:00
|
|
|
|
|
|
|
if (code == 0)
|
|
|
|
return "No additional information";
|
|
|
|
if (code == 1)
|
|
|
|
return "Invalid P(S)";
|
|
|
|
if (code == 2)
|
|
|
|
return "Invalid P(R)";
|
|
|
|
if (code == 16)
|
|
|
|
return "Packet type invalid";
|
|
|
|
if (code == 17)
|
|
|
|
return "Packet type invalid for state r1";
|
|
|
|
if (code == 18)
|
|
|
|
return "Packet type invalid for state r2";
|
|
|
|
if (code == 19)
|
|
|
|
return "Packet type invalid for state r3";
|
|
|
|
if (code == 20)
|
|
|
|
return "Packet type invalid for state p1";
|
|
|
|
if (code == 21)
|
|
|
|
return "Packet type invalid for state p2";
|
|
|
|
if (code == 22)
|
|
|
|
return "Packet type invalid for state p3";
|
|
|
|
if (code == 23)
|
|
|
|
return "Packet type invalid for state p4";
|
|
|
|
if (code == 24)
|
|
|
|
return "Packet type invalid for state p5";
|
|
|
|
if (code == 25)
|
|
|
|
return "Packet type invalid for state p6";
|
|
|
|
if (code == 26)
|
|
|
|
return "Packet type invalid for state p7";
|
|
|
|
if (code == 27)
|
|
|
|
return "Packet type invalid for state d1";
|
|
|
|
if (code == 28)
|
|
|
|
return "Packet type invalid for state d2";
|
|
|
|
if (code == 29)
|
|
|
|
return "Packet type invalid for state d3";
|
|
|
|
if (code == 32)
|
|
|
|
return "Packet not allowed";
|
|
|
|
if (code == 33)
|
|
|
|
return "Unidentifiable packet";
|
|
|
|
if (code == 34)
|
|
|
|
return "Call on one-way logical channel";
|
|
|
|
if (code == 35)
|
|
|
|
return "Invalid packet type on a PVC";
|
|
|
|
if (code == 36)
|
|
|
|
return "Packet on unassigned LC";
|
|
|
|
if (code == 37)
|
|
|
|
return "Reject not subscribed to";
|
|
|
|
if (code == 38)
|
|
|
|
return "Packet too short";
|
|
|
|
if (code == 39)
|
|
|
|
return "Packet too long";
|
|
|
|
if (code == 40)
|
|
|
|
return "Invalid general format identifier";
|
|
|
|
if (code == 41)
|
|
|
|
return "Restart/registration packet with nonzero bits";
|
|
|
|
if (code == 42)
|
|
|
|
return "Packet type not compatible with facility";
|
|
|
|
if (code == 43)
|
|
|
|
return "Unauthorised interrupt confirmation";
|
|
|
|
if (code == 44)
|
|
|
|
return "Unauthorised interrupt";
|
|
|
|
if (code == 45)
|
|
|
|
return "Unauthorised reject";
|
|
|
|
if (code == 48)
|
|
|
|
return "Time expired";
|
|
|
|
if (code == 49)
|
|
|
|
return "Time expired for incoming call";
|
|
|
|
if (code == 50)
|
|
|
|
return "Time expired for clear indication";
|
|
|
|
if (code == 51)
|
|
|
|
return "Time expired for reset indication";
|
|
|
|
if (code == 52)
|
|
|
|
return "Time expired for restart indication";
|
|
|
|
if (code == 53)
|
|
|
|
return "Time expired for call deflection";
|
|
|
|
if (code == 64)
|
|
|
|
return "Call set-up/clearing or registration pb.";
|
|
|
|
if (code == 65)
|
|
|
|
return "Facility/registration code not allowed";
|
|
|
|
if (code == 66)
|
|
|
|
return "Facility parameter not allowed";
|
|
|
|
if (code == 67)
|
|
|
|
return "Invalid called DTE address";
|
|
|
|
if (code == 68)
|
|
|
|
return "Invalid calling DTE address";
|
|
|
|
if (code == 69)
|
|
|
|
return "Invalid facility/registration length";
|
|
|
|
if (code == 70)
|
|
|
|
return "Incoming call barred";
|
|
|
|
if (code == 71)
|
|
|
|
return "No logical channel available";
|
|
|
|
if (code == 72)
|
|
|
|
return "Call collision";
|
|
|
|
if (code == 73)
|
|
|
|
return "Duplicate facility requested";
|
|
|
|
if (code == 74)
|
|
|
|
return "Non zero address length";
|
|
|
|
if (code == 75)
|
|
|
|
return "Non zero facility length";
|
|
|
|
if (code == 76)
|
|
|
|
return "Facility not provided when expected";
|
|
|
|
if (code == 77)
|
|
|
|
return "Invalid CCITT-specified DTE facility";
|
|
|
|
if (code == 78)
|
|
|
|
return "Max. nb of call redir/defl. exceeded";
|
|
|
|
if (code == 80)
|
|
|
|
return "Miscellaneous";
|
|
|
|
if (code == 81)
|
|
|
|
return "Improper cause code from DTE";
|
|
|
|
if (code == 82)
|
|
|
|
return "Not aligned octet";
|
|
|
|
if (code == 83)
|
|
|
|
return "Inconsistent Q bit setting";
|
|
|
|
if (code == 84)
|
|
|
|
return "NUI problem";
|
|
|
|
if (code == 112)
|
|
|
|
return "International problem";
|
|
|
|
if (code == 113)
|
|
|
|
return "Remote network problem";
|
|
|
|
if (code == 114)
|
|
|
|
return "International protocol problem";
|
|
|
|
if (code == 115)
|
|
|
|
return "International link out of order";
|
|
|
|
if (code == 116)
|
|
|
|
return "International link busy";
|
|
|
|
if (code == 117)
|
|
|
|
return "Transit network facility problem";
|
|
|
|
if (code == 118)
|
|
|
|
return "Remote network facility problem";
|
|
|
|
if (code == 119)
|
|
|
|
return "International routing problem";
|
|
|
|
if (code == 120)
|
|
|
|
return "Temporary routing problem";
|
|
|
|
if (code == 121)
|
|
|
|
return "Unknown called DNIC";
|
|
|
|
if (code == 122)
|
|
|
|
return "Maintenance action";
|
2001-07-14 09:30:01 +00:00
|
|
|
if (code == 144)
|
|
|
|
return "Timer expired or retransmission count surpassed";
|
|
|
|
if (code == 145)
|
2001-07-16 20:57:42 +00:00
|
|
|
return "Timer expired or retransmission count surpassed for INTERRUPT";
|
2001-07-14 09:30:01 +00:00
|
|
|
if (code == 146)
|
|
|
|
return "Timer expired or retransmission count surpassed for DATA "
|
|
|
|
"packet transmission";
|
|
|
|
if (code == 147)
|
|
|
|
return "Timer expired or retransmission count surpassed for REJECT";
|
|
|
|
if (code == 160)
|
|
|
|
return "DTE-specific signals";
|
|
|
|
if (code == 161)
|
|
|
|
return "DTE operational";
|
|
|
|
if (code == 162)
|
|
|
|
return "DTE not operational";
|
|
|
|
if (code == 163)
|
|
|
|
return "DTE resource constraint";
|
|
|
|
if (code == 164)
|
|
|
|
return "Fast select not subscribed";
|
|
|
|
if (code == 165)
|
|
|
|
return "Invalid partially full DATA packet";
|
|
|
|
if (code == 166)
|
|
|
|
return "D-bit procedure not supported";
|
|
|
|
if (code == 167)
|
|
|
|
return "Registration/Cancellation confirmed";
|
|
|
|
if (code == 224)
|
|
|
|
return "OSI network service problem";
|
|
|
|
if (code == 225)
|
|
|
|
return "Disconnection (transient condition)";
|
|
|
|
if (code == 226)
|
|
|
|
return "Disconnection (permanent condition)";
|
|
|
|
if (code == 227)
|
|
|
|
return "Connection rejection - reason unspecified (transient "
|
|
|
|
"condition)";
|
|
|
|
if (code == 228)
|
|
|
|
return "Connection rejection - reason unspecified (permanent "
|
|
|
|
"condition)";
|
|
|
|
if (code == 229)
|
|
|
|
return "Connection rejection - quality of service not available "
|
|
|
|
"transient condition)";
|
|
|
|
if (code == 230)
|
|
|
|
return "Connection rejection - quality of service not available "
|
|
|
|
"permanent condition)";
|
|
|
|
if (code == 231)
|
|
|
|
return "Connection rejection - NSAP unreachable (transient condition)";
|
|
|
|
if (code == 232)
|
|
|
|
return "Connection rejection - NSAP unreachable (permanent condition)";
|
|
|
|
if (code == 233)
|
|
|
|
return "reset - reason unspecified";
|
|
|
|
if (code == 234)
|
|
|
|
return "reset - congestion";
|
|
|
|
if (code == 235)
|
|
|
|
return "Connection rejection - NSAP address unknown (permanent "
|
|
|
|
"condition)";
|
|
|
|
if (code == 240)
|
|
|
|
return "Higher layer initiated";
|
|
|
|
if (code == 241)
|
|
|
|
return "Disconnection - normal";
|
|
|
|
if (code == 242)
|
|
|
|
return "Disconnection - abnormal";
|
|
|
|
if (code == 243)
|
|
|
|
return "Disconnection - incompatible information in user data";
|
|
|
|
if (code == 244)
|
|
|
|
return "Connection rejection - reason unspecified (transient "
|
|
|
|
"condition)";
|
|
|
|
if (code == 245)
|
|
|
|
return "Connection rejection - reason unspecified (permanent "
|
|
|
|
"condition)";
|
|
|
|
if (code == 246)
|
|
|
|
return "Connection rejection - quality of service not available "
|
|
|
|
"(transient condition)";
|
|
|
|
if (code == 247)
|
|
|
|
return "Connection rejection - quality of service not available "
|
|
|
|
"(permanent condition)";
|
|
|
|
if (code == 248)
|
|
|
|
return "Connection rejection - incompatible information in user data";
|
|
|
|
if (code == 249)
|
|
|
|
return "Connection rejection - unrecognizable protocol indentifier "
|
|
|
|
"in user data";
|
|
|
|
if (code == 250)
|
|
|
|
return "Reset - user resynchronization";
|
1999-08-04 06:11:17 +00:00
|
|
|
|
2005-08-19 23:28:23 +00:00
|
|
|
buffer=ep_alloc(32);
|
|
|
|
g_snprintf(buffer, 32, "Unknown %d", code);
|
1999-08-04 06:11:17 +00:00
|
|
|
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
|
2005-08-05 13:10:58 +00:00
|
|
|
static const char *reset_code(unsigned char code)
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
2005-08-19 23:28:23 +00:00
|
|
|
static char *buffer;
|
1999-08-02 02:26:22 +00:00
|
|
|
|
|
|
|
if (code == 0x00 || (code & 0x80) == 0x80)
|
|
|
|
return "DTE Originated";
|
1999-08-04 06:11:17 +00:00
|
|
|
if (code == 0x01)
|
|
|
|
return "Out of order";
|
1999-08-02 02:26:22 +00:00
|
|
|
if (code == 0x03)
|
|
|
|
return "Remote Procedure Error";
|
|
|
|
if (code == 0x05)
|
|
|
|
return "Local Procedure Error";
|
|
|
|
if (code == 0x07)
|
|
|
|
return "Network Congestion";
|
1999-08-04 06:11:17 +00:00
|
|
|
if (code == 0x09)
|
|
|
|
return "Remote DTE operational";
|
|
|
|
if (code == 0x0F)
|
|
|
|
return "Network operational";
|
|
|
|
if (code == 0x11)
|
|
|
|
return "Incompatible Destination";
|
|
|
|
if (code == 0x1D)
|
|
|
|
return "Network out of order";
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2005-08-19 23:28:23 +00:00
|
|
|
buffer=ep_alloc(32);
|
|
|
|
g_snprintf(buffer, 32, "Unknown %02X", code);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
|
2005-08-05 13:10:58 +00:00
|
|
|
static const char *restart_code(unsigned char code)
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
2005-08-19 23:28:23 +00:00
|
|
|
static char *buffer;
|
1999-08-02 02:26:22 +00:00
|
|
|
|
|
|
|
if (code == 0x00 || (code & 0x80) == 0x80)
|
|
|
|
return "DTE Originated";
|
|
|
|
if (code == 0x01)
|
|
|
|
return "Local Procedure Error";
|
|
|
|
if (code == 0x03)
|
|
|
|
return "Network Congestion";
|
|
|
|
if (code == 0x07)
|
|
|
|
return "Network Operational";
|
1999-08-04 06:11:17 +00:00
|
|
|
if (code == 0x7F)
|
|
|
|
return "Registration/cancellation confirmed";
|
|
|
|
|
2005-08-19 23:28:23 +00:00
|
|
|
buffer=ep_alloc(32);
|
|
|
|
g_snprintf(buffer, 32, "Unknown %02X", code);
|
1999-08-04 06:11:17 +00:00
|
|
|
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
|
2005-08-05 13:10:58 +00:00
|
|
|
static const char *registration_code(unsigned char code)
|
1999-08-04 06:11:17 +00:00
|
|
|
{
|
2005-08-19 23:28:23 +00:00
|
|
|
static char *buffer;
|
1999-08-04 06:11:17 +00:00
|
|
|
|
|
|
|
if (code == 0x03)
|
|
|
|
return "Invalid facility request";
|
|
|
|
if (code == 0x05)
|
|
|
|
return "Network congestion";
|
|
|
|
if (code == 0x13)
|
|
|
|
return "Local procedure error";
|
|
|
|
if (code == 0x7F)
|
|
|
|
return "Registration/cancellation confirmed";
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2005-08-19 23:28:23 +00:00
|
|
|
buffer=ep_alloc(32);
|
|
|
|
g_snprintf(buffer, 32, "Unknown %02X", code);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
static void
|
2000-05-25 21:34:58 +00:00
|
|
|
dump_facilities(proto_tree *tree, int *offset, tvbuff_t *tvb)
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
2000-05-25 21:34:58 +00:00
|
|
|
guint8 fac, byte1, byte2, byte3;
|
1999-08-02 02:26:22 +00:00
|
|
|
guint32 len; /* facilities length */
|
1999-12-12 12:59:01 +00:00
|
|
|
proto_item *ti=0;
|
1999-12-09 13:51:08 +00:00
|
|
|
proto_tree *fac_tree = 0;
|
1999-12-12 12:59:01 +00:00
|
|
|
proto_tree *fac_subtree;
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2000-05-25 21:34:58 +00:00
|
|
|
len = tvb_get_guint8(tvb, *offset);
|
1999-12-09 13:51:08 +00:00
|
|
|
if (len && tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(tree, tvb, *offset, len + 1,
|
1999-12-09 13:51:08 +00:00
|
|
|
"Facilities");
|
|
|
|
fac_tree = proto_item_add_subtree(ti, ett_x25_fac);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_tree, tvb, *offset, 1,
|
1999-08-02 02:26:22 +00:00
|
|
|
"Facilities length: %d", len);
|
1999-12-09 13:51:08 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
(*offset)++;
|
|
|
|
|
|
|
|
while (len > 0) {
|
2000-05-25 21:34:58 +00:00
|
|
|
fac = tvb_get_guint8(tvb, *offset);
|
|
|
|
switch(fac & X25_FAC_CLASS_MASK) {
|
1999-08-02 02:26:22 +00:00
|
|
|
case X25_FAC_CLASS_A:
|
2000-05-25 21:34:58 +00:00
|
|
|
switch (fac) {
|
1999-08-02 02:26:22 +00:00
|
|
|
case X25_FAC_COMP_MARK:
|
1999-12-09 23:03:49 +00:00
|
|
|
if (fac_tree)
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1,
|
1999-12-12 12:59:01 +00:00
|
|
|
"Code : 00 (Marker)");
|
2000-05-25 21:34:58 +00:00
|
|
|
switch (tvb_get_guint8(tvb, *offset + 1)) {
|
1999-08-02 02:26:22 +00:00
|
|
|
case 0x00:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_mark);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
1999-12-09 23:03:49 +00:00
|
|
|
"Parameter : 00 (Network complementary "
|
|
|
|
"services - calling DTE)");
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case 0xFF:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_mark);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
1999-12-09 23:03:49 +00:00
|
|
|
"Parameter : FF (Network complementary "
|
|
|
|
"services - called DTE)");
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case 0x0F:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_mark);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
1999-12-09 23:03:49 +00:00
|
|
|
"Parameter : 0F (DTE complementary "
|
|
|
|
"services)");
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
default:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_mark);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
1999-12-09 23:03:49 +00:00
|
|
|
"Parameter : %02X (Unknown marker)",
|
2000-05-25 21:34:58 +00:00
|
|
|
tvb_get_guint8(tvb, *offset+1));
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case X25_FAC_REVERSE:
|
1999-12-09 13:51:08 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Reverse charging / Fast select)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_reverse);
|
2000-05-25 21:34:58 +00:00
|
|
|
byte1 = tvb_get_guint8(tvb, *offset + 1);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Parameter : %02X", byte1);
|
|
|
|
if (byte1 & 0xC0)
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
1999-12-09 23:03:49 +00:00
|
|
|
"11.. .... = Fast select with restriction");
|
2000-05-25 21:34:58 +00:00
|
|
|
else if (byte1 & 0x80)
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
1999-12-09 23:03:49 +00:00
|
|
|
"10.. .... = Fast select - no restriction");
|
1999-08-02 02:26:22 +00:00
|
|
|
else
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
1999-12-09 23:03:49 +00:00
|
|
|
"00.. .... = Fast select not requested");
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
decode_boolean_bitfield(byte1, 0x01, 1*8,
|
1999-12-09 23:03:49 +00:00
|
|
|
"Reverse charging requested",
|
|
|
|
"Reverse charging not requested"));
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
break;
|
2008-04-12 13:41:53 +00:00
|
|
|
case X25_FAC_CHARGING_INFO:
|
|
|
|
if (fac_tree) {
|
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Charging information)", fac);
|
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_charging_info);
|
|
|
|
byte1 = tvb_get_guint8(tvb, *offset + 1);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Parameter : %02X", byte1);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
decode_boolean_bitfield(byte1, 0x01, 1*8,
|
|
|
|
"Charging information requested",
|
|
|
|
"Charging information not requested"));
|
|
|
|
}
|
|
|
|
break;
|
1999-08-02 02:26:22 +00:00
|
|
|
case X25_FAC_THROUGHPUT:
|
1999-12-09 13:51:08 +00:00
|
|
|
if (fac_tree) {
|
2005-08-19 23:28:23 +00:00
|
|
|
char *tmpbuf;
|
1999-08-04 06:11:17 +00:00
|
|
|
|
2005-08-19 23:28:23 +00:00
|
|
|
tmpbuf=ep_alloc(80);
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
2006-01-05 13:01:08 +00:00
|
|
|
"(Throughput class negotiation)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_throughput);
|
2000-05-25 21:34:58 +00:00
|
|
|
byte1 = tvb_get_guint8(tvb, *offset + 1);
|
|
|
|
switch (byte1 >> 4)
|
1999-12-09 23:03:49 +00:00
|
|
|
{
|
|
|
|
case 3:
|
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
case 6:
|
|
|
|
case 7:
|
|
|
|
case 8:
|
|
|
|
case 9:
|
|
|
|
case 10:
|
|
|
|
case 11:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (%d bps)",
|
2000-05-25 21:34:58 +00:00
|
|
|
75*(1<<((byte1 >> 4)-3)));
|
1999-12-09 23:03:49 +00:00
|
|
|
break;
|
|
|
|
case 12:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (48000 bps)");
|
1999-12-09 23:03:49 +00:00
|
|
|
break;
|
|
|
|
case 13:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (64000 bps)");
|
1999-12-09 23:03:49 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (Reserved)");
|
1999-12-09 23:03:49 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
decode_numeric_bitfield(byte1, 0xF0, 1*8, tmpbuf));
|
|
|
|
switch (byte1 & 0x0F)
|
1999-12-09 23:03:49 +00:00
|
|
|
{
|
|
|
|
case 3:
|
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
case 6:
|
|
|
|
case 7:
|
|
|
|
case 8:
|
|
|
|
case 9:
|
|
|
|
case 10:
|
|
|
|
case 11:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (%d bps)",
|
2000-05-25 21:34:58 +00:00
|
|
|
75*(1<<((byte1 & 0x0F)-3)));
|
1999-12-09 23:03:49 +00:00
|
|
|
break;
|
|
|
|
case 12:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (48000 bps)");
|
1999-12-09 23:03:49 +00:00
|
|
|
break;
|
|
|
|
case 13:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (64000 bps)");
|
1999-12-09 23:03:49 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (Reserved)");
|
1999-12-09 23:03:49 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
decode_numeric_bitfield(byte1, 0x0F, 1*8, tmpbuf));
|
1999-08-04 06:11:17 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_FAC_CUG:
|
1999-12-09 23:03:49 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Closed user group selection)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_cug);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Closed user group: %02X", tvb_get_guint8(tvb, *offset+1));
|
1999-12-09 23:03:49 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_FAC_CALLED_MODIF:
|
1999-12-09 23:03:49 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Called address modified)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_called_modif);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_tree, tvb, *offset+1, 1,
|
|
|
|
"Parameter %02X", tvb_get_guint8(tvb, *offset+1));
|
1999-12-09 23:03:49 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
1999-08-04 06:11:17 +00:00
|
|
|
case X25_FAC_CUG_OUTGOING_ACC:
|
1999-12-09 23:03:49 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
1999-12-12 12:59:01 +00:00
|
|
|
"(Closed user group with outgoing access selection)",
|
2000-05-25 21:34:58 +00:00
|
|
|
fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_cug_outgoing_acc);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Closed user group: %02X", tvb_get_guint8(tvb, *offset+1));
|
1999-12-09 23:03:49 +00:00
|
|
|
}
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
1999-08-02 02:26:22 +00:00
|
|
|
case X25_FAC_THROUGHPUT_MIN:
|
1999-12-09 23:03:49 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Minimum throughput class)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_throughput_min);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Parameter %02X", tvb_get_guint8(tvb, *offset+1));
|
1999-12-09 23:03:49 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_FAC_EXPRESS_DATA:
|
1999-12-09 23:03:49 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
2006-01-05 13:01:08 +00:00
|
|
|
"(Negotiation of express data)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_express_data);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Parameter %02X", tvb_get_guint8(tvb, *offset+1));
|
1999-12-09 23:03:49 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
default:
|
1999-12-09 23:03:49 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1,
|
|
|
|
"Code : %02X (Unknown class A)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_unknown);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Parameter %02X", tvb_get_guint8(tvb, *offset+1));
|
1999-12-09 23:03:49 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
(*offset) += 2;
|
|
|
|
len -= 2;
|
|
|
|
break;
|
|
|
|
case X25_FAC_CLASS_B:
|
2000-05-25 21:34:58 +00:00
|
|
|
switch (fac) {
|
1999-08-04 06:11:17 +00:00
|
|
|
case X25_FAC_BILATERAL_CUG:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Bilateral closed user group selection)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_bilateral_cug);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 2,
|
|
|
|
"Bilateral CUG: %04X",
|
|
|
|
tvb_get_ntohs(tvb, *offset+1));
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
1999-08-02 02:26:22 +00:00
|
|
|
case X25_FAC_PACKET_SIZE:
|
1999-12-09 13:51:08 +00:00
|
|
|
if (fac_tree)
|
1999-08-04 06:11:17 +00:00
|
|
|
{
|
2005-08-19 23:28:23 +00:00
|
|
|
char *tmpbuf;
|
1999-08-04 06:11:17 +00:00
|
|
|
|
2005-08-19 23:28:23 +00:00
|
|
|
tmpbuf=ep_alloc(80);
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Packet size)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_packet_size);
|
2000-05-25 21:34:58 +00:00
|
|
|
byte1 = tvb_get_guint8(tvb, *offset + 1);
|
|
|
|
switch (byte1)
|
1999-08-04 06:11:17 +00:00
|
|
|
{
|
|
|
|
case 0x04:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (16)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
|
|
|
case 0x05:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (32)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
|
|
|
case 0x06:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (64)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
|
|
|
case 0x07:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (128)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
|
|
|
case 0x08:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (256)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
2008-04-12 13:41:53 +00:00
|
|
|
case 0x09:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (512)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
2008-04-12 13:41:53 +00:00
|
|
|
case 0x0A:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (1024)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
2008-04-12 13:41:53 +00:00
|
|
|
case 0x0B:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (2048)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
2008-04-12 13:41:53 +00:00
|
|
|
case 0x0C:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (4096)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the called DTE : %%u (Unknown)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
decode_numeric_bitfield(byte1, 0x0F, 1*8, tmpbuf));
|
1999-08-04 06:11:17 +00:00
|
|
|
|
2008-04-12 13:41:53 +00:00
|
|
|
byte2 = tvb_get_guint8(tvb, *offset + 2);
|
2000-05-25 21:34:58 +00:00
|
|
|
switch (byte2)
|
1999-08-04 06:11:17 +00:00
|
|
|
{
|
|
|
|
case 0x04:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (16)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
|
|
|
case 0x05:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (32)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
|
|
|
case 0x06:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (64)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
|
|
|
case 0x07:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (128)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
|
|
|
case 0x08:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (256)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
2008-04-12 13:41:53 +00:00
|
|
|
case 0x09:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (512)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
2008-04-12 13:41:53 +00:00
|
|
|
case 0x0A:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (1024)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
2008-04-12 13:41:53 +00:00
|
|
|
case 0x0B:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (2048)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
2008-04-12 13:41:53 +00:00
|
|
|
case 0x0C:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (4096)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-08-19 23:28:23 +00:00
|
|
|
g_snprintf(tmpbuf, 80, "From the calling DTE : %%u (Unknown)");
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
|
|
|
|
decode_numeric_bitfield(byte2, 0x0F, 1*8, tmpbuf));
|
1999-08-04 06:11:17 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_FAC_WINDOW_SIZE:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Window size)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_window_size);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
decode_numeric_bitfield(tvb_get_guint8(tvb, *offset+1),
|
|
|
|
0x7F, 1*8, "From the called DTE: %u"));
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
|
|
|
|
decode_numeric_bitfield(tvb_get_guint8(tvb, *offset+2),
|
|
|
|
0x7F, 1*8, "From the calling DTE: %u"));
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
|
|
|
case X25_FAC_RPOA_SELECTION:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(RPOA selection)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_rpoa_selection);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 2,
|
|
|
|
"Data network identification code : %04X",
|
|
|
|
tvb_get_ntohs(tvb, *offset+1));
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
2008-04-12 13:41:53 +00:00
|
|
|
case X25_FAC_CUG_EXT:
|
|
|
|
if (fac_tree) {
|
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Extended closed user group selection)", fac);
|
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_cug_ext);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 2,
|
|
|
|
"Closed user group: %04X", tvb_get_ntohs(tvb, *offset+1));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case X25_FAC_CUG_OUTGOING_ACC_EXT:
|
|
|
|
if (fac_tree) {
|
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Extended closed user group with outgoing access selection)",
|
|
|
|
fac);
|
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_cug_outgoing_acc_ext);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 2,
|
|
|
|
"Closed user group: %04X", tvb_get_ntohs(tvb, *offset+1));
|
|
|
|
}
|
|
|
|
break;
|
1999-08-02 02:26:22 +00:00
|
|
|
case X25_FAC_TRANSIT_DELAY:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Transit delay selection and indication)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_transit_delay);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 2,
|
1999-12-12 12:59:01 +00:00
|
|
|
"Transit delay: %d ms",
|
2000-05-25 21:34:58 +00:00
|
|
|
tvb_get_ntohs(tvb, *offset+1));
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
default:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1,
|
|
|
|
"Code : %02X (Unknown class B)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_unknown);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 2,
|
|
|
|
"Parameter %04X", tvb_get_ntohs(tvb, *offset+1));
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
(*offset) += 3;
|
|
|
|
len -= 3;
|
|
|
|
break;
|
|
|
|
case X25_FAC_CLASS_C:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1,
|
|
|
|
"Code : %02X (Unknown class C)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_unknown);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 3,
|
|
|
|
"Parameter %06X",
|
|
|
|
tvb_get_ntoh24(tvb, *offset+1));
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
(*offset) += 4;
|
|
|
|
len -= 4;
|
|
|
|
break;
|
|
|
|
case X25_FAC_CLASS_D:
|
2000-05-25 21:34:58 +00:00
|
|
|
switch (fac) {
|
2008-04-12 13:41:53 +00:00
|
|
|
case X25_FAC_CALL_DURATION:
|
|
|
|
if (fac_tree) {
|
|
|
|
int i;
|
|
|
|
|
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Call duration)", fac);
|
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_call_duration);
|
|
|
|
byte1 = tvb_get_guint8(tvb, *offset+1);
|
|
|
|
if ((byte1 < 4) || (byte1 % 4)) {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Bogus length : %d", byte1);
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Length : %u", byte1);
|
|
|
|
}
|
|
|
|
for (i = 0; (i<byte1); i+=4) {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2+i, 4,
|
|
|
|
"Call duration : %u Day(s) %02X:%02X:%02X Hour(s)",
|
|
|
|
tvb_get_guint8(tvb, *offset+2+i),
|
|
|
|
tvb_get_guint8(tvb, *offset+3+i),
|
|
|
|
tvb_get_guint8(tvb, *offset+4+i),
|
|
|
|
tvb_get_guint8(tvb, *offset+5+i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case X25_FAC_SEGMENT_COUNT:
|
|
|
|
if (fac_tree) {
|
|
|
|
int i;
|
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Segment count)", fac);
|
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_segment_count);
|
|
|
|
byte1 = tvb_get_guint8(tvb, *offset+1);
|
|
|
|
if ((byte1 < 8) || (byte1 % 8)) {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Bogus length : %d", byte1);
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Length : %u", byte1);
|
|
|
|
}
|
|
|
|
for (i = 0; (i<byte1); i+=8) {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2+i, 4,
|
|
|
|
"Segments sent to DTE : %02X%02X%02X%02X",
|
|
|
|
tvb_get_guint8(tvb, *offset+2+i),
|
|
|
|
tvb_get_guint8(tvb, *offset+3+i),
|
|
|
|
tvb_get_guint8(tvb, *offset+4+i),
|
|
|
|
tvb_get_guint8(tvb, *offset+5+i));
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+6+i, 4,
|
|
|
|
"Segments received from DTE : %02X%02X%02X%02X",
|
|
|
|
tvb_get_guint8(tvb, *offset+6+i),
|
|
|
|
tvb_get_guint8(tvb, *offset+7+i),
|
|
|
|
tvb_get_guint8(tvb, *offset+8+i),
|
|
|
|
tvb_get_guint8(tvb, *offset+9+i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
1999-08-02 02:26:22 +00:00
|
|
|
case X25_FAC_CALL_TRANSFER:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
|
|
|
int i;
|
2005-08-19 23:28:23 +00:00
|
|
|
char *tmpbuf;
|
1999-12-12 12:59:01 +00:00
|
|
|
|
2005-08-19 23:28:23 +00:00
|
|
|
tmpbuf=ep_alloc(258);
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Call redirection or deflection notification)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_call_transfer);
|
2000-05-25 21:34:58 +00:00
|
|
|
byte1 = tvb_get_guint8(tvb, *offset+1);
|
2004-12-09 19:06:59 +00:00
|
|
|
if (byte1 < 2) {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Bogus length : %d", byte1);
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Length : %u", byte1);
|
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
byte2 = tvb_get_guint8(tvb, *offset+2);
|
|
|
|
if ((byte2 & 0xC0) == 0xC0) {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
|
1999-12-12 12:59:01 +00:00
|
|
|
"Reason : call deflection by the originally "
|
|
|
|
"called DTE address");
|
|
|
|
}
|
|
|
|
else {
|
2000-05-25 21:34:58 +00:00
|
|
|
switch (byte2) {
|
1999-12-12 12:59:01 +00:00
|
|
|
case 0x01:
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
|
1999-12-12 12:59:01 +00:00
|
|
|
"Reason : originally called DTE busy");
|
|
|
|
break;
|
|
|
|
case 0x07:
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
|
1999-12-12 12:59:01 +00:00
|
|
|
"Reason : call dist. within a hunt group");
|
|
|
|
break;
|
|
|
|
case 0x09:
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
|
1999-12-12 12:59:01 +00:00
|
|
|
"Reason : originally called DTE out of order");
|
|
|
|
break;
|
|
|
|
case 0x0F:
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
|
1999-12-12 12:59:01 +00:00
|
|
|
"Reason : systematic call redirection");
|
|
|
|
break;
|
|
|
|
default:
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
|
1999-12-12 12:59:01 +00:00
|
|
|
"Reason : unknown");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
byte3 = tvb_get_guint8(tvb, *offset+3);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+3, 1,
|
|
|
|
"Number of semi-octets in DTE address : %u",
|
|
|
|
byte3);
|
2005-08-19 23:28:23 +00:00
|
|
|
for (i = 0; (i<byte3)&&(i<256); i++) {
|
1999-12-12 12:59:01 +00:00
|
|
|
if (i % 2 == 0) {
|
2000-05-25 21:34:58 +00:00
|
|
|
tmpbuf[i] = ((tvb_get_guint8(tvb, *offset+4+i/2) >> 4)
|
|
|
|
& 0x0F) + '0';
|
1999-12-12 12:59:01 +00:00
|
|
|
/* if > 9, convert to the right hexadecimal letter */
|
|
|
|
if (tmpbuf[i] > '9') tmpbuf[i] += ('A' - '0' - 10);
|
|
|
|
} else {
|
2000-05-25 21:34:58 +00:00
|
|
|
tmpbuf[i] = (tvb_get_guint8(tvb, *offset+4+i/2)
|
|
|
|
& 0x0F) + '0';
|
1999-12-12 12:59:01 +00:00
|
|
|
/* if > 9, convert to the right hexadecimal letter */
|
|
|
|
if (tmpbuf[i] > '9') tmpbuf[i] += ('A' - '0' - 10);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tmpbuf[i] = 0;
|
2004-12-09 19:06:59 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+4, byte1 - 2,
|
|
|
|
"DTE address : %s", tmpbuf);
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
2008-04-12 13:41:53 +00:00
|
|
|
case X25_FAC_RPOA_SELECTION_EXT:
|
|
|
|
if (fac_tree) {
|
|
|
|
int i;
|
|
|
|
|
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Extended RPOA selection)", fac);
|
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_rpoa_selection_ext);
|
|
|
|
byte1 = tvb_get_guint8(tvb, *offset+1);
|
|
|
|
if ((byte1 < 2) || (byte1 % 2)) {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Bogus length : %d", byte1);
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Length : %u", byte1);
|
|
|
|
}
|
|
|
|
for (i = 0; (i<byte1); i+=2) {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2+i, 2,
|
|
|
|
"Data network identification code : %04X",
|
|
|
|
tvb_get_ntohs(tvb, *offset+2+i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
1999-12-09 13:51:08 +00:00
|
|
|
case X25_FAC_CALLING_ADDR_EXT:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
|
|
|
int i;
|
2005-08-19 23:28:23 +00:00
|
|
|
char *tmpbuf;
|
1999-12-12 12:59:01 +00:00
|
|
|
|
2005-08-19 23:28:23 +00:00
|
|
|
tmpbuf=ep_alloc(258);
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Calling address extension)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_calling_addr_ext);
|
2000-05-25 21:34:58 +00:00
|
|
|
byte1 = tvb_get_guint8(tvb, *offset+1);
|
2004-12-09 19:06:59 +00:00
|
|
|
if (byte1 < 1) {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Bogus length : %d", byte1);
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Length : %u", byte1);
|
|
|
|
}
|
2003-02-16 20:55:10 +00:00
|
|
|
byte2 = tvb_get_guint8(tvb, *offset+2) & 0x3F;
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
|
|
|
|
"Number of semi-octets in DTE address : %u", byte2);
|
2005-08-19 23:28:23 +00:00
|
|
|
for (i = 0; (i<byte2)&&(i<256) ; i++) {
|
1999-12-12 12:59:01 +00:00
|
|
|
if (i % 2 == 0) {
|
2000-05-25 21:34:58 +00:00
|
|
|
tmpbuf[i] = ((tvb_get_guint8(tvb, *offset+3+i/2) >> 4)
|
|
|
|
& 0x0F) + '0';
|
1999-12-12 12:59:01 +00:00
|
|
|
/* if > 9, convert to the right hexadecimal letter */
|
|
|
|
if (tmpbuf[i] > '9') tmpbuf[i] += ('A' - '0' - 10);
|
|
|
|
} else {
|
2000-05-25 21:34:58 +00:00
|
|
|
tmpbuf[i] = (tvb_get_guint8(tvb, *offset+3+i/2)
|
|
|
|
& 0x0F) + '0';
|
1999-12-12 12:59:01 +00:00
|
|
|
/* if > 9, convert to the right hexadecimal letter */
|
|
|
|
if (tmpbuf[i] > '9') tmpbuf[i] += ('A' - '0' - 10);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tmpbuf[i] = 0;
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+3, byte1 - 1,
|
1999-12-12 12:59:01 +00:00
|
|
|
"DTE address : %s", tmpbuf);
|
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
2008-04-12 13:41:53 +00:00
|
|
|
case X25_FAC_MONETARY_UNIT:
|
|
|
|
if (fac_tree) {
|
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Monetary Unit)", fac);
|
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_monetary_unit);
|
|
|
|
byte1 = tvb_get_guint8(tvb, *offset+1);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Length : %u", byte1);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, byte1, "Value");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case X25_FAC_NUI:
|
|
|
|
if (fac_tree) {
|
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Network User Identification selection)", fac);
|
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_nui);
|
|
|
|
byte1 = tvb_get_guint8(tvb, *offset+1);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Length : %u", byte1);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, byte1, "NUI");
|
|
|
|
}
|
|
|
|
break;
|
1999-08-02 02:26:22 +00:00
|
|
|
case X25_FAC_CALLED_ADDR_EXT:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
|
|
|
int i;
|
2005-08-19 23:28:23 +00:00
|
|
|
char *tmpbuf;
|
1999-12-12 12:59:01 +00:00
|
|
|
|
2005-08-19 23:28:23 +00:00
|
|
|
tmpbuf=ep_alloc(258);
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Called address extension)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_called_addr_ext);
|
2000-05-25 21:34:58 +00:00
|
|
|
byte1 = tvb_get_guint8(tvb, *offset+1);
|
2004-12-09 19:06:59 +00:00
|
|
|
if (byte1 < 1) {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Bogus length : %d", byte1);
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Length : %u", byte1);
|
|
|
|
}
|
2003-02-16 20:55:10 +00:00
|
|
|
byte2 = tvb_get_guint8(tvb, *offset+2) & 0x3F;
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
|
|
|
|
"Number of semi-octets in DTE address : %u", byte2);
|
2005-08-19 23:28:23 +00:00
|
|
|
for (i = 0; (i<byte2)&&(i<256) ; i++) {
|
1999-12-12 12:59:01 +00:00
|
|
|
if (i % 2 == 0) {
|
2000-05-25 21:34:58 +00:00
|
|
|
tmpbuf[i] = ((tvb_get_guint8(tvb, *offset+3+i/2) >> 4)
|
|
|
|
& 0x0F) + '0';
|
1999-12-12 12:59:01 +00:00
|
|
|
/* if > 9, convert to the right hexadecimal letter */
|
|
|
|
if (tmpbuf[i] > '9') tmpbuf[i] += ('A' - '0' - 10);
|
|
|
|
} else {
|
2000-05-25 21:34:58 +00:00
|
|
|
tmpbuf[i] = (tvb_get_guint8(tvb, *offset+3+i/2)
|
|
|
|
& 0x0F) + '0';
|
1999-12-12 12:59:01 +00:00
|
|
|
/* if > 9, convert to the right hexadecimal letter */
|
|
|
|
if (tmpbuf[i] > '9') tmpbuf[i] += ('A' - '0' - 10);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tmpbuf[i] = 0;
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+3, byte1 - 1,
|
1999-12-12 12:59:01 +00:00
|
|
|
"DTE address : %s", tmpbuf);
|
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_FAC_ETE_TRANSIT_DELAY:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(End to end transit delay)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_ete_transit_delay);
|
2000-05-25 21:34:58 +00:00
|
|
|
byte1 = tvb_get_guint8(tvb, *offset+1);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Length : %u", byte1);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, byte1, "Value");
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
1999-08-04 06:11:17 +00:00
|
|
|
case X25_FAC_CALL_DEFLECT:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
|
|
|
int i;
|
2005-08-19 23:28:23 +00:00
|
|
|
char *tmpbuf;
|
1999-12-12 12:59:01 +00:00
|
|
|
|
2005-08-19 23:28:23 +00:00
|
|
|
tmpbuf=ep_alloc(258);
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X "
|
|
|
|
"(Call deflection selection)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti,
|
|
|
|
ett_x25_fac_call_deflect);
|
2000-05-25 21:34:58 +00:00
|
|
|
byte1 = tvb_get_guint8(tvb, *offset+1);
|
2004-12-09 19:06:59 +00:00
|
|
|
if (byte1 < 2) {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Bogus length : %d", byte1);
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Length : %u", byte1);
|
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
byte2 = tvb_get_guint8(tvb, *offset+2);
|
|
|
|
if ((byte2 & 0xC0) == 0xC0)
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
|
1999-12-12 12:59:01 +00:00
|
|
|
"Reason : call DTE originated");
|
|
|
|
else
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, 1,
|
1999-12-12 12:59:01 +00:00
|
|
|
"Reason : unknown");
|
2000-05-25 21:34:58 +00:00
|
|
|
byte3 = tvb_get_guint8(tvb, *offset+3);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+3, 1,
|
1999-12-12 12:59:01 +00:00
|
|
|
"Number of semi-octets in the alternative DTE address : %u",
|
2000-05-25 21:34:58 +00:00
|
|
|
byte3);
|
2005-08-19 23:28:23 +00:00
|
|
|
for (i = 0; (i<byte3)&&(i<256) ; i++) {
|
1999-12-12 12:59:01 +00:00
|
|
|
if (i % 2 == 0) {
|
2000-05-25 21:34:58 +00:00
|
|
|
tmpbuf[i] = ((tvb_get_guint8(tvb, *offset+4+i/2) >> 4)
|
|
|
|
& 0x0F) + '0';
|
1999-12-12 12:59:01 +00:00
|
|
|
/* if > 9, convert to the right hexadecimal letter */
|
|
|
|
if (tmpbuf[i] > '9') tmpbuf[i] += ('A' - '0' - 10);
|
|
|
|
} else {
|
2000-05-25 21:34:58 +00:00
|
|
|
tmpbuf[i] = (tvb_get_guint8(tvb, *offset+4+i/2)
|
|
|
|
& 0x0F) + '0';
|
1999-12-12 12:59:01 +00:00
|
|
|
/* if > 9, convert to the right hexadecimal letter */
|
|
|
|
if (tmpbuf[i] > '9') tmpbuf[i] += ('A' - '0' - 10);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tmpbuf[i] = 0;
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+4, byte1 - 2,
|
1999-12-12 12:59:01 +00:00
|
|
|
"Alternative DTE address : %s", tmpbuf);
|
|
|
|
}
|
1999-08-04 06:11:17 +00:00
|
|
|
break;
|
1999-12-09 13:51:08 +00:00
|
|
|
case X25_FAC_PRIORITY:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1,
|
|
|
|
"Code : %02X (Priority)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_priority);
|
2000-05-25 21:34:58 +00:00
|
|
|
byte1 = tvb_get_guint8(tvb, *offset+1);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Length : %u", byte1);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, byte1, "Value");
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-12-09 13:51:08 +00:00
|
|
|
break;
|
1999-08-02 02:26:22 +00:00
|
|
|
default:
|
1999-12-12 12:59:01 +00:00
|
|
|
if (fac_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
ti = proto_tree_add_text(fac_tree, tvb, *offset, 1,
|
|
|
|
"Code : %02X (Unknown class D)", fac);
|
1999-12-12 12:59:01 +00:00
|
|
|
fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_unknown);
|
2000-05-25 21:34:58 +00:00
|
|
|
byte1 = tvb_get_guint8(tvb, *offset+1);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+1, 1,
|
|
|
|
"Length : %u", byte1);
|
|
|
|
proto_tree_add_text(fac_subtree, tvb, *offset+2, byte1, "Value");
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
byte1 = tvb_get_guint8(tvb, *offset+1);
|
|
|
|
(*offset) += byte1+2;
|
|
|
|
len -= byte1+2;
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
static void
|
2000-05-25 21:34:58 +00:00
|
|
|
x25_ntoa(proto_tree *tree, int *offset, tvbuff_t *tvb,
|
2002-05-09 11:18:47 +00:00
|
|
|
packet_info *pinfo, gboolean is_registration)
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
1999-08-04 06:11:17 +00:00
|
|
|
int len1, len2;
|
1999-08-02 02:26:22 +00:00
|
|
|
int i;
|
2005-08-19 23:28:23 +00:00
|
|
|
char *addr1, *addr2;
|
1999-08-04 06:11:17 +00:00
|
|
|
char *first, *second;
|
2000-05-25 21:34:58 +00:00
|
|
|
guint8 byte;
|
|
|
|
int localoffset;
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2005-08-19 23:28:23 +00:00
|
|
|
addr1=ep_alloc(16);
|
|
|
|
addr2=ep_alloc(16);
|
|
|
|
|
2000-05-25 21:34:58 +00:00
|
|
|
byte = tvb_get_guint8(tvb, *offset);
|
2002-05-09 11:18:47 +00:00
|
|
|
len1 = (byte >> 0) & 0x0F;
|
|
|
|
len2 = (byte >> 4) & 0x0F;
|
2002-05-09 05:49:28 +00:00
|
|
|
|
1999-08-02 02:26:22 +00:00
|
|
|
if (tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(tree, tvb, *offset, 1,
|
|
|
|
decode_numeric_bitfield(byte, 0xF0, 1*8,
|
2002-05-09 11:18:47 +00:00
|
|
|
is_registration ?
|
|
|
|
"DTE address length : %u" :
|
1999-12-12 12:59:01 +00:00
|
|
|
"Calling address length : %u"));
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(tree, tvb, *offset, 1,
|
|
|
|
decode_numeric_bitfield(byte, 0x0F, 1*8,
|
2002-05-09 11:18:47 +00:00
|
|
|
is_registration ?
|
|
|
|
"DCE address length : %u" :
|
1999-12-12 12:59:01 +00:00
|
|
|
"Called address length : %u"));
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
(*offset)++;
|
|
|
|
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = *offset;
|
|
|
|
byte = tvb_get_guint8(tvb, localoffset);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
1999-08-04 06:11:17 +00:00
|
|
|
first=addr1;
|
|
|
|
second=addr2;
|
|
|
|
for (i = 0; i < (len1 + len2); i++) {
|
|
|
|
if (i < len1) {
|
1999-08-02 02:26:22 +00:00
|
|
|
if (i % 2 != 0) {
|
2000-05-25 21:34:58 +00:00
|
|
|
*first++ = ((byte >> 0) & 0x0F) + '0';
|
|
|
|
localoffset++;
|
|
|
|
byte = tvb_get_guint8(tvb, localoffset);
|
1999-08-02 02:26:22 +00:00
|
|
|
} else {
|
2000-05-25 21:34:58 +00:00
|
|
|
*first++ = ((byte >> 4) & 0x0F) + '0';
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (i % 2 != 0) {
|
2000-05-25 21:34:58 +00:00
|
|
|
*second++ = ((byte >> 0) & 0x0F) + '0';
|
|
|
|
localoffset++;
|
|
|
|
byte = tvb_get_guint8(tvb, localoffset);
|
1999-08-02 02:26:22 +00:00
|
|
|
} else {
|
2000-05-25 21:34:58 +00:00
|
|
|
*second++ = ((byte >> 4) & 0x0F) + '0';
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-08-04 06:11:17 +00:00
|
|
|
*first = '\0';
|
|
|
|
*second = '\0';
|
1999-08-02 02:26:22 +00:00
|
|
|
|
1999-08-04 06:11:17 +00:00
|
|
|
if (len1) {
|
2002-05-09 11:18:47 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_RES_DL_DST))
|
|
|
|
col_add_str(pinfo->cinfo, COL_RES_DL_DST, addr1);
|
1999-08-02 02:26:22 +00:00
|
|
|
if (tree)
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(tree, tvb, *offset,
|
1999-08-04 06:11:17 +00:00
|
|
|
(len1 + 1) / 2,
|
2002-05-09 11:18:47 +00:00
|
|
|
is_registration ?
|
|
|
|
"DCE address : %s" :
|
|
|
|
"Called address : %s",
|
1999-08-04 06:11:17 +00:00
|
|
|
addr1);
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
1999-08-04 06:11:17 +00:00
|
|
|
if (len2) {
|
2002-05-09 11:18:47 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_RES_DL_SRC))
|
|
|
|
col_add_str(pinfo->cinfo, COL_RES_DL_SRC, addr2);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, *offset + len1/2,
|
|
|
|
(len2+1)/2+(len1%2+(len2+1)%2)/2,
|
|
|
|
is_registration ?
|
|
|
|
"DTE address : %s" :
|
|
|
|
"Calling address : %s",
|
|
|
|
addr2);
|
|
|
|
}
|
|
|
|
(*offset) += ((len1 + len2 + 1) / 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
x25_toa(proto_tree *tree, int *offset, tvbuff_t *tvb,
|
|
|
|
packet_info *pinfo)
|
|
|
|
{
|
|
|
|
int len1, len2;
|
|
|
|
int i;
|
2005-08-19 23:28:23 +00:00
|
|
|
char *addr1, *addr2;
|
2002-05-09 11:18:47 +00:00
|
|
|
char *first, *second;
|
|
|
|
guint8 byte;
|
|
|
|
int localoffset;
|
|
|
|
|
2005-08-19 23:28:23 +00:00
|
|
|
addr1=ep_alloc(256);
|
|
|
|
addr2=ep_alloc(256);
|
|
|
|
|
2002-05-09 11:18:47 +00:00
|
|
|
len1 = tvb_get_guint8(tvb, *offset);
|
|
|
|
if (tree) {
|
|
|
|
proto_tree_add_text(tree, tvb, *offset, 1,
|
|
|
|
"Called address length : %u",
|
|
|
|
len1);
|
|
|
|
}
|
|
|
|
(*offset)++;
|
|
|
|
|
|
|
|
len2 = tvb_get_guint8(tvb, *offset);
|
|
|
|
if (tree) {
|
|
|
|
proto_tree_add_text(tree, tvb, *offset, 1,
|
|
|
|
"Calling address length : %u",
|
|
|
|
len2);
|
|
|
|
}
|
|
|
|
(*offset)++;
|
|
|
|
|
|
|
|
localoffset = *offset;
|
|
|
|
byte = tvb_get_guint8(tvb, localoffset);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XXX - the first two half-octets of the address are the TOA and
|
|
|
|
* NPI; process them as such and, if the TOA says an address is
|
|
|
|
* an alternative address, process it correctly (i.e., not as a
|
|
|
|
* sequence of half-octets containing digit values).
|
|
|
|
*/
|
|
|
|
first=addr1;
|
|
|
|
second=addr2;
|
|
|
|
for (i = 0; i < (len1 + len2); i++) {
|
|
|
|
if (i < len1) {
|
|
|
|
if (i % 2 != 0) {
|
|
|
|
*first++ = ((byte >> 0) & 0x0F) + '0';
|
|
|
|
localoffset++;
|
|
|
|
byte = tvb_get_guint8(tvb, localoffset);
|
|
|
|
} else {
|
|
|
|
*first++ = ((byte >> 4) & 0x0F) + '0';
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (i % 2 != 0) {
|
|
|
|
*second++ = ((byte >> 0) & 0x0F) + '0';
|
|
|
|
localoffset++;
|
|
|
|
byte = tvb_get_guint8(tvb, localoffset);
|
|
|
|
} else {
|
|
|
|
*second++ = ((byte >> 4) & 0x0F) + '0';
|
|
|
|
}
|
1999-12-12 12:59:01 +00:00
|
|
|
}
|
2002-05-09 11:18:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*first = '\0';
|
|
|
|
*second = '\0';
|
|
|
|
|
|
|
|
if (len1) {
|
|
|
|
if (check_col(pinfo->cinfo, COL_RES_DL_DST))
|
|
|
|
col_add_str(pinfo->cinfo, COL_RES_DL_DST, addr1);
|
|
|
|
if (tree)
|
|
|
|
proto_tree_add_text(tree, tvb, *offset,
|
|
|
|
(len1 + 1) / 2,
|
|
|
|
"Called address : %s",
|
|
|
|
addr1);
|
|
|
|
}
|
|
|
|
if (len2) {
|
|
|
|
if (check_col(pinfo->cinfo, COL_RES_DL_SRC))
|
|
|
|
col_add_str(pinfo->cinfo, COL_RES_DL_SRC, addr2);
|
1999-08-02 02:26:22 +00:00
|
|
|
if (tree)
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(tree, tvb, *offset + len1/2,
|
1999-08-04 06:11:17 +00:00
|
|
|
(len2+1)/2+(len1%2+(len2+1)%2)/2,
|
2002-05-09 11:18:47 +00:00
|
|
|
"Calling address : %s",
|
1999-08-04 06:11:17 +00:00
|
|
|
addr2);
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
1999-08-04 06:11:17 +00:00
|
|
|
(*offset) += ((len1 + len2 + 1) / 2);
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
static int
|
2000-05-25 21:34:58 +00:00
|
|
|
get_x25_pkt_len(tvbuff_t *tvb)
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
2001-07-05 22:10:09 +00:00
|
|
|
guint length, called_len, calling_len, dte_len, dce_len;
|
2000-05-25 21:34:58 +00:00
|
|
|
guint8 byte2, bytex;
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2000-05-25 21:34:58 +00:00
|
|
|
byte2 = tvb_get_guint8(tvb, 2);
|
|
|
|
switch (byte2)
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
|
|
|
case X25_CALL_REQUEST:
|
2000-05-25 21:34:58 +00:00
|
|
|
bytex = tvb_get_guint8(tvb, 3);
|
|
|
|
called_len = (bytex >> 0) & 0x0F;
|
|
|
|
calling_len = (bytex >> 4) & 0x0F;
|
|
|
|
length = 4 + (called_len + calling_len + 1) / 2; /* addr */
|
2000-05-29 22:35:11 +00:00
|
|
|
if (length < tvb_reported_length(tvb))
|
2000-05-25 21:34:58 +00:00
|
|
|
length += (1 + tvb_get_guint8(tvb, length)); /* facilities */
|
|
|
|
|
2000-05-29 22:35:11 +00:00
|
|
|
return MIN(tvb_reported_length(tvb),length);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
|
|
|
case X25_CALL_ACCEPTED:
|
2001-07-18 15:49:29 +00:00
|
|
|
/* The calling/called address length byte (following the packet type)
|
|
|
|
* is not mandatory, so we must check the packet length before trying
|
|
|
|
* to read it */
|
|
|
|
if (tvb_reported_length(tvb) == 3)
|
|
|
|
return(3);
|
2000-05-25 21:34:58 +00:00
|
|
|
bytex = tvb_get_guint8(tvb, 3);
|
|
|
|
called_len = (bytex >> 0) & 0x0F;
|
|
|
|
calling_len = (bytex >> 4) & 0x0F;
|
|
|
|
length = 4 + (called_len + calling_len + 1) / 2; /* addr */
|
2000-05-29 22:35:11 +00:00
|
|
|
if (length < tvb_reported_length(tvb))
|
2000-05-25 21:34:58 +00:00
|
|
|
length += (1 + tvb_get_guint8(tvb, length)); /* facilities */
|
|
|
|
|
2000-05-29 22:35:11 +00:00
|
|
|
return MIN(tvb_reported_length(tvb),length);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
|
|
|
case X25_CLEAR_REQUEST:
|
1999-09-12 18:37:01 +00:00
|
|
|
case X25_RESET_REQUEST:
|
|
|
|
case X25_RESTART_REQUEST:
|
2000-05-29 22:35:11 +00:00
|
|
|
return MIN(tvb_reported_length(tvb),5);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
|
|
|
case X25_DIAGNOSTIC:
|
2000-05-29 22:35:11 +00:00
|
|
|
return MIN(tvb_reported_length(tvb),4);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
1999-09-12 18:37:01 +00:00
|
|
|
case X25_CLEAR_CONFIRMATION:
|
1999-08-02 02:26:22 +00:00
|
|
|
case X25_INTERRUPT:
|
|
|
|
case X25_INTERRUPT_CONFIRMATION:
|
|
|
|
case X25_RESET_CONFIRMATION:
|
|
|
|
case X25_RESTART_CONFIRMATION:
|
2000-05-29 22:35:11 +00:00
|
|
|
return MIN(tvb_reported_length(tvb),3);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
|
|
|
case X25_REGISTRATION_REQUEST:
|
2000-05-25 21:34:58 +00:00
|
|
|
bytex = tvb_get_guint8(tvb, 3);
|
|
|
|
dce_len = (bytex >> 0) & 0x0F;
|
|
|
|
dte_len = (bytex >> 4) & 0x0F;
|
|
|
|
length = 4 + (dte_len + dce_len + 1) / 2; /* addr */
|
2000-05-29 22:35:11 +00:00
|
|
|
if (length < tvb_reported_length(tvb))
|
2000-05-25 21:34:58 +00:00
|
|
|
length += (1 + tvb_get_guint8(tvb, length)); /* registration */
|
|
|
|
|
2000-05-29 22:35:11 +00:00
|
|
|
return MIN(tvb_reported_length(tvb),length);
|
1999-09-12 18:37:01 +00:00
|
|
|
|
1999-08-02 02:26:22 +00:00
|
|
|
case X25_REGISTRATION_CONFIRMATION:
|
2000-05-25 21:34:58 +00:00
|
|
|
bytex = tvb_get_guint8(tvb, 5);
|
|
|
|
dce_len = (bytex >> 0) & 0x0F;
|
|
|
|
dte_len = (bytex >> 4) & 0x0F;
|
|
|
|
length = 6 + (dte_len + dce_len + 1) / 2; /* addr */
|
2000-05-29 22:35:11 +00:00
|
|
|
if (length < tvb_reported_length(tvb))
|
2000-05-25 21:34:58 +00:00
|
|
|
length += (1 + tvb_get_guint8(tvb, length)); /* registration */
|
|
|
|
|
2000-05-29 22:35:11 +00:00
|
|
|
return MIN(tvb_reported_length(tvb),length);
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
|
2003-01-08 08:43:09 +00:00
|
|
|
if (PACKET_IS_DATA(byte2))
|
|
|
|
return MIN(tvb_reported_length(tvb),3);
|
2000-05-25 21:34:58 +00:00
|
|
|
|
2003-01-08 08:43:09 +00:00
|
|
|
switch (PACKET_TYPE_FC(byte2))
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
|
|
|
case X25_RR:
|
2000-05-29 22:35:11 +00:00
|
|
|
return MIN(tvb_reported_length(tvb),3);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
|
|
|
case X25_RNR:
|
2000-05-29 22:35:11 +00:00
|
|
|
return MIN(tvb_reported_length(tvb),3);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
|
|
|
case X25_REJ:
|
2000-05-29 22:35:11 +00:00
|
|
|
return MIN(tvb_reported_length(tvb),3);
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2000-01-30 05:58:02 +00:00
|
|
|
static const value_string prt_id_vals[] = {
|
2001-12-02 00:38:54 +00:00
|
|
|
{PRT_ID_ISO_8073, "ISO 8073 COTP"},
|
|
|
|
{PRT_ID_ISO_8602, "ISO 8602 CLTP"},
|
|
|
|
{PRT_ID_ISO_10736_ISO_8073, "ISO 10736 in conjunction with ISO 8073 COTP"},
|
|
|
|
{PRT_ID_ISO_10736_ISO_8602, "ISO 10736 in conjunction with ISO 8602 CLTP"},
|
|
|
|
{0x00, NULL}
|
2000-01-30 05:58:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string sharing_strategy_vals[] = {
|
|
|
|
{0x00, "No sharing"},
|
|
|
|
{0x00, NULL}
|
|
|
|
};
|
|
|
|
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
static void
|
2002-04-09 08:15:04 +00:00
|
|
|
dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
2003-03-05 05:20:38 +00:00
|
|
|
x25_dir_t dir, gboolean side)
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
2001-12-02 00:07:46 +00:00
|
|
|
proto_tree *x25_tree=0, *gfi_tree=0, *userdata_tree=0;
|
2001-01-03 23:30:50 +00:00
|
|
|
proto_item *ti;
|
2001-07-05 22:10:09 +00:00
|
|
|
guint localoffset=0;
|
|
|
|
guint x25_pkt_len;
|
1999-08-02 02:26:22 +00:00
|
|
|
int modulo;
|
|
|
|
guint16 vc;
|
2003-02-28 00:48:06 +00:00
|
|
|
dissector_handle_t dissect = NULL;
|
1999-12-12 12:59:01 +00:00
|
|
|
gboolean toa; /* TOA/NPI address format */
|
2000-05-25 21:34:58 +00:00
|
|
|
guint16 bytes0_1;
|
|
|
|
guint8 pkt_type;
|
2005-08-05 13:10:58 +00:00
|
|
|
const char *short_name = NULL, *long_name = NULL;
|
2003-03-04 19:50:23 +00:00
|
|
|
tvbuff_t *next_tvb = NULL;
|
2001-11-15 21:11:01 +00:00
|
|
|
gboolean q_bit_set = FALSE;
|
2003-03-05 01:12:11 +00:00
|
|
|
gboolean m_bit_set;
|
|
|
|
gint payload_len;
|
2003-03-05 05:20:38 +00:00
|
|
|
guint32 frag_key;
|
2003-01-06 02:24:57 +00:00
|
|
|
void *saved_private_data;
|
2003-03-04 19:50:23 +00:00
|
|
|
fragment_data *fd_head;
|
2000-05-25 21:34:58 +00:00
|
|
|
|
2007-03-26 11:06:26 +00:00
|
|
|
|
|
|
|
guint8 spi;
|
|
|
|
int is_x_264;
|
|
|
|
guint8 prt_id;
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "X.25");
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2000-05-25 21:34:58 +00:00
|
|
|
bytes0_1 = tvb_get_ntohs(tvb, 0);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2000-05-25 21:34:58 +00:00
|
|
|
modulo = ((bytes0_1 & 0x2000) ? 128 : 8);
|
|
|
|
vc = (int)(bytes0_1 & 0x0FFF);
|
1999-12-12 12:59:01 +00:00
|
|
|
|
2002-11-08 01:00:07 +00:00
|
|
|
pinfo->ctype = CT_X25;
|
|
|
|
pinfo->circuit_id = vc;
|
|
|
|
|
2003-03-05 01:12:11 +00:00
|
|
|
if (bytes0_1 & X25_ABIT) toa = TRUE;
|
1999-12-12 12:59:01 +00:00
|
|
|
else toa = FALSE;
|
|
|
|
|
2000-05-25 21:34:58 +00:00
|
|
|
x25_pkt_len = get_x25_pkt_len(tvb);
|
1999-09-12 18:37:01 +00:00
|
|
|
if (x25_pkt_len < 3) /* packet too short */
|
|
|
|
{
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Invalid/short X.25 packet");
|
1999-09-12 18:37:01 +00:00
|
|
|
if (tree)
|
2002-01-24 09:20:54 +00:00
|
|
|
proto_tree_add_protocol_format(tree, proto_x25, tvb, 0, -1,
|
|
|
|
"Invalid/short X.25 packet");
|
1999-09-12 18:37:01 +00:00
|
|
|
return;
|
|
|
|
}
|
2001-01-03 23:30:50 +00:00
|
|
|
|
|
|
|
pkt_type = tvb_get_guint8(tvb, 2);
|
2003-01-08 08:43:09 +00:00
|
|
|
if (PACKET_IS_DATA(pkt_type)) {
|
2003-03-05 01:12:11 +00:00
|
|
|
if (bytes0_1 & X25_QBIT)
|
2003-01-06 02:24:57 +00:00
|
|
|
q_bit_set = TRUE;
|
|
|
|
}
|
2001-01-03 23:30:50 +00:00
|
|
|
|
1999-08-02 02:26:22 +00:00
|
|
|
if (tree) {
|
2001-11-15 21:11:01 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_x25, tvb, 0, x25_pkt_len, FALSE);
|
|
|
|
x25_tree = proto_item_add_subtree(ti, ett_x25);
|
|
|
|
ti = proto_tree_add_item(x25_tree, hf_x25_gfi, tvb, 0, 2, FALSE);
|
|
|
|
gfi_tree = proto_item_add_subtree(ti, ett_x25_gfi);
|
|
|
|
|
2003-01-08 08:43:09 +00:00
|
|
|
if (PACKET_IS_DATA(pkt_type)) {
|
2001-11-15 21:11:01 +00:00
|
|
|
proto_tree_add_boolean(gfi_tree, hf_x25_qbit, tvb, 0, 2,
|
|
|
|
bytes0_1);
|
|
|
|
}
|
|
|
|
else if (pkt_type == X25_CALL_REQUEST ||
|
|
|
|
pkt_type == X25_CALL_ACCEPTED ||
|
|
|
|
pkt_type == X25_CLEAR_REQUEST ||
|
|
|
|
pkt_type == X25_CLEAR_CONFIRMATION) {
|
|
|
|
proto_tree_add_boolean(gfi_tree, hf_x25_abit, tvb, 0, 2,
|
|
|
|
bytes0_1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pkt_type == X25_CALL_REQUEST || pkt_type == X25_CALL_ACCEPTED ||
|
2003-01-08 08:43:09 +00:00
|
|
|
PACKET_IS_DATA(pkt_type)) {
|
2001-11-15 21:11:01 +00:00
|
|
|
proto_tree_add_boolean(gfi_tree, hf_x25_dbit, tvb, 0, 2,
|
|
|
|
bytes0_1);
|
|
|
|
}
|
|
|
|
proto_tree_add_uint(gfi_tree, hf_x25_mod, tvb, 0, 2, bytes0_1);
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
|
|
|
|
switch (pkt_type) {
|
1999-08-02 02:26:22 +00:00
|
|
|
case X25_CALL_REQUEST:
|
2002-04-09 08:15:04 +00:00
|
|
|
switch (dir) {
|
|
|
|
|
|
|
|
case X25_FROM_DCE:
|
|
|
|
short_name = "Inc. call";
|
|
|
|
long_name = "Incoming call";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X25_FROM_DTE:
|
|
|
|
short_name = "Call req.";
|
|
|
|
long_name = "Call request";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X25_UNKNOWN:
|
|
|
|
short_name = "Inc. call/Call req.";
|
|
|
|
long_name = "Incoming call/Call request";
|
|
|
|
break;
|
|
|
|
}
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2002-04-09 08:15:04 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d", short_name, vc);
|
1999-10-18 01:51:34 +00:00
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb,
|
2000-05-25 21:34:58 +00:00
|
|
|
0, 2, bytes0_1);
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint_format(x25_tree, hf_x25_type, tvb, 2, 1,
|
2003-01-08 08:43:09 +00:00
|
|
|
X25_CALL_REQUEST, "Packet Type: %s", long_name);
|
1999-10-18 01:51:34 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = 3;
|
2002-05-09 11:18:47 +00:00
|
|
|
if (localoffset < x25_pkt_len) { /* calling/called addresses */
|
|
|
|
if (toa)
|
2007-03-26 11:06:26 +00:00
|
|
|
x25_toa(x25_tree, (gint*)&localoffset, tvb, pinfo);
|
2002-05-09 11:18:47 +00:00
|
|
|
else
|
2007-03-26 11:06:26 +00:00
|
|
|
x25_ntoa(x25_tree, (gint*)&localoffset, tvb, pinfo, FALSE);
|
2002-05-09 11:18:47 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2000-05-25 21:34:58 +00:00
|
|
|
if (localoffset < x25_pkt_len) /* facilities */
|
2007-03-26 11:06:26 +00:00
|
|
|
dump_facilities(x25_tree, (gint*)&localoffset, tvb);
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2000-05-29 22:35:11 +00:00
|
|
|
if (localoffset < tvb_reported_length(tvb)) /* user data */
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
2000-01-30 05:58:02 +00:00
|
|
|
|
2001-12-02 00:07:46 +00:00
|
|
|
if (x25_tree) {
|
2002-01-24 09:20:54 +00:00
|
|
|
ti = proto_tree_add_text(x25_tree, tvb, localoffset, -1,
|
2001-12-02 00:07:46 +00:00
|
|
|
"User data");
|
|
|
|
userdata_tree = proto_item_add_subtree(ti, ett_x25_user_data);
|
|
|
|
}
|
2000-01-30 05:58:02 +00:00
|
|
|
|
2001-12-02 00:07:46 +00:00
|
|
|
/* X.263/ISO 9577 says that:
|
|
|
|
|
|
|
|
When CLNP or ESIS are run over X.25, the SPI
|
|
|
|
is 0x81 or 0x82, respectively; those are the
|
|
|
|
NLPIDs for those protocol.
|
|
|
|
|
|
|
|
When X.224/ISO 8073 COTP is run over X.25, and
|
|
|
|
when ISO 11570 explicit identification is being
|
|
|
|
used, the first octet of the user data field is
|
|
|
|
a TPDU length field, and the rest is "as defined
|
|
|
|
in ITU-T Rec. X.225 | ISO/IEC 8073, Annex B,
|
|
|
|
or ITU-T Rec. X.264 and ISO/IEC 11570".
|
|
|
|
|
|
|
|
When X.264/ISO 11570 default identification is
|
|
|
|
being used, there is no user data field in the
|
|
|
|
CALL REQUEST packet. This is for X.225/ISO 8073
|
|
|
|
COTP.
|
|
|
|
|
|
|
|
It also says that SPI values from 0x03 through 0x3f are
|
|
|
|
reserved and are in use by X.224/ISO 8073 Annex B and
|
|
|
|
X.264/ISO 11570. The note says that those values are
|
|
|
|
not NLPIDs, they're "used by the respective higher layer
|
|
|
|
protocol" and "not used for higher layer protocol
|
|
|
|
identification". I infer from this and from what
|
|
|
|
X.264/ISO 11570 says that this means that values in those
|
|
|
|
range are valid values for the first octet of an
|
|
|
|
X.224/ISO 8073 packet or for X.264/ISO 11570.
|
|
|
|
|
|
|
|
Annex B of X.225/ISO 8073 mentions some additional TPDU
|
|
|
|
types that can be put in what I presume is the user
|
|
|
|
data of connect requests. It says that:
|
|
|
|
|
|
|
|
The sending transport entity shall:
|
|
|
|
|
|
|
|
a) either not transmit any TPDU in the NS-user data
|
|
|
|
parameter of the N-CONNECT request primitive; or
|
|
|
|
|
|
|
|
b) transmit the UN-TPDU (see ITU-T Rec. X.264 and
|
|
|
|
ISO/IEC 11570) followed by the NCM-TPDU in the
|
|
|
|
NS-user data parameter of the N-CONNECT request
|
|
|
|
primitive.
|
|
|
|
|
|
|
|
I don't know if this means that the user data field
|
|
|
|
will contain a UN TPDU followed by an NCM TPDU or not.
|
|
|
|
|
|
|
|
X.264/ISO 11570 says that:
|
|
|
|
|
|
|
|
When default identification is being used,
|
|
|
|
X.225/ISO 8073 COTP is identified. No user data
|
|
|
|
is sent in the network-layer connection request.
|
|
|
|
|
|
|
|
When explicit identification is being used,
|
|
|
|
the user data is a UN TPDU ("Use of network
|
|
|
|
connection TPDU"), which specifies the transport
|
|
|
|
protocol to use over this network connection.
|
|
|
|
It also says that the length of a UN TPDU shall
|
|
|
|
not exceed 32 octets, i.e. shall not exceed 0x20;
|
|
|
|
it says this is "due to the desire not to conflict
|
|
|
|
with the protocol identifier field carried by X.25
|
|
|
|
CALL REQUEST/INCOMING CALL packets", and says that
|
|
|
|
field has values specified in X.244. X.244 has been
|
|
|
|
superseded by X.263/ISO 9577, so that presumably
|
|
|
|
means the goal is to allow a UN TPDU's length
|
|
|
|
field to be distinguished from an NLPID, allowing
|
|
|
|
you to tell whether X.264/ISO 11570 explicit
|
|
|
|
identification is being used or an NLPID is
|
|
|
|
being used as the SPI.
|
|
|
|
|
|
|
|
I read this as meaning that, if the ISO mechanisms are
|
|
|
|
used to identify the protocol being carried over X.25:
|
|
|
|
|
|
|
|
if there's no user data in the CALL REQUEST/
|
|
|
|
INCOMING CALL packet, it's COTP;
|
|
|
|
|
|
|
|
if there is user data, then:
|
|
|
|
|
|
|
|
if the first octet is less than or equal to
|
|
|
|
32, it might be a UN TPDU, and that identifies
|
|
|
|
the transport protocol being used, and
|
|
|
|
it may be followed by more data, such
|
|
|
|
as a COTP NCM TPDU if it's COTP;
|
|
|
|
|
|
|
|
if the first octet is greater than 32, it's
|
|
|
|
an NLPID, *not* a TPDU length, and the
|
|
|
|
stuff following it is *not* a TPDU.
|
|
|
|
|
|
|
|
Figure A.2 of X.263/ISO 9577 seems to say that the
|
|
|
|
first octet of the user data is a TPDU length field,
|
|
|
|
in the range 0x03 through 0x82, and says they are
|
|
|
|
for X.225/ISO 8073 Annex B or X.264/ISO 11570.
|
|
|
|
|
|
|
|
However, X.264/ISO 11570 seems to imply that the length
|
|
|
|
field would be that of a UN TPDU, which must be less
|
|
|
|
than or equal to 0x20, and X.225/ISO 8073 Annex B seems
|
|
|
|
to indicate that the user data must begin with
|
|
|
|
an X.264/ISO 11570 UN TPDU, so I'd say that A.2 should
|
|
|
|
have said "in the range 0x03 through 0x20", instead
|
|
|
|
(the length value doesn't include the length field,
|
|
|
|
and the minimum UN TPDU has length, type, PRT-ID,
|
|
|
|
and SHARE, so that's 3 bytes without the length). */
|
|
|
|
spi = tvb_get_guint8(tvb, localoffset);
|
|
|
|
if (spi > 32 || spi < 3) {
|
|
|
|
/* First octet is > 32, or < 3, so the user data isn't an
|
|
|
|
X.264/ISO 11570 UN TPDU */
|
|
|
|
is_x_264 = FALSE;
|
|
|
|
} else {
|
|
|
|
/* First octet is >= 3 and <= 32, so the user data *might*
|
|
|
|
be an X.264/ISO 11570 UN TPDU. Check whether we have
|
|
|
|
enough data to see if it is. */
|
|
|
|
if (tvb_bytes_exist(tvb, localoffset+1, 1)) {
|
|
|
|
/* We do; check whether the second octet is 1. */
|
|
|
|
if (tvb_get_guint8(tvb, localoffset+1) == 0x01) {
|
|
|
|
/* Yes, the second byte is 1, so it looks like
|
|
|
|
a UN TPDU. */
|
|
|
|
is_x_264 = TRUE;
|
|
|
|
} else {
|
|
|
|
/* No, the second byte is not 1, so it's not a
|
|
|
|
UN TPDU. */
|
|
|
|
is_x_264 = FALSE;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* We can't see the second byte of the putative UN
|
|
|
|
TPDU, so we don't know if that's what it is. */
|
|
|
|
is_x_264 = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (is_x_264 == -1) {
|
|
|
|
/*
|
|
|
|
* We don't know what it is; just skip it.
|
|
|
|
*/
|
|
|
|
localoffset = tvb_length(tvb);
|
|
|
|
} else if (is_x_264) {
|
|
|
|
/* It looks like an X.264 UN TPDU, so show it as such. */
|
|
|
|
if (userdata_tree) {
|
|
|
|
proto_tree_add_text(userdata_tree, tvb, localoffset, 1,
|
2000-01-30 05:58:02 +00:00
|
|
|
"X.264 length indicator: %u",
|
2000-05-25 21:34:58 +00:00
|
|
|
spi);
|
2001-12-02 00:07:46 +00:00
|
|
|
proto_tree_add_text(userdata_tree, tvb, localoffset+1, 1,
|
|
|
|
"X.264 UN TPDU identifier: 0x%02X",
|
|
|
|
tvb_get_guint8(tvb, localoffset+1));
|
|
|
|
}
|
|
|
|
prt_id = tvb_get_guint8(tvb, localoffset+2);
|
|
|
|
if (userdata_tree) {
|
2003-10-07 18:19:59 +00:00
|
|
|
proto_tree_add_text(userdata_tree, tvb, localoffset+2, 1,
|
2001-12-02 00:07:46 +00:00
|
|
|
"X.264 protocol identifier: %s",
|
2000-05-25 21:34:58 +00:00
|
|
|
val_to_str(prt_id, prt_id_vals,
|
2001-12-02 00:07:46 +00:00
|
|
|
"Unknown (0x%02X)"));
|
2003-10-07 18:19:59 +00:00
|
|
|
proto_tree_add_text(userdata_tree, tvb, localoffset+3, 1,
|
2001-12-02 00:07:46 +00:00
|
|
|
"X.264 sharing strategy: %s",
|
2000-05-25 21:34:58 +00:00
|
|
|
val_to_str(tvb_get_guint8(tvb, localoffset+3),
|
2001-12-02 00:07:46 +00:00
|
|
|
sharing_strategy_vals, "Unknown (0x%02X)"));
|
|
|
|
}
|
2000-01-30 05:58:02 +00:00
|
|
|
|
2001-12-02 00:07:46 +00:00
|
|
|
/* XXX - dissect the variable part? */
|
2000-01-30 05:58:02 +00:00
|
|
|
|
2001-12-02 00:07:46 +00:00
|
|
|
/* The length doesn't include the length octet itself. */
|
|
|
|
localoffset += spi + 1;
|
2000-01-30 05:58:02 +00:00
|
|
|
|
2001-12-02 00:07:46 +00:00
|
|
|
switch (prt_id) {
|
2000-01-30 05:58:02 +00:00
|
|
|
|
2001-12-02 00:07:46 +00:00
|
|
|
case PRT_ID_ISO_8073:
|
|
|
|
/* ISO 8073 COTP */
|
2003-01-11 10:03:12 +00:00
|
|
|
if (!pinfo->fd->flags.visited)
|
|
|
|
x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle);
|
2003-01-06 02:24:57 +00:00
|
|
|
/* XXX - dissect the rest of the user data as COTP?
|
2001-12-02 00:07:46 +00:00
|
|
|
That needs support for NCM TPDUs, etc. */
|
|
|
|
break;
|
2001-12-02 00:38:54 +00:00
|
|
|
|
|
|
|
case PRT_ID_ISO_8602:
|
|
|
|
/* ISO 8602 CLTP */
|
2003-01-11 10:03:12 +00:00
|
|
|
if (!pinfo->fd->flags.visited)
|
|
|
|
x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle);
|
2001-12-02 00:38:54 +00:00
|
|
|
break;
|
2000-01-30 05:58:02 +00:00
|
|
|
}
|
2001-12-02 00:07:46 +00:00
|
|
|
} else if (is_x_264 == 0) {
|
|
|
|
/* It doesn't look like a UN TPDU, so compare the first
|
|
|
|
octet of the CALL REQUEST packet with various X.263/
|
2002-08-28 21:04:11 +00:00
|
|
|
ISO 9577 NLPIDs, as per Annex A of X.263/ISO 9577. */
|
2001-12-02 00:07:46 +00:00
|
|
|
|
|
|
|
if (userdata_tree) {
|
|
|
|
proto_tree_add_text(userdata_tree, tvb, localoffset, 1,
|
|
|
|
"X.263 secondary protocol ID: %s",
|
|
|
|
val_to_str(spi, nlpid_vals, "Unknown (0x%02x)"));
|
|
|
|
}
|
2003-02-28 00:48:06 +00:00
|
|
|
|
2003-03-01 08:50:46 +00:00
|
|
|
if (!pinfo->fd->flags.visited) {
|
|
|
|
/*
|
|
|
|
* Is there a dissector handle for this SPI?
|
|
|
|
* If so, assign it to this virtual circuit.
|
|
|
|
*/
|
|
|
|
dissect = dissector_get_port_handle(x25_subdissector_table, spi);
|
|
|
|
if (dissect != NULL)
|
|
|
|
x25_hash_add_proto_start(vc, pinfo->fd->num, dissect);
|
|
|
|
}
|
|
|
|
|
2003-02-28 00:48:06 +00:00
|
|
|
/*
|
2003-03-01 08:50:46 +00:00
|
|
|
* If there's only one octet of user data, it's just
|
|
|
|
* an NLPID; don't try to dissect it.
|
|
|
|
*/
|
2003-03-04 19:50:23 +00:00
|
|
|
if (localoffset + 1 == tvb_reported_length(tvb))
|
2003-03-01 08:50:46 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* There's more than one octet of user data, so we'll
|
2003-02-28 00:48:06 +00:00
|
|
|
* dissect it; for some protocols, the NLPID is considered
|
|
|
|
* to be part of the PDU, so, for those cases, we don't
|
|
|
|
* skip past it. For other protocols, we skip the NLPID.
|
|
|
|
*/
|
|
|
|
switch (spi) {
|
|
|
|
|
|
|
|
case NLPID_ISO8473_CLNP:
|
|
|
|
case NLPID_ISO9542_ESIS:
|
|
|
|
case NLPID_ISO10589_ISIS:
|
|
|
|
case NLPID_ISO10747_IDRP:
|
|
|
|
case NLPID_SNDCF:
|
|
|
|
/*
|
|
|
|
* The NLPID is part of the PDU. Don't skip it.
|
2003-03-01 08:50:46 +00:00
|
|
|
* But if it's all there is to the PDU, don't
|
|
|
|
* bother dissecting it.
|
2003-02-28 00:48:06 +00:00
|
|
|
*/
|
|
|
|
break;
|
|
|
|
|
2003-03-01 10:02:35 +00:00
|
|
|
case NLPID_SPI_X_29:
|
|
|
|
/*
|
|
|
|
* The first 4 bytes of the call user data are
|
|
|
|
* the SPI plus 3 reserved bytes; they are not
|
|
|
|
* part of the data to be dissected as X.29 data.
|
|
|
|
*/
|
|
|
|
localoffset += 4;
|
|
|
|
break;
|
|
|
|
|
2003-02-28 00:48:06 +00:00
|
|
|
default:
|
|
|
|
/*
|
|
|
|
* The NLPID isn't part of the PDU - skip it.
|
2003-03-01 08:50:46 +00:00
|
|
|
* If that means there's nothing to dissect
|
2003-02-28 00:48:06 +00:00
|
|
|
*/
|
|
|
|
localoffset++;
|
|
|
|
}
|
2001-12-02 00:07:46 +00:00
|
|
|
}
|
2007-03-14 17:28:55 +00:00
|
|
|
} else {
|
|
|
|
/* if there's no user data in the CALL REQUEST/
|
|
|
|
INCOMING CALL packet, it's COTP; */
|
|
|
|
|
2008-03-16 10:19:51 +00:00
|
|
|
if (call_request_nodata_is_cotp){
|
|
|
|
x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle);
|
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case X25_CALL_ACCEPTED:
|
2002-04-09 08:15:04 +00:00
|
|
|
switch (dir) {
|
|
|
|
|
|
|
|
case X25_FROM_DCE:
|
|
|
|
short_name = "Call conn.";
|
|
|
|
long_name = "Call connected";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X25_FROM_DTE:
|
|
|
|
short_name = "Call acc.";
|
|
|
|
long_name = "Call accepted";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X25_UNKNOWN:
|
|
|
|
short_name = "Call conn./Call acc.";
|
|
|
|
long_name = "Call connected/Call accepted";
|
|
|
|
break;
|
|
|
|
}
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
2002-04-09 08:15:04 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d", short_name, vc);
|
1999-10-18 01:51:34 +00:00
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1);
|
|
|
|
proto_tree_add_uint_format(x25_tree, hf_x25_type, tvb, 2, 1,
|
2003-01-08 08:43:09 +00:00
|
|
|
X25_CALL_ACCEPTED, "Packet Type: %s", long_name);
|
1999-10-18 01:51:34 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = 3;
|
2002-05-09 11:18:47 +00:00
|
|
|
if (localoffset < x25_pkt_len) { /* calling/called addresses */
|
|
|
|
if (toa)
|
2007-03-26 11:06:26 +00:00
|
|
|
x25_toa(x25_tree, (gint*)&localoffset, tvb, pinfo);
|
2002-05-09 11:18:47 +00:00
|
|
|
else
|
2007-03-26 11:06:26 +00:00
|
|
|
x25_ntoa(x25_tree, (gint*)&localoffset, tvb, pinfo, FALSE);
|
2002-05-09 11:18:47 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2000-05-25 21:34:58 +00:00
|
|
|
if (localoffset < x25_pkt_len) /* facilities */
|
2007-03-26 11:06:26 +00:00
|
|
|
dump_facilities(x25_tree, (gint*)&localoffset, tvb);
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_CLEAR_REQUEST:
|
2002-04-09 08:15:04 +00:00
|
|
|
switch (dir) {
|
|
|
|
|
|
|
|
case X25_FROM_DCE:
|
|
|
|
short_name = "Clear ind.";
|
|
|
|
long_name = "Clear indication";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X25_FROM_DTE:
|
|
|
|
short_name = "Clear req.";
|
|
|
|
long_name = "Clear request";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X25_UNKNOWN:
|
|
|
|
short_name = "Clear ind./Clear req.";
|
|
|
|
long_name = "Clear indication/Clear request";
|
|
|
|
break;
|
|
|
|
}
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO)) {
|
2002-04-09 08:15:04 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d %s - %s", short_name,
|
2000-05-25 21:34:58 +00:00
|
|
|
vc, clear_code(tvb_get_guint8(tvb, 3)),
|
|
|
|
clear_diag(tvb_get_guint8(tvb, 4)));
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
2002-11-08 01:00:07 +00:00
|
|
|
x25_hash_add_proto_end(vc, pinfo->fd->num);
|
1999-08-02 02:26:22 +00:00
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1);
|
|
|
|
proto_tree_add_uint_format(x25_tree, hf_x25_type, tvb,
|
2003-01-08 08:43:09 +00:00
|
|
|
localoffset+2, 1, X25_CLEAR_REQUEST, "Packet Type: %s",
|
|
|
|
long_name);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(x25_tree, tvb, 3, 1,
|
|
|
|
"Cause : %s", clear_code(tvb_get_guint8(tvb, 3)));
|
|
|
|
proto_tree_add_text(x25_tree, tvb, 4, 1,
|
|
|
|
"Diagnostic : %s", clear_diag(tvb_get_guint8(tvb, 4)));
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = x25_pkt_len;
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_CLEAR_CONFIRMATION:
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Clear Conf. VC:%d", vc);
|
1999-10-18 01:51:34 +00:00
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1);
|
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1,
|
|
|
|
X25_CLEAR_CONFIRMATION);
|
1999-10-18 01:51:34 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = x25_pkt_len;
|
1999-08-04 06:11:17 +00:00
|
|
|
|
2002-05-09 11:18:47 +00:00
|
|
|
if (localoffset < tvb_reported_length(tvb)) { /* extended clear conf format */
|
|
|
|
if (toa)
|
2007-03-26 11:06:26 +00:00
|
|
|
x25_toa(x25_tree, (gint*)&localoffset, tvb, pinfo);
|
2002-05-09 11:18:47 +00:00
|
|
|
else
|
2007-03-26 11:06:26 +00:00
|
|
|
x25_ntoa(x25_tree,(gint*)&localoffset, tvb, pinfo, FALSE);
|
2002-05-09 11:18:47 +00:00
|
|
|
}
|
1999-08-04 06:11:17 +00:00
|
|
|
|
2000-05-29 22:35:11 +00:00
|
|
|
if (localoffset < tvb_reported_length(tvb)) /* facilities */
|
2007-03-26 11:06:26 +00:00
|
|
|
dump_facilities(x25_tree, (gint*)&localoffset, tvb);
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_DIAGNOSTIC:
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Diag. %d",
|
2000-05-25 21:34:58 +00:00
|
|
|
(int)tvb_get_guint8(tvb, 3));
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1,
|
|
|
|
X25_DIAGNOSTIC);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(x25_tree, tvb, 3, 1,
|
|
|
|
"Diagnostic : %d", (int)tvb_get_guint8(tvb, 3));
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = x25_pkt_len;
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_INTERRUPT:
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Interrupt VC:%d", vc);
|
1999-10-18 01:51:34 +00:00
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1);
|
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1,
|
|
|
|
X25_INTERRUPT);
|
1999-10-18 01:51:34 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = x25_pkt_len;
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_INTERRUPT_CONFIRMATION:
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Interrupt Conf. VC:%d", vc);
|
1999-10-18 01:51:34 +00:00
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1);
|
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1,
|
|
|
|
X25_INTERRUPT_CONFIRMATION);
|
1999-10-18 01:51:34 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = x25_pkt_len;
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_RESET_REQUEST:
|
2002-04-09 08:15:04 +00:00
|
|
|
switch (dir) {
|
|
|
|
|
|
|
|
case X25_FROM_DCE:
|
|
|
|
short_name = "Reset ind.";
|
|
|
|
long_name = "Reset indication";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X25_FROM_DTE:
|
|
|
|
short_name = "Reset req.";
|
|
|
|
long_name = "Reset request";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X25_UNKNOWN:
|
|
|
|
short_name = "Reset ind./Reset req.";
|
|
|
|
long_name = "Reset indication/Reset request";
|
|
|
|
break;
|
|
|
|
}
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s VC:%d %s - Diag.:%d",
|
2002-04-09 08:15:04 +00:00
|
|
|
short_name, vc, reset_code(tvb_get_guint8(tvb, 3)),
|
2000-05-25 21:34:58 +00:00
|
|
|
(int)tvb_get_guint8(tvb, 4));
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
2002-11-08 01:00:07 +00:00
|
|
|
x25_hash_add_proto_end(vc, pinfo->fd->num);
|
1999-08-02 02:26:22 +00:00
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1);
|
|
|
|
proto_tree_add_uint_format(x25_tree, hf_x25_type, tvb, 2, 1,
|
2003-01-08 08:43:09 +00:00
|
|
|
X25_RESET_REQUEST, "Packet Type: %s", long_name);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(x25_tree, tvb, 3, 1,
|
|
|
|
"Cause : %s", reset_code(tvb_get_guint8(tvb, 3)));
|
|
|
|
proto_tree_add_text(x25_tree, tvb, 4, 1,
|
|
|
|
"Diagnostic : %d", (int)tvb_get_guint8(tvb, 4));
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = x25_pkt_len;
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_RESET_CONFIRMATION:
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Reset conf. VC:%d", vc);
|
1999-10-18 01:51:34 +00:00
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, 0, 2, bytes0_1);
|
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1,
|
|
|
|
X25_RESET_CONFIRMATION);
|
1999-10-18 01:51:34 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = x25_pkt_len;
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_RESTART_REQUEST:
|
2002-04-09 08:15:04 +00:00
|
|
|
switch (dir) {
|
|
|
|
|
|
|
|
case X25_FROM_DCE:
|
|
|
|
short_name = "Restart ind.";
|
|
|
|
long_name = "Restart indication";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X25_FROM_DTE:
|
|
|
|
short_name = "Restart req.";
|
|
|
|
long_name = "Restart request";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X25_UNKNOWN:
|
|
|
|
short_name = "Restart ind./Restart req.";
|
|
|
|
long_name = "Restart indication/Restart request";
|
|
|
|
break;
|
|
|
|
}
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s - Diag.:%d",
|
2002-04-09 08:15:04 +00:00
|
|
|
short_name,
|
2000-05-25 21:34:58 +00:00
|
|
|
restart_code(tvb_get_guint8(tvb, 3)),
|
2007-08-18 22:56:44 +00:00
|
|
|
(int)tvb_get_guint8(tvb, 4));
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint_format(x25_tree, hf_x25_type, tvb, 2, 1,
|
2003-01-08 08:43:09 +00:00
|
|
|
X25_RESTART_REQUEST, "Packet Type: %s", long_name);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(x25_tree, tvb, 3, 1,
|
|
|
|
"Cause : %s", restart_code(tvb_get_guint8(tvb, 3)));
|
|
|
|
proto_tree_add_text(x25_tree, tvb, 4, 1,
|
|
|
|
"Diagnostic : %d", (int)tvb_get_guint8(tvb, 4));
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = x25_pkt_len;
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_RESTART_CONFIRMATION:
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Restart conf.");
|
1999-08-02 02:26:22 +00:00
|
|
|
if (x25_tree)
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1,
|
|
|
|
X25_RESTART_CONFIRMATION);
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = x25_pkt_len;
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_REGISTRATION_REQUEST:
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Registration req.");
|
1999-08-02 02:26:22 +00:00
|
|
|
if (x25_tree)
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1,
|
|
|
|
X25_REGISTRATION_REQUEST);
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = 3;
|
|
|
|
if (localoffset < x25_pkt_len)
|
2007-03-26 11:06:26 +00:00
|
|
|
x25_ntoa(x25_tree, (gint*)&localoffset, tvb, pinfo, TRUE);
|
1999-08-04 06:11:17 +00:00
|
|
|
|
|
|
|
if (x25_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
if (localoffset < x25_pkt_len)
|
|
|
|
proto_tree_add_text(x25_tree, tvb, localoffset, 1,
|
|
|
|
"Registration length: %d",
|
|
|
|
tvb_get_guint8(tvb, localoffset) & 0x7F);
|
|
|
|
if (localoffset+1 < x25_pkt_len)
|
|
|
|
proto_tree_add_text(x25_tree, tvb, localoffset+1,
|
|
|
|
tvb_get_guint8(tvb, localoffset) & 0x7F,
|
|
|
|
"Registration");
|
1999-08-04 06:11:17 +00:00
|
|
|
}
|
2000-05-29 22:35:11 +00:00
|
|
|
localoffset = tvb_reported_length(tvb);
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
case X25_REGISTRATION_CONFIRMATION:
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Registration conf.");
|
1999-08-04 06:11:17 +00:00
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type, tvb, 2, 1,
|
|
|
|
X25_REGISTRATION_CONFIRMATION);
|
2000-05-25 21:34:58 +00:00
|
|
|
proto_tree_add_text(x25_tree, tvb, 3, 1,
|
|
|
|
"Cause: %s", registration_code(tvb_get_guint8(tvb, 3)));
|
|
|
|
proto_tree_add_text(x25_tree, tvb, 4, 1,
|
|
|
|
"Diagnostic: %s", registration_code(tvb_get_guint8(tvb, 4)));
|
1999-08-04 06:11:17 +00:00
|
|
|
}
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = 5;
|
|
|
|
if (localoffset < x25_pkt_len)
|
2007-03-26 11:06:26 +00:00
|
|
|
x25_ntoa(x25_tree, (gint*)&localoffset, tvb, pinfo, TRUE);
|
1999-08-04 06:11:17 +00:00
|
|
|
|
|
|
|
if (x25_tree) {
|
2000-05-25 21:34:58 +00:00
|
|
|
if (localoffset < x25_pkt_len)
|
|
|
|
proto_tree_add_text(x25_tree, tvb, localoffset, 1,
|
|
|
|
"Registration length: %d",
|
|
|
|
tvb_get_guint8(tvb, localoffset) & 0x7F);
|
|
|
|
if (localoffset+1 < x25_pkt_len)
|
|
|
|
proto_tree_add_text(x25_tree, tvb, localoffset+1,
|
|
|
|
tvb_get_guint8(tvb, localoffset) & 0x7F,
|
|
|
|
"Registration");
|
1999-08-04 06:11:17 +00:00
|
|
|
}
|
2000-05-29 22:35:11 +00:00
|
|
|
localoffset = tvb_reported_length(tvb);
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
default :
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset = 2;
|
2003-01-08 08:43:09 +00:00
|
|
|
if (PACKET_IS_DATA(pkt_type))
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO)) {
|
1999-08-04 06:11:17 +00:00
|
|
|
if (modulo == 8)
|
2001-12-10 00:26:21 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO,
|
1999-08-04 06:11:17 +00:00
|
|
|
"Data VC:%d P(S):%d P(R):%d %s", vc,
|
2000-05-25 21:34:58 +00:00
|
|
|
(pkt_type >> 1) & 0x07,
|
|
|
|
(pkt_type >> 5) & 0x07,
|
2003-03-05 01:12:11 +00:00
|
|
|
(pkt_type & X25_MBIT_MOD8) ? " M" : "");
|
1999-08-04 06:11:17 +00:00
|
|
|
else
|
2001-12-10 00:26:21 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO,
|
1999-08-04 06:11:17 +00:00
|
|
|
"Data VC:%d P(S):%d P(R):%d %s", vc,
|
2000-05-25 21:34:58 +00:00
|
|
|
tvb_get_guint8(tvb, localoffset+1) >> 1,
|
|
|
|
pkt_type >> 1,
|
2003-03-05 01:12:11 +00:00
|
|
|
(tvb_get_guint8(tvb, localoffset+1) & X25_MBIT_MOD128) ? " M" : "");
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, localoffset-2,
|
|
|
|
2, bytes0_1);
|
1999-08-04 06:11:17 +00:00
|
|
|
if (modulo == 8) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_p_r_mod8, tvb,
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset, 1, pkt_type);
|
2003-01-06 23:34:33 +00:00
|
|
|
proto_tree_add_boolean(x25_tree, hf_x25_mbit_mod8, tvb,
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
localoffset, 1, pkt_type);
|
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_p_s_mod8, tvb,
|
|
|
|
localoffset, 1, pkt_type);
|
2003-01-08 08:43:09 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type_data, tvb,
|
|
|
|
localoffset, 1, pkt_type);
|
1999-08-04 06:11:17 +00:00
|
|
|
}
|
|
|
|
else {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_p_r_mod128, tvb,
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset, 1, pkt_type);
|
2003-01-08 08:43:09 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type_data, tvb,
|
|
|
|
localoffset, 1, pkt_type);
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_p_s_mod128, tvb,
|
|
|
|
localoffset+1, 1,
|
|
|
|
tvb_get_guint8(tvb, localoffset+1));
|
2003-01-06 23:34:33 +00:00
|
|
|
proto_tree_add_boolean(x25_tree, hf_x25_mbit_mod128, tvb,
|
|
|
|
localoffset+1, 1,
|
|
|
|
tvb_get_guint8(tvb, localoffset+1));
|
1999-08-04 06:11:17 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
2003-03-05 01:12:11 +00:00
|
|
|
if (modulo == 8) {
|
|
|
|
m_bit_set = pkt_type & X25_MBIT_MOD8;
|
|
|
|
localoffset += 1;
|
|
|
|
} else {
|
|
|
|
m_bit_set = tvb_get_guint8(tvb, localoffset+1) & X25_MBIT_MOD128;
|
|
|
|
localoffset += 2;
|
|
|
|
}
|
|
|
|
payload_len = tvb_reported_length_remaining(tvb, localoffset);
|
2003-03-05 05:20:38 +00:00
|
|
|
if (reassemble_x25) {
|
|
|
|
/*
|
|
|
|
* Reassemble received and sent traffic separately.
|
|
|
|
* We don't reassemble traffic with an unknown direction
|
|
|
|
* at all.
|
|
|
|
*/
|
|
|
|
frag_key = vc;
|
|
|
|
if (side) {
|
|
|
|
/*
|
|
|
|
* OR in an extra bit to distinguish from traffic
|
|
|
|
* in the other direction.
|
|
|
|
*/
|
|
|
|
frag_key |= 0x10000;
|
|
|
|
}
|
2003-03-04 19:50:23 +00:00
|
|
|
fd_head = fragment_add_seq_next(tvb, localoffset,
|
2003-03-05 05:20:38 +00:00
|
|
|
pinfo, frag_key,
|
|
|
|
x25_segment_table,
|
2003-03-04 19:50:23 +00:00
|
|
|
x25_reassembled_table,
|
2003-03-05 01:12:11 +00:00
|
|
|
payload_len, m_bit_set);
|
|
|
|
pinfo->fragmented = m_bit_set;
|
2008-07-30 14:50:17 +00:00
|
|
|
|
|
|
|
/* Fragment handling is not adapted to handle several x25
|
|
|
|
* packets in the same frame. This is common with XOT and
|
|
|
|
* shorter packet sizes.
|
|
|
|
* Therefore, fragment_add_seq_next seem to always return fd_head
|
|
|
|
* A fix to use m_bit_set to only show fragments for last pkt
|
|
|
|
*/
|
|
|
|
if (!m_bit_set && fd_head) {
|
2003-03-05 01:12:11 +00:00
|
|
|
if (fd_head->next) {
|
2005-06-02 20:55:58 +00:00
|
|
|
proto_item *frag_tree_item;
|
|
|
|
|
2003-03-05 01:12:11 +00:00
|
|
|
/* This is the last packet */
|
|
|
|
next_tvb = tvb_new_real_data(fd_head->data,
|
|
|
|
fd_head->len,
|
|
|
|
fd_head->len);
|
|
|
|
tvb_set_child_real_data_tvbuff(tvb, next_tvb);
|
|
|
|
add_new_data_source(pinfo, next_tvb, "Reassembled X.25");
|
2008-07-30 14:50:17 +00:00
|
|
|
if (x25_tree) {
|
|
|
|
show_fragment_seq_tree(fd_head,
|
|
|
|
&x25_frag_items,
|
|
|
|
x25_tree,
|
|
|
|
pinfo, next_tvb, &frag_tree_item);
|
|
|
|
}
|
2003-03-05 05:20:38 +00:00
|
|
|
}
|
2003-03-05 01:12:11 +00:00
|
|
|
}
|
2003-03-05 05:20:38 +00:00
|
|
|
|
|
|
|
if (m_bit_set && next_tvb == NULL) {
|
|
|
|
/*
|
|
|
|
* This isn't the last packet, so just
|
|
|
|
* show it as X.25 user data.
|
|
|
|
*/
|
|
|
|
proto_tree_add_text(x25_tree, tvb, localoffset, -1,
|
|
|
|
"User data (%u byte%s)", payload_len,
|
|
|
|
plurality(payload_len, "", "s"));
|
|
|
|
return;
|
|
|
|
}
|
2003-03-05 01:12:11 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-03-05 05:20:38 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Non-data packets (RR, RNR, REJ).
|
|
|
|
*/
|
2003-01-08 08:43:09 +00:00
|
|
|
switch (PACKET_TYPE_FC(pkt_type))
|
1999-08-02 02:26:22 +00:00
|
|
|
{
|
|
|
|
case X25_RR:
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO)) {
|
1999-08-04 06:11:17 +00:00
|
|
|
if (modulo == 8)
|
2001-12-10 00:26:21 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "RR VC:%d P(R):%d",
|
2000-05-25 21:34:58 +00:00
|
|
|
vc, (pkt_type >> 5) & 0x07);
|
1999-08-04 06:11:17 +00:00
|
|
|
else
|
2001-12-10 00:26:21 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "RR VC:%d P(R):%d",
|
2000-05-25 21:34:58 +00:00
|
|
|
vc, tvb_get_guint8(tvb, localoffset+1) >> 1);
|
1999-08-04 06:11:17 +00:00
|
|
|
}
|
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, localoffset-2,
|
|
|
|
2, bytes0_1);
|
1999-10-18 01:51:34 +00:00
|
|
|
if (modulo == 8) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_p_r_mod8, tvb,
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset, 1, pkt_type);
|
2003-01-08 08:43:09 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type_fc_mod8, tvb,
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset, 1, X25_RR);
|
1999-10-18 01:51:34 +00:00
|
|
|
}
|
|
|
|
else {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type, tvb,
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset, 1, X25_RR);
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_item(x25_tree, hf_x25_p_r_mod128, tvb,
|
2000-05-31 05:09:07 +00:00
|
|
|
localoffset+1, 1, FALSE);
|
1999-10-18 01:51:34 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X25_RNR:
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO)) {
|
1999-08-04 06:11:17 +00:00
|
|
|
if (modulo == 8)
|
2001-12-10 00:26:21 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "RNR VC:%d P(R):%d",
|
2000-05-25 21:34:58 +00:00
|
|
|
vc, (pkt_type >> 5) & 0x07);
|
1999-08-04 06:11:17 +00:00
|
|
|
else
|
2001-12-10 00:26:21 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "RNR VC:%d P(R):%d",
|
2000-05-25 21:34:58 +00:00
|
|
|
vc, tvb_get_guint8(tvb, localoffset+1) >> 1);
|
1999-08-04 06:11:17 +00:00
|
|
|
}
|
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, localoffset-2,
|
|
|
|
2, bytes0_1);
|
1999-10-18 01:51:34 +00:00
|
|
|
if (modulo == 8) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_p_r_mod8, tvb,
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset, 1, pkt_type);
|
2003-01-08 08:43:09 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type_fc_mod8, tvb,
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset, 1, X25_RNR);
|
1999-10-18 01:51:34 +00:00
|
|
|
}
|
|
|
|
else {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type, tvb,
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset, 1, X25_RNR);
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_item(x25_tree, hf_x25_p_r_mod128, tvb,
|
2000-05-31 05:09:07 +00:00
|
|
|
localoffset+1, 1, FALSE);
|
1999-10-18 01:51:34 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case X25_REJ:
|
2001-12-10 00:26:21 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO)) {
|
1999-08-04 06:11:17 +00:00
|
|
|
if (modulo == 8)
|
2001-12-10 00:26:21 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "REJ VC:%d P(R):%d",
|
2000-05-25 21:34:58 +00:00
|
|
|
vc, (pkt_type >> 5) & 0x07);
|
1999-08-04 06:11:17 +00:00
|
|
|
else
|
2001-12-10 00:26:21 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "REJ VC:%d P(R):%d",
|
2000-05-25 21:34:58 +00:00
|
|
|
vc, tvb_get_guint8(tvb, localoffset+1) >> 1);
|
1999-08-04 06:11:17 +00:00
|
|
|
}
|
|
|
|
if (x25_tree) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_lcn, tvb, localoffset-2,
|
|
|
|
2, bytes0_1);
|
1999-10-18 01:51:34 +00:00
|
|
|
if (modulo == 8) {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_p_r_mod8, tvb,
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset, 1, pkt_type);
|
2003-01-08 08:43:09 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type_fc_mod8, tvb,
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset, 1, X25_REJ);
|
1999-10-18 01:51:34 +00:00
|
|
|
}
|
|
|
|
else {
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_uint(x25_tree, hf_x25_type, tvb,
|
2000-05-25 21:34:58 +00:00
|
|
|
localoffset, 1, X25_REJ);
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_tree_add_item(x25_tree, hf_x25_p_r_mod128, tvb,
|
2000-05-31 05:09:07 +00:00
|
|
|
localoffset+1, 1, FALSE);
|
1999-10-18 01:51:34 +00:00
|
|
|
}
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
}
|
1999-08-04 06:11:17 +00:00
|
|
|
localoffset += (modulo == 8) ? 1 : 2;
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
|
2003-03-05 05:20:38 +00:00
|
|
|
if (localoffset >= tvb_reported_length(tvb))
|
|
|
|
return;
|
2003-03-04 19:50:23 +00:00
|
|
|
if (pinfo->fragmented)
|
|
|
|
return;
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2003-03-04 19:50:23 +00:00
|
|
|
if (!next_tvb)
|
|
|
|
next_tvb = tvb_new_subset(tvb, localoffset, -1, -1);
|
2001-11-15 21:11:01 +00:00
|
|
|
|
2003-01-06 02:24:57 +00:00
|
|
|
saved_private_data = pinfo->private_data;
|
|
|
|
pinfo->private_data = &q_bit_set;
|
2001-11-15 21:11:01 +00:00
|
|
|
|
2002-11-08 01:00:07 +00:00
|
|
|
/* See if there's already a dissector for this circuit. */
|
2003-01-06 02:24:57 +00:00
|
|
|
if (try_circuit_dissector(CT_X25, vc, pinfo->fd->num, next_tvb, pinfo,
|
|
|
|
tree)) {
|
|
|
|
pinfo->private_data = saved_private_data;
|
|
|
|
return; /* found it and dissected it */
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Did the user suggest QLLC/SNA? */
|
|
|
|
if (payload_is_qllc_sna) {
|
|
|
|
/* Yes - dissect it as QLLC/SNA. */
|
2003-01-11 10:03:12 +00:00
|
|
|
if (!pinfo->fd->flags.visited)
|
|
|
|
x25_hash_add_proto_start(vc, pinfo->fd->num, qllc_handle);
|
2003-01-06 02:24:57 +00:00
|
|
|
call_dissector(qllc_handle, next_tvb, pinfo, tree);
|
|
|
|
pinfo->private_data = saved_private_data;
|
2001-12-05 08:43:26 +00:00
|
|
|
return;
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
2001-12-05 08:43:26 +00:00
|
|
|
|
2008-03-16 10:19:51 +00:00
|
|
|
if (payload_check_data){
|
2003-01-06 02:24:57 +00:00
|
|
|
/* If the Call Req. has not been captured, let's look at the first
|
2007-08-18 22:56:44 +00:00
|
|
|
two bytes of the payload to see if this looks like COTP. */
|
|
|
|
if (tvb_get_guint8(tvb, localoffset) == tvb_length(next_tvb)-1) {
|
|
|
|
/* First byte contains the length of the remaining buffer */
|
|
|
|
if ((tvb_get_guint8(tvb, localoffset+1) & 0x0F) == 0) {
|
|
|
|
/* Second byte contains a valid COTP TPDU */
|
|
|
|
if (!pinfo->fd->flags.visited)
|
|
|
|
x25_hash_add_proto_start(vc, pinfo->fd->num, ositp_handle);
|
|
|
|
call_dissector(ositp_handle, next_tvb, pinfo, tree);
|
|
|
|
pinfo->private_data = saved_private_data;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Then let's look at the first byte of the payload to see if this
|
|
|
|
looks like IP or CLNP. */
|
2003-01-06 02:24:57 +00:00
|
|
|
switch (tvb_get_guint8(tvb, localoffset)) {
|
|
|
|
|
|
|
|
case 0x45:
|
|
|
|
/* Looks like an IP header */
|
2003-01-11 10:03:12 +00:00
|
|
|
if (!pinfo->fd->flags.visited)
|
|
|
|
x25_hash_add_proto_start(vc, pinfo->fd->num, ip_handle);
|
2001-12-05 08:43:26 +00:00
|
|
|
call_dissector(ip_handle, next_tvb, pinfo, tree);
|
2003-01-06 02:24:57 +00:00
|
|
|
pinfo->private_data = saved_private_data;
|
|
|
|
return;
|
|
|
|
|
|
|
|
case NLPID_ISO8473_CLNP:
|
2003-01-11 10:03:12 +00:00
|
|
|
if (!pinfo->fd->flags.visited)
|
|
|
|
x25_hash_add_proto_start(vc, pinfo->fd->num, clnp_handle);
|
2003-01-06 02:24:57 +00:00
|
|
|
call_dissector(clnp_handle, next_tvb, pinfo, tree);
|
|
|
|
pinfo->private_data = saved_private_data;
|
2001-12-05 08:43:26 +00:00
|
|
|
return;
|
|
|
|
}
|
2008-03-16 10:19:51 +00:00
|
|
|
}
|
2001-12-05 08:43:26 +00:00
|
|
|
|
|
|
|
/* Try the heuristic dissectors. */
|
|
|
|
if (dissector_try_heuristic(x25_heur_subdissector_list, next_tvb, pinfo,
|
2003-01-06 02:24:57 +00:00
|
|
|
tree)) {
|
|
|
|
pinfo->private_data = saved_private_data;
|
2001-12-05 08:43:26 +00:00
|
|
|
return;
|
2003-01-06 02:24:57 +00:00
|
|
|
}
|
2001-12-05 08:43:26 +00:00
|
|
|
|
|
|
|
/* All else failed; dissect it as raw data */
|
|
|
|
call_dissector(data_handle, next_tvb, pinfo, tree);
|
2003-01-06 02:24:57 +00:00
|
|
|
pinfo->private_data = saved_private_data;
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
|
|
|
|
2002-04-09 08:15:04 +00:00
|
|
|
/*
|
|
|
|
* X.25 dissector for use when "pinfo->pseudo_header" points to a
|
|
|
|
* "struct x25_phdr".
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dissect_x25_dir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_x25_common(tvb, pinfo, tree,
|
|
|
|
(pinfo->pseudo_header->x25.flags & FROM_DCE) ? X25_FROM_DCE :
|
2003-03-05 05:20:38 +00:00
|
|
|
X25_FROM_DTE,
|
|
|
|
pinfo->pseudo_header->x25.flags & FROM_DCE);
|
2002-04-09 08:15:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* X.25 dissector for use when "pinfo->pseudo_header" doesn't point to a
|
|
|
|
* "struct x25_phdr".
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
2003-03-05 05:20:38 +00:00
|
|
|
int direction;
|
|
|
|
|
2002-04-09 08:15:04 +00:00
|
|
|
/*
|
|
|
|
* We don't know if this packet is DTE->DCE or DCE->DCE.
|
2003-03-05 05:20:38 +00:00
|
|
|
* However, we can, at least, distinguish between the two
|
|
|
|
* sides of the conversation, based on the addresses and
|
|
|
|
* ports.
|
2002-04-09 08:15:04 +00:00
|
|
|
*/
|
2003-03-05 05:20:38 +00:00
|
|
|
direction = CMP_ADDRESS(&pinfo->src, &pinfo->dst);
|
|
|
|
if (direction == 0)
|
|
|
|
direction = (pinfo->srcport > pinfo->destport)*2 - 1;
|
|
|
|
dissect_x25_common(tvb, pinfo, tree, X25_UNKNOWN, direction > 0);
|
2002-04-09 08:15:04 +00:00
|
|
|
}
|
|
|
|
|
2003-03-04 19:50:23 +00:00
|
|
|
static void
|
|
|
|
x25_reassemble_init(void)
|
|
|
|
{
|
|
|
|
fragment_table_init(&x25_segment_table);
|
|
|
|
reassembled_table_init(&x25_reassembled_table);
|
|
|
|
}
|
|
|
|
|
1999-08-02 02:26:22 +00:00
|
|
|
void
|
|
|
|
proto_register_x25(void)
|
|
|
|
{
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
static hf_register_info hf[] = {
|
2001-01-03 23:30:50 +00:00
|
|
|
{ &hf_x25_gfi,
|
2003-01-31 03:17:56 +00:00
|
|
|
{ "GFI", "x.25.gfi", FT_UINT16, BASE_DEC, NULL, 0xF000,
|
2001-06-18 02:18:27 +00:00
|
|
|
"General format identifier", HFILL }},
|
2001-01-03 23:30:50 +00:00
|
|
|
{ &hf_x25_abit,
|
2003-03-05 01:12:11 +00:00
|
|
|
{ "A Bit", "x.25.a", FT_BOOLEAN, 16, NULL, X25_ABIT,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Address Bit", HFILL }},
|
1999-10-18 01:51:34 +00:00
|
|
|
{ &hf_x25_qbit,
|
2003-03-05 01:12:11 +00:00
|
|
|
{ "Q Bit", "x.25.q", FT_BOOLEAN, 16, NULL, X25_QBIT,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Qualifier Bit", HFILL }},
|
2000-05-28 06:26:10 +00:00
|
|
|
{ &hf_x25_dbit,
|
2003-03-05 01:12:11 +00:00
|
|
|
{ "D Bit", "x.25.d", FT_BOOLEAN, 16, NULL, X25_DBIT,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Delivery Confirmation Bit", HFILL }},
|
1999-10-18 01:51:34 +00:00
|
|
|
{ &hf_x25_mod,
|
2001-01-03 23:30:50 +00:00
|
|
|
{ "Modulo", "x.25.mod", FT_UINT16, BASE_DEC, VALS(vals_modulo), 0x3000,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Specifies whether the frame is modulo 8 or 128", HFILL }},
|
1999-08-02 02:26:22 +00:00
|
|
|
{ &hf_x25_lcn,
|
2001-01-03 23:30:50 +00:00
|
|
|
{ "Logical Channel", "x.25.lcn", FT_UINT16, BASE_DEC, NULL, 0x0FFF,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Logical Channel Number", HFILL }},
|
1999-08-02 02:26:22 +00:00
|
|
|
{ &hf_x25_type,
|
2001-01-03 23:30:50 +00:00
|
|
|
{ "Packet Type", "x.25.type", FT_UINT8, BASE_HEX, VALS(vals_x25_type), 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Packet Type", HFILL }},
|
2003-01-08 08:43:09 +00:00
|
|
|
{ &hf_x25_type_fc_mod8,
|
|
|
|
{ "Packet Type", "x.25.type", FT_UINT8, BASE_HEX, VALS(vals_x25_type), 0x1F,
|
|
|
|
"Packet Type", HFILL }},
|
|
|
|
{ &hf_x25_type_data,
|
|
|
|
{ "Packet Type", "x.25.type", FT_UINT8, BASE_HEX, VALS(vals_x25_type), 0x01,
|
|
|
|
"Packet Type", HFILL }},
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
{ &hf_x25_p_r_mod8,
|
2003-01-06 23:34:33 +00:00
|
|
|
{ "P(R)", "x.25.p_r", FT_UINT8, BASE_DEC, NULL, 0xE0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Packet Receive Sequence Number", HFILL }},
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
{ &hf_x25_p_r_mod128,
|
2003-01-06 23:34:33 +00:00
|
|
|
{ "P(R)", "x.25.p_r", FT_UINT8, BASE_DEC, NULL, 0xFE,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Packet Receive Sequence Number", HFILL }},
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
{ &hf_x25_mbit_mod8,
|
2003-03-05 01:12:11 +00:00
|
|
|
{ "M Bit", "x.25.m", FT_BOOLEAN, 8, TFS(&m_bit_tfs), X25_MBIT_MOD8,
|
2001-06-18 02:18:27 +00:00
|
|
|
"More Bit", HFILL }},
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
{ &hf_x25_mbit_mod128,
|
2003-03-05 01:12:11 +00:00
|
|
|
{ "M Bit", "x.25.m", FT_BOOLEAN, 8, TFS(&m_bit_tfs), X25_MBIT_MOD128,
|
2001-06-18 02:18:27 +00:00
|
|
|
"More Bit", HFILL }},
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
{ &hf_x25_p_s_mod8,
|
2003-01-06 23:34:33 +00:00
|
|
|
{ "P(S)", "x.25.p_s", FT_UINT8, BASE_DEC, NULL, 0x0E,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Packet Send Sequence Number", HFILL }},
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
{ &hf_x25_p_s_mod128,
|
2003-01-06 23:34:33 +00:00
|
|
|
{ "P(S)", "x.25.p_s", FT_UINT8, BASE_DEC, NULL, 0xFE,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Packet Send Sequence Number", HFILL }},
|
2003-03-04 19:50:23 +00:00
|
|
|
{ &hf_x25_segment_overlap,
|
|
|
|
{ "Fragment overlap", "x25.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
"Fragment overlaps with other fragments", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_x25_segment_overlap_conflict,
|
|
|
|
{ "Conflicting data in fragment overlap", "x25.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
"Overlapping fragments contained conflicting data", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_x25_segment_multiple_tails,
|
|
|
|
{ "Multiple tail fragments found", "x25.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
"Several tails were found when defragmenting the packet", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_x25_segment_too_long_segment,
|
|
|
|
{ "Fragment too long", "x25.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
"Fragment contained data past end of packet", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_x25_segment_error,
|
|
|
|
{ "Defragmentation error", "x25.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
|
|
|
|
"Defragmentation error due to illegal fragments", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_x25_segment,
|
|
|
|
{ "X.25 Fragment", "x25.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
|
|
|
|
"X25 Fragment", HFILL }},
|
|
|
|
|
|
|
|
{ &hf_x25_segments,
|
|
|
|
{ "X.25 Fragments", "x25.fragments", FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
"X.25 Fragments", HFILL }},
|
1999-08-02 02:26:22 +00:00
|
|
|
};
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_x25,
|
2001-01-03 23:30:50 +00:00
|
|
|
&ett_x25_gfi,
|
1999-12-12 12:59:01 +00:00
|
|
|
&ett_x25_fac,
|
|
|
|
&ett_x25_fac_unknown,
|
|
|
|
&ett_x25_fac_mark,
|
|
|
|
&ett_x25_fac_reverse,
|
2008-04-12 13:41:53 +00:00
|
|
|
&ett_x25_fac_charging_info,
|
1999-12-12 12:59:01 +00:00
|
|
|
&ett_x25_fac_throughput,
|
|
|
|
&ett_x25_fac_cug,
|
|
|
|
&ett_x25_fac_called_modif,
|
|
|
|
&ett_x25_fac_cug_outgoing_acc,
|
|
|
|
&ett_x25_fac_throughput_min,
|
|
|
|
&ett_x25_fac_express_data,
|
|
|
|
&ett_x25_fac_bilateral_cug,
|
|
|
|
&ett_x25_fac_packet_size,
|
|
|
|
&ett_x25_fac_window_size,
|
|
|
|
&ett_x25_fac_rpoa_selection,
|
2008-04-12 13:41:53 +00:00
|
|
|
&ett_x25_fac_cug_ext,
|
|
|
|
&ett_x25_fac_cug_outgoing_acc_ext,
|
1999-12-12 12:59:01 +00:00
|
|
|
&ett_x25_fac_transit_delay,
|
2008-04-12 13:41:53 +00:00
|
|
|
&ett_x25_fac_call_duration,
|
|
|
|
&ett_x25_fac_segment_count,
|
1999-12-12 12:59:01 +00:00
|
|
|
&ett_x25_fac_call_transfer,
|
2008-04-12 13:41:53 +00:00
|
|
|
&ett_x25_fac_rpoa_selection_ext,
|
|
|
|
&ett_x25_fac_monetary_unit,
|
|
|
|
&ett_x25_fac_nui,
|
1999-12-12 12:59:01 +00:00
|
|
|
&ett_x25_fac_called_addr_ext,
|
|
|
|
&ett_x25_fac_ete_transit_delay,
|
|
|
|
&ett_x25_fac_calling_addr_ext,
|
|
|
|
&ett_x25_fac_call_deflect,
|
2001-12-02 00:07:46 +00:00
|
|
|
&ett_x25_fac_priority,
|
2003-03-04 19:50:23 +00:00
|
|
|
&ett_x25_user_data,
|
|
|
|
&ett_x25_segment,
|
|
|
|
&ett_x25_segments
|
1999-11-16 11:44:20 +00:00
|
|
|
};
|
2001-11-15 21:11:01 +00:00
|
|
|
module_t *x25_module;
|
1999-08-02 02:26:22 +00:00
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_x25 = proto_register_protocol ("X.25", "X.25", "x.25");
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
proto_register_field_array (proto_x25, hf, array_length(hf));
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
|
2001-12-08 06:41:48 +00:00
|
|
|
x25_subdissector_table = register_dissector_table("x.25.spi",
|
|
|
|
"X.25 secondary protocol identifier", FT_UINT8, BASE_HEX);
|
2001-12-05 08:43:26 +00:00
|
|
|
register_heur_dissector_list("x.25", &x25_heur_subdissector_list);
|
2001-12-02 00:07:46 +00:00
|
|
|
|
2002-04-09 08:15:04 +00:00
|
|
|
register_dissector("x.25_dir", dissect_x25_dir, proto_x25);
|
If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)
This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".
That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.
The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).
svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
|
|
|
register_dissector("x.25", dissect_x25, proto_x25);
|
2001-11-15 21:11:01 +00:00
|
|
|
|
|
|
|
/* Preferences */
|
|
|
|
x25_module = prefs_register_protocol(proto_x25, NULL);
|
2003-01-06 02:24:57 +00:00
|
|
|
prefs_register_obsolete_preference(x25_module, "non_q_bit_is_sna");
|
|
|
|
prefs_register_bool_preference(x25_module, "payload_is_qllc_sna",
|
|
|
|
"Default to QLLC/SNA",
|
|
|
|
"If CALL REQUEST not seen or didn't specify protocol, dissect as QLLC/SNA",
|
|
|
|
&payload_is_qllc_sna);
|
2008-03-16 10:19:51 +00:00
|
|
|
prefs_register_bool_preference(x25_module, "call_request_nodata_is_cotp",
|
|
|
|
"Assume COTP for Call Request without data",
|
|
|
|
"If CALL REQUEST has no data, assume the protocol handled is COTP",
|
|
|
|
&call_request_nodata_is_cotp);
|
|
|
|
prefs_register_bool_preference(x25_module, "payload_check_data",
|
|
|
|
"Check data for COTP/IP/CLNP",
|
|
|
|
"If CALL REQUEST not seen or didn't specify protocol, check user data before checking heuristic dissectors",
|
|
|
|
&payload_check_data);
|
2003-03-05 01:12:11 +00:00
|
|
|
prefs_register_bool_preference(x25_module, "reassemble",
|
2003-03-04 19:50:23 +00:00
|
|
|
"Reassemble fragmented X.25 packets",
|
|
|
|
"Reassemble fragmented X.25 packets",
|
|
|
|
&reassemble_x25);
|
|
|
|
register_init_routine(&x25_reassemble_init);
|
1999-08-02 02:26:22 +00:00
|
|
|
}
|
2000-11-19 04:14:26 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_x25(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t x25_handle;
|
|
|
|
|
2000-11-19 04:14:26 +00:00
|
|
|
/*
|
2001-12-02 00:07:46 +00:00
|
|
|
* Get handles for various dissectors.
|
2000-11-19 04:14:26 +00:00
|
|
|
*/
|
2001-12-03 05:07:18 +00:00
|
|
|
ip_handle = find_dissector("ip");
|
2003-01-06 02:24:57 +00:00
|
|
|
clnp_handle = find_dissector("clnp");
|
2000-11-19 04:14:26 +00:00
|
|
|
ositp_handle = find_dissector("ositp");
|
2001-11-15 21:11:01 +00:00
|
|
|
qllc_handle = find_dissector("qllc");
|
2001-11-25 22:19:25 +00:00
|
|
|
data_handle = find_dissector("data");
|
2001-01-05 19:07:38 +00:00
|
|
|
|
2001-12-03 04:00:26 +00:00
|
|
|
x25_handle = find_dissector("x.25");
|
|
|
|
dissector_add("llc.dsap", SAP_X25, x25_handle);
|
2000-11-19 04:14:26 +00:00
|
|
|
}
|