1999-09-11 05:32:33 +00:00
|
|
|
/* packet-ascend.c
|
|
|
|
* Routines for decoding Lucent/Ascend packet traces
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1999-09-11 05:32:33 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1999-09-11 05:32:33 +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-09-11 05:32:33 +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-09-11 05:32:33 +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
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
1999-09-11 05:32:33 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
1999-09-11 05:32:33 +00:00
|
|
|
|
|
|
|
#include <glib.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
1999-09-11 05:32:33 +00:00
|
|
|
|
2013-03-13 21:14:20 +00:00
|
|
|
void proto_register_ascend(void);
|
|
|
|
void proto_reg_handoff_acend(void);
|
|
|
|
|
1999-09-11 22:36:38 +00:00
|
|
|
static int proto_ascend = -1;
|
1999-10-16 14:04:22 +00:00
|
|
|
static int hf_link_type = -1;
|
1999-09-11 22:36:38 +00:00
|
|
|
static int hf_session_id = -1;
|
1999-10-16 14:04:22 +00:00
|
|
|
static int hf_called_number = -1;
|
1999-09-13 03:49:04 +00:00
|
|
|
static int hf_chunk = -1;
|
1999-09-11 22:36:38 +00:00
|
|
|
static int hf_task = -1;
|
1999-10-16 08:54:25 +00:00
|
|
|
static int hf_user_name = -1;
|
1999-09-11 22:36:38 +00:00
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint ett_raw = -1;
|
|
|
|
|
1999-09-11 22:36:38 +00:00
|
|
|
static const value_string encaps_vals[] = {
|
1999-09-13 03:49:04 +00:00
|
|
|
{ASCEND_PFX_WDS_X, "PPP Transmit"},
|
|
|
|
{ASCEND_PFX_WDS_R, "PPP Receive" },
|
|
|
|
{ASCEND_PFX_WDD, "Ethernet" },
|
1999-09-11 22:36:38 +00:00
|
|
|
{0, NULL } };
|
1999-09-11 05:32:33 +00:00
|
|
|
|
2004-11-24 09:13:52 +00:00
|
|
|
static dissector_handle_t eth_withoutfcs_handle;
|
2001-03-30 06:10:54 +00:00
|
|
|
static dissector_handle_t ppp_hdlc_handle;
|
2000-11-19 02:00:03 +00:00
|
|
|
|
2000-11-29 05:16:15 +00:00
|
|
|
static void
|
2000-05-19 23:07:04 +00:00
|
|
|
dissect_ascend(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
2000-05-16 06:21:33 +00:00
|
|
|
{
|
2012-04-23 17:50:02 +00:00
|
|
|
proto_tree *fh_tree;
|
|
|
|
proto_item *ti, *hidden_item;
|
|
|
|
union wtap_pseudo_header *pseudo_header = pinfo->pseudo_header;
|
2000-05-16 06:21:33 +00:00
|
|
|
|
1999-09-11 05:32:33 +00:00
|
|
|
/* load the top pane info. This should be overwritten by
|
|
|
|
the next protocol in the stack */
|
2009-08-09 07:14:16 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_RES_DL_SRC, "N/A");
|
|
|
|
col_set_str(pinfo->cinfo, COL_RES_DL_DST, "N/A");
|
2009-08-09 06:47:24 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "N/A");
|
2009-08-09 07:01:26 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "Lucent/Ascend packet trace");
|
1999-09-11 05:32:33 +00:00
|
|
|
|
2001-12-20 05:34:50 +00:00
|
|
|
/* If this is a transmitted or received PPP frame, set the PPP direction. */
|
|
|
|
switch (pseudo_header->ascend.type) {
|
|
|
|
|
|
|
|
case ASCEND_PFX_WDS_X:
|
|
|
|
pinfo->p2p_dir = P2P_DIR_SENT;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ASCEND_PFX_WDS_R:
|
|
|
|
pinfo->p2p_dir = P2P_DIR_RECV;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
1999-09-11 05:32:33 +00:00
|
|
|
/* populate a tree in the second pane with the status of the link
|
|
|
|
layer (ie none) */
|
|
|
|
if(tree) {
|
2000-08-20 19:16:39 +00:00
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_ascend, tvb, 0, 0,
|
2012-04-23 17:50:02 +00:00
|
|
|
"Lucent/Ascend packet trace");
|
1999-11-16 11:44:20 +00:00
|
|
|
fh_tree = proto_item_add_subtree(ti, ett_raw);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_uint(fh_tree, hf_link_type, tvb, 0, 0,
|
2012-04-23 17:50:02 +00:00
|
|
|
pseudo_header->ascend.type);
|
2000-05-18 09:09:50 +00:00
|
|
|
if (pseudo_header->ascend.type == ASCEND_PFX_WDD) {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_string(fh_tree, hf_called_number, tvb, 0, 0,
|
2012-04-23 17:50:02 +00:00
|
|
|
pseudo_header->ascend.call_num);
|
2000-05-31 05:09:07 +00:00
|
|
|
proto_tree_add_uint(fh_tree, hf_chunk, tvb, 0, 0,
|
2012-04-23 17:50:02 +00:00
|
|
|
pseudo_header->ascend.chunk);
|
2008-05-09 13:59:10 +00:00
|
|
|
hidden_item = proto_tree_add_uint(fh_tree, hf_session_id, tvb, 0, 0, 0);
|
2012-04-23 17:50:02 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
1999-09-13 03:49:04 +00:00
|
|
|
} else { /* It's wandsession data */
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_string(fh_tree, hf_user_name, tvb, 0, 0,
|
2012-04-23 17:50:02 +00:00
|
|
|
pseudo_header->ascend.user);
|
2000-05-31 05:09:07 +00:00
|
|
|
proto_tree_add_uint(fh_tree, hf_session_id, tvb, 0, 0,
|
2012-04-23 17:50:02 +00:00
|
|
|
pseudo_header->ascend.sess);
|
2008-05-09 13:59:10 +00:00
|
|
|
hidden_item = proto_tree_add_uint(fh_tree, hf_chunk, tvb, 0, 0, 0);
|
2012-04-23 17:50:02 +00:00
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
1999-09-13 03:49:04 +00:00
|
|
|
}
|
2000-05-31 05:09:07 +00:00
|
|
|
proto_tree_add_uint(fh_tree, hf_task, tvb, 0, 0, pseudo_header->ascend.task);
|
1999-09-11 05:32:33 +00:00
|
|
|
}
|
|
|
|
|
2000-05-18 09:09:50 +00:00
|
|
|
switch (pseudo_header->ascend.type) {
|
1999-09-13 03:49:04 +00:00
|
|
|
case ASCEND_PFX_WDS_X:
|
|
|
|
case ASCEND_PFX_WDS_R:
|
2001-03-30 06:10:54 +00:00
|
|
|
call_dissector(ppp_hdlc_handle, tvb, pinfo, tree);
|
1999-09-13 03:49:04 +00:00
|
|
|
break;
|
|
|
|
case ASCEND_PFX_WDD:
|
2004-11-24 09:13:52 +00:00
|
|
|
call_dissector(eth_withoutfcs_handle, tvb, pinfo, tree);
|
1999-09-11 05:32:33 +00:00
|
|
|
break;
|
1999-09-13 03:49:04 +00:00
|
|
|
default:
|
1999-09-11 05:32:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-09-11 22:36:38 +00:00
|
|
|
void
|
|
|
|
proto_register_ascend(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
1999-10-16 14:04:22 +00:00
|
|
|
{ &hf_link_type,
|
2012-04-23 17:50:02 +00:00
|
|
|
{ "Link type", "ascend.type", FT_UINT32, BASE_DEC, VALS(encaps_vals), 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-16 14:04:22 +00:00
|
|
|
|
1999-09-11 22:36:38 +00:00
|
|
|
{ &hf_session_id,
|
2012-04-23 17:50:02 +00:00
|
|
|
{ "Session ID", "ascend.sess", FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-16 14:04:22 +00:00
|
|
|
|
|
|
|
{ &hf_called_number,
|
2012-04-23 17:50:02 +00:00
|
|
|
{ "Called number", "ascend.number", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-09-11 22:36:38 +00:00
|
|
|
|
1999-09-13 03:49:04 +00:00
|
|
|
{ &hf_chunk,
|
2012-04-23 17:50:02 +00:00
|
|
|
{ "WDD Chunk", "ascend.chunk", FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-09-13 03:49:04 +00:00
|
|
|
|
1999-09-11 22:36:38 +00:00
|
|
|
{ &hf_task,
|
2012-04-23 17:50:02 +00:00
|
|
|
{ "Task", "ascend.task", FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-10-16 08:54:25 +00:00
|
|
|
|
|
|
|
{ &hf_user_name,
|
2012-04-23 17:50:02 +00:00
|
|
|
{ "User name", "ascend.user", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
1999-09-11 22:36:38 +00:00
|
|
|
};
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_raw,
|
|
|
|
};
|
1999-09-11 22:36:38 +00:00
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_ascend = proto_register_protocol("Lucent/Ascend debug output",
|
2012-04-23 17:50:02 +00:00
|
|
|
"Lucent/Ascend", "ascend");
|
1999-09-11 22:36:38 +00:00
|
|
|
proto_register_field_array(proto_ascend, hf, array_length(hf));
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
1999-09-11 22:36:38 +00:00
|
|
|
}
|
2000-11-19 02:00:03 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_ascend(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t ascend_handle;
|
|
|
|
|
2000-11-19 02:00:03 +00:00
|
|
|
/*
|
2001-03-30 06:10:54 +00:00
|
|
|
* Get handles for the Ethernet and PPP-in-HDLC-like-framing dissectors.
|
2000-11-19 02:00:03 +00:00
|
|
|
*/
|
2004-11-24 09:13:52 +00:00
|
|
|
eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
|
2001-03-30 06:10:54 +00:00
|
|
|
ppp_hdlc_handle = find_dissector("ppp_hdlc");
|
2001-12-03 04:00:26 +00:00
|
|
|
|
|
|
|
ascend_handle = create_dissector_handle(dissect_ascend, proto_ascend);
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("wtap_encap", WTAP_ENCAP_ASCEND, ascend_handle);
|
2000-11-19 02:00:03 +00:00
|
|
|
}
|