Index: packet-gsm_map.c
===================================================================
RCS file: /cvsroot/ethereal/packet-gsm_map.c,v
retrieving revision 1.4
diff -u -r1.4 packet-gsm_map.c
--- packet-gsm_map.c	21 Dec 2003 21:41:10 -0000	1.4
+++ packet-gsm_map.c	11 Feb 2004 00:48:55 -0000
@@ -45,6 +45,8 @@
 #include "epan/packet.h"
 #include "asn1.h"
 
+#include "packet-gsm_map.h"
+
 
 /* OPERATION CODE DEFINITION */
 
@@ -163,7 +165,7 @@
 #define MAP_OK			0x0
 #define MAP_FAIL		0x1
 
-static const value_string opr_code_strings[] = {
+const value_string gsm_map_opr_code_strings[] = {
 
 /* LOCATION MANAGEMENT */
     { MAP_UPD_LOC,			"Update Location"},
@@ -287,6 +289,9 @@
 
 /* Initialize the protocol and registered fields */
 static int proto_map = -1;
+
+static int gsm_map_tap = -1;
+
 static int hf_map_tag = -1;
 static int hf_map_length = -1;
 static int hf_map_opr_code = -1;
@@ -653,7 +658,7 @@
     }
 }
 
-#define	GSM_MAP_NUM_OP (sizeof(opr_code_strings)/sizeof(value_string))
+#define	GSM_MAP_NUM_OP (sizeof(gsm_map_opr_code_strings)/sizeof(value_string))
 static gint ett_op[GSM_MAP_NUM_OP];
 static void (*op_fcn[])(ASN1_SCK *asn1, proto_tree *tree) = {
     NULL,	/* Update Location */
@@ -983,14 +988,27 @@
 static int
 dissect_map_opr_code(ASN1_SCK *asn1, packet_info *pinfo, proto_tree *tree, gint *op_idx_p)
 {
-    guint	saved_offset = 0;
-    guint	len;
-    guint	tag;
-    gint32	val;
-    gchar	*str = NULL;
-    proto_item	*item;
-    proto_tree	*subtree;
-    gboolean	def_len;
+    guint			saved_offset = 0;
+    guint			len;
+    guint			tag;
+    gint32			val;
+    gchar			*str = NULL;
+    proto_item			*item;
+    proto_tree			*subtree;
+    gboolean			def_len;
+    static gsm_map_tap_rec_t	tap_rec[4];
+    static gsm_map_tap_rec_t	*tap_p;
+    static int			tap_current=0;
+
+    /*
+     * set tap record pointer
+     */
+    tap_current++;
+    if (tap_current == 4)
+    {
+	tap_current = 0;
+    }
+    tap_p = &tap_rec[tap_current];
 
     if (check_map_tag(asn1, MAP_OPR_CODE_TAG))
     {
@@ -1004,7 +1022,7 @@
 	proto_tree_add_int(subtree, hf_map_opr_code, asn1->tvb, saved_offset,
 	    asn1->offset - saved_offset, val);
 
-	str = my_match_strval(val, opr_code_strings, op_idx_p);
+	str = my_match_strval(val, gsm_map_opr_code_strings, op_idx_p);
 
 	if (NULL == str) return(MAP_FAIL);
 
@@ -1012,6 +1030,10 @@
 	{
 	    col_append_fstr(pinfo->cinfo, COL_INFO,  "%s ", str);
 	}
+
+	tap_p->opr_code_idx = *op_idx_p;
+
+	tap_queue_packet(gsm_map_tap, pinfo, tap_p);
     }
 
     return(MAP_OK);
@@ -1478,7 +1500,7 @@
 	},
 	{ &hf_map_opr_code,
 	    { "Operation Code",	"map.oprcode",
-	    FT_INT32, BASE_DEC, VALS(opr_code_strings), 0,
+	    FT_INT32, BASE_DEC, VALS(gsm_map_opr_code_strings), 0,
 	    "", HFILL }
 	},
 	{ &hf_map_int,
@@ -1524,6 +1546,8 @@
     /* Required function calls to register the header fields and subtrees used */
     proto_register_field_array(proto_map, hf, array_length(hf));
     proto_register_subtree_array(ett, array_length(ett));
+
+    gsm_map_tap = register_tap("gsm_map");
 }
 
 void
