libsmp_plugin.h revision ac88567a7a5bb7f01cf22cf366bc9d6203e24d7a
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * CDDL HEADER START
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * The contents of this file are subject to the terms of the
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * Common Development and Distribution License (the "License").
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * You may not use this file except in compliance with the License.
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * See the License for the specific language governing permissions
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * and limitations under the License.
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * When distributing Covered Code, include this CDDL HEADER in each
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * If applicable, add the following below this CDDL HEADER, with the
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * fields enclosed by brackets "[]" replaced with your own identifying
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * information: Portions Copyright [yyyy] [name of copyright owner]
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * CDDL HEADER END
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimextern "C" {
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim (offsetof(smp_request_frame_t, srf_data[0]) + sizeof (smp_crc_t))
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim (offsetof(smp_response_frame_t, srf_data[0]) + sizeof (smp_crc_t))
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim#define VERIFY(x) ((void)((x) || smp_assert(#x, __FILE__, __LINE__)))
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimtypedef struct smp_engine_ops {
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim void *(*seo_open)(const void *);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim void (*seo_close)(void *);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimtypedef struct smp_engine_config {
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim const char *sec_name;
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimtypedef struct smp_function_def {
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim off_t (*sfd_rq_dataoff)(smp_action_t *, smp_target_t *);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim void (*sfd_rq_setframe)(smp_action_t *, smp_target_t *);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim size_t (*sfd_rs_datalen)(smp_action_t *, smp_target_t *);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim off_t (*sfd_rs_dataoff)(smp_action_t *, smp_target_t *);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim void (*sfd_rs_getparams)(smp_action_t *, smp_target_t *);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimtypedef struct smp_plugin_config {
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim const char *spc_name;
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimextern int smp_assert(const char *, const char *, int);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimextern char *smp_strdup(const char *);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimextern void smp_free(void *);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimextern int smp_verror(smp_errno_t, const char *, va_list);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimextern int smp_error(smp_errno_t, const char *, ...);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimextern void smp_action_get_request_frame(const smp_action_t *,
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim void **, size_t *);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimextern void smp_action_get_response_frame(const smp_action_t *,
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim void **, size_t *);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimextern void smp_action_set_response_len(smp_action_t *, size_t);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimextern void smp_action_set_result(smp_action_t *, smp_result_t);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimextern const smp_function_def_t *smp_action_get_function_def(
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimextern void smp_plugin_setspecific(smp_plugin_t *, void *);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimextern void *smp_plugin_getspecific(smp_plugin_t *);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim#endif /* _LIBSMP_PLUGIN_H */