2004-03-18 08:25:09 +00:00
|
|
|
/* packet-ipdc.c
|
|
|
|
* Routines for IP Device Control (SS7 over IP) dissection
|
|
|
|
* Copyright Lucent Technologies 2004
|
2004-03-20 05:53:40 +00:00
|
|
|
* Josh Bailey <joshbailey@lucent.com> and Ruud Linders <ruud@lucent.com>
|
2004-03-18 08:25:09 +00:00
|
|
|
*
|
2004-04-09 08:39:00 +00:00
|
|
|
* Using IPDC spec 0.20.2
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2004-03-18 08:25:09 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-03-18 08:25:09 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2010-09-23 21:46:31 +00:00
|
|
|
*
|
2004-03-18 08:25:09 +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.
|
2010-09-23 21:46:31 +00:00
|
|
|
*
|
2004-03-18 08:25:09 +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 <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include "packet-ipdc.h"
|
|
|
|
#include "packet-tcp.h"
|
2004-09-29 00:52:45 +00:00
|
|
|
#include <epan/ipproto.h>
|
2004-09-27 22:55:15 +00:00
|
|
|
#include <epan/prefs.h>
|
2004-03-18 08:25:09 +00:00
|
|
|
|
|
|
|
static int proto_ipdc = -1;
|
|
|
|
static int hf_ipdc_nr = -1;
|
|
|
|
static int hf_ipdc_ns = -1;
|
|
|
|
static int hf_ipdc_payload_len = -1;
|
|
|
|
static int hf_ipdc_protocol_id = -1;
|
|
|
|
static int hf_ipdc_trans_id_size = -1;
|
|
|
|
static int hf_ipdc_trans_id = -1;
|
|
|
|
static int hf_ipdc_message_code = -1;
|
|
|
|
|
|
|
|
static gint ett_ipdc = -1;
|
|
|
|
static gint ett_ipdc_tag = -1;
|
|
|
|
|
|
|
|
static gboolean ipdc_desegment = TRUE;
|
2005-07-09 00:53:17 +00:00
|
|
|
static guint ipdc_port_pref = TCP_PORT_IPDC;
|
2004-04-09 08:39:00 +00:00
|
|
|
static gboolean new_packet = FALSE;
|
2004-03-20 05:53:40 +00:00
|
|
|
|
|
|
|
static dissector_handle_t q931_handle;
|
|
|
|
|
|
|
|
void proto_reg_handoff_ipdc(void);
|
|
|
|
|
2004-03-18 08:25:09 +00:00
|
|
|
|
|
|
|
static guint
|
2006-10-31 09:29:07 +00:00
|
|
|
get_ipdc_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
2004-03-18 08:25:09 +00:00
|
|
|
{
|
2010-11-19 15:21:40 +00:00
|
|
|
/* lower 10 bits only */
|
|
|
|
guint raw_len = (tvb_get_ntohs(tvb,offset+2) & 0x03FF);
|
2010-09-23 21:46:31 +00:00
|
|
|
|
2010-11-19 15:21:40 +00:00
|
|
|
return raw_len + 4;
|
2004-03-18 08:25:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_ipdc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *ipdc_tree;
|
|
|
|
proto_item *ipdc_tag;
|
|
|
|
proto_tree *tag_tree;
|
2004-03-20 05:53:40 +00:00
|
|
|
tvbuff_t *q931_tvb;
|
2004-03-18 08:25:09 +00:00
|
|
|
|
2005-06-26 19:56:52 +00:00
|
|
|
const char *des;
|
|
|
|
const char *enum_val = "";
|
2004-04-09 08:39:00 +00:00
|
|
|
char tmp_tag_text[IPDC_STR_LEN + 1];
|
2004-03-18 08:25:09 +00:00
|
|
|
const value_string *val_ptr;
|
2004-03-20 05:53:40 +00:00
|
|
|
guint32 type;
|
2004-03-18 08:25:09 +00:00
|
|
|
guint len;
|
|
|
|
guint i;
|
|
|
|
guint status;
|
|
|
|
gshort tag;
|
|
|
|
guint32 tmp_tag;
|
|
|
|
|
|
|
|
gshort nr = tvb_get_guint8(tvb,0);
|
|
|
|
gshort ns = tvb_get_guint8(tvb,1);
|
2010-11-19 15:21:40 +00:00
|
|
|
guint payload_len = get_ipdc_pdu_len(pinfo,tvb,0);
|
2004-03-18 08:25:09 +00:00
|
|
|
|
2010-11-19 15:21:40 +00:00
|
|
|
gshort protocol_id;
|
|
|
|
gshort trans_id_size;
|
|
|
|
guint32 trans_id;
|
|
|
|
guint16 message_code;
|
|
|
|
guint16 offset;
|
2004-03-18 08:25:09 +00:00
|
|
|
|
2010-11-19 15:21:40 +00:00
|
|
|
/* display IPDC protocol ID */
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPDC");
|
2004-03-18 08:25:09 +00:00
|
|
|
|
|
|
|
/* short frame... */
|
|
|
|
if (payload_len < 4)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* clear info column and display send/receive sequence numbers */
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
2004-04-09 08:39:00 +00:00
|
|
|
if (new_packet == TRUE) {
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
|
|
|
new_packet = FALSE;
|
|
|
|
}
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "r=%u s=%u ",
|
2004-03-18 08:25:09 +00:00
|
|
|
nr, ns);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (payload_len == 4) {
|
|
|
|
if (!tree)
|
|
|
|
return;
|
|
|
|
|
2010-11-19 15:21:40 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_ipdc, tvb, 0, -1, FALSE);
|
|
|
|
ipdc_tree = proto_item_add_subtree(ti, ett_ipdc);
|
2004-03-18 08:25:09 +00:00
|
|
|
proto_tree_add_item(ipdc_tree, hf_ipdc_nr, tvb, 0, 1, nr);
|
2010-11-19 15:21:40 +00:00
|
|
|
proto_tree_add_item(ipdc_tree, hf_ipdc_ns, tvb, 1, 1, ns);
|
|
|
|
proto_tree_add_uint(ipdc_tree, hf_ipdc_payload_len, tvb, 2, 2,
|
2004-03-18 08:25:09 +00:00
|
|
|
payload_len);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* IPDC tags present - display message code and trans. ID */
|
|
|
|
protocol_id = tvb_get_guint8(tvb,4);
|
2010-11-19 15:21:40 +00:00
|
|
|
trans_id_size = TRANS_ID_SIZE_IPDC; /* tvb_get_guint8(tvb,5); */
|
|
|
|
trans_id = tvb_get_ntohl(tvb,6);
|
|
|
|
message_code = tvb_get_ntohs(tvb,6+trans_id_size);
|
|
|
|
offset = 6 + trans_id_size + 2; /* past message_code */
|
2004-03-18 08:25:09 +00:00
|
|
|
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
2010-11-19 15:21:40 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO,
|
|
|
|
"TID=%x %s ",
|
|
|
|
trans_id,
|
|
|
|
val_to_str(message_code, message_code_vals,
|
|
|
|
TEXT_UNDEFINED));
|
2004-03-18 08:25:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
ti = proto_tree_add_item(tree, proto_ipdc, tvb, 0, -1, FALSE);
|
|
|
|
ipdc_tree = proto_item_add_subtree(ti, ett_ipdc);
|
|
|
|
|
|
|
|
proto_tree_add_item(ipdc_tree, hf_ipdc_nr, tvb, 0, 1, nr);
|
|
|
|
proto_tree_add_item(ipdc_tree, hf_ipdc_ns, tvb, 1, 1, ns);
|
|
|
|
proto_tree_add_uint(ipdc_tree, hf_ipdc_payload_len, tvb,
|
|
|
|
2, 2, payload_len);
|
|
|
|
|
|
|
|
proto_tree_add_item(ipdc_tree, hf_ipdc_protocol_id, tvb,
|
|
|
|
4, 1, protocol_id);
|
|
|
|
proto_tree_add_item(ipdc_tree, hf_ipdc_trans_id_size, tvb,
|
|
|
|
5, 1, trans_id_size);
|
|
|
|
proto_tree_add_item(ipdc_tree, hf_ipdc_trans_id, tvb,
|
|
|
|
6, trans_id_size, trans_id);
|
|
|
|
proto_tree_add_item(ipdc_tree, hf_ipdc_message_code, tvb,
|
|
|
|
6 + trans_id_size + 1, 1, message_code);
|
|
|
|
|
|
|
|
ipdc_tag = proto_tree_add_text(ipdc_tree, tvb, offset,
|
|
|
|
payload_len - offset, "IPDC tags");
|
|
|
|
tag_tree = proto_item_add_subtree(ipdc_tag, ett_ipdc_tag);
|
|
|
|
|
|
|
|
/* iterate through tags. first byte is tag, second is length,
|
2010-11-19 15:21:40 +00:00
|
|
|
in bytes, following is tag data. tag of 0x0 should be
|
2004-03-18 08:25:09 +00:00
|
|
|
end of tags. */
|
|
|
|
for (;;) {
|
|
|
|
tag = tvb_get_guint8(tvb, offset);
|
|
|
|
|
|
|
|
if (tag == 0x0) {
|
|
|
|
if (offset == payload_len - 1) {
|
|
|
|
proto_tree_add_text(tag_tree, tvb,
|
|
|
|
offset, 1, "end of tags");
|
|
|
|
} else {
|
|
|
|
proto_tree_add_text(tag_tree, tvb,
|
|
|
|
offset, 1, "data trailing end of tags");
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
len = tvb_get_guint8(tvb,offset+1);
|
2010-11-19 15:21:40 +00:00
|
|
|
des = val_to_str_ext(tag, &tag_description_ext, TEXT_UNDEFINED);
|
2004-03-20 05:53:40 +00:00
|
|
|
/* lookup tag type */
|
|
|
|
for (i = 0; (ipdc_tag_types[i].tag != tag &&
|
2004-03-21 19:57:14 +00:00
|
|
|
ipdc_tag_types[i].type != IPDC_UNKNOWN); i++)
|
2004-03-20 05:53:40 +00:00
|
|
|
;
|
|
|
|
type = ipdc_tag_types[i].type;
|
|
|
|
|
|
|
|
tmp_tag = 0;
|
|
|
|
|
|
|
|
switch (type) {
|
2004-03-21 19:57:14 +00:00
|
|
|
/* simple IPDC_ASCII strings */
|
|
|
|
case IPDC_ASCII:
|
2007-04-10 14:48:06 +00:00
|
|
|
DISSECTOR_ASSERT(len<=IPDC_STR_LEN);
|
2007-03-28 21:55:11 +00:00
|
|
|
tvb_memcpy(tvb, tmp_tag_text, offset+2, len);
|
2004-03-20 08:01:07 +00:00
|
|
|
tmp_tag_text[len] = 0;
|
2004-03-18 08:25:09 +00:00
|
|
|
proto_tree_add_text(tag_tree, tvb, offset,
|
2004-03-20 05:53:40 +00:00
|
|
|
len + 2, "0x%2.2x: %s: %s", tag, des,
|
|
|
|
tmp_tag_text);
|
|
|
|
break;
|
2004-03-18 08:25:09 +00:00
|
|
|
|
2004-03-20 05:53:40 +00:00
|
|
|
/* unsigned integers, or bytes */
|
2004-03-21 19:57:14 +00:00
|
|
|
case IPDC_UINT:
|
|
|
|
case IPDC_BYTE:
|
2010-09-23 21:46:31 +00:00
|
|
|
for (i = 0; i < len; i++)
|
2004-03-20 05:53:40 +00:00
|
|
|
tmp_tag += tvb_get_guint8(tvb,
|
|
|
|
offset + 2 + i) * (guint32)
|
|
|
|
pow(256, len - (i + 1));
|
|
|
|
|
|
|
|
if (len == 1)
|
|
|
|
enum_val =
|
2010-11-19 15:21:40 +00:00
|
|
|
val_to_str_ext(IPDC_TAG(tag) +
|
2004-03-20 05:53:40 +00:00
|
|
|
tmp_tag,
|
2010-11-19 15:21:40 +00:00
|
|
|
&tag_enum_type_ext, TEXT_UNDEFINED);
|
2004-03-18 08:25:09 +00:00
|
|
|
|
2004-03-20 05:53:40 +00:00
|
|
|
if (len == 1 &&
|
|
|
|
strcmp(enum_val, TEXT_UNDEFINED) != 0) {
|
|
|
|
proto_tree_add_text(tag_tree, tvb,
|
|
|
|
offset, len + 2,
|
|
|
|
"0x%2.2x: %s: %s",
|
|
|
|
tag, des, enum_val);
|
|
|
|
} else {
|
|
|
|
proto_tree_add_text(tag_tree, tvb,
|
|
|
|
offset, len + 2,
|
|
|
|
"0x%2.2x: %s: %u",
|
|
|
|
tag, des, tmp_tag);
|
|
|
|
}
|
|
|
|
break;
|
2004-03-18 08:25:09 +00:00
|
|
|
|
2004-03-20 05:53:40 +00:00
|
|
|
/* IP addresses */
|
2004-03-21 19:57:14 +00:00
|
|
|
case IPDC_IPA:
|
2004-04-09 08:39:00 +00:00
|
|
|
switch (len) {
|
|
|
|
case 4:
|
|
|
|
g_snprintf(tmp_tag_text,
|
|
|
|
IPDC_STR_LEN,
|
|
|
|
"%u.%u.%u.%u",
|
|
|
|
tvb_get_guint8(tvb, offset + 2),
|
|
|
|
tvb_get_guint8(tvb, offset + 3),
|
|
|
|
tvb_get_guint8(tvb, offset + 4),
|
|
|
|
tvb_get_guint8(tvb, offset + 5)
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 6:
|
|
|
|
g_snprintf(tmp_tag_text,
|
|
|
|
IPDC_STR_LEN,
|
|
|
|
"%u.%u.%u.%u:%u",
|
|
|
|
tvb_get_guint8(tvb, offset + 2),
|
|
|
|
tvb_get_guint8(tvb, offset + 3),
|
|
|
|
tvb_get_guint8(tvb, offset + 4),
|
|
|
|
tvb_get_guint8(tvb, offset + 5),
|
|
|
|
tvb_get_ntohs(tvb, offset + 6));
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_snprintf(tmp_tag_text,
|
|
|
|
IPDC_STR_LEN,
|
|
|
|
"Invalid IP address length %u",
|
2010-11-19 15:21:40 +00:00
|
|
|
len);
|
2004-03-20 05:53:40 +00:00
|
|
|
}
|
2004-03-18 08:25:09 +00:00
|
|
|
|
2004-03-20 05:53:40 +00:00
|
|
|
proto_tree_add_text(tag_tree, tvb,
|
|
|
|
offset, len + 2,
|
|
|
|
"0x%2.2x: %s: %s",
|
|
|
|
tag, des, tmp_tag_text);
|
|
|
|
break;
|
2004-03-18 08:25:09 +00:00
|
|
|
|
2004-03-20 05:53:40 +00:00
|
|
|
/* Line status arrays */
|
2004-03-21 19:57:14 +00:00
|
|
|
case IPDC_LINESTATUS:
|
|
|
|
case IPDC_CHANNELSTATUS:
|
2004-03-20 05:53:40 +00:00
|
|
|
proto_tree_add_text(tag_tree, tvb, offset,
|
|
|
|
len + 2, "0x%2.2x: %s", tag, des);
|
2004-03-21 19:57:14 +00:00
|
|
|
val_ptr = (type == IPDC_LINESTATUS) ?
|
2004-03-20 05:53:40 +00:00
|
|
|
line_status_vals : channel_status_vals;
|
|
|
|
|
|
|
|
for (i = 0; i < len; i++) {
|
|
|
|
status = tvb_get_guint8(tvb,offset+2+i);
|
|
|
|
|
|
|
|
proto_tree_add_text(tag_tree, tvb,
|
2010-09-23 21:46:31 +00:00
|
|
|
offset + 2 + i, 1,
|
2004-03-20 05:53:40 +00:00
|
|
|
" %.2u: %.2x (%s)",
|
|
|
|
i + 1, status,
|
|
|
|
val_to_str(status,
|
|
|
|
val_ptr,
|
|
|
|
TEXT_UNDEFINED));
|
|
|
|
}
|
|
|
|
break;
|
2004-03-18 08:25:09 +00:00
|
|
|
|
2004-03-21 19:57:14 +00:00
|
|
|
case IPDC_Q931:
|
2004-03-20 05:53:40 +00:00
|
|
|
q931_tvb =
|
|
|
|
tvb_new_subset(tvb, offset+2, len, len);
|
|
|
|
call_dissector(q931_handle,q931_tvb,pinfo,tree);
|
|
|
|
break;
|
2004-03-18 08:25:09 +00:00
|
|
|
|
2004-04-09 08:39:00 +00:00
|
|
|
case IPDC_ENCTYPE:
|
|
|
|
proto_tree_add_text(tag_tree, tvb,
|
|
|
|
offset, len + 2,
|
|
|
|
"0x%2.2x: %s: %s",
|
|
|
|
tag, des, val_to_str(
|
|
|
|
tvb_get_guint8(tvb,offset+2),
|
|
|
|
encoding_type_vals,
|
|
|
|
TEXT_UNDEFINED));
|
|
|
|
|
|
|
|
if (len == 2) {
|
|
|
|
proto_tree_add_text(tag_tree, tvb,
|
|
|
|
offset, len + 2,
|
|
|
|
"0x%2.2x: %s: %u",
|
|
|
|
tag, des,
|
|
|
|
tvb_get_guint8(tvb,offset+3));
|
|
|
|
}
|
|
|
|
break;
|
2010-09-23 21:46:31 +00:00
|
|
|
|
2004-03-20 05:53:40 +00:00
|
|
|
/* default */
|
|
|
|
default:
|
|
|
|
proto_tree_add_text(tag_tree, tvb, offset,
|
|
|
|
len + 2, "0x%2.2x: %s", tag, des);
|
|
|
|
} /* switch */
|
2004-03-18 08:25:09 +00:00
|
|
|
|
|
|
|
offset += len + 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_ipdc_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_ipdc_common(tvb, pinfo, tree);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_ipdc_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
2004-04-09 08:39:00 +00:00
|
|
|
new_packet = TRUE;
|
2004-03-18 08:25:09 +00:00
|
|
|
tcp_dissect_pdus(tvb, pinfo, tree, ipdc_desegment, 4,
|
|
|
|
get_ipdc_pdu_len, dissect_ipdc_tcp_pdu);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_ipdc(void)
|
2010-09-23 21:46:31 +00:00
|
|
|
{
|
2004-03-18 08:25:09 +00:00
|
|
|
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_ipdc_nr,
|
|
|
|
{ "N(r)", "ipdc.nr",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
"Receive sequence number", HFILL }
|
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_ipdc_ns,
|
|
|
|
{ "N(s)", "ipdc.ns",
|
2010-09-23 21:46:31 +00:00
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
2004-03-18 08:25:09 +00:00
|
|
|
"Transmit sequence number", HFILL }
|
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_ipdc_payload_len,
|
|
|
|
{ "Payload length", "ipdc.length",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2004-03-18 08:25:09 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_ipdc_protocol_id,
|
|
|
|
{ "Protocol ID", "ipdc.protocol_id",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2004-03-18 08:25:09 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_ipdc_trans_id_size,
|
|
|
|
{ "Transaction ID size", "ipdc.trans_id_size",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2004-03-18 08:25:09 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_ipdc_trans_id,
|
|
|
|
{ "Transaction ID", "ipdc.trans_id",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }
|
2004-03-18 08:25:09 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
{ &hf_ipdc_message_code,
|
|
|
|
{ "Message code", "ipdc.message_code",
|
|
|
|
FT_UINT16, BASE_HEX, VALS(message_code_vals), 0x0,
|
2010-09-23 21:46:31 +00:00
|
|
|
NULL, HFILL }
|
2004-03-18 08:25:09 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_ipdc,
|
|
|
|
&ett_ipdc_tag,
|
|
|
|
};
|
|
|
|
|
|
|
|
module_t *ipdc_module;
|
|
|
|
|
|
|
|
proto_ipdc = proto_register_protocol("IP Device Control (SS7 over IP)",
|
|
|
|
"IPDC", "ipdc");
|
|
|
|
proto_register_field_array(proto_ipdc, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
|
2004-03-20 05:53:40 +00:00
|
|
|
ipdc_module = prefs_register_protocol(proto_ipdc, proto_reg_handoff_ipdc);
|
2004-03-18 08:25:09 +00:00
|
|
|
prefs_register_bool_preference(ipdc_module, "desegment_ipdc_messages",
|
2004-08-21 09:02:52 +00:00
|
|
|
"Reassemble IPDC messages spanning multiple TCP segments",
|
|
|
|
"Whether the IPDC dissector should reassemble messages spanning multiple TCP segments."
|
|
|
|
" To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
|
2004-03-18 08:25:09 +00:00
|
|
|
&ipdc_desegment);
|
2004-03-20 05:53:40 +00:00
|
|
|
prefs_register_uint_preference(ipdc_module, "tcp.port",
|
|
|
|
"IPDC monitoring port",
|
|
|
|
"Set the IPDC monitoring port", 10,
|
|
|
|
&ipdc_port_pref);
|
2004-03-18 08:25:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_ipdc(void)
|
|
|
|
{
|
2005-07-09 00:53:17 +00:00
|
|
|
static guint last_ipdc_port_pref = 0;
|
2004-03-20 05:53:40 +00:00
|
|
|
static dissector_handle_t ipdc_tcp_handle = NULL;
|
|
|
|
|
|
|
|
if (ipdc_tcp_handle) {
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_delete_uint("tcp.port", last_ipdc_port_pref,
|
2004-03-20 05:53:40 +00:00
|
|
|
ipdc_tcp_handle);
|
|
|
|
} else {
|
2010-09-23 21:46:31 +00:00
|
|
|
ipdc_tcp_handle =
|
2004-03-20 05:53:40 +00:00
|
|
|
create_dissector_handle(dissect_ipdc_tcp, proto_ipdc);
|
|
|
|
q931_handle = find_dissector("q931");
|
|
|
|
}
|
2004-03-18 08:25:09 +00:00
|
|
|
|
2004-03-20 05:53:40 +00:00
|
|
|
last_ipdc_port_pref = ipdc_port_pref;
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("tcp.port", ipdc_port_pref, ipdc_tcp_handle);
|
2004-03-18 08:25:09 +00:00
|
|
|
}
|