For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
[obnox/wireshark/wip.git] / epan / dissectors / packet-alcap.c
index 3253f4557ef4549276627ec6bb5ed70deaebd7ff..02096cf49a27f8906da14b4b238e716d08fcdc11 100644 (file)
 /* packet-alcap.c
- * Routines for ALCAP (Q.2630.1) dissection
- * AAL type 2 signalling protocol - Capability set 1
- * 12/1999
- *
- * Copyright 2003, Michael Lum <mlum [AT] telostech.com>
- * In association with Telos Technology Inc.
- *
- * $Id$
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
- * 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.
- *
- * 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.
- *
- * 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.
- */
+* Routines for ALCAP (Q.2630.3) dissection
+* AAL type 2 signalling protocol - Capability set 3
+* 10/2003
+*
+* Copyright 2003, Michael Lum <mlum [AT] telostech.com>
+* In association with Telos Technology Inc.
+*
+* Copyright 2005, Luis E. Garcia Ontanon <luis.ontanon [AT] gmail.com>
+*
+* $Id$
+*
+* Wireshark - Network traffic analyzer
+* By Gerald Combs <gerald@wireshark.org>
+* 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.
+*
+* 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.
+*
+* 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 <stdio.h>
-#include <stdlib.h>
-#include <gmodule.h>
+#include <glib.h>
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h>
-#endif
+#include <wsutil/str_util.h>
 
-#include <string.h>
-
-#include "epan/packet.h"
+#include <epan/packet.h>
 #include <epan/emem.h>
+#include <epan/prefs.h>
+#include "packet-alcap.h"
+#include <epan/dissectors/packet-isup.h>
+#include <epan/expert.h>
 
+#define ALCAP_MSG_HEADER_LEN     6
+#define ALCAP_PARM_HEADER_LEN    3
+#define FIELD_NSAP_ADDRESS_LEN  20
 
-#define        ALCAP_MSG_HEADER_LEN    6
-#define        ALCAP_PARM_HEADER_LEN   3
-
-#define        ALCAP_SI                12
+#define ALCAP_SI                12
 
-#define        EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \
-    if ((edc_len) > (edc_max_len)) \
-    { \
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb, \
-           curr_offset, (edc_len) - (edc_max_len), "Extraneous Data"); \
-    }
+static const value_string msg_type_strings[] = {
+    {  1,   "Block confirm (BLC)" },
+    {  2,   "Block request (BLO)" },
+    {  3,   "Confusion (CFN)" },
+    {  4,   "Establish confirm (ECF)" },
+    {  5,   "Establish request (ERQ)" },
+    {  6,   "Release confirm (RLC)" },
+    {  7,   "Release request (REL)" },
+    {  8,   "Reset confirm (RSC)" },
+    {  9,   "Reset request (RES)" },
+    { 10,   "Unblock confirm (UBC)" },
+    { 11,   "Unblock request (UBL)" },
+    { 12,   "Modify Ack (MOA)" },
+    { 13,   "Modify Reject (MOR)" },
+    { 14,   "Modify Request (MOD)" },
+    { 0, NULL }
+};
 
-#define        SHORT_DATA_CHECK(sdc_len, sdc_min_len) \
-    if ((sdc_len) < (sdc_min_len)) \
-    { \
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb, \
-           curr_offset, (sdc_len), "Short Data (?)"); \
-       return; \
-    }
+static const value_string send_notification[] = {
+    { 0, "Do Not Send Notification"},
+    { 1, "Send Notification" },
+    { 0, NULL }
+};
 
-#define        EXACT_DATA_CHECK(edc_len, edc_eq_len) \
-    if ((edc_len) != (edc_eq_len)) \
-    { \
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb, \
-           curr_offset, (edc_len), "Unexpected Data Length"); \
-       return; \
-    }
+static const value_string instruction_indicator[] = {
+    { 0, "Pass On Message or Parameter"},
+    { 1, "Discard Parameter" },
+    { 2, "Discard Message" },
+    { 3, "Release Connection" },
+    { 0, NULL }
+};
 
 static const value_string msg_parm_strings[] = {
-    { 1,       "Cause (CAU)" },
-    { 2,       "Connection element identifier (CEID)" },
-    { 3,       "Destination E.164 service endpoint address (ESEA)" },
-    { 4,       "Destination NSAP service endpoint address (NSEA)" },
-    { 5,       "Link characteristics (ALC)" },
-    { 6,       "Originating signalling association identifier (OSAID)" },
-    { 7,       "Served user generated reference (SUGR)" },
-    { 8,       "Served user transport (SUT)" },
-    { 9,       "Service specific information (audio) (SSIA)" },
-    { 10,      "Service specific information (multirate) (SSIM)" },
-    { 11,      "Service specific information (SAR-assured) (SSISA)" },
-    { 12,      "Service specific information (SAR-unassured) (SSISU)" },
-    { 13,      "Test connection identifier (TCI)" },
+    {  1,  "Cause (CAU)" },
+    {  2,  "Connection element identifier (CEID)" },
+    {  3,  "Destination E.164 service endpoint address (DESEA)" },
+    {  4,  "Destination NSAP service endpoint address (DNSEA)" },
+    {  5,  "Link characteristics (ALC)" },
+    {  6,  "Originating signalling association identifier (OSAID)" },
+    {  7,  "Served user generated reference (SUGR)" },
+    {  8,  "Served user transport (SUT)" },
+    {  9,  "Service specific information (audio) (SSIA)" },
+    { 10,  "Service specific information (multirate) (SSIM)" },
+    { 11,  "Service specific information (SAR-assured) (SSISA)" },
+    { 12,  "Service specific information (SAR-unassured) (SSISU)" },
+    { 13,  "Test connection identifier (TCI)" },
+    { 14,  "Modify Support for Link Characteristics (MSLC)" },
+    { 15,  "Modify Support for Service Specific Information (MSSSI)" },
+    { 16,  "Path Type (PT)" },
+    { 17,  "Preferred Link Characteristics (PLC)" },
+    { 18,  "Preferred Service Specific Information - Audio Extended (PSSIAE)" },
+    { 19,  "Preferred Service Specific Information - Multirate Extended (PSSIME)" },
+    { 20,  "Served User Correlation ID (SUCI)" },
+    { 21,  "Origination NSAP Service Endpoint Address (ONSEA)" },
+    { 22,  "Service Specific Information - Audio Extended (SSIAE)" },
+    { 23,  "Service Specific Information - Multirate Extended (SSIME)" },
+    { 24,  "Automatic Congestion Control (ACC)" },
+    { 25,  "Connection Priority (CP)" },
+    { 26,  "Hop Counter (HC)" },
+    { 27,  "Origination E.164 Service Endpoint Address (OESEA)" },
+    { 28,  "Preferred Transfer Capability - FBW (PFBW)" },
+    { 29,  "Preferred Transfer Capability - VBWS (PVBWS)" },
+    { 30,  "Preferred Transfer Capability - VBWT (PVBWT)" },
+    { 31,  "TAR Controlled Connection (TCC)" },
+    { 32,  "Transfer Capability (FBW)" },
+    { 33,  "Transfer Capability (VBWS)" },
+    { 34,  "Transfer Capability (VBWT)" },
+    { 35,  "Transfer Capability Support (TCS)" },
     { 0, NULL },
 };
-#define        NUM_PARMS (sizeof(msg_parm_strings)/sizeof(value_string))
-
-static char *alcap_proto_name = "AAL type 2 signalling protocol - Capability set 1 (Q.2630.1)";
-static char *alcap_proto_name_short = "ALCAP";
 
-/* Initialize the subtree pointers */
-static gint ett_alcap = -1;
-static gint ett_parm = -1;
 
-/* Initialize the protocol and registered fields */
-static int proto_alcap = -1;
-static int hf_alcap_msg_type = -1;
-static int hf_alcap_length = -1;
-static int hf_alcap_parm_id = -1;
-static int hf_alcap_none = -1;
-static int hf_alcap_dsaid = -1;
-static int hf_alcap_osaid = -1;
-static int hf_alcap_aal2_path_id = -1;
-static int hf_alcap_channel_id = -1;
-static int hf_alcap_organizational_unique_id = -1;
-static int hf_alcap_served_user_gen_ref = -1;
-static int hf_alcap_nsap_address = -1;
-
-static char* bigbuf;
-static char* bigbuf2;
-static dissector_handle_t data_handle;
-static packet_info *g_pinfo;
-static proto_tree *g_tree;
-
-#define        FIELD_COMPATIBILITY             0
-#define        FIELD_SIGNALLING_ASSOC_ID       1
-#define        FIELD_AAL2_PATH_ID              2
-#define        FIELD_CHANNEL_ID                3
-#define        FIELD_ORGANIZATIONAL_UNIQUE_ID  4
-#define        FIELD_AUDIO_SERVICE             5
-#define        FIELD_MULTIRATE_SERVICE         6
-#define        FIELD_SEG_REASSEMBLY_ASS        7
-#define        FIELD_SEG_REASSEMBLY_UNASS      8
-#define        FIELD_SERVED_USER_GEN_REF       9
-#define        FIELD_MAX_CPS_SDU_BIT_RATE      10
-#define        FIELD_AVG_CPS_SDU_BIT_RATE      11
-#define        FIELD_MAX_CPS_SDU_SIZE          12
-#define        FIELD_AVG_CPS_SDU_SIZE          13
-#define        FIELD_NATURE_OF_ADDRESS         14
-#define        FIELD_E164_ADDRESS              15
-#define        FIELD_NSAP_ADDRESS              16
-#define        FIELD_CAUSE_VALUE               17
-#define        FIELD_DIAGNOSTICS               18
-#define        FIELD_SERVED_USER_TRANSPORT     19
-static const char * field_strings[] = {
-    "Compatibility",
-    "Signalling association identifier",
-    "AAL type 2 path identifier",
-    "Channel identifier (CID)",
-    "Organizational unique identifier (OUI)",
-    "Audio service",
-    "Multirate service",
-    "Segmentation and reassembly (assured data transfer)",
-    "Segmentation and reassembly (unassured data transfer)",
-    "Served user generated reference",
-    "Maximum CPS-SDU bit rate",
-    "Average CPS-SDU bit rate",
-    "Maximum CPS-SDU size",
-    "Average CPS-SDU size",
-    "Nature of address",
-    "E.164 address",
-    "NSAP address",
-    "Cause value",
-    "Diagnostics",
-    "Served user transport"
+static const value_string enabled_disabled[] = {
+    {0, "disabled" },
+    {1, "enabled" },
+    {0,NULL}
 };
-#define        NUM_FIELDS (sizeof(field_strings)/sizeof(char *))
-static gint ett_fields[NUM_FIELDS];
 
-static const value_string msg_type_strings[] = {
-    { 1,       "Block confirm (BLC)" },
-    { 2,       "Block request (BLO)" },
-    { 3,       "Confusion (CFN)" },
-    { 4,       "Establish confirm (ECF)" },
-    { 5,       "Establish request (ERQ)" },
-    { 6,       "Release confirm (RLC)" },
-    { 7,       "Release request (REL)" },
-    { 8,       "Reset confirm (RSC)" },
-    { 9,       "Reset request (RES)" },
-    { 10,      "Unblock confirm (UBC)" },
-    { 11,      "Unblock request (UBL)" },
-    { 0, NULL },
+static const value_string alaw_ulaw[] = {
+    {0, "A-Law" },
+    {1, "u-Law" },
+    {0,NULL}
 };
 
-/* FUNCTIONS */
-
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.1
- */
-static void
-dis_field_compatibility(tvbuff_t *tvb, proto_tree *tree, guint32 *offset, gboolean message)
-{
-    guint32    curr_offset;
-    guint8     compat;
-    proto_item *item;
-    proto_tree *subtree;
-    gchar      *str = NULL;
-
-    curr_offset = *offset;
-
-    item =
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb,
-           curr_offset, 1, "%s %s",
-           message ? "Message" : "Parameter",
-           field_strings[FIELD_COMPATIBILITY]);
-
-    subtree = proto_item_add_subtree(item, ett_fields[FIELD_COMPATIBILITY]);
-
-    compat = tvb_get_guint8(tvb, curr_offset);
-
-    other_decode_bitfield_value(bigbuf, compat, 0x80, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Reserved",
-       bigbuf);
-
-    other_decode_bitfield_value(bigbuf, compat, 0x40, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Pass-on not possible - %s",
-       bigbuf,
-       (compat & 0x40) ? "Send notification" : "Do not send notification");
-
-    switch ((compat & 0x30) >> 4)
-    {
-    case 0x00:
-       str = "Pass on message or parameter (Release connection)";
-       break;
-
-    case 0x01:
-       if (message)
-       {
-           str = "Discard parameter (Discard message)";
-       }
-       else
-       {
-           str = "Discard parameter";
-       }
-       break;
-
-    case 0x02:
-       str = "Discard message";
-       break;
-
-    case 0x03:
-       str = "Release connection";
-       break;
-    }
-
-    other_decode_bitfield_value(bigbuf, compat, 0x30, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Pass-on not possible, instruction - %s",
-       bigbuf,
-       str);
-
-    other_decode_bitfield_value(bigbuf, compat, 0x08, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Reserved",
-       bigbuf);
-
-    other_decode_bitfield_value(bigbuf, compat, 0x04, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  General action - %s",
-       bigbuf,
-       (compat & 0x04) ? "Send notification" : "Do not send notification");
-
-    switch (compat & 0x03)
-    {
-    case 0x00:
-       str = "Pass on message or parameter";
-       break;
-
-    case 0x01:
-       if (message)
-       {
-           str = "Discard parameter (Discard message)";
-       }
-       else
-       {
-           str = "Discard parameter";
-       }
-       break;
-
-    case 0x02:
-       str = "Discard message";
-       break;
-
-    case 0x03:
-       str = "Release connection";
-       break;
-    }
-
-    other_decode_bitfield_value(bigbuf, compat, 0x03, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  General action, instruction - %s",
-       bigbuf,
-       str);
-
-    *offset += 1;
-}
-
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.2
- */
-static void
-dis_field_signalling_assoc_id(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset, gboolean destination)
-{
-    guint32    curr_offset;
-    guint32    value;
-
-    curr_offset = *offset;
-
-#define        FIELD_SIGNALLING_ASSOC_ID_LEN   4
-
-    SHORT_DATA_CHECK(*len, FIELD_SIGNALLING_ASSOC_ID_LEN);
-
-    value = tvb_get_ntohl(tvb, curr_offset);
+static const value_string cause_coding_vals[] = {
+    {0, "ITU (Q.850 - Q.2610)"},
+    {1, "ISO/IEC"},
+    {2, "National"},
+    {3, "Private"},
+    {0,NULL}
+};
 
-       if (value && check_col(g_pinfo->cinfo, COL_INFO))
-               col_append_fstr(g_pinfo->cinfo, COL_INFO, " SA: %u", value);
 
-       if (destination)
-    {
-       proto_tree_add_uint_format(tree, hf_alcap_dsaid, tvb,
-           curr_offset, FIELD_SIGNALLING_ASSOC_ID_LEN, value,
-           "Destination signalling association identifier: %u%s",
-           value,
-           value ? "" : " (unknown)");
-    }
-    else
-    {
-       proto_tree_add_uint(tree, hf_alcap_osaid, tvb,
-           curr_offset, FIELD_SIGNALLING_ASSOC_ID_LEN, value);
-    }
+static const value_string cause_values_itu[] = {
+    { 1, "Unallocated (unassigned) number"},
+    { 3, "No route to destination"},
+    { 31, "Normal, unspecified"},
+    { 34, "No circuit/channel available"},
+    { 38, "Network out of order"},
+    { 41, "Temporary failure"},
+    { 42, "Switching equipment congestion"},
+    { 44, "Requested circuit/channel not available"},
+    { 47, "Resource unavailable, unspecified"},
+    { 93, "AAL parameters cannot be supported"},
+    { 95, "Invalid message, unspecified"},
+    { 96, "Mandatory information element is missing"},
+    { 97, "Message type non-existent or not implemented"},
+    { 99, "Information element/parameter non-existent or not implemented"},
+    { 100, "Invalid information element contents"},
+    { 102, "Recovery on timer expiry"},
+    { 110, "Message with unrecognized parameter, discarded"},
+    { 111, "Protocol error, unspecified"},
+    { 0, NULL }
+};
 
-    curr_offset += FIELD_SIGNALLING_ASSOC_ID_LEN;
+static const value_string audio_profile_type[] = {
+    { 0, "From I.366.2" },
+    { 1, "From Organization" },
+    { 2, "Custom" },
+    { 3, "Reserved" },
+    { 0, NULL }
+};
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
-}
+static const value_string congestion_level[] = {
+    { 0, "Spare" },
+    { 1, "Congestion Level 1 exceeded" },
+    { 2, "Congestion Level 2 exceeded" },
+    { 0, NULL }
+};
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.3
- */
-static void
-dis_field_aal2_path_id(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset)
-{
-    guint32    curr_offset;
-    guint32    value;
+static const value_string connection_priority[] = {
+    { 0, "Level 1 (Highest)" },
+    { 1, "Level 2" },
+    { 2, "Level 3" },
+    { 3, "Level 4" },
+    { 4, "Level 5 (Lowest)" },
+    { 5, "Reserved" },
+    { 6, "Reserved" },
+    { 7, "Reserved" },
+    { 0, NULL }
+};
 
-    curr_offset = *offset;
 
-#define        FIELD_AAL2_PATH_ID_LEN  4
 
-    SHORT_DATA_CHECK(*len, FIELD_AAL2_PATH_ID_LEN);
+static const char *alcap_proto_name = "AAL type 2 signalling protocol (Q.2630)";
+static const char *alcap_proto_name_short = "ALCAP";
 
-    value = tvb_get_ntohl(tvb, curr_offset);
+/* Initialize the subtree pointers */
+static gint ett_alcap = -1;
+static gint ett_leg = -1;
+static gint ett_compat = -1;
+static gint ett_cau_diag = -1;
 
-       if (value && check_col(g_pinfo->cinfo, COL_INFO))
-               col_append_fstr(g_pinfo->cinfo, COL_INFO, " PathId: %u", value);
+/* Initialize the protocol and registered fields */
+static int proto_alcap = -1;
 
-    proto_tree_add_uint_format(tree, hf_alcap_aal2_path_id, tvb,
-       curr_offset, FIELD_AAL2_PATH_ID_LEN, value,
-       "AAL2 path identifier: %d%s",
-       value,
-       value ? "" : " (Null)");
+static int hf_alcap_dsaid = -1;
+static int hf_alcap_msg_id = -1;
+static int hf_alcap_compat = -1;
+static int hf_alcap_compat_pass_on_sni = -1;
+static int hf_alcap_compat_pass_on_ii = -1;
+static int hf_alcap_compat_general_sni = -1;
+static int hf_alcap_compat_general_ii = -1;
+
+static int hf_alcap_param_id = -1;
+static int hf_alcap_param_len = -1;
+
+static int hf_alcap_unknown = -1;
+
+static int hf_alcap_cau_coding = -1;
+static int hf_alcap_cau_value_itu = -1;
+static int hf_alcap_cau_value_non_itu = -1;
+static int hf_alcap_cau_diag = -1;
+static int hf_alcap_cau_diag_len = -1;
+static int hf_alcap_cau_diag_msg = -1;
+static int hf_alcap_cau_diag_param_id = -1;
+static int hf_alcap_cau_diag_field_num = -1;
+
+static int hf_alcap_ceid_pathid = -1;
+static int hf_alcap_ceid_cid = -1;
+
+static int hf_alcap_dnsea = -1;
+
+static int hf_alcap_alc_max_br_fw = -1;
+static int hf_alcap_alc_max_br_bw = -1;
+static int hf_alcap_alc_avg_br_fw = -1;
+static int hf_alcap_alc_avg_br_bw = -1;
+static int hf_alcap_alc_max_sdu_fw = -1;
+static int hf_alcap_alc_max_sdu_bw = -1;
+static int hf_alcap_alc_avg_sdu_fw = -1;
+static int hf_alcap_alc_avg_sdu_bw = -1;
 
-    curr_offset += FIELD_AAL2_PATH_ID_LEN;
+static int hf_alcap_osaid = -1;
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
+static int hf_alcap_sugr = -1;
+
+static int hf_alcap_sut_len = -1;
+static int hf_alcap_sut = -1;
+
+static int hf_alcap_ssia_pr_type = -1;
+static int hf_alcap_ssia_pr_id = -1;
+static int hf_alcap_ssia_frm = -1;
+static int hf_alcap_ssia_cmd = -1;
+static int hf_alcap_ssia_mfr2 = -1;
+static int hf_alcap_ssia_mfr1 = -1;
+static int hf_alcap_ssia_dtmf = -1;
+static int hf_alcap_ssia_cas = -1;
+static int hf_alcap_ssia_fax = -1;
+static int hf_alcap_ssia_pcm = -1;
+static int hf_alcap_ssia_max_len = -1;
+static int hf_alcap_ssia_oui = -1;
+
+static int hf_alcap_ssim_frm = -1;
+static int hf_alcap_ssim_mult = -1;
+static int hf_alcap_ssim_max = -1;
+
+static int hf_alcap_ssisa_max_sssar_fw = -1;
+static int hf_alcap_ssisa_max_sssar_bw = -1;
+static int hf_alcap_ssisa_max_sscop_sdu_fw = -1;
+static int hf_alcap_ssisa_max_sscop_sdu_bw = -1;
+static int hf_alcap_ssisa_max_sscop_uu_fw = -1;
+static int hf_alcap_ssisa_max_sscop_uu_bw = -1;
+
+static int hf_alcap_ssisu_max_sssar_fw = -1;
+static int hf_alcap_ssisu_max_sssar_bw = -1;
+static int hf_alcap_ssisu_ted = -1;
+
+static int hf_alcap_pt = -1;
+
+static int hf_alcap_plc_max_br_fw = -1;
+static int hf_alcap_plc_max_br_bw = -1;
+static int hf_alcap_plc_avg_br_fw = -1;
+static int hf_alcap_plc_avg_br_bw = -1;
+static int hf_alcap_plc_max_sdu_fw = -1;
+static int hf_alcap_plc_max_sdu_bw = -1;
+static int hf_alcap_plc_avg_sdu_fw = -1;
+static int hf_alcap_plc_avg_sdu_bw = -1;
+
+static int hf_alcap_pssiae_pr_type = -1;
+static int hf_alcap_pssiae_pr_id = -1;
+static int hf_alcap_pssiae_lb = -1;
+static int hf_alcap_pssiae_rc = -1;
+static int hf_alcap_pssiae_syn = -1;
+static int hf_alcap_pssiae_frm = -1;
+static int hf_alcap_pssiae_cmd = -1;
+static int hf_alcap_pssiae_mfr2 = -1;
+static int hf_alcap_pssiae_mfr1 = -1;
+static int hf_alcap_pssiae_dtmf = -1;
+static int hf_alcap_pssiae_cas = -1;
+static int hf_alcap_pssiae_fax = -1;
+static int hf_alcap_pssiae_pcm = -1;
+static int hf_alcap_pssiae_max_len = -1;
+static int hf_alcap_pssiae_oui = -1;
+
+static int hf_alcap_pssime_frm = -1;
+static int hf_alcap_pssime_lb = -1;
+static int hf_alcap_pssime_mult = -1;
+static int hf_alcap_pssime_max = -1;
+
+static int hf_alcap_suci = -1;
+
+static int hf_alcap_onsea = -1;
+
+static int hf_alcap_ssiae_pr_type = -1;
+static int hf_alcap_ssiae_pr_id = -1;
+static int hf_alcap_ssiae_lb = -1;
+static int hf_alcap_ssiae_rc = -1;
+static int hf_alcap_ssiae_syn = -1;
+static int hf_alcap_ssiae_frm = -1;
+static int hf_alcap_ssiae_cmd = -1;
+static int hf_alcap_ssiae_mfr2 = -1;
+static int hf_alcap_ssiae_mfr1 = -1;
+static int hf_alcap_ssiae_dtmf = -1;
+static int hf_alcap_ssiae_cas = -1;
+static int hf_alcap_ssiae_fax = -1;
+static int hf_alcap_ssiae_pcm = -1;
+static int hf_alcap_ssiae_max_len = -1;
+static int hf_alcap_ssiae_oui = -1;
+
+static int hf_alcap_ssime_frm = -1;
+static int hf_alcap_ssime_lb = -1;
+static int hf_alcap_ssime_mult = -1;
+static int hf_alcap_ssime_max = -1;
+
+static int hf_alcap_acc_level = -1;
+
+static int hf_alcap_cp = -1;
+
+static int hf_alcap_hc = -1;
+
+static int hf_alcap_pfbw_br_fw = -1;
+static int hf_alcap_pfbw_br_bw = -1;
+static int hf_alcap_pfbw_bucket_fw = -1;
+static int hf_alcap_pfbw_bucket_bw = -1;
+static int hf_alcap_pfbw_size_fw = -1;
+static int hf_alcap_pfbw_size_bw = -1;
+
+static int hf_alcap_pvbws_br_fw = -1;
+static int hf_alcap_pvbws_br_bw = -1;
+static int hf_alcap_pvbws_bucket_fw = -1;
+static int hf_alcap_pvbws_bucket_bw = -1;
+static int hf_alcap_pvbws_size_fw = -1;
+static int hf_alcap_pvbws_size_bw = -1;
+static int hf_alcap_pvbws_stt = -1;
+
+static int hf_alcap_pvbwt_peak_br_fw = -1;
+static int hf_alcap_pvbwt_peak_br_bw = -1;
+static int hf_alcap_pvbwt_peak_bucket_fw = -1;
+static int hf_alcap_pvbwt_peak_bucket_bw = -1;
+static int hf_alcap_pvbwt_sust_br_fw = -1;
+static int hf_alcap_pvbwt_sust_br_bw = -1;
+static int hf_alcap_pvbwt_sust_bucket_fw = -1;
+static int hf_alcap_pvbwt_sust_bucket_bw = -1;
+static int hf_alcap_pvbwt_size_fw = -1;
+static int hf_alcap_pvbwt_size_bw = -1;
+
+static int hf_alcap_fbw_br_fw = -1;
+static int hf_alcap_fbw_br_bw = -1;
+static int hf_alcap_fbw_bucket_fw = -1;
+static int hf_alcap_fbw_bucket_bw = -1;
+static int hf_alcap_fbw_size_fw = -1;
+static int hf_alcap_fbw_size_bw = -1;
+
+static int hf_alcap_vbws_br_fw = -1;
+static int hf_alcap_vbws_br_bw = -1;
+static int hf_alcap_vbws_bucket_fw = -1;
+static int hf_alcap_vbws_bucket_bw = -1;
+static int hf_alcap_vbws_size_fw = -1;
+static int hf_alcap_vbws_size_bw = -1;
+static int hf_alcap_vbws_stt = -1;
+
+static int hf_alcap_vbwt_peak_br_fw = -1;
+static int hf_alcap_vbwt_peak_br_bw = -1;
+static int hf_alcap_vbwt_peak_bucket_fw = -1;
+static int hf_alcap_vbwt_peak_bucket_bw = -1;
+static int hf_alcap_vbwt_sust_br_fw = -1;
+static int hf_alcap_vbwt_sust_br_bw = -1;
+static int hf_alcap_vbwt_sust_bucket_fw = -1;
+static int hf_alcap_vbwt_sust_bucket_bw = -1;
+static int hf_alcap_vbwt_size_fw = -1;
+static int hf_alcap_vbwt_size_bw = -1;
+
+
+static int hf_alcap_leg_osaid = -1;
+static int hf_alcap_leg_dsaid = -1;
+static int hf_alcap_leg_pathid = -1;
+static int hf_alcap_leg_cid = -1;
+static int hf_alcap_leg_sugr = -1;
+static int hf_alcap_leg_dnsea = -1;
+static int hf_alcap_leg_onsea = -1;
+static int hf_alcap_leg_frame = -1;
+static int hf_alcap_leg_release_cause = -1;
+
+static gboolean keep_persistent_info = TRUE;
+
+static emem_tree_t* legs_by_dsaid = NULL;
+static emem_tree_t* legs_by_osaid = NULL;
+static emem_tree_t* legs_by_bearer = NULL;
+
+static const gchar* dissect_fields_unknown(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    proto_item* pi = proto_tree_add_item(tree,hf_alcap_unknown,tvb,offset,len,ENC_NA);
+    proto_item_set_expert_flags(pi, PI_UNDECODED, PI_WARN);
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.4
- */
-static void
-dis_field_channel_id(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset)
-{
-    guint32    curr_offset;
-    guint8     oct;
-
-    curr_offset = *offset;
-
-    SHORT_DATA_CHECK(*len, 1);
-
-    oct = tvb_get_guint8(tvb, curr_offset);
-
-       if (oct && check_col(g_pinfo->cinfo, COL_INFO))
-               col_append_fstr(g_pinfo->cinfo, COL_INFO, " CID: %u", oct);
-
-    proto_tree_add_uint_format(tree, hf_alcap_channel_id, tvb,
-       curr_offset, 1, oct,
-       "Channel identifier (CID): %d%s",
-       oct,
-       oct ? "" : " (Null)");
-
-    curr_offset++;
+static const gchar* dissect_fields_cau(packet_info* pinfo, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info) {
+    /*
+     * Q.2630.1 -> 7.3.1 Cause
+     *
+     * 7.4.16 Cause Value
+     * 7.4.17 Diagnostics
+     */
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
-}
+    guint coding;
+    const gchar* ret_str;
+    proto_item* pi;
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.5
- */
-static void
-dis_field_organizational_unique_id(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset)
-{
-    guint32    curr_offset;
-    guint32    octs;
+    if (len < 2) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    curr_offset = *offset;
+    msg_info->release_cause = tvb_get_guint8(tvb, offset+1) & 0x7f;
 
-#define        FIELD_ORGANIZATIONAL_UNIQUE_ID_LEN      3
+    coding = tvb_get_guint8(tvb, offset) & 0x3;
 
-    SHORT_DATA_CHECK(*len, FIELD_ORGANIZATIONAL_UNIQUE_ID_LEN);
+    proto_tree_add_item(tree, hf_alcap_cau_coding, tvb, offset, 1, ENC_BIG_ENDIAN);
 
-    octs = tvb_get_ntoh24(tvb, curr_offset);
+    if (coding == 0) {
+        pi = proto_tree_add_item(tree, hf_alcap_cau_value_itu, tvb, offset+1, 1, ENC_BIG_ENDIAN);
 
-    proto_tree_add_uint(tree, hf_alcap_organizational_unique_id, tvb,
-       curr_offset, FIELD_ORGANIZATIONAL_UNIQUE_ID_LEN, octs);
+        if ( msg_info->release_cause && msg_info->release_cause != 31 )
+            expert_add_info_format(pinfo, pi, PI_RESPONSE_CODE, PI_WARN, "Abnormal Release");
 
-    curr_offset += FIELD_ORGANIZATIONAL_UNIQUE_ID_LEN;
+        ret_str = val_to_str(msg_info->release_cause, cause_values_itu, "Unknown(%u)");
+    } else {
+        proto_tree_add_item(tree, hf_alcap_cau_value_non_itu, tvb, offset+1 , 1, ENC_BIG_ENDIAN);
+        ret_str = ep_strdup_printf("%u", msg_info->release_cause);
+    }
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
+    if (!tree) return ret_str;
+
+    offset += 2;
+
+    if (len > 2)  {
+        int diag_len = tvb_get_guint8(tvb,offset);
+
+        pi = proto_tree_add_item(tree,hf_alcap_cau_diag, tvb, offset,len-2,ENC_NA);
+        tree = proto_item_add_subtree(pi,ett_cau_diag);
+
+        proto_tree_add_item(tree, hf_alcap_cau_diag_len, tvb, offset, 1, ENC_BIG_ENDIAN);
+
+        if (diag_len) {
+            switch (msg_info->release_cause) {
+                case 97:
+                case 99:
+                case 110:
+                    proto_tree_add_item(tree, hf_alcap_cau_diag_msg, tvb, ++offset, 1, ENC_BIG_ENDIAN);
+
+                    while(diag_len >= 2) {
+                        proto_tree_add_item(tree, hf_alcap_cau_diag_param_id, tvb, ++offset, 1, ENC_BIG_ENDIAN);
+                        proto_tree_add_item(tree, hf_alcap_cau_diag_field_num, tvb, ++offset, 1, ENC_BIG_ENDIAN);
+                        diag_len -= 2;
+                    }
+                    break;
+                default:
+                    /* XXX - TODO Q.2610 */
+                    pi = proto_tree_add_text(tree,tvb,offset,diag_len,"Undecoded");
+                    proto_item_set_expert_flags(pi, PI_UNDECODED, PI_WARN);
+                    break;
+            }
+        }
+    }
+    return ret_str;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.6
- */
-static void
-dis_field_audio_service(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset)
-{
-    guint32    curr_offset;
-    guint32    value;
-    guint8     oct;
-    proto_item *item;
-    proto_tree *subtree;
-    gchar      *str = NULL;
-
-    curr_offset = *offset;
+static const gchar* dissect_fields_ceid(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info) {
+    /*
+     * Q.2630.1 -> 7.3.2 Connection Element Identifier
+     *
+     * 7.4.3 Path Identifier
+     * 7.4.4 Channel Identifier
+     */
+    proto_item* pi;
 
-#define        FIELD_AUDIO_SERVICE_LEN 5
+    if (len != 5) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    SHORT_DATA_CHECK(*len, FIELD_AUDIO_SERVICE_LEN);
+    pi = proto_tree_add_item(tree,hf_alcap_ceid_pathid,tvb,offset,4,ENC_BIG_ENDIAN);
 
-    item =
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb,
-           curr_offset, FIELD_AUDIO_SERVICE_LEN, field_strings[FIELD_AUDIO_SERVICE]);
+    msg_info->pathid = tvb_get_ntohl(tvb,offset);
+    msg_info->cid = tvb_get_guint8(tvb,offset+4);
 
-    subtree = proto_item_add_subtree(item, ett_fields[FIELD_AUDIO_SERVICE]);
+    if (msg_info->pathid == 0) {
+        proto_item_append_text(pi," (All Paths in association)");
+        return "Path: 0 (All Paths)";
+    }
 
-    oct = tvb_get_guint8(tvb, curr_offset);
+    pi = proto_tree_add_item(tree,hf_alcap_ceid_cid,tvb,offset+4,1,ENC_BIG_ENDIAN);
 
-    switch ((oct & 0xc0) >> 6)
-    {
-    case 0x00: str = "Designates a profile specified by ITU-T Rec. I.366.2; ignore organizational unique identifier"; break;
-    case 0x01: str = "Designates a profile specified by organizational unique identifier"; break;
-    case 0x02: str = "Designates a custom profile; ignore organizational unique identifier"; break;
-    case 0x03: str = "Reserved"; break;
+    if (msg_info->cid == 0) {
+        proto_item_append_text(pi," (All CIDs in the Path)");
+        return ep_strdup_printf("Path: %u CID: 0 (Every CID)",msg_info->pathid);
+    } else {
+        return ep_strdup_printf("Path: %u CID: %u",msg_info->pathid,msg_info->cid);
     }
-
-    other_decode_bitfield_value(bigbuf, oct, 0xc0, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Profile type, %s",
-       bigbuf, str);
-
-    other_decode_bitfield_value(bigbuf, oct, 0x3f, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Reserved",
-       bigbuf);
-
-    curr_offset++;
-
-    oct = tvb_get_guint8(tvb, curr_offset);
-
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "Profile identifier (%d)",
-       oct);
-
-    curr_offset++;
-
-    oct = tvb_get_guint8(tvb, curr_offset);
-
-    other_decode_bitfield_value(bigbuf, oct, 0x80, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  FRM, transport of frame mode data %s",
-       bigbuf,
-       (oct & 0x80) ? "enabled" : "disabled");
-
-    other_decode_bitfield_value(bigbuf, oct, 0x40, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  CMD, transport of circuit mode data (64 kbit/s) %s",
-       bigbuf,
-       (oct & 0x40) ? "enabled" : "disabled");
-
-    other_decode_bitfield_value(bigbuf, oct, 0x20, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  MF-R2, transport of multi-frequency R2 dialled digits %s",
-       bigbuf,
-       (oct & 0x20) ? "enabled" : "disabled");
-
-    other_decode_bitfield_value(bigbuf, oct, 0x10, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  MF-R1, transport of multi-frequency R1 dialled digits %s",
-       bigbuf,
-       (oct & 0x10) ? "enabled" : "disabled");
-
-    other_decode_bitfield_value(bigbuf, oct, 0x08, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  DTMF, transport of dual tone multi-frequency dialled digits %s",
-       bigbuf,
-       (oct & 0x08) ? "enabled" : "disabled");
-
-    other_decode_bitfield_value(bigbuf, oct, 0x04, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  CAS, transport of channel associated signalling %s",
-       bigbuf,
-       (oct & 0x04) ? "enabled" : "disabled");
-
-    other_decode_bitfield_value(bigbuf, oct, 0x02, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  FAX, transport of demodulated facsimile data %s",
-       bigbuf,
-       (oct & 0x02) ? "enabled" : "disabled");
-
-    other_decode_bitfield_value(bigbuf, oct, 0x01, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  A/mu-law, interpretation of generic PCM coding: %s-law",
-       bigbuf,
-       (oct & 0x01) ? "mu" : "A");
-
-    curr_offset++;
-
-    value = tvb_get_ntohs(tvb, curr_offset);
-
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 2,
-       "Maximum length of frame mode data (%d)",
-       value);
-
-    curr_offset += 2;
-
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.7
- */
-static void
-dis_field_multirate_service(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset)
-{
-    guint32    curr_offset;
-    guint32    value;
-    guint8     oct;
-    proto_item *item;
-    proto_tree *subtree;
-
-    curr_offset = *offset;
-
-#define        FIELD_MULTIRATE_SERVICE_LEN     3
-
-    SHORT_DATA_CHECK(*len, FIELD_MULTIRATE_SERVICE_LEN);
+static const gchar* dissect_fields_desea(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.1 -> 7.3.3 Destination E.164 service endpoint address
+     *
+     * 7.4.13 Nature of Address
+     * 7.4.14 E.164 Address
+     */
+    e164_info_t* e164;
 
-    item =
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb,
-           curr_offset, FIELD_MULTIRATE_SERVICE_LEN, field_strings[FIELD_MULTIRATE_SERVICE]);
+    if (len < 2) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    subtree = proto_item_add_subtree(item, ett_fields[FIELD_MULTIRATE_SERVICE]);
+    e164 = ep_alloc(sizeof(e164_info_t));
 
-    oct = tvb_get_guint8(tvb, curr_offset);
+    e164->e164_number_type = CALLED_PARTY_NUMBER;
+    e164->nature_of_address = tvb_get_guint8(tvb,offset) & 0x7f;
+    e164->E164_number_str = (gchar*)tvb_get_ephemeral_string(tvb,offset+1,len);
+    e164->E164_number_length = len-1;
 
-    other_decode_bitfield_value(bigbuf, oct, 0x80, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  FRM, transport of frame mode data %s",
-       bigbuf,
-       (oct & 0x80) ? "enabled" : "disabled");
+    dissect_e164_number(tvb, tree, offset-1, len, *e164);
 
-    other_decode_bitfield_value(bigbuf, oct, 0x60, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Reserved",
-       bigbuf);
+    return NULL;
+}
 
-    other_decode_bitfield_value(bigbuf, oct, 0x1f, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Multiplier (%d) for n x 64 kbit/s",
-       bigbuf,
-       oct & 0x1f);
+static const gchar* dissect_fields_oesea(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.3 -> 7.3.23 Origination E.164 service endpoint address
+     *
+     * 7.4.13 Nature of Address
+     * 7.4.14 E.164 Address
+     */
+    e164_info_t* e164;
 
-    curr_offset++;
+    if (len < 2) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    value = tvb_get_ntohs(tvb, curr_offset);
+    e164 = ep_alloc(sizeof(e164_info_t));
 
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 2,
-       "Maximum length of frame mode data (%d)",
-       value);
+    e164->e164_number_type = CALLING_PARTY_NUMBER;
+    e164->nature_of_address = tvb_get_guint8(tvb,offset) & 0x7f;
+    e164->E164_number_str = (gchar*)tvb_get_ephemeral_string(tvb,offset+1,len);
+    e164->E164_number_length = len-1;
 
-    curr_offset += 2;
+    dissect_e164_number(tvb, tree, offset-1, len, *e164);
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.8
- */
-static void
-dis_field_seg_reassembly_ass(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset)
-{
-    guint32    curr_offset;
-    guint32    value;
-    proto_item *item;
-    proto_tree *subtree;
-
-    curr_offset = *offset;
-
-#define        FIELD_SEG_REASSEMBLY_ASS_LEN    14
-
-    SHORT_DATA_CHECK(*len, FIELD_SEG_REASSEMBLY_ASS_LEN);
+static const gchar* dissect_fields_dnsea(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.1 -> 7.3.4 Destination NSAP service endpoint address
+     *
+     * 7.4.15 NSAP Address
+     */
 
-    item =
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb,
-           curr_offset, FIELD_SEG_REASSEMBLY_ASS_LEN, field_strings[FIELD_SEG_REASSEMBLY_ASS]);
+    if (len < 1) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    subtree = proto_item_add_subtree(item, ett_fields[FIELD_SEG_REASSEMBLY_ASS]);
+    msg_info->dest_nsap = tvb_bytes_to_str(tvb,offset,20);
 
-    value = tvb_get_ntoh24(tvb, curr_offset);
+    proto_tree_add_item(tree, hf_alcap_dnsea, tvb, offset, 20, ENC_NA);
+    dissect_nsap(tvb, offset,20, tree);
 
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 3,
-       "Maximum length of SSSAR-SDU in the forward direction (%d)",
-       value);
+    return NULL;
+}
 
-    curr_offset += 3;
+static const gchar* dissect_fields_onsea(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.3 -> 7.3.24 Origination NSAP service endpoint address
+     *
+     * 7.4.15 NSAP Address
+     */
 
-    value = tvb_get_ntoh24(tvb, curr_offset);
+    if (len < 1) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 3,
-       "Maximum length of SSSAR-SDU in the backward direction (%d)",
-       value);
+    msg_info->orig_nsap = tvb_bytes_to_str(tvb,offset,20);
 
-    curr_offset += 3;
+    proto_tree_add_item(tree, hf_alcap_onsea, tvb, offset, 20, ENC_NA);
+    dissect_nsap(tvb, offset,20, tree);
 
-    value = tvb_get_ntohs(tvb, curr_offset);
+    return NULL;
+}
 
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 2,
-       "Maximum length of SSCOP-SDU in the forward direction (%d)",
-       value);
+static const gchar* dissect_fields_alc(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.1 -> 7.3.5 Link characteristics
+     *
+     * 7.4.11 CPS-SDU Bit Rate -> Maximum CPS-SDU Bit Rate
+     * 7.4.11 CPS-SDU Bit Rate -> Average CPS-SDU Bit Rate
+     * 7.4.12 CPS-SDU Size -> Maximum CPS-SDU Size
+     * 7.4.12 CPS-SDU Size -> Average CPS-SDU Size
+     */
 
-    curr_offset += 2;
+    if (len != 12) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    value = tvb_get_ntohs(tvb, curr_offset);
+    proto_tree_add_item(tree, hf_alcap_alc_max_br_fw, tvb, offset+0, 2, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_alc_max_br_bw, tvb, offset+2, 2, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_alc_avg_br_fw, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_alc_avg_br_bw, tvb, offset+6, 2, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_alc_max_sdu_fw, tvb, offset+8, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_alc_max_sdu_bw, tvb, offset+9, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_alc_avg_sdu_fw, tvb, offset+10, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_alc_avg_sdu_bw, tvb, offset+11, 1, ENC_BIG_ENDIAN);
 
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 2,
-       "Maximum length of SSCOP-SDU in the backward direction (%d)",
-       value);
+    return NULL;
+}
 
-    curr_offset += 2;
+static const gchar* dissect_fields_plc(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.2 -> 7.3.19 Preferred Link characteristics
+     *
+     * 7.4.11 CPS-SDU Bit Rate -> Maximum CPS-SDU Bit Rate
+     * 7.4.11 CPS-SDU Bit Rate -> Average CPS-SDU Bit Rate
+     * 7.4.12 CPS-SDU Size -> Maximum CPS-SDU Size
+     * 7.4.12 CPS-SDU Size -> Average CPS-SDU Size
+     */
 
-    value = tvb_get_ntohs(tvb, curr_offset);
+    if (len != 12) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 2,
-       "Maximum length of SSCOP-UU in the forward direction (%d)",
-       value);
+    proto_tree_add_item(tree, hf_alcap_plc_max_br_fw, tvb, offset+0, 2, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_plc_max_br_bw, tvb, offset+2, 2, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_plc_avg_br_fw, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_plc_avg_br_bw, tvb, offset+6, 2, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_plc_max_sdu_fw, tvb, offset+8, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_plc_max_sdu_bw, tvb, offset+9, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_plc_avg_sdu_fw, tvb, offset+10, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_plc_avg_sdu_bw, tvb, offset+11, 1, ENC_BIG_ENDIAN);
 
-    curr_offset += 2;
+    return NULL;
+}
 
-    value = tvb_get_ntohs(tvb, curr_offset);
+static const gchar* dissect_fields_osaid(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.1 -> 7.3.6 Originating signalling association identifier
+     *
+     * 7.4.2 Signalling Association Identifier -> Originating Signalling Association
+     */
+    if (len != 4) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 2,
-       "Maximum length of SSCOP-UU in the backward direction (%d)",
-       value);
+    msg_info->osaid = tvb_get_ntohl(tvb,offset);
 
-    curr_offset += 2;
+    proto_tree_add_item(tree, hf_alcap_osaid, tvb, offset, 4, ENC_BIG_ENDIAN);
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.9
- */
-static void
-dis_field_seg_reassembly_unass(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset)
-{
-    guint32    curr_offset;
-    guint32    value;
-    guint8     oct;
-    proto_item *item;
-    proto_tree *subtree;
-
-    curr_offset = *offset;
-
-#define        FIELD_SEG_REASSEMBLY_UNASS_LEN  7
-
-    SHORT_DATA_CHECK(*len, FIELD_SEG_REASSEMBLY_UNASS_LEN);
+static const gchar* dissect_fields_sugr(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.1 -> 7.3.7 Served user generated reference
+     *
+     * 7.4.10 Served User Generated Reference
+     */
+    if (len != 4) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    item =
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb,
-           curr_offset, FIELD_SEG_REASSEMBLY_UNASS_LEN, field_strings[FIELD_SEG_REASSEMBLY_UNASS]);
+    msg_info->sugr = tvb_get_ntohl(tvb,offset);
 
-    subtree = proto_item_add_subtree(item, ett_fields[FIELD_SEG_REASSEMBLY_UNASS]);
+    proto_tree_add_item(tree, hf_alcap_sugr, tvb, offset, 4, ENC_NA);
 
-    value = tvb_get_ntoh24(tvb, curr_offset);
+    return NULL;
+}
 
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 3,
-       "Maximum length of SSSAR-SDU in the forward direction (%d)",
-       value);
+static const gchar* dissect_fields_suci(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.2 -> 7.3.22 Served user correlation ID
+     *
+     * 7.4.22 Served user correlation ID
+     */
+    if (len != 4) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    curr_offset += 3;
+    proto_tree_add_item(tree, hf_alcap_suci, tvb, offset, len, ENC_BIG_ENDIAN);
 
-    value = tvb_get_ntoh24(tvb, curr_offset);
+    return NULL;
+}
 
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 3,
-       "Maximum length of SSSAR-SDU in the backward direction (%d)",
-       value);
+static const gchar* dissect_fields_ssia(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.2 -> 7.3.9 Service specific information (Audio)
+     *
+     * 7.4.5 Organizational Unique Identifier
+     */
+    if (len != 8) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    curr_offset += 3;
+    proto_tree_add_item(tree, hf_alcap_ssia_pr_type, tvb, offset+0,1,ENC_BIG_ENDIAN);
 
-    oct = tvb_get_guint8(tvb, curr_offset);
+    proto_tree_add_item(tree, hf_alcap_ssia_pr_id, tvb, offset+2,1,ENC_BIG_ENDIAN);
 
-    other_decode_bitfield_value(bigbuf, oct, 0x80, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  TED, transmission error detection %s",
-       bigbuf,
-       oct & 0x80 ? "enabled" : "disabled");
+    proto_tree_add_item(tree, hf_alcap_ssia_frm, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssia_cmd, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssia_mfr2, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssia_mfr1, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssia_dtmf, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssia_cas, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssia_fax, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssia_pcm, tvb, offset+3,1,ENC_BIG_ENDIAN);
 
-    other_decode_bitfield_value(bigbuf, oct, 0x7f, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Reserved",
-       bigbuf);
+    proto_tree_add_item(tree, hf_alcap_ssia_max_len, tvb, offset+4,2,ENC_BIG_ENDIAN);
 
-    curr_offset++;
+    proto_tree_add_item(tree, hf_alcap_ssia_oui, tvb, offset+5,3,ENC_NA);
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.10
- */
-static void
-dis_field_served_user_gen_ref(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset)
-{
-    guint32    curr_offset;
-    guint32    value;
-
-    curr_offset = *offset;
-
-#define        FIELD_SERVED_USER_GEN_REF_LEN   4
+static const gchar* dissect_fields_ssim(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.1 -> 7.3.10 Service specific information (Multirate)
+     *
+     * 7.4.7 Multirate Service
+     */
+    if (len != 3) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    SHORT_DATA_CHECK(*len, FIELD_SERVED_USER_GEN_REF_LEN);
+    proto_tree_add_item(tree,hf_alcap_ssim_frm,tvb,offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_ssim_mult,tvb,offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_ssim_max,tvb,offset+1,2,ENC_BIG_ENDIAN);
 
-    value = tvb_get_ntohl(tvb, curr_offset);
+    return NULL;
+}
 
-       if (value && check_col(g_pinfo->cinfo, COL_INFO))
-               col_append_fstr(g_pinfo->cinfo, COL_INFO, " SUGR: %u", value);
+static const gchar* dissect_fields_ssisa(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.1 -> 7.3.11 Service specific information (SAR-assured)
+     *
+     * 7.4.8 Segmentation and Reassembly (Assured Data Transfer)
+     */
+    if (len != 14) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    proto_tree_add_uint(tree, hf_alcap_served_user_gen_ref, tvb,
-       curr_offset, FIELD_SERVED_USER_GEN_REF_LEN, value);
+    proto_tree_add_item(tree,hf_alcap_ssisa_max_sssar_fw,tvb,offset,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_ssisa_max_sssar_bw,tvb,offset+3,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_ssisa_max_sscop_sdu_fw,tvb,offset+6,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_ssisa_max_sscop_sdu_bw,tvb,offset+8,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_ssisa_max_sscop_uu_fw,tvb,offset+10,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_ssisa_max_sscop_uu_bw,tvb,offset+12,2,ENC_BIG_ENDIAN);
 
-    curr_offset += FIELD_SERVED_USER_GEN_REF_LEN;
+    proto_tree_add_text(tree,tvb,offset,14,"Not yet decoded: Q.2630.1 7.4.8");
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.11
- */
-static void
-dis_field_cps_sdu_bit_rate(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset, gboolean maximum)
-{
-    guint32    curr_offset;
-    guint32    value;
-    proto_item *item;
-    proto_tree *subtree;
-
-    curr_offset = *offset;
+static const gchar* dissect_fields_ssisu(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.1 -> 7.3.12 Service specific information (SAR-unassured)
+     *
+     * 7.4.9 Segmentation and Reassembly (Unassured Data Transfer)
+     */
+    if (len != 7) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-#define        FIELD_CPS_SDU_BIT_RATE_LEN      4
+    proto_tree_add_item(tree,hf_alcap_ssisu_max_sssar_fw,tvb,offset,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_ssisu_max_sssar_bw,tvb,offset+3,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_ssisu_ted,tvb,offset+6,1,ENC_BIG_ENDIAN);
+    proto_tree_add_text(tree,tvb,offset,7,"Not yet decoded: Q.2630.1 7.4.9");
 
-    SHORT_DATA_CHECK(*len, FIELD_CPS_SDU_BIT_RATE_LEN);
+    return NULL;
+}
 
-    item =
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb,
-           curr_offset, FIELD_CPS_SDU_BIT_RATE_LEN, field_strings[FIELD_MAX_CPS_SDU_BIT_RATE + (maximum ? 0 : 1)]);
+static const gchar* dissect_fields_none(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * used for parameters that have no fields, just checks if len==0
+     *
+     * Q.2630.1 -> 7.3.13 Test connection indicator
+     * Q.2630.2 -> 7.3.20 Modify support for link characteristics
+     * Q.2630.2 -> 7.3.21 Modify support for service specific information
+     * Q.2630.3 -> 7.3.35 Transfer capability support
+     *
+     */
+    if (len != 0) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    subtree = proto_item_add_subtree(item, ett_fields[FIELD_MAX_CPS_SDU_BIT_RATE + (maximum ? 0 : 1)]);
+    return NULL;
+}
 
-    value = tvb_get_ntohs(tvb, curr_offset);
+static const gchar* dissect_fields_ssiae(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.2 -> 7.3.15 Service specific information (Audio Extended)
+     *
+     * 7.4.19 Audio extended service
+     * 7.4.5 Organizational unique identifier
+     */
+    if (len != 8) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 2,
-       "CPS-SDU bit rate in the forward direction (%d)",
-       value);
+    proto_tree_add_item(tree, hf_alcap_ssiae_pr_type, tvb, offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssiae_lb, tvb, offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssiae_rc, tvb, offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssiae_syn, tvb, offset,1,ENC_BIG_ENDIAN);
 
-    curr_offset += 2;
+    proto_tree_add_item(tree, hf_alcap_ssiae_pr_id, tvb, offset+1,1,ENC_BIG_ENDIAN);
 
-    value = tvb_get_ntohs(tvb, curr_offset);
+    proto_tree_add_item(tree, hf_alcap_ssiae_frm, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssiae_cmd, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssiae_mfr2, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssiae_mfr1, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssiae_dtmf, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssiae_cas, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssiae_fax, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_ssiae_pcm, tvb, offset+3,1,ENC_BIG_ENDIAN);
 
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 2,
-       "CPS-SDU bit rate in the backward direction (%d)",
-       value);
+    proto_tree_add_item(tree, hf_alcap_ssiae_max_len, tvb, offset+4,2,ENC_BIG_ENDIAN);
 
-    curr_offset += 2;
+    proto_tree_add_item(tree, hf_alcap_ssiae_oui, tvb, offset+5,3,ENC_NA);
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.12
- */
-static void
-dis_field_cps_sdu_size(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset, gboolean maximum)
-{
-    guint32    curr_offset;
-    guint8     oct;
-    proto_item *item;
-    proto_tree *subtree;
-
-    curr_offset = *offset;
-
-#define        FIELD_CPS_SDU_SIZE_LEN  2
-
-    SHORT_DATA_CHECK(*len, FIELD_CPS_SDU_SIZE_LEN);
-
-    item =
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb,
-           curr_offset, FIELD_CPS_SDU_SIZE_LEN, field_strings[FIELD_MAX_CPS_SDU_SIZE + (maximum ? 0 : 1)]);
-
-    subtree = proto_item_add_subtree(item, ett_fields[FIELD_MAX_CPS_SDU_SIZE + (maximum ? 0 : 1)]);
-
-    oct = tvb_get_guint8(tvb, curr_offset);
+static const gchar* dissect_fields_pssiae(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.2 -> 7.3.17 Preferred service specific information (Audio Extended)
+     *
+     * 7.4.19 Audio extended service
+     * 7.4.5 Organizational unique identifier
+     */
+    if (len != 8) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 1,
-       "CPS-SDU size in the forward direction (%d)",
-       oct);
+    proto_tree_add_item(tree, hf_alcap_pssiae_pr_type, tvb, offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_pssiae_lb, tvb, offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_pssiae_rc, tvb, offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_pssiae_syn, tvb, offset,1,ENC_BIG_ENDIAN);
 
-    curr_offset++;
+    proto_tree_add_item(tree, hf_alcap_pssiae_pr_id, tvb, offset+1,1,ENC_BIG_ENDIAN);
 
-    oct = tvb_get_guint8(tvb, curr_offset);
+    proto_tree_add_item(tree, hf_alcap_pssiae_frm, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_pssiae_cmd, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_pssiae_mfr2, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_pssiae_mfr1, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_pssiae_dtmf, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_pssiae_cas, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_pssiae_fax, tvb, offset+3,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_pssiae_pcm, tvb, offset+3,1,ENC_BIG_ENDIAN);
 
-    proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-       curr_offset, 1,
-       "CPS-SDU size in the backward direction (%d)",
-       oct);
+    proto_tree_add_item(tree, hf_alcap_pssiae_max_len, tvb, offset+4,2,ENC_BIG_ENDIAN);
 
-    curr_offset++;
+    proto_tree_add_item(tree, hf_alcap_pssiae_oui, tvb, offset+5,3,ENC_NA);
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.13
- */
-static void
-dis_field_nature_of_address(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset)
-{
-    guint32    curr_offset;
-    guint32    value;
-    guint8     oct;
-    proto_item *item;
-    proto_tree *subtree;
-    gchar      *str = NULL;
-
-    curr_offset = *offset;
-
-#define        FIELD_NATURE_OF_ADDRESS_LEN     1
-
-    SHORT_DATA_CHECK(*len, FIELD_NATURE_OF_ADDRESS_LEN);
-
-    item =
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb,
-           curr_offset, FIELD_NATURE_OF_ADDRESS_LEN, field_strings[FIELD_NATURE_OF_ADDRESS]);
-
-    subtree = proto_item_add_subtree(item, ett_fields[FIELD_NATURE_OF_ADDRESS]);
-
-    oct = tvb_get_guint8(tvb, curr_offset);
-
-    other_decode_bitfield_value(bigbuf, oct, 0x80, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Reserved",
-       bigbuf);
-
-    value = oct & 0x7f;
-
-    switch (value)
-    {
-    case 0x00: str = "spare"; break;
-    case 0x01: str = "subscriber number (national use)"; break;
-    case 0x02: str = "unknown (national use)"; break;
-    case 0x03: str = "national (significant) number"; break;
-    case 0x04: str = "international number"; break;
-    case 0x05: str = "network-specific number (national use)"; break;
-    default:
-       if ((value >= 0x06) && (value <= 0x6f)) { str = "spare"; break; }
-       else if ((value >= 0x70) && (value <= 0xfe)) { str = "reserved for national use"; break; }
-       else { str = "not given in spec. ???"; break; }
+static const gchar* dissect_fields_ssime(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.2 -> 7.3.16 Service specific information (Multirate Extended)
+     *
+     * 7.4.20 Multirate extended service
+     */
+    if (len != 3) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
     }
 
-    other_decode_bitfield_value(bigbuf, oct, 0x7f, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Nature of address code, %s (%d)",
-       bigbuf,
-       str,
-       value);
+    proto_tree_add_item(tree,hf_alcap_ssime_frm,tvb,offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_ssime_lb,tvb,offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_ssime_mult,tvb,offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_ssime_max,tvb,offset+1,2,ENC_BIG_ENDIAN);
 
-    curr_offset++;
-
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.14
- */
-static void
-dis_field_e164_address(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset)
-{
-    guint32    curr_offset;
-    proto_item *item;
-    proto_tree *subtree;
-    guint8     parm_len;
-    guint8     oct;
-    guint8     i;
-
-    curr_offset = *offset;
-
-    SHORT_DATA_CHECK(*len, 1);
-
-    item =
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb,
-           curr_offset, -1, field_strings[FIELD_E164_ADDRESS]);
-
-    subtree = proto_item_add_subtree(item, ett_fields[FIELD_E164_ADDRESS]);
-
-    parm_len = tvb_get_guint8(tvb, curr_offset);
-
-    proto_item_set_len(item, parm_len + 1);
-
-    proto_tree_add_uint(subtree, hf_alcap_length, tvb, curr_offset, 1, parm_len);
-
-    curr_offset++;
-
-    if (parm_len > 0)
-    {
-       i=0;
-       while (i < parm_len)
-       {
-           oct = tvb_get_guint8(tvb, curr_offset);
-
-           other_decode_bitfield_value(bigbuf, oct, 0xf0, 8);
-           proto_tree_add_text(subtree, tvb,
-               curr_offset, 1,
-               "%s :  Reserved",
-               bigbuf);
-
-           bigbuf2[i] = (oct & 0x0f) + 0x30;
-
-           other_decode_bitfield_value(bigbuf, oct, 0x0f, 8);
-           proto_tree_add_text(subtree, tvb,
-               curr_offset, 1,
-               "%s :  Digit %d of address (%d)",
-               bigbuf,
-               i+1,
-               oct & 0x0f);
-
-           curr_offset++;
-           i++;
-       }
+static const gchar* dissect_fields_pssime(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.2 -> 7.3.18 Preferred service specific information (Multirate Extended)
+     *
+     * 7.4.20 Multirate extended service
+     */
+    if (len != 3) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-       bigbuf2[i] = '\0';
+    proto_tree_add_item(tree,hf_alcap_pssime_frm,tvb,offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pssime_lb,tvb,offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pssime_mult,tvb,offset,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pssime_max,tvb,offset+1,2,ENC_BIG_ENDIAN);
 
-       if (check_col(g_pinfo->cinfo, COL_INFO))
-               col_append_fstr(g_pinfo->cinfo, COL_INFO, " E164: %s", bigbuf2);
+    return NULL;
+}
 
-       proto_item_append_text(item, " (%s)", bigbuf2);
+static const gchar* dissect_fields_acc(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.3 -> 7.3.25 Automatic congestion control
+     *
+     * 7.4.23 AAL type 2 Node Automatic Congestion Level
+     */
+    if (len != 1) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
     }
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
+    proto_tree_add_item(tree,hf_alcap_acc_level,tvb,offset,len,ENC_BIG_ENDIAN);
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.15
- */
-static void
-dis_field_nsap_address(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset)
-{
-    guint32    curr_offset;
-       
-    curr_offset = *offset;
-
-#define        FIELD_NSAP_ADDRESS_LEN  20
-
-    SHORT_DATA_CHECK(*len, FIELD_NSAP_ADDRESS_LEN);
-
-    proto_tree_add_item(tree, hf_alcap_nsap_address, tvb,
-                                               curr_offset, FIELD_NSAP_ADDRESS_LEN,FALSE);
 
-    curr_offset += FIELD_NSAP_ADDRESS_LEN;
+static const gchar* dissect_fields_cp(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.3 -> 7.3.26 Connection Priority
+     *
+     * 7.4.24 Priority
+     */
+    if (len != 1) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
+    proto_tree_add_item(tree,hf_alcap_cp,tvb,offset,len,ENC_BIG_ENDIAN);
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.16
- */
-static void
-dis_field_cause_value(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset, gboolean *compat)
-{
-    guint32    curr_offset;
-    guint8     oct;
-    proto_item *item;
-    proto_tree *subtree;
-    gchar      *str = NULL;
-
-    *compat = FALSE;
-    curr_offset = *offset;
-
-#define        FIELD_CAUSE_VALUE_LEN   2
-
-    SHORT_DATA_CHECK(*len, FIELD_CAUSE_VALUE_LEN);
-
-    item =
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb,
-           curr_offset, FIELD_CAUSE_VALUE_LEN, field_strings[FIELD_CAUSE_VALUE]);
-
-    subtree = proto_item_add_subtree(item, ett_fields[FIELD_CAUSE_VALUE]);
-
-    oct = tvb_get_guint8(tvb, curr_offset);
-
-    other_decode_bitfield_value(bigbuf, oct, 0xfc, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Reserved",
-       bigbuf);
-
-    switch (oct & 0x3)
-    {
-    case 0x00: str = "ITU-T standardized coding as described in ITU-T Rec. Q.850 and Q.2610"; break;
-    case 0x01: str = "ISO/IEC standard"; break;
-    case 0x02: str = "national standard"; break;
-    case 0x03: str = "standard defined for the network (either public or private) present on the network side of the interface"; break;
-    }
-
-    other_decode_bitfield_value(bigbuf, oct, 0x03, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Coding standard, %s",
-       bigbuf,
-       str);
-
-    curr_offset++;
-
-    oct = tvb_get_guint8(tvb, curr_offset);
-
-    other_decode_bitfield_value(bigbuf, oct, 0x80, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Reserved",
-       bigbuf);
-
-    switch (oct & 0x7f)
-    {
-    case 1: str = "Unallocated (unassigned) number"; break;
-    case 3: str = "No route to destination"; break;
-    case 31: str = "Normal, unspecified"; break;
-    case 34: str = "No circuit/channel available"; break;
-    case 38: str = "Network out of order"; break;
-    case 41: str = "Temporary failure"; break;
-    case 42: str = "Switching equipment congestion"; break;
-    case 44: str = "Requested circuit/channel not available"; break;
-    case 47: str = "Resource unavailable, unspecified"; break;
-    case 93: str = "AAL parameters cannot be supported"; break;
-    case 95: str = "Invalid message, unspecified"; break;
-    case 96: str = "Mandatory information element is missing"; break;
-    case 97: str = "Message type non-existent or not implemented"; *compat = TRUE; break;
-    case 99: str = "Information element/parameter non-existent or not implemented"; *compat = TRUE; break;
-    case 100: str = "Invalid information element contents"; break;
-    case 102: str = "Recovery on timer expiry"; break;
-    case 110: str = "Message with unrecognized parameter, discarded"; *compat = TRUE; break;
-    default: str = "Unknown"; break;
+static const gchar* dissect_fields_pt(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.2 -> 7.3.14 Path Type
+     *
+     * 7.4.21 AAL Type 2 Path QoS Codepoint
+     */
+    if (len != 1) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
     }
 
-    other_decode_bitfield_value(bigbuf, oct, 0x7f, 8);
-    proto_tree_add_text(subtree, tvb,
-       curr_offset, 1,
-       "%s :  Cause (%d), %s",
-       bigbuf,
-       oct & 0x7f,
-       str);
-
-    curr_offset++;
-
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
+    proto_tree_add_item(tree,hf_alcap_pt,tvb,offset,len,ENC_BIG_ENDIAN);
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.17
- */
-static void
-dis_field_diagnostics(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset, gboolean compat)
-{
-    guint32    curr_offset;
-    guint8     oct;
-    proto_item *item;
-    proto_tree *subtree;
-    guint8     parm_len;
-    const gchar        *str = NULL;
-    gint       idx;
-    guint8     i;
-
-    curr_offset = *offset;
-
-    SHORT_DATA_CHECK(*len, 1);
-
-    item =
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb,
-           curr_offset, -1, field_strings[FIELD_DIAGNOSTICS]);
-
-    subtree = proto_item_add_subtree(item, ett_fields[FIELD_DIAGNOSTICS]);
-
-    parm_len = tvb_get_guint8(tvb, curr_offset);
-
-    proto_item_set_len(item, parm_len + 1);
-
-    proto_tree_add_uint(subtree, hf_alcap_length, tvb, curr_offset, 1, parm_len);
-
-    curr_offset++;
-
-    if (parm_len > 0)
-    {
-       if (compat)
-       {
-           /*
-            * compatibility diagnostics
-            */
-           oct = tvb_get_guint8(tvb, curr_offset);
-
-           str = match_strval_idx(oct, msg_type_strings, &idx);
-
-           proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-               curr_offset, 1, (str == NULL) ? "Unknown message identifier" : str);
-
-           curr_offset++;
-
-           i=1;
-           while ((i+2) <= parm_len)
-           {
-               oct = tvb_get_guint8(tvb, curr_offset);
-
-               str = match_strval_idx(oct, msg_parm_strings, &idx);
-
-               proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-                   curr_offset, 1, (str == NULL) ? "Unknown parameter" : str);
-
-               curr_offset++;
-
-               oct = tvb_get_guint8(tvb, curr_offset);
-
-               if (oct == 0)
-               {
-                   proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-                       curr_offset, 1, "Whole parameter");
-               }
-               else
-               {
-                   proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-                       curr_offset, 1, "Field number %d", oct);
-               }
 
-               curr_offset++;
-               i += 2;
-           }
-
-           if (i != parm_len)
-           {
-               proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-                   curr_offset, parm_len - i, "Extraneous Data ???");
-
-               curr_offset += (parm_len - i);
-           }
-       }
-       else
-       {
-           proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-               curr_offset, parm_len, "Coded as per ITU-T Rec. Q.2610");
-
-           curr_offset += parm_len;
-       }
+static const gchar* dissect_fields_hc(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.3 -> 7.3.27 Hop counter
+     *
+     * 7.4.25 AAL type 2 Hop Counter
+     */
+    if (len != 1) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
     }
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
+    proto_tree_add_item(tree,hf_alcap_hc,tvb,offset,len,ENC_BIG_ENDIAN);
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.4.18
- */
-static void
-dis_field_served_user_transport(tvbuff_t *tvb, proto_tree *tree, guint *len, guint32 *offset)
-{
-    guint32    curr_offset;
-    proto_item *item;
-    proto_tree *subtree;
-    guint8     parm_len;
-
-    curr_offset = *offset;
-
-    SHORT_DATA_CHECK(*len, 1);
-
-    item =
-       proto_tree_add_none_format(tree, hf_alcap_none, tvb,
-           curr_offset, -1, field_strings[FIELD_SERVED_USER_TRANSPORT]);
-
-    subtree = proto_item_add_subtree(item, ett_fields[FIELD_SERVED_USER_TRANSPORT]);
 
-    parm_len = tvb_get_guint8(tvb, curr_offset);
-
-    proto_item_set_len(item, parm_len + 1);
-
-    proto_tree_add_uint(subtree, hf_alcap_length, tvb, curr_offset, 1, parm_len);
+static const gchar* dissect_fields_fbw(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.3 -> 7.3.32 Fixed bandwidth transfer capability
+     *
+     * 7.4.26 CPS Bit rate -> Peak CPS bit rate
+     * 7.4.27 CPS Token Bucket Size -> CPS token bucket size associated with Peak CPS bit rate
+     * 7.4.28 Maximum allowed CPS packet size
+     */
+    if (len != 12) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    curr_offset++;
+    proto_tree_add_item(tree,hf_alcap_fbw_br_fw,tvb,offset,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_fbw_br_bw,tvb,offset+3,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_fbw_bucket_fw,tvb,offset+6,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_fbw_bucket_bw,tvb,offset+8,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_fbw_size_fw,tvb,offset+10,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_fbw_size_bw,tvb,offset+11,1,ENC_BIG_ENDIAN);
 
-    if (parm_len > 0)
-    {
-       proto_tree_add_none_format(subtree, hf_alcap_none, tvb,
-           curr_offset, parm_len, "Value");
+    return NULL;
+}
 
-       curr_offset += parm_len;
+static const gchar* dissect_fields_pfbw(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.3 -> 7.3.29 Preferred fixed bandwidth transfer capability
+     *
+     * 7.4.26 CPS Bit rate -> Peak CPS bit rate
+     * 7.4.27 CPS Token Bucket Size -> CPS token bucket size associated with Peak CPS bit rate
+     * 7.4.28 Maximum allowed CPS packet size
+     */
+    if (len != 12) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
     }
 
-    *len -= (curr_offset - *offset);
-    *offset = curr_offset;
-}
+    proto_tree_add_item(tree,hf_alcap_pfbw_br_fw,tvb,offset,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pfbw_br_bw,tvb,offset+3,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pfbw_bucket_fw,tvb,offset+6,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pfbw_bucket_bw,tvb,offset+8,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pfbw_size_fw,tvb,offset+10,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pfbw_size_bw,tvb,offset+11,1,ENC_BIG_ENDIAN);
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.3.1
- */
-static void
-dis_parm_cause(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 curr_offset)
-{
-    gboolean   compat;
+    return NULL;
+}
 
-    dis_field_cause_value(tvb, tree, &len, &curr_offset, &compat);
+static const gchar* dissect_fields_vbws(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.3 -> 7.3.33 Variable bandwidth stringent transfer capability
+     *
+     * 7.4.26 CPS Bit rate -> Peak CPS bit rate
+     * 7.4.27 CPS Token Bucket Size -> CPS token bucket size associated with Peak CPS bit rate
+     * 7.4.28 Maximum allowed CPS packet size
+     * 7.4.29 Source Traffic Type
+     */
+    if (len != 13) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    dis_field_diagnostics(tvb, tree, &len, &curr_offset, compat);
+    proto_tree_add_item(tree,hf_alcap_vbws_br_fw,tvb,offset,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_vbws_br_bw,tvb,offset+3,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_vbws_bucket_fw,tvb,offset+6,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_vbws_bucket_bw,tvb,offset+8,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_vbws_size_fw,tvb,offset+10,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_vbws_size_bw,tvb,offset+11,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_vbws_size_bw,tvb,offset+11,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_vbws_stt,tvb,offset+12,1,ENC_BIG_ENDIAN);
 
-    EXTRANEOUS_DATA_CHECK(len, 0);
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.3.2
- */
-static void
-dis_parm_conn_element_id(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 curr_offset)
-{
-
-    dis_field_aal2_path_id(tvb, tree, &len, &curr_offset);
+static const gchar* dissect_fields_pvbws(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.3 -> 7.3.30 Preferred variable bandwidth stringent transfer capability
+     *
+     * 7.4.26 CPS Bit rate -> Peak CPS bit rate
+     * 7.4.27 CPS Token Bucket Size -> CPS token bucket size associated with Peak CPS bit rate
+     * 7.4.28 Maximum allowed CPS packet size
+     * 7.4.29 Source Traffic Type
+     */
+    if (len != 13) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    dis_field_channel_id(tvb, tree, &len, &curr_offset);
+    proto_tree_add_item(tree,hf_alcap_pvbws_br_fw,tvb,offset,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pvbws_br_bw,tvb,offset+3,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pvbws_bucket_fw,tvb,offset+6,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pvbws_bucket_bw,tvb,offset+8,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pvbws_size_fw,tvb,offset+10,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pvbws_size_bw,tvb,offset+11,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pvbws_size_bw,tvb,offset+11,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pvbws_stt,tvb,offset+12,1,ENC_BIG_ENDIAN);
 
-    EXTRANEOUS_DATA_CHECK(len, 0);
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.3.3
- */
-static void
-dis_parm_dest_e164_sea(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 curr_offset)
-{
 
-    dis_field_nature_of_address(tvb, tree, &len, &curr_offset);
+static const gchar* dissect_fields_pvbwt(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.3 -> 7.3.31 Preferred variable bandwidth tolerant transfer capability
+     *
+     * 7.4.26 CPS Bit rate -> Peak CPS bit rate
+     * 7.4.27 CPS Token Bucket Size -> CPS token bucket size associated with Peak CPS bit rate
+     * 7.4.26 CPS Bit rate -> Sustainable CPS bit rate
+     * 7.4.27 CPS Token Bucket Size -> CPS token bucket size associated with Sustainable CPS bit rate
+     * 7.4.28 Maximum allowed CPS packet size
+     */
 
-    dis_field_e164_address(tvb, tree, &len, &curr_offset);
+    if (len != 22) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    EXTRANEOUS_DATA_CHECK(len, 0);
-}
+    proto_tree_add_item(tree,hf_alcap_pvbwt_peak_br_fw,tvb,offset,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pvbwt_peak_br_bw,tvb,offset+3,3,ENC_BIG_ENDIAN);
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.3.4
- */
-static void
-dis_parm_dest_nsap_sea(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 curr_offset)
-{
+    proto_tree_add_item(tree,hf_alcap_pvbwt_peak_bucket_fw,tvb,offset+6,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pvbwt_peak_bucket_bw,tvb,offset+8,2,ENC_BIG_ENDIAN);
 
-    dis_field_nsap_address(tvb, tree, &len, &curr_offset);
+    proto_tree_add_item(tree,hf_alcap_pvbwt_sust_br_fw,tvb,offset+10,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pvbwt_sust_br_bw,tvb,offset+13,3,ENC_BIG_ENDIAN);
 
-    EXTRANEOUS_DATA_CHECK(len, 0);
-}
+    proto_tree_add_item(tree,hf_alcap_pvbwt_sust_bucket_fw,tvb,offset+16,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pvbwt_sust_bucket_bw,tvb,offset+18,2,ENC_BIG_ENDIAN);
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.3.5
- */
-static void
-dis_parm_link_characteristics(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 curr_offset)
-{
+    proto_tree_add_item(tree,hf_alcap_pvbwt_size_fw,tvb,offset+20,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_pvbwt_size_bw,tvb,offset+21,1,ENC_BIG_ENDIAN);
 
-    dis_field_cps_sdu_bit_rate(tvb, tree, &len, &curr_offset, TRUE);
+    return NULL;
+}
 
-    dis_field_cps_sdu_bit_rate(tvb, tree, &len, &curr_offset, FALSE);
+static const gchar* dissect_fields_vbwt(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.3 -> 7.3.34 Variable bandwidth tolerant transfer capability
+     *
+     * 7.4.26 CPS Bit rate -> Peak CPS bit rate
+     * 7.4.27 CPS Token Bucket Size -> CPS token bucket size associated with Peak CPS bit rate
+     * 7.4.26 CPS Bit rate -> Sustainable CPS bit rate
+     * 7.4.27 CPS Token Bucket Size -> CPS token bucket size associated with Sustainable CPS bit rate
+     * 7.4.28 Maximum allowed CPS packet size
+     */
+    if (len != 22) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    dis_field_cps_sdu_size(tvb, tree, &len, &curr_offset, TRUE);
+    proto_tree_add_item(tree,hf_alcap_vbwt_peak_br_fw,tvb,offset,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_vbwt_peak_br_bw,tvb,offset+3,3,ENC_BIG_ENDIAN);
 
-    dis_field_cps_sdu_size(tvb, tree, &len, &curr_offset, FALSE);
+    proto_tree_add_item(tree,hf_alcap_vbwt_peak_bucket_fw,tvb,offset+6,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_vbwt_peak_bucket_bw,tvb,offset+8,2,ENC_BIG_ENDIAN);
 
-    EXTRANEOUS_DATA_CHECK(len, 0);
-}
+    proto_tree_add_item(tree,hf_alcap_vbwt_sust_br_fw,tvb,offset+10,3,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_vbwt_sust_br_bw,tvb,offset+13,3,ENC_BIG_ENDIAN);
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.3.6
- */
-static void
-dis_parm_osai(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 curr_offset)
-{
+    proto_tree_add_item(tree,hf_alcap_vbwt_sust_bucket_fw,tvb,offset+16,2,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_vbwt_sust_bucket_bw,tvb,offset+18,2,ENC_BIG_ENDIAN);
 
-    dis_field_signalling_assoc_id(tvb, tree, &len, &curr_offset, FALSE);
+    proto_tree_add_item(tree,hf_alcap_vbwt_size_fw,tvb,offset+20,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree,hf_alcap_vbwt_size_bw,tvb,offset+21,1,ENC_BIG_ENDIAN);
 
-    EXTRANEOUS_DATA_CHECK(len, 0);
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.3.7
- */
-static void
-dis_parm_served_user_gen_ref(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 curr_offset)
-{
+static const gchar* dissect_fields_sut(packet_info* pinfo _U_, tvbuff_t *tvb, proto_tree *tree, int offset, int len, alcap_message_info_t* msg_info _U_) {
+    /*
+     * Q.2630.1 -> 7.3.8 Served user transport
+     *
+     * 7.4.18 Served User Transport
+     */
+    guint sut_len;
 
-    dis_field_served_user_gen_ref(tvb, tree, &len, &curr_offset);
+    if (len < 2) {
+        proto_item* bad_length = proto_tree_add_text(tree, tvb, offset, len,"[Wrong length for parameter fields]");
+        proto_item_set_expert_flags(bad_length, PI_MALFORMED, PI_WARN);
+        return NULL;
+    }
 
-    EXTRANEOUS_DATA_CHECK(len, 0);
-}
+    sut_len = tvb_get_guint8(tvb,offset);
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.3.8
- */
-static void
-dis_parm_served_user_transport(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 curr_offset)
-{
+    proto_tree_add_item(tree, hf_alcap_sut_len, tvb, offset, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_alcap_sut, tvb, offset, sut_len, ENC_NA);
 
-    dis_field_served_user_transport(tvb, tree, &len, &curr_offset);
-
-    EXTRANEOUS_DATA_CHECK(len, 0);
+    return NULL;
 }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.3.9
- */
-static void
-dis_parm_service_specific_info_audio(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 curr_offset)
-{
+typedef const gchar* (*alcap_parameter_dissector_t) (packet_info* pinfo, tvbuff_t*, proto_tree*, int, int, alcap_message_info_t*);
+
+typedef struct _alcap_param_info_t {
+    gint ett;
+    const gchar* name;
+    alcap_parameter_dissector_t dissect_fields;
+    gboolean run_wo_tree;
+} alcap_param_info_t;
+
+static alcap_param_info_t param_infos[]  = {
+    {-1, "Unknown", dissect_fields_unknown , FALSE},
+    {-1, "CAU", dissect_fields_cau, TRUE},
+    {-1, "CEID", dissect_fields_ceid, TRUE},
+    {-1, "DESEA", dissect_fields_desea, FALSE},
+    {-1, "DNSEA", dissect_fields_dnsea, TRUE},
+    {-1, "ALC", dissect_fields_alc, FALSE},
+    {-1, "OSAID", dissect_fields_osaid, TRUE},
+    {-1, "SUGR", dissect_fields_sugr, TRUE},
+    {-1, "SUT", dissect_fields_sut, FALSE},
+    {-1, "SSIA", dissect_fields_ssia, FALSE},
+    {-1, "SSIM", dissect_fields_ssim, FALSE},
+    {-1, "SSISA", dissect_fields_ssisa, FALSE},
+    {-1, "SSISU", dissect_fields_ssisu, FALSE},
+    {-1, "TCI", dissect_fields_none, FALSE},
+    {-1, "MSLC", dissect_fields_none, FALSE},
+    {-1, "MSSSI", dissect_fields_none, FALSE},
+    {-1, "PT", dissect_fields_pt, FALSE},
+    {-1, "PLC", dissect_fields_plc, FALSE},
+    {-1, "PSSIAE", dissect_fields_pssiae, FALSE},
+    {-1, "PSSIME", dissect_fields_pssime, FALSE},
+    {-1, "SUCI", dissect_fields_suci, FALSE},
+    {-1, "ONSEA", dissect_fields_onsea, TRUE},
+    {-1, "SSIAE", dissect_fields_ssiae, FALSE},
+    {-1, "SSIME", dissect_fields_ssime, FALSE},
+    {-1, "ACC", dissect_fields_acc, FALSE},
+    {-1, "CP", dissect_fields_cp, FALSE},
+    {-1, "HC", dissect_fields_hc, FALSE},
+    {-1, "OESEA", dissect_fields_oesea, FALSE},
+    {-1, "PFBW", dissect_fields_pfbw, FALSE},
+    {-1, "PVBWS", dissect_fields_pvbws, FALSE},
+    {-1, "PVBWT", dissect_fields_pvbwt, FALSE},
+    {-1, "TTC", dissect_fields_none, FALSE},
+    {-1, "FBW", dissect_fields_fbw, FALSE},
+    {-1, "VBWS", dissect_fields_vbws, FALSE},
+    {-1, "VBWT", dissect_fields_vbwt, FALSE},
+    {-1, "TCS", dissect_fields_none, FALSE}
+};
 
-    dis_field_audio_service(tvb, tree, &len, &curr_offset);
+#define GET_PARAM_INFO(id) ( array_length(param_infos) <= id ? &(param_infos[0]) : &(param_infos[id]) )
+
+typedef struct _alcap_msg_type_info_t {
+    const gchar* abbr;
+    int severity;
+} alcap_msg_type_info_t;
+
+static const alcap_msg_type_info_t msg_types[] = {
+    { "Unknown Message ", PI_ERROR },
+    { "BLC ", PI_NOTE },
+    { "BLO ", PI_NOTE },
+    { "CFN ", PI_WARN },
+    { "ECF ", PI_CHAT },
+    { "ERQ ", PI_CHAT },
+    { "RLC ", PI_CHAT },
+    { "REL ", PI_CHAT },
+    { "RSC ", PI_NOTE },
+    { "RES ", PI_NOTE },
+    { "UBC ", PI_NOTE },
+    { "UBL ", PI_NOTE },
+    { "MOA ", PI_CHAT },
+    { "MOR ", PI_CHAT },
+    { "MOD ", PI_CHAT },
+};
 
-    dis_field_organizational_unique_id(tvb, tree, &len, &curr_offset);
+static void alcap_leg_tree(proto_tree* tree, tvbuff_t* tvb, const alcap_leg_info_t* leg) {
+    proto_item* pi = proto_tree_add_text(tree,tvb,0,0,"[ALCAP Leg Info]");
 
-    EXTRANEOUS_DATA_CHECK(len, 0);
-}
+    tree = proto_item_add_subtree(pi,ett_leg);
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.3.10
- */
-static void
-dis_parm_service_specific_info_multirate(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 curr_offset)
-{
+    if (leg->dsaid) {
+        pi = proto_tree_add_uint(tree,hf_alcap_leg_dsaid,tvb,0,0,leg->dsaid);
+        PROTO_ITEM_SET_GENERATED(pi);
+    }
 
-    dis_field_multirate_service(tvb, tree, &len, &curr_offset);
+    if (leg->osaid) {
+        pi = proto_tree_add_uint(tree,hf_alcap_leg_osaid,tvb,0,0,leg->osaid);
+        PROTO_ITEM_SET_GENERATED(pi);
+    }
 
-    EXTRANEOUS_DATA_CHECK(len, 0);
-}
+    if (leg->pathid) {
+        pi = proto_tree_add_uint(tree,hf_alcap_leg_pathid,tvb,0,0,leg->pathid);
+        PROTO_ITEM_SET_GENERATED(pi);
+    }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.3.11
- */
-static void
-dis_parm_service_specific_info_ass(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 curr_offset)
-{
+    if (leg->cid) {
+        pi = proto_tree_add_uint(tree,hf_alcap_leg_cid,tvb,0,0,leg->cid);
+        PROTO_ITEM_SET_GENERATED(pi);
+    }
 
-    dis_field_seg_reassembly_ass(tvb, tree, &len, &curr_offset);
+    if (leg->sugr) {
+        pi = proto_tree_add_uint(tree,hf_alcap_leg_sugr,tvb,0,0,leg->sugr);
+        PROTO_ITEM_SET_GENERATED(pi);
+    }
 
-    EXTRANEOUS_DATA_CHECK(len, 0);
-}
+    if (leg->orig_nsap) {
+        pi = proto_tree_add_string(tree,hf_alcap_leg_onsea,tvb,0,0,leg->orig_nsap);
+        PROTO_ITEM_SET_GENERATED(pi);
+    }
 
-/*
- * Ref. ITU-T Q.2630.1 (12/1999)
- * Section 7.3.12
- */
-static void
-dis_parm_service_specific_info_unass(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 curr_offset)
-{
+    if (leg->dest_nsap) {
+        pi = proto_tree_add_string(tree,hf_alcap_leg_dnsea,tvb,0,0,leg->dest_nsap);
+        PROTO_ITEM_SET_GENERATED(pi);
+    }
 
-    dis_field_seg_reassembly_unass(tvb, tree, &len, &curr_offset);
+    if(leg->release_cause) {
+        pi = proto_tree_add_uint(tree,hf_alcap_leg_release_cause,tvb,0,0,leg->release_cause);
+        PROTO_ITEM_SET_GENERATED(pi);
+        if (leg->release_cause && leg->release_cause != 31)
+            proto_item_set_expert_flags(pi, PI_RESPONSE_CODE, PI_WARN);
+    }
 
-    EXTRANEOUS_DATA_CHECK(len, 0);
-}
+    if(leg->msgs) {
+        alcap_msg_data_t* msg = leg->msgs;
+        proto_item* pi_local = proto_tree_add_text(tree,tvb,0,0,"[Messages in this leg]");
+        proto_tree* tree_local = proto_item_add_subtree(pi_local,ett_leg);
 
-static gint ett_parms[NUM_PARMS];
-static void (*alcap_parm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) = {
-    dis_parm_cause,                            /* Cause */
-    dis_parm_conn_element_id,                          /* Connection element identifier */
-    dis_parm_dest_e164_sea,                    /* Destination E.164 service endpoint address */
-    dis_parm_dest_nsap_sea,                    /* Destination NSAP service endpoint address */
-    dis_parm_link_characteristics,             /* Link characteristics */
-    dis_parm_osai,                             /* Originating signalling association identifier */
-    dis_parm_served_user_gen_ref,              /* Served user generated reference */
-    dis_parm_served_user_transport,            /* Served user transport */
-    dis_parm_service_specific_info_audio,      /* Service specific information (audio) */
-    dis_parm_service_specific_info_multirate,  /* Service specific information (multirate) */
-    dis_parm_service_specific_info_ass,                /* Service specific information (SAR-assured) */
-    dis_parm_service_specific_info_unass,      /* Service specific information (SAR-unassured) */
-    NULL /* no parms */,                       /* Test connection identifier */
-    NULL,      /* NONE */
-};
 
-/* GENERIC ALCAP DISSECTOR FUNCTIONS */
+        do {
+            pi_local = proto_tree_add_uint(tree_local,hf_alcap_leg_frame,tvb,0,0,msg->framenum);
+            proto_item_set_text(pi_local,"%s in frame %u", val_to_str(msg->msg_type,msg_type_strings,"Unknown message"),msg->framenum);
+            PROTO_ITEM_SET_GENERATED(pi_local);
+        } while (( msg = msg->next));
 
-static void
-dissect_alcap_parms(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 len)
-{
-    void (*parm_fcn)(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) = NULL;
-    guint8     parm;
-    guint8     parm_len;
-    guint32    curr_offset, saved_offset;
-    gint       idx;
-    const gchar        *str = NULL;
-    proto_item *item;
-    proto_tree *subtree;
-    gint       ett_parm_idx;
-
-
-    curr_offset = offset;
-
-    while (len >= ALCAP_PARM_HEADER_LEN)
-    {
-               saved_offset = curr_offset;
-               
-               parm = tvb_get_guint8(tvb, curr_offset);
-               
-               str = match_strval_idx(parm, msg_parm_strings, &idx);
-               
-               if (str == NULL)
-               {
-                       ett_parm_idx = ett_parm;
-                       parm_fcn = NULL;
-               }
-               else
-               {
-                       ett_parm_idx = ett_parms[idx];
-                       parm_fcn = alcap_parm_fcn[idx];
-               }
-               
-               item = proto_tree_add_none_format(tree, hf_alcap_none, tvb,
-                                                                                 curr_offset, -1,
-                                                                                 (str == NULL) ? "Unknown parameter" : str);
-               
-               subtree = proto_item_add_subtree(item, ett_parm_idx);
-               
-               proto_tree_add_uint(subtree, hf_alcap_parm_id, tvb,
-                                                       curr_offset, 1, parm);
-               
-               curr_offset++;
-               
-               dis_field_compatibility(tvb, subtree, &curr_offset, FALSE);
-               
-               parm_len = tvb_get_guint8(tvb, curr_offset);
-               
-               proto_tree_add_uint(subtree, hf_alcap_length, tvb, curr_offset, 1, parm_len);
-               
-               curr_offset++;
-               
-               proto_item_set_len(item, (curr_offset - saved_offset) + parm_len);
-               
-               if (parm_len > 0)
-               {
-                       if (parm_fcn == NULL)
-                       {
-                               proto_tree_add_none_format(subtree, hf_alcap_none,
-                                                                                  tvb, curr_offset, parm_len, "Parameter data");
-                       }
-                       else
-                       {
-                               (*parm_fcn)(tvb, subtree, parm_len, curr_offset);
-                       }
-               }
-               
-               len -= (ALCAP_PARM_HEADER_LEN + parm_len);
-               curr_offset += parm_len;
     }
 
-    EXTRANEOUS_DATA_CHECK(len, 0);
 }
 
-static void
-dissect_alcap_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *alcap_tree)
-{
-    guint32    temp_len;
-    guint32    len;
-    guint32    offset;
-    guint8     msg_type;
-    gint       idx;
-    const gchar        *str = NULL;
-
-    offset = 0;
-
-    len = tvb_length(tvb);
-    temp_len = len;
 
-    if (len < ALCAP_MSG_HEADER_LEN)
-    {
-       proto_tree_add_none_format(alcap_tree, hf_alcap_none, tvb,
-           offset, len, "Message header too short");
+extern void alcap_tree_from_bearer_key(proto_tree* tree, tvbuff_t* tvb, const  gchar* key) {
+    alcap_leg_info_t* leg = se_tree_lookup_string(legs_by_bearer,key,0);
 
-       return;
+    if (leg) {
+        alcap_leg_tree(tree,tvb,leg);
     }
+}
 
-    dis_field_signalling_assoc_id(tvb, alcap_tree, &temp_len, &offset, TRUE);
-
-    msg_type = tvb_get_guint8(tvb, offset);
+#define GET_MSG_TYPE(id) ( array_length(msg_types) <= id ? &(msg_types[0]) : &(msg_types[id]) )
 
-    str = match_strval_idx(msg_type, msg_type_strings, &idx);
+static void dissect_alcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+    proto_tree *alcap_tree = NULL;
+    alcap_message_info_t* msg_info = ep_alloc0(sizeof(alcap_message_info_t));
+    int len = tvb_length(tvb);
+    int offset;
+    proto_item* pi;
+    proto_tree* compat_tree;
+    const alcap_msg_type_info_t* msg_type;
 
-    if (str == NULL)
-    {
-       proto_tree_add_none_format(alcap_tree, hf_alcap_none, tvb,
-           offset, 1, "Unknown message identifier");
+    col_set_str(pinfo->cinfo, COL_PROTOCOL, alcap_proto_name_short);
 
-       return;
+    if (tree) {
+        proto_item *alcap_item = proto_tree_add_item(tree, proto_alcap, tvb, 0, -1, ENC_NA);
+        alcap_tree = proto_item_add_subtree(alcap_item, ett_alcap);
     }
 
-    if (check_col(pinfo->cinfo, COL_INFO))
-    {
-       col_set_str(pinfo->cinfo, COL_INFO, str);
-    }
+    proto_tree_add_item(alcap_tree,hf_alcap_dsaid,tvb,0,4,ENC_BIG_ENDIAN);
+    pi = proto_tree_add_item(alcap_tree,hf_alcap_msg_id,tvb,4,1,ENC_BIG_ENDIAN);
 
-    proto_tree_add_uint(alcap_tree, hf_alcap_msg_type, tvb,
-       offset, 1, msg_type);
+    msg_info->dsaid = tvb_get_ntohl(tvb, 0);
+    msg_info->msg_type = tvb_get_guint8(tvb, 4);
 
-    offset++;
+    msg_type = GET_MSG_TYPE(msg_info->msg_type);
 
-    dis_field_compatibility(tvb, alcap_tree, &offset, TRUE);
+    expert_add_info_format(pinfo, pi, PI_RESPONSE_CODE, msg_type->severity, " ");
 
-    if (len > ALCAP_MSG_HEADER_LEN)
-    {
-       dissect_alcap_parms(tvb, alcap_tree, offset, len - ALCAP_MSG_HEADER_LEN);
-    }
-}
+    col_set_str(pinfo->cinfo, COL_INFO, msg_type->abbr);
 
-static void
-dissect_alcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-{
-    proto_item *alcap_item;
-    proto_tree *alcap_tree = NULL;
+    pi = proto_tree_add_item(alcap_tree,hf_alcap_compat,tvb,5,1,ENC_NA);
+    compat_tree = proto_item_add_subtree(pi,ett_compat);
+    proto_tree_add_item(compat_tree,hf_alcap_compat_pass_on_sni,tvb,5,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(compat_tree,hf_alcap_compat_pass_on_ii,tvb,5,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(compat_tree,hf_alcap_compat_general_sni,tvb,5,1,ENC_BIG_ENDIAN);
+    proto_tree_add_item(compat_tree,hf_alcap_compat_general_ii,tvb,5,1,ENC_BIG_ENDIAN);
 
-       bigbuf = ep_alloc(1024);
-       bigbuf2 = ep_alloc(1024);
-       
-    g_pinfo = pinfo;
+    len -= ALCAP_MSG_HEADER_LEN;
+    offset = ALCAP_MSG_HEADER_LEN;
 
-    /*
-     * Don't change the Protocol column on summary display
-     */
-    if (check_col(pinfo->cinfo, COL_PROTOCOL))
-    {
-       col_set_str(pinfo->cinfo, COL_PROTOCOL, alcap_proto_name_short);
-    }
+    while(len > 0) {
+        guint param_id = tvb_get_guint8(tvb,offset);
+        guint param_len = tvb_get_guint8(tvb,offset+2);
+        const alcap_param_info_t* param_info = GET_PARAM_INFO(param_id);
+        proto_tree* param_tree;
+        const gchar* colinfo_str = NULL;
 
-    /* In the interest of speed, if "tree" is NULL, don't do any work not
-     * necessary to generate protocol tree items.
-     */
-    if (tree)
-    {
-       g_tree = tree;
+        pi = proto_tree_add_item(alcap_tree,hf_alcap_param_id,tvb,offset,1,ENC_BIG_ENDIAN);
+        param_tree = proto_item_add_subtree(pi,param_info->ett);
 
-       /*
-        * create the ALCAP protocol tree
-        */
-       alcap_item =
-           proto_tree_add_protocol_format(tree, proto_alcap, tvb, 0, -1,
-               alcap_proto_name);
+        pi = proto_tree_add_item(param_tree,hf_alcap_compat,tvb,offset+1,1,ENC_NA);
+        compat_tree = proto_item_add_subtree(pi,ett_compat);
+        proto_tree_add_item(compat_tree,hf_alcap_compat_pass_on_sni,tvb,offset+1,1,ENC_BIG_ENDIAN);
+        proto_tree_add_item(compat_tree,hf_alcap_compat_pass_on_ii,tvb,offset+1,1,ENC_BIG_ENDIAN);
+        proto_tree_add_item(compat_tree,hf_alcap_compat_general_sni,tvb,offset+1,1,ENC_BIG_ENDIAN);
+        proto_tree_add_item(compat_tree,hf_alcap_compat_general_ii,tvb,offset+1,1,ENC_BIG_ENDIAN);
 
-       alcap_tree =
-           proto_item_add_subtree(alcap_item, ett_alcap);
+        proto_tree_add_item(param_tree,hf_alcap_param_len,tvb,offset+2,1,ENC_BIG_ENDIAN);
 
+        if ( alcap_tree || param_info->run_wo_tree )
+            colinfo_str = param_info->dissect_fields(pinfo,tvb,param_tree,offset+3,param_len,msg_info);
+
+        col_append_fstr(pinfo->cinfo, COL_INFO, " %s",colinfo_str);
+
+        len -= 3 + param_len;
+        offset += 3 + param_len;
     }
-       
-       dissect_alcap_message(tvb, pinfo, alcap_tree);
 
+    if (keep_persistent_info) {
+        alcap_leg_info_t* leg = NULL;
+        switch (msg_info->msg_type) {
+            case 5: /* ERQ */
+                if( ! ( leg = se_tree_lookup32(legs_by_osaid,msg_info->osaid) )) {
+                    leg = se_alloc(sizeof(alcap_leg_info_t));
+
+                    leg->dsaid = 0;
+                    leg->osaid = msg_info->osaid;
+                    leg->pathid = msg_info->pathid;
+                    leg->cid = msg_info->cid;
+                    leg->sugr = msg_info->sugr;
+                    leg->orig_nsap = NULL;
+                    leg->dest_nsap = NULL;
+
+                    if (msg_info->orig_nsap) {
+                        gchar* key = se_strdup_printf("%s:%.8X",msg_info->orig_nsap,leg->sugr);
+                        ascii_strdown_inplace(key);
+
+                        leg->orig_nsap = se_strdup(msg_info->orig_nsap);
+
+                        if (!se_tree_lookup_string(legs_by_bearer,key,0)) {
+                            se_tree_insert_string(legs_by_bearer,key,leg,0);
+                        }
+                    }
+
+                    if (msg_info->dest_nsap) {
+                        gchar* key = se_strdup_printf("%s:%.8X",msg_info->dest_nsap,leg->sugr);
+                        ascii_strdown_inplace(key);
+
+                        leg->dest_nsap = se_strdup(msg_info->dest_nsap);
+
+                        if (!se_tree_lookup_string(legs_by_bearer,key,0)) {
+                            se_tree_insert_string(legs_by_bearer,key,leg,0);
+                        }
+                    }
+
+                    leg->msgs = NULL;
+                    leg->release_cause = 0;
+
+                    se_tree_insert32(legs_by_osaid,leg->osaid,leg);
+                }
+                break;
+            case 4: /* ECF */
+                if(( leg = se_tree_lookup32(legs_by_osaid,msg_info->dsaid) )) {
+                    leg->dsaid = msg_info->osaid;
+                    se_tree_insert32(legs_by_dsaid,leg->dsaid,leg);
+                }
+                break;
+            case 6: /* RLC */
+            case 12:  /* MOA */
+            case 13: /* MOR */
+            case 14: /* MOD */
+                if( ( leg = se_tree_lookup32(legs_by_osaid,msg_info->dsaid) )
+                    || ( leg = se_tree_lookup32(legs_by_dsaid,msg_info->dsaid) ) ) {
+
+                    if(msg_info->release_cause)
+                        leg->release_cause =  msg_info->release_cause;
+
+                }
+                break;
+            case 7: /* REL */
+                leg = se_tree_lookup32(legs_by_osaid,msg_info->dsaid);
+
+                if(leg) {
+                    leg->release_cause =  msg_info->release_cause;
+                } else if (( leg = se_tree_lookup32(legs_by_dsaid,msg_info->dsaid) )) {
+                    leg->release_cause =  msg_info->release_cause;
+                }
+                    break;
+            default:
+                break;
+        }
+
+        if (leg != NULL && ( (! leg->msgs) || leg->msgs->last->framenum < pinfo->fd->num ) ) {
+            alcap_msg_data_t* msg = se_alloc(sizeof(alcap_msg_data_t));
+            msg->msg_type = msg_info->msg_type;
+            msg->framenum = pinfo->fd->num;
+            msg->next = NULL;
+            msg->last = NULL;
+
+            if (leg->msgs) {
+                leg->msgs->last->next = msg;
+            } else {
+                leg->msgs = msg;
+            }
+
+            leg->msgs->last = msg;
+
+        }
+
+        if (tree && leg) alcap_leg_tree(alcap_tree,tvb,leg);
+    }
 }
 
-
-/* Register the protocol with Ethereal */
 void
 proto_register_alcap(void)
 {
-    guint              i;
-
-    /* Setup list of header fields */
-    static hf_register_info hf[] =
-    {
-       { &hf_alcap_msg_type,
-         { "Message Type",
-           "alcap.msg_type",
-           FT_UINT8, BASE_DEC, VALS(msg_type_strings), 0,
-           "", HFILL }},
-       { &hf_alcap_dsaid,
-         { "Destination signalling association identifier",
-           "alcap.dsai",
-           FT_UINT32, BASE_DEC, NULL, 0,
-           "", HFILL }
-       },
-       { &hf_alcap_osaid,
-         { "Originating signalling association identifier",
-           "alcap.osai",
-           FT_UINT32, BASE_DEC, NULL, 0,
-           "", HFILL }
-       },
-       { &hf_alcap_aal2_path_id,
-         { "AAL2 path identifier",
-           "alcap.path_id",
-           FT_UINT32, BASE_DEC, NULL, 0,
-           "", HFILL }
-       },
-       { &hf_alcap_channel_id,
-         { "Channel identifier (CID)",
-           "alcap.cid",
-           FT_UINT32, BASE_DEC, NULL, 0,
-           "", HFILL }
-       },
-       { &hf_alcap_organizational_unique_id,
-         { "Organizational unique identifier (OUI)",
-           "alcap.oui",
-           FT_UINT24, BASE_DEC, NULL, 0,
-           "", HFILL }
-       },
-       { &hf_alcap_served_user_gen_ref,
-         { "Served user generated reference",
-           "alcap.sugr",
-           FT_UINT32, BASE_DEC, NULL, 0,
-           "", HFILL }
-       },
-       { &hf_alcap_nsap_address,
-         { "NSAP address",
-           "alcap.nsap",
-           FT_BYTES, BASE_NONE, NULL, 0,
-           "", HFILL }
-       },
-       { &hf_alcap_parm_id,
-         { "Parameter identifier",
-           "alcap.param_id",
-           FT_UINT8, BASE_DEC, NULL, 0,
-           "", HFILL }},
-       { &hf_alcap_length,
-           { "Length",         "alcap.len",
-           FT_UINT8, BASE_DEC, NULL, 0,
-           "", HFILL }
-       },
-       { &hf_alcap_none,
-           { "Subtree",        "alcap.none",
-           FT_NONE, 0, 0, 0,
-           "", HFILL }
-       },
+    module_t *alcap_module;
+
+    static hf_register_info hf[] = {
+    { &hf_alcap_dsaid, { "DSAID", "alcap.dsaid", FT_UINT32, BASE_HEX, NULL, 0, "Destination Service Association ID", HFILL }},
+    { &hf_alcap_msg_id, { "Message Type", "alcap.msg_type", FT_UINT8, BASE_DEC, VALS(msg_type_strings), 0, NULL, HFILL }},
+    { &hf_alcap_compat, { "Message Compatibility", "alcap.compat", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_compat_pass_on_sni, { "Pass-On SNI", "alcap.compat.pass.sni", FT_UINT8, BASE_DEC, VALS(send_notification), 0x40, "Send Notificaation Indicator", HFILL }},
+    { &hf_alcap_compat_pass_on_ii, { "Pass-On II", "alcap.compat.pass.ii", FT_UINT8, BASE_DEC, VALS(instruction_indicator), 0x30, "Instruction Indicator", HFILL }},
+    { &hf_alcap_compat_general_sni, { "General SNI", "alcap.compat.general.sni", FT_UINT8, BASE_DEC, VALS(send_notification), 0x04, "Send Notificaation Indicator", HFILL }},
+    { &hf_alcap_compat_general_ii, { "General II", "alcap.compat.general.ii", FT_UINT8, BASE_DEC, VALS(instruction_indicator), 0x03, "Instruction Indicator", HFILL }},
+
+    { &hf_alcap_unknown, { "Unknown Field Data", "alcap.unknown.field", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_param_id, { "Parameter", "alcap.param", FT_UINT8, BASE_DEC, VALS(msg_parm_strings), 0, "Parameter Id", HFILL }},
+    { &hf_alcap_param_len, { "Length", "alcap.param.len", FT_UINT8, BASE_DEC, NULL, 0, "Parameter Length", HFILL }},
+
+    { &hf_alcap_cau_coding, { "Cause Coding", "alcap.cau.coding", FT_UINT8, BASE_DEC, VALS(cause_coding_vals), 0x03, NULL, HFILL }},
+    { &hf_alcap_cau_value_itu, { "Cause Value (ITU)", "alcap.cau.value", FT_UINT8, BASE_DEC, VALS(cause_values_itu), 0x7f, NULL, HFILL }},
+    { &hf_alcap_cau_value_non_itu, { "Cause Value (Other)", "alcap.cau.value", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
+    { &hf_alcap_cau_diag, { "Diagnostic", "alcap.cau.diag", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_cau_diag_len, { "Length", "alcap.cau.diag.len", FT_UINT8, BASE_DEC, NULL, 0, "Diagnostics Length", HFILL }},
+    { &hf_alcap_cau_diag_msg, { "Message Identifier", "alcap.cau.diag.msg", FT_UINT8, BASE_DEC, VALS(msg_type_strings), 0, NULL, HFILL }},
+    { &hf_alcap_cau_diag_param_id, { "Parameter Identifier", "alcap.cau.diag.param", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_cau_diag_field_num, { "Field Number", "alcap.cau.diag.field_num", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_ceid_pathid, { "Path ID", "alcap.ceid.pathid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_ceid_cid, { "CID", "alcap.ceid.cid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_dnsea, { "Address", "alcap.dnsea.addr", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_alc_max_br_fw, { "Maximum Forward Bit Rate", "alcap.alc.bitrate.max.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_alc_max_br_bw, { "Maximum Backwards Bit Rate", "alcap.alc.bitrate.max.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_alc_avg_br_fw, { "Average Forward Bit Rate", "alcap.alc.bitrate.avg.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_alc_avg_br_bw, { "Average Backwards Bit Rate", "alcap.alc.bitrate.avg.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_alc_max_sdu_fw, { "Maximum Forward CPS SDU Size", "alcap.alc.sdusize.max.fw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
+    { &hf_alcap_alc_max_sdu_bw, { "Maximum Backwards CPS SDU Size", "alcap.alc.sdusize.max.bw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
+    { &hf_alcap_alc_avg_sdu_fw, { "Average Forward CPS SDU Size", "alcap.alc.sdusize.avg.fw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
+    { &hf_alcap_alc_avg_sdu_bw, { "Average Backwards CPS SDU Size", "alcap.alc.sdusize.avg.bw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
+
+    { &hf_alcap_osaid, { "OSAID", "alcap.osaid", FT_UINT32, BASE_HEX, NULL, 0, "Originating Service Association ID", HFILL }},
+
+    { &hf_alcap_sugr, { "SUGR", "alcap.sugr", FT_BYTES, BASE_NONE, NULL, 0, "Served User Generated Reference", HFILL }},
+
+    { &hf_alcap_sut_len, { "SUT Length", "alcap.sut.sut_len", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_sut, { "SUT", "alcap.sut.transport", FT_BYTES, BASE_NONE, NULL, 0, "Served User Transport", HFILL }},
+
+    { &hf_alcap_ssia_pr_type, { "Profile Type", "alcap.ssia.profile.type", FT_UINT8, BASE_DEC, VALS(audio_profile_type), 0xc0, "I.366.2 Profile Type", HFILL }},
+    { &hf_alcap_ssia_pr_id, { "Profile Id", "alcap.ssia.profile.id", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_ssia_frm, { "Frame Mode", "alcap.ssia.frm", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
+    { &hf_alcap_ssia_cmd, { "Circuit Mode", "alcap.ssia.cmd", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40, NULL, HFILL }},
+    { &hf_alcap_ssia_mfr2, { "Multi-Frequency R2", "alcap.ssia.mfr2", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x20, NULL, HFILL }},
+    { &hf_alcap_ssia_mfr1, { "Multi-Frequency R1", "alcap.ssia.mfr1", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x10, NULL, HFILL }},
+    { &hf_alcap_ssia_dtmf, { "DTMF", "alcap.ssia.dtmf", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x08, NULL, HFILL }},
+    { &hf_alcap_ssia_cas, { "CAS", "alcap.ssia.cas", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x04, "Channel Associated Signalling", HFILL }},
+    { &hf_alcap_ssia_fax, { "Fax", "alcap.ssia.fax", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x02, "Facsimile", HFILL }},
+    { &hf_alcap_ssia_pcm, { "PCM Mode", "alcap.ssia.pcm", FT_UINT8, BASE_DEC, VALS(alaw_ulaw), 0x01, NULL, HFILL }},
+    { &hf_alcap_ssia_max_len, { "Max Len of FM Data", "alcap.ssia.max_fmdata_len", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_ssia_oui, { "OUI", "alcap.ssia.oui", FT_BYTES, BASE_NONE, NULL, 0, "Organizational Unique Identifier", HFILL }},
+
+    { &hf_alcap_ssim_frm, { "Frame Mode", "alcap.ssim.frm", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
+    { &hf_alcap_ssim_mult, { "Multiplier", "alcap.ssim.mult", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL }},
+    { &hf_alcap_ssim_max, { "Max Len", "alcap.ssim.max", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_ssisa_max_sssar_fw, { "Maximum Len of SSSAR-SDU Forward", "alcap.ssisa.sssar.max_len.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_ssisa_max_sssar_bw, { "Maximum Len of SSSAR-SDU Backwards", "alcap.ssisa.sssar.max_len.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_ssisa_max_sscop_sdu_fw, { "Maximum Len of SSSAR-SDU Forward", "alcap.ssisa.sscop.max_sdu_len.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_ssisa_max_sscop_sdu_bw, { "Maximum Len of SSSAR-SDU Backwards", "alcap.ssisa.sscop.max_sdu_len.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_ssisa_max_sscop_uu_fw, { "Maximum Len of SSSAR-SDU Forward", "alcap.ssisa.sscop.max_uu_len.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_ssisa_max_sscop_uu_bw, { "Maximum Len of SSSAR-SDU Backwards", "alcap.ssisa.sscop.max_uu_len.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_ssisu_max_sssar_fw, { "Maximum Len of SSSAR-SDU Forward", "alcap.ssisu.sssar.max_len.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_ssisu_max_sssar_bw, { "Maximum Len of SSSAR-SDU Backwards", "alcap.ssisu.sssar.max_len.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_ssisu_ted, { "Transmission Error Detection", "alcap.ssisu.ted", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
+
+    { &hf_alcap_pt, { "QoS Codepoint", "alcap.pt.codepoint", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+
+    { &hf_alcap_plc_max_br_fw, { "Maximum Forward Bit Rate", "alcap.plc.bitrate.max.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_plc_max_br_bw, { "Maximum Backwards Bit Rate", "alcap.plc.bitrate.max.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_plc_avg_br_fw, { "Average Forward Bit Rate", "alcap.plc.bitrate.avg.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_plc_avg_br_bw, { "Average Backwards Bit Rate", "alcap.plc.bitrate.avg.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_plc_max_sdu_fw, { "Maximum Forward CPS SDU Size", "alcap.plc.sdusize.max.fw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
+    { &hf_alcap_plc_max_sdu_bw, { "Maximum Backwards CPS SDU Size", "alcap.plc.sdusize.max.bw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
+    { &hf_alcap_plc_avg_sdu_fw, { "Maximum Forward CPS SDU Size", "alcap.plc.sdusize.max.fw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
+    { &hf_alcap_plc_avg_sdu_bw, { "Maximum Backwards CPS SDU Size", "alcap.plc.sdusize.max.bw", FT_UINT8, BASE_DEC, NULL, 0x7f, NULL, HFILL }},
+
+    { &hf_alcap_pssiae_pr_type, { "Profile Type", "alcap.pssiae.profile.type", FT_UINT8, BASE_DEC, VALS(audio_profile_type), 0xc0, "I.366.2 Profile Type", HFILL }},
+    { &hf_alcap_pssiae_pr_id, { "Profile Id", "alcap.pssiae.profile.id", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pssiae_lb, { "Loopback", "alcap.pssiae.lb", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0, NULL, HFILL }},
+    { &hf_alcap_pssiae_rc, { "Rate Control", "alcap.pssiae.rc", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0, NULL, HFILL }},
+    { &hf_alcap_pssiae_syn, { "Synchronization", "alcap.pssiae.syn", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0, "Transport of synchronization of change in SSCS operation", HFILL }},
+    { &hf_alcap_pssiae_frm, { "Frame Mode", "alcap.pssiae.frm", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
+    { &hf_alcap_pssiae_cmd, { "Circuit Mode", "alcap.pssiae.cmd", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40, NULL, HFILL }},
+    { &hf_alcap_pssiae_mfr2, { "Multi-Frequency R2", "alcap.pssiae.mfr2", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x20, NULL, HFILL }},
+    { &hf_alcap_pssiae_mfr1, { "Multi-Frequency R1", "alcap.pssiae.mfr1", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x10, NULL, HFILL }},
+    { &hf_alcap_pssiae_dtmf, { "DTMF", "alcap.pssiae.dtmf", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x08, NULL, HFILL }},
+    { &hf_alcap_pssiae_cas, { "CAS", "alcap.pssiae.cas", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x04, "Channel Associated Signalling", HFILL }},
+    { &hf_alcap_pssiae_fax, { "Fax", "alcap.pssiae.fax", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x02, "Facsimile", HFILL }},
+    { &hf_alcap_pssiae_pcm, { "PCM Mode", "alcap.pssiae.pcm", FT_UINT8, BASE_DEC, VALS(alaw_ulaw), 0x01, NULL, HFILL }},
+    { &hf_alcap_pssiae_max_len, { "Max Len of FM Data", "alcap.pssiae.max_fmdata_len", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pssiae_oui, { "OUI", "alcap.pssiae.oui", FT_BYTES, BASE_NONE, NULL, 0, "Organizational Unique Identifier", HFILL }},
+
+    { &hf_alcap_pssime_frm, { "Frame Mode", "alcap.pssime.frm", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
+    { &hf_alcap_pssime_lb, { "Loopback", "alcap.pssime.lb", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40, NULL, HFILL }},
+    { &hf_alcap_pssime_mult, { "Multiplier", "alcap.pssime.mult", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL }},
+    { &hf_alcap_pssime_max, { "Max Len", "alcap.pssime.max", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_suci, { "SUCI", "alcap.suci", FT_UINT8, BASE_HEX, NULL, 0, "Served User Correlation Id", HFILL }},
+
+    { &hf_alcap_onsea, { "Address", "alcap.onsea.addr", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_ssiae_pr_type, { "Profile Type", "alcap.ssiae.profile.type", FT_UINT8, BASE_DEC, VALS(audio_profile_type), 0xc0, "I.366.2 Profile Type", HFILL }},
+    { &hf_alcap_ssiae_lb, { "Loopback", "alcap.ssiae.lb", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0, NULL, HFILL }},
+    { &hf_alcap_ssiae_rc, { "Rate Control", "alcap.ssiae.rc", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0, NULL, HFILL }},
+    { &hf_alcap_ssiae_syn, { "Synchronization", "alcap.ssiae.syn", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0xc0, "Transport of synchronization of change in SSCS operation", HFILL }},
+    { &hf_alcap_ssiae_pr_id, { "Profile Id", "alcap.ssiae.profile.id", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_ssiae_frm, { "Frame Mode", "alcap.ssiae.frm", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
+    { &hf_alcap_ssiae_cmd, { "Circuit Mode", "alcap.ssiae.cmd", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40, NULL, HFILL }},
+    { &hf_alcap_ssiae_mfr2, { "Multi-Frequency R2", "alcap.ssiae.mfr2", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x20, NULL, HFILL }},
+    { &hf_alcap_ssiae_mfr1, { "Multi-Frequency R1", "alcap.ssiae.mfr1", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x10, NULL, HFILL }},
+    { &hf_alcap_ssiae_dtmf, { "DTMF", "alcap.ssiae.dtmf", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x08, NULL, HFILL }},
+    { &hf_alcap_ssiae_cas, { "CAS", "alcap.ssiae.cas", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x04, "Channel Associated Signalling", HFILL }},
+    { &hf_alcap_ssiae_fax, { "Fax", "alcap.ssiae.fax", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x02, "Facsimile", HFILL }},
+    { &hf_alcap_ssiae_pcm, { "PCM Mode", "alcap.ssiae.pcm", FT_UINT8, BASE_DEC, VALS(alaw_ulaw), 0x01, NULL, HFILL }},
+    { &hf_alcap_ssiae_max_len, { "Max Len of FM Data", "alcap.ssiae.max_fmdata_len", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_ssiae_oui, { "OUI", "alcap.ssiae.oui", FT_BYTES, BASE_NONE, NULL, 0, "Organizational Unique Identifier", HFILL }},
+
+    { &hf_alcap_ssime_frm, { "Frame Mode", "alcap.ssime.frm", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x80, NULL, HFILL }},
+    { &hf_alcap_ssime_lb, { "Loopback", "alcap.ssime.lb", FT_UINT8, BASE_DEC, VALS(enabled_disabled), 0x40, NULL, HFILL }},
+    { &hf_alcap_ssime_mult, { "Multiplier", "alcap.ssime.mult", FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL }},
+    { &hf_alcap_ssime_max, { "Max Len", "alcap.ssime.max", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_acc_level, { "Congestion Level", "alcap.acc.level", FT_UINT8, BASE_DEC, VALS(congestion_level), 0, NULL, HFILL }},
+
+    { &hf_alcap_cp, { "Level", "alcap.cp.level", FT_UINT8, BASE_DEC, VALS(connection_priority), 0x07, NULL, HFILL }},
+
+    { &hf_alcap_hc, { "Codepoint", "alcap.hc.codepoint", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_pfbw_br_fw, { "CPS Forward Bitrate", "alcap.pfbw.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pfbw_br_bw, { "CPS Backwards Bitrate", "alcap.pfbw.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pfbw_bucket_fw, { "Forward CPS Bucket Size", "alcap.pfbw.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pfbw_bucket_bw, { "Backwards CPS Bucket Size", "alcap.pfbw.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pfbw_size_fw, { "Forward CPS Packet Size", "alcap.pfbw.max_size.fw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pfbw_size_bw, { "Backwards CPS Packet Size", "alcap.pfbw.max_size.bw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_pvbws_br_fw, { "Peak CPS Forward Bitrate", "alcap.pvbws.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbws_br_bw, { "Peak CPS Backwards Bitrate", "alcap.pvbws.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbws_bucket_fw, { "Peak Forward CPS Bucket Size", "alcap.pvbws.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbws_bucket_bw, { "Peak Backwards CPS Bucket Size", "alcap.pvbws.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbws_size_fw, { "Forward CPS Packet Size", "alcap.pvbws.max_size.fw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbws_size_bw, { "Backwards CPS Packet Size", "alcap.pvbws.max_size.bw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbws_stt, { "Source Traffic Type", "alcap.pvbws.stt", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_pvbwt_peak_br_fw, { "Peak CPS Forward Bitrate", "alcap.pvbwt.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbwt_peak_br_bw, { "Peak CPS Backwards Bitrate", "alcap.pvbwt.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbwt_peak_bucket_fw, { "Peak Forward CPS Bucket Size", "alcap.pvbwt.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbwt_peak_bucket_bw, { "Peak Backwards CPS Bucket Size", "alcap.pvbwt.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbwt_sust_br_fw, { "Sustainable CPS Forward Bitrate", "alcap.pvbwt.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbwt_sust_br_bw, { "Sustainable CPS Backwards Bitrate", "alcap.pvbwt.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbwt_sust_bucket_fw, { "Sustainable Forward CPS Bucket Size", "alcap.pvbwt.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbwt_sust_bucket_bw, { "Sustainable Backwards CPS Bucket Size", "alcap.pvbwt.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbwt_size_fw, { "Forward CPS Packet Size", "alcap.pvbwt.max_size.fw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_pvbwt_size_bw, { "Backwards CPS Packet Size", "alcap.pvbwt.max_size.bw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_fbw_br_fw, { "CPS Forward Bitrate", "alcap.fbw.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_fbw_br_bw, { "CPS Backwards Bitrate", "alcap.fbw.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_fbw_bucket_fw, { "Forward CPS Bucket Size", "alcap.fbw.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_fbw_bucket_bw, { "Backwards CPS Bucket Size", "alcap.fbw.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_fbw_size_fw, { "Forward CPS Packet Size", "alcap.fbw.max_size.fw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_fbw_size_bw, { "Backwards CPS Packet Size", "alcap.fbw.max_size.bw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_vbws_br_fw, { "CPS Forward Bitrate", "alcap.vbws.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbws_br_bw, { "CPS Backwards Bitrate", "alcap.vbws.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbws_bucket_fw, { "Forward CPS Bucket Size", "alcap.vbws.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbws_bucket_bw, { "Backwards CPS Bucket Size", "alcap.vbws.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbws_size_fw, { "Forward CPS Packet Size", "alcap.vbws.max_size.fw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbws_size_bw, { "Backwards CPS Packet Size", "alcap.vbws.max_size.bw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbws_stt, { "Source Traffic Type", "alcap.vbws.stt", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_vbwt_peak_br_fw, { "Peak CPS Forward Bitrate", "alcap.vbwt.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbwt_peak_br_bw, { "Peak CPS Backwards Bitrate", "alcap.vbwt.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbwt_peak_bucket_fw, { "Peak Forward CPS Bucket Size", "alcap.vbwt.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbwt_peak_bucket_bw, { "Peak Backwards CPS Bucket Size", "alcap.vbwt.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbwt_sust_br_fw, { "Sustainable CPS Forward Bitrate", "alcap.vbwt.bitrate.fw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbwt_sust_br_bw, { "Sustainable CPS Backwards Bitrate", "alcap.vbwt.bitrate.bw", FT_UINT24, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbwt_sust_bucket_fw, { "Sustainable Forward CPS Bucket Size", "alcap.vbwt.bucket_size.fw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbwt_sust_bucket_bw, { "Sustainable Backwards CPS Bucket Size", "alcap.vbwt.bucket_size.bw", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbwt_size_fw, { "Forward CPS Packet Size", "alcap.vbwt.max_size.fw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+    { &hf_alcap_vbwt_size_bw, { "Backwards CPS Packet Size", "alcap.vbwt.max_size.bw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
+
+    { &hf_alcap_leg_osaid, { "Leg's ERQ OSA id",    "alcap.leg.osaid", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
+    { &hf_alcap_leg_dsaid, { "Leg's ECF OSA id",    "alcap.leg.dsaid", FT_UINT32, BASE_HEX, NULL, 0,NULL, HFILL } },
+    { &hf_alcap_leg_pathid, { "Leg's path id",    "alcap.leg.pathid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
+    { &hf_alcap_leg_cid, { "Leg's channel id",    "alcap.leg.cid", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
+    { &hf_alcap_leg_sugr, { "Leg's SUGR",    "alcap.leg.sugr", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL } },
+    { &hf_alcap_leg_dnsea, { "Leg's destination NSAP",    "alcap.leg.dnsea", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } },
+    { &hf_alcap_leg_onsea, { "Leg's originating NSAP",    "alcap.leg.onsea", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } },
+    { &hf_alcap_leg_frame, { "a message of this leg",    "alcap.leg.msg", FT_FRAMENUM, BASE_NONE, NULL, 0, NULL, HFILL } },
+    { &hf_alcap_leg_release_cause, { "Leg's cause value in REL",    "alcap.leg.cause", FT_UINT8, BASE_DEC, VALS(cause_values_itu), 0, NULL, HFILL }},
+
     };
 
-    /* Setup protocol subtree array */
-#define        NUM_INDIVIDUAL_PARMS    2
-    static gint *ett[NUM_INDIVIDUAL_PARMS+NUM_PARMS+NUM_FIELDS];
+    gint* ett[] = {
+        &ett_alcap,
+        &ett_leg,
+        &ett_compat,
+        &ett_cau_diag,
+        &param_infos[0].ett,
+        &param_infos[1].ett,
+        &param_infos[2].ett,
+        &param_infos[3].ett,
+        &param_infos[4].ett,
+        &param_infos[5].ett,
+        &param_infos[6].ett,
+        &param_infos[7].ett,
+        &param_infos[8].ett,
+        &param_infos[9].ett,
+        &param_infos[10].ett,
+        &param_infos[11].ett,
+        &param_infos[12].ett,
+        &param_infos[13].ett,
+        &param_infos[14].ett,
+        &param_infos[15].ett,
+        &param_infos[16].ett,
+        &param_infos[17].ett,
+        &param_infos[18].ett,
+        &param_infos[19].ett,
+        &param_infos[20].ett,
+        &param_infos[21].ett,
+        &param_infos[22].ett,
+        &param_infos[23].ett,
+        &param_infos[24].ett,
+        &param_infos[25].ett,
+        &param_infos[26].ett,
+        &param_infos[27].ett,
+        &param_infos[28].ett,
+        &param_infos[29].ett,
+        &param_infos[30].ett,
+        &param_infos[31].ett,
+        &param_infos[32].ett,
+        &param_infos[33].ett,
+        &param_infos[34].ett,
+        &param_infos[35].ett,
+    };
 
-    memset((void *) ett, 0, sizeof(ett));
+    proto_alcap = proto_register_protocol(alcap_proto_name, alcap_proto_name_short, "alcap");
 
-    ett[0] = &ett_alcap;
-    ett[1] = &ett_parm;
+    register_dissector("alcap", dissect_alcap, proto_alcap);
 
-    for (i=0; i < NUM_PARMS; i++)
-    {
-       ett_parms[i] = -1;
-       ett[NUM_INDIVIDUAL_PARMS+i] = &ett_parms[i];
-    }
+    proto_register_field_array(proto_alcap, hf, array_length(hf));
+    proto_register_subtree_array(ett, array_length(ett));
 
-    for (i=0; i < NUM_FIELDS; i++)
-    {
-       ett_fields[i] = -1;
-       ett[NUM_INDIVIDUAL_PARMS+NUM_PARMS+i] = &ett_fields[i];
-    }
+    alcap_module = prefs_register_protocol(proto_alcap, NULL);
 
-    /* Register the protocol name and description */
-    proto_alcap =
-       proto_register_protocol(alcap_proto_name, alcap_proto_name_short, "alcap");
+    prefs_register_bool_preference(alcap_module, "leg_info",
+                                   "Keep Leg Information",
+                                   "Whether persistent call leg information is to be kept",
+                                   &keep_persistent_info);
 
-       register_dissector("alcap", dissect_alcap, proto_alcap);
-       
-    /* Required function calls to register the header fields and subtrees used */
-    proto_register_field_array(proto_alcap, hf, array_length(hf));
-    proto_register_subtree_array(ett, array_length(ett));
+    legs_by_dsaid = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "legs_by_dsaid");
+    legs_by_osaid = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "legs_by_osaid");
+    legs_by_bearer = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "legs_by_bearer");
 }
 
 
 void
 proto_reg_handoff_alcap(void)
 {
-    dissector_handle_t alcap_handle;
-
-    alcap_handle = create_dissector_handle(dissect_alcap, proto_alcap);
-
-    dissector_add("mtp3.service_indicator", ALCAP_SI, alcap_handle);
+    dissector_handle_t alcap_handle = create_dissector_handle(dissect_alcap, proto_alcap);
 
-    data_handle = find_dissector("data");
+    dissector_add_uint("mtp3.service_indicator", ALCAP_SI, alcap_handle);
 }