Add {0, NULL} to the isup_Pass_on_not_possible_indicator_vals and
[obnox/wireshark/wip.git] / packet-sccp.c
index a3d78c7def77e8ff87f303ef29003f68925ef461..382bb834431cd7d4a360b17cb4aba8863b97ca54 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Copyright 2002, Jeff Morriss <jeff.morriss[AT]ulticom.com>
  *
- * $Id: packet-sccp.c,v 1.12 2003/09/04 14:30:18 tuexen Exp $
+ * $Id: packet-sccp.c,v 1.16 2003/11/06 09:28:40 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -266,6 +266,9 @@ static const value_string sccp_ssn_values[] = {
   { 0x0c,  "Reserved for international use (ITU only)" },
   { 0x0d,  "Broadband ISDN edge-to-edge applications (ITU only)" },
   { 0x0e,  "TC test responder (ITU only)" },
+  { 0x8e,  "RANAP" },
+  { 0xfc,  "IOS" },
+  { 0xfe,  "BSSAP/BSAP" },
   { 0,     NULL } };
 
 
@@ -659,6 +662,8 @@ static guint8 calling_ssn = INVALID_SSN;
 static dissector_handle_t data_handle;
 static dissector_table_t sccp_ssn_dissector_table;
 
+static heur_dissector_list_t heur_subdissector_list;
+
 static void
 dissect_sccp_unknown_message(tvbuff_t *message_tvb, proto_tree *sccp_tree)
 {
@@ -1191,6 +1196,12 @@ dissect_sccp_data_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                          tree)))
     return;
 
+    /* try heuristic subdissector list to see if there are any takers */
+    if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree))
+    {
+       return;
+    }
+
     /* No sub-dissection occured, treat it as raw data */
     call_dissector(data_handle, tvb, pinfo, tree);
 }
@@ -1891,17 +1902,18 @@ dissect_sccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   proto_tree *sccp_tree = NULL;
 
   /* Make entry in the Protocol column on summary display */
-  switch(mtp3_standard) {
-    case ITU_STANDARD:
-      col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (Int. ITU)");
-      break;
-    case ANSI_STANDARD:
-      col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (ANSI)");
-      break;
-    case CHINESE_ITU_STANDARD:
-      col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (Chin. ITU)");
-      break;
-  };      
+  if (check_col(pinfo->cinfo, COL_PROTOCOL))
+    switch(mtp3_standard) {
+      case ITU_STANDARD:
+        col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (Int. ITU)");
+        break;
+      case ANSI_STANDARD:
+        col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (ANSI)");
+        break;
+      case CHINESE_ITU_STANDARD:
+        col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (Chin. ITU)");
+        break;
+    };      
 
   /* In the interest of speed, if "tree" is NULL, don't do any work not
      necessary to generate protocol tree items. */
@@ -2267,12 +2279,15 @@ proto_register_sccp(void)
   proto_sccp = proto_register_protocol("Signalling Connection Control Part",
                                       "SCCP", "sccp");
 
+  register_dissector("sccp", dissect_sccp, proto_sccp);
+
   /* Required function calls to register the header fields and subtrees used */
   proto_register_field_array(proto_sccp, hf, array_length(hf));
   proto_register_subtree_array(ett, array_length(ett));
 
   sccp_ssn_dissector_table = register_dissector_table("sccp.ssn", "SCCP SSN", FT_UINT8, BASE_DEC);
 
+  register_heur_dissector_list("sccp", &heur_subdissector_list);
 }
 
 void
@@ -2280,7 +2295,7 @@ proto_reg_handoff_sccp(void)
 {
   dissector_handle_t sccp_handle;
 
-  sccp_handle = create_dissector_handle(dissect_sccp, proto_sccp);
+  sccp_handle = find_dissector("sccp");
 
   dissector_add("mtp3.service_indicator", SCCP_SI, sccp_handle);
   dissector_add("m3ua.protocol_data_si", SCCP_SI, sccp_handle);