d9638e547d8811f2c689977f8dd2a353938b61fdmws * CDDL HEADER START
d9638e547d8811f2c689977f8dd2a353938b61fdmws * The contents of this file are subject to the terms of the
25351652d920ae27c5a56c199da581033ce763f6Vuong Nguyen * Common Development and Distribution License (the "License").
25351652d920ae27c5a56c199da581033ce763f6Vuong Nguyen * You may not use this file except in compliance with the License.
d9638e547d8811f2c689977f8dd2a353938b61fdmws * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d9638e547d8811f2c689977f8dd2a353938b61fdmws * See the License for the specific language governing permissions
d9638e547d8811f2c689977f8dd2a353938b61fdmws * and limitations under the License.
d9638e547d8811f2c689977f8dd2a353938b61fdmws * When distributing Covered Code, include this CDDL HEADER in each
d9638e547d8811f2c689977f8dd2a353938b61fdmws * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d9638e547d8811f2c689977f8dd2a353938b61fdmws * If applicable, add the following below this CDDL HEADER, with the
d9638e547d8811f2c689977f8dd2a353938b61fdmws * fields enclosed by brackets "[]" replaced with your own identifying
d9638e547d8811f2c689977f8dd2a353938b61fdmws * information: Portions Copyright [yyyy] [name of copyright owner]
d9638e547d8811f2c689977f8dd2a353938b61fdmws * CDDL HEADER END
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hanson * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
d9638e547d8811f2c689977f8dd2a353938b61fdmws * Use is subject to license terms.
d9638e547d8811f2c689977f8dd2a353938b61fdmwsextern "C" {
d9638e547d8811f2c689977f8dd2a353938b61fdmwstypedef void fmd_xprt_rule_f(struct fmd_xprt_impl *, nvlist_t *);
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hansonextern fmd_xprt_rule_f fmd_xprt_event_uuresolved;
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hansonextern fmd_xprt_rule_f fmd_xprt_event_updated;
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_eventqstat_t xs_evqstat; /* statistics for xprt event queue */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_stat_t xs_module; /* module name associated with xprt */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_stat_t xs_authority; /* authority associated with xprt */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_stat_t xs_state; /* state name associated with xprt */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_stat_t xs_received; /* number of events received by xprt */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_stat_t xs_discarded; /* number of events discarded by xprt */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_stat_t xs_retried; /* number of events retried by xprt */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_stat_t xs_replayed; /* number of events replayed by xprt */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_stat_t xs_timeouts; /* number of events recv'd with ttl=0 */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_stat_t xs_subscriptions; /* number of active subscriptions */
d9638e547d8811f2c689977f8dd2a353938b61fdmws struct fmd_xprt_class *xc_next; /* next class on xi_subhash chain */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_eventq_t *xch_queue; /* associated event queue (or NULL) */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_xprt_class_t **xch_hash; /* subscription hash bucket array */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_list_t xi_list; /* linked list next/prev pointers */
d9638e547d8811f2c689977f8dd2a353938b61fdmws struct fmd_eventq *xi_queue; /* event queue for outbound events */
d9638e547d8811f2c689977f8dd2a353938b61fdmws struct fmd_thread *xi_thread; /* thread associated with transport */
d9638e547d8811f2c689977f8dd2a353938b61fdmws const fmd_xprt_rule_t *xi_state; /* rules for the current state */
d9638e547d8811f2c689977f8dd2a353938b61fdmws struct fmd_log *xi_log; /* log for received events (optional) */
d9638e547d8811f2c689977f8dd2a353938b61fdmws pthread_mutex_t xi_stats_lock; /* lock protecting xi_stats data */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_xprt_stat_t *xi_stats; /* built-in per-transport statistics */
d9638e547d8811f2c689977f8dd2a353938b61fdmws pthread_mutex_t xi_lock; /* lock for modifying members below */
d9638e547d8811f2c689977f8dd2a353938b61fdmws pthread_cond_t xi_cv; /* condition variable for xi_flags */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_xprt_class_hash_t xi_lsub; /* subscriptions in local dispq */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_xprt_class_hash_t xi_rsub; /* subscriptions in remote peer */
d9638e547d8811f2c689977f8dd2a353938b61fdmws fmd_xprt_class_hash_t xi_usub; /* pending remote unsubscriptions */
d9638e547d8811f2c689977f8dd2a353938b61fdmws * Flags for fmd_xprt_create() and xi_flags. NOTE: Any public API flags must
d9638e547d8811f2c689977f8dd2a353938b61fdmws * exactly match the corresponding definitions in <fmd_api.h>.
d9638e547d8811f2c689977f8dd2a353938b61fdmws#define FMD_XPRT_ACCEPT 0x4 /* xprt is accepting connection */
d9638e547d8811f2c689977f8dd2a353938b61fdmws#define FMD_XPRT_SUSPENDED 0x8 /* xprt is suspended by user */
d9638e547d8811f2c689977f8dd2a353938b61fdmws#define FMD_XPRT_SUBSCRIBER 0x10 /* xprt is actively subscribing */
d9638e547d8811f2c689977f8dd2a353938b61fdmws#define FMD_XPRT_ISUSPENDED 0x20 /* xprt is waiting for _fmd_init */
d9638e547d8811f2c689977f8dd2a353938b61fdmws#define FMD_XPRT_DSUSPENDED 0x40 /* xprt is suspended by fmd mechanism */
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hanson#define FMD_XPRT_EXTERNAL 0x80 /* xprt is external to a chassis */
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hanson#define FMD_XPRT_NO_REMOTE_REPAIR 0x100 /* xprt allows remote repair */
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hanson#define FMD_XPRT_CACHE_AS_LOCAL 0x200 /* xprt caches fault as if local */
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hanson#define FMD_XPRT_HCONLY 0x400 /* xprt only proxies hc-scheme faults */
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hanson#define FMD_XPRT_HC_PRESENT_ONLY 0x800 /* only locally present hc faults */
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hanson#define FMD_XPRT_CMASK /* xprt create flag mask */ \
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hanson (FMD_XPRT_RDWR | FMD_XPRT_ACCEPT | FMD_XPRT_SUSPENDED | \
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hanson FMD_XPRT_EXTERNAL | FMD_XPRT_NO_REMOTE_REPAIR | \
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hanson FMD_XPRT_CACHE_AS_LOCAL | FMD_XPRT_HCONLY | FMD_XPRT_HC_PRESENT_ONLY)
d9638e547d8811f2c689977f8dd2a353938b61fdmws (FMD_XPRT_SUSPENDED | FMD_XPRT_ISUSPENDED | FMD_XPRT_DSUSPENDED)
d9638e547d8811f2c689977f8dd2a353938b61fdmwsextern fmd_xprt_t *fmd_xprt_create(fmd_module_t *, uint_t, nvlist_t *, void *);
25351652d920ae27c5a56c199da581033ce763f6Vuong Nguyenextern void fmd_xprt_recv(fmd_xprt_t *, nvlist_t *, hrtime_t, boolean_t);
d9638e547d8811f2c689977f8dd2a353938b61fdmwsextern void fmd_xprt_uuclose(fmd_xprt_t *, const char *);
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hansonextern void fmd_xprt_uuresolved(fmd_xprt_t *, const char *);
cbf75e67acb6c32a2f4884f28a839d59f7988d37Stephen Hansonextern void fmd_xprt_updated(fmd_xprt_t *, const char *, uint8_t *, uint8_t *,
d9638e547d8811f2c689977f8dd2a353938b61fdmwsextern void fmd_xprt_subscribe(fmd_xprt_t *, const char *);
d9638e547d8811f2c689977f8dd2a353938b61fdmwsextern void fmd_xprt_unsubscribe(fmd_xprt_t *, const char *);
d9638e547d8811f2c689977f8dd2a353938b61fdmwsextern void fmd_xprt_subscribe_all(const char *);
d9638e547d8811f2c689977f8dd2a353938b61fdmwsextern void fmd_xprt_unsubscribe_all(const char *);
d9638e547d8811f2c689977f8dd2a353938b61fdmwsextern void fmd_xprt_suspend_all(void);
d9638e547d8811f2c689977f8dd2a353938b61fdmwsextern void fmd_xprt_resume_all(void);
d9638e547d8811f2c689977f8dd2a353938b61fdmws#endif /* _FMD_XPRT_H */