* <anders.broman@ericsson.com>
* Inserted routines for BICC dissection according to Q.765.5 Q.1902 Q.1970 Q.1990,
* calling SDP dissector for RFC2327 decoding.
- * $Id: packet-isup.c,v 1.38 2003/12/04 05:47:38 gram Exp $
+ * $Id: packet-isup.c,v 1.41 2003/12/12 19:55:27 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include <epan/packet.h>
#include <epan/ipv6-utils.h>
+#include <tap.h>
#include "packet-q931.h"
+#include "packet-isup.h"
#define MTP3_ISUP_SERVICE_INDICATOR 5
#define MTP3_BICC_SERVICE_INDICATOR 13
#define MESSAGE_TYPE_SUBSEQUENT_DIR_NUM 67
-static const value_string isup_message_type_value[] = {
+const value_string isup_message_type_value[] = {
{ MESSAGE_TYPE_INITIAL_ADDR, "Initial address"},
{ MESSAGE_TYPE_SUBSEQ_ADDR, "Subsequent address"},
{ MESSAGE_TYPE_INFO_REQ, "Information request (national use)"},
{ 0, NULL}};
/* Same as above but in acronym form (for the Info column) */
-static const value_string isup_message_type_value_acro[] = {
+const value_string isup_message_type_value_acro[] = {
{ MESSAGE_TYPE_INITIAL_ADDR, "IAM"},
{ MESSAGE_TYPE_SUBSEQ_ADDR, "SAM"},
{ MESSAGE_TYPE_INFO_REQ, "INR"},
static int hf_isup_cic = -1;
static int hf_bicc_cic = -1;
+static int isup_tap = -1;
+
static int hf_isup_message_type = -1;
static int hf_isup_parameter_type = -1;
static int hf_isup_parameter_length = -1;
{ 0x02, "Discard parameter" },
{ 0x03, "Reserved (interpreted as 00)" },
{ 0, NULL },
-
};
static const value_string ISUP_Broadband_narrowband_interworking_indicator_vals[] = {
{ 0x00, "Pass on" },
static void
dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup_tree)
{
+ static isup_tap_rec_t tap_rec;
tvbuff_t *parameter_tvb;
tvbuff_t *optional_parameter_tvb;
proto_item* pass_along_item;
proto_tree_add_uint_format(isup_tree, hf_isup_message_type, message_tvb, 0, MESSAGE_TYPE_LENGTH, message_type, "Message type: %s (%u)", val_to_str(message_type, isup_message_type_value, "reserved"), message_type);
offset += MESSAGE_TYPE_LENGTH;
+ tap_rec.message_type = message_type;
+
+ tap_queue_packet(isup_tap, pinfo, &tap_rec);
+
bufferlength = tvb_ensure_length_remaining(message_tvb, offset);
parameter_tvb = tvb_new_subset(message_tvb, offset, bufferlength, bufferlength);
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *ti;
- proto_tree *isup_tree;
+ proto_tree *isup_tree = NULL;
tvbuff_t *message_tvb;
guint16 cic;
guint8 message_type;
/* Extract message type field */
message_type = tvb_get_guint8(tvb, CIC_OFFSET + CIC_LENGTH);
+ /* dissect CIC in main dissector since pass-along message type carrying complete IUSP message w/o CIC needs
+ recursive message dissector call */
+ cic = tvb_get_letohs(tvb, CIC_OFFSET) & 0x0FFF; /*since upper 4 bits spare */
if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, isup_message_type_value_acro, "reserved"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s(CIC %u)", val_to_str(message_type, isup_message_type_value_acro, "reserved"),cic);
/* In the interest of speed, if "tree" is NULL, don't do any work not
necessary to generate protocol tree items. */
ti = proto_tree_add_item(tree, proto_isup, tvb, 0, -1, FALSE);
isup_tree = proto_item_add_subtree(ti, ett_isup);
- /* dissect CIC in main dissector since pass-along message type carrying complete IUSP message w/o CIC needs
- recursive message dissector call */
- cic = tvb_get_letohs(tvb, CIC_OFFSET) & 0x0FFF; /*since upper 4 bits spare */
proto_tree_add_uint_format(isup_tree, hf_isup_cic, tvb, CIC_OFFSET, CIC_LENGTH, cic, "CIC: %u", cic);
-
- message_tvb = tvb_new_subset(tvb, CIC_LENGTH, -1, -1);
- dissect_isup_message(message_tvb, pinfo, isup_tree);
}
+
+ message_tvb = tvb_new_subset(tvb, CIC_LENGTH, -1, -1);
+ dissect_isup_message(message_tvb, pinfo, isup_tree);
}
/* ------------------------------------------------------------------ */
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *ti;
- proto_tree *bicc_tree;
+ proto_tree *bicc_tree = NULL;
tvbuff_t *message_tvb;
guint32 bicc_cic;
guint8 message_type;
bicc_cic = tvb_get_letohl(tvb, BICC_CIC_OFFSET);
proto_tree_add_uint_format(bicc_tree, hf_bicc_cic, tvb, BICC_CIC_OFFSET, BICC_CIC_LENGTH, bicc_cic, "CIC: %u", bicc_cic);
-
- message_tvb = tvb_new_subset(tvb, BICC_CIC_LENGTH, -1, -1);
- dissect_isup_message(message_tvb, pinfo, bicc_tree);
}
+
+ message_tvb = tvb_new_subset(tvb, BICC_CIC_LENGTH, -1, -1);
+ dissect_isup_message(message_tvb, pinfo, bicc_tree);
}
/*---------------------------------------------------------------------*/
/* Register the protocol with Ethereal */
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_isup, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+
+ isup_tap = register_tap("isup");
}