4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
28 * FMA Event Transport Module Transport Layer API implementation.
30 * Library for establishing connections and transporting FMA events between
31 * ETMs (event-transport modules) in separate fault domains.
33 * The transport for this library is internet socket based and uses the DSCP
34 * client services library (libdscp).
40 #pragma ident "%Z%%M% %I% %E% SMI"
48 #include <sys/socket.h>
57 #include "etm_xport_api.h"
59 /* Connection handle */
60 typedef struct etm_xport_sock_conn
{
61 int c_len
; /* Length of saddr */
62 int c_sd
; /* Socket descriptor */
63 struct sockaddr_in c_saddr
; /* Sockaddr for DSCP connection */
66 /* Transport instance handle */
67 typedef struct etm_xport_sock_hdl
{
68 exs_conn_t h_client
; /* Sending connection handle */
69 exs_conn_t h_server
; /* Receiving connection handle */
70 pthread_t h_tid
; /* Thread ID of server thread */
71 int h_destroy
; /* Destroy the server thread? */
72 char *h_endpt_id
; /* Endpoint id from ETM common */
73 int h_dom
; /* Domain ID from platform (libdscp) */
74 fmd_hdl_t
*h_hdl
; /* fmd handle */
75 int (*h_cb_func
)(fmd_hdl_t
*, etm_xport_conn_t
, etm_cb_flag_t
, void *);
76 /* Callback function for ETM common */
77 void *h_cb_func_arg
; /* Arg to pass when calling h_cb_func */
78 int h_quit
; /* Signal to quit */
79 struct etm_xport_sock_hdl
*h_next
;
82 #define EXS_SERVER_PORT 24 /* Port number for server */
83 #define EXS_SERVER_ADDR in6addr_any /* Address for server */
84 #define EXS_CLIENT_PORT 12 /* Port number for client */
85 #define EXS_NUM_SOCKS 24 /* Length of socket queue */
86 #define EXS_SD_FREE -1 /* Socket descr value when unset */
87 #define EXS_TID_FREE 0 /* Thread ID value when unset */
88 #define EXS_DOMAIN_PREFIX "dom" /* Domain auth prefix in FMRI string */
89 #define EXS_DOMAIN_PREFIX_LEN 3 /* Length of domain prefix */
90 #define EXS_SP_PREFIX "sp" /* SP auth prefix in FMRI string */
91 #define EXS_IO_SLEEP_DIV 100 /* Divisor for I/O sleeptime */
93 #define EXS_CLOSE_CLR(x) { (void) close(x.c_sd); x.c_sd = EXS_SD_FREE; }
99 #endif /* _EX_DSCP_H */