/* Dissect a parameter given its type, offset into tvb, and length.  */
static guint16 dissect_bssap_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bssap_tree, proto_tree *tree, guint8 parameter_type, gint offset, guint16 parameter_length, struct _sccp_msg_info_t *sccp_info)
/* Dissect a parameter given its type, offset into tvb, and length.  */
static guint16 dissect_bssap_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bssap_tree, proto_tree *tree, guint8 parameter_type, gint offset, guint16 parameter_length, struct _sccp_msg_info_t *sccp_info)
{
    tvbuff_t *parameter_tvb;
    parameter_tvb = tvb_new_subset_length(tvb, offset, parameter_length);
    switch (parameter_type)
    {
    case PARAMETER_DLCI:
        dissect_bssap_dlci_param(parameter_tvb, bssap_tree, parameter_length);
        break;
    case PARAMETER_LENGTH:
        dissect_bssap_length_param(parameter_tvb, bssap_tree, parameter_length);
        break;
    case PARAMETER_DATA:
        dissect_bssap_data_param(parameter_tvb, pinfo, bssap_tree, tree, sccp_info);
        break;
    default:
        proto_tree_add_expert_format(bssap_tree, pinfo, &ei_bssap_unknown_parameter, parameter_tvb, 0, parameter_length,
                "Unknown parameter 0x%x (%u byte%s)", parameter_type, parameter_length, plurality(parameter_length, "", "s"));
        break;
    }
    return(parameter_length);
}