xref: /onnv-gate/usr/src/cmd/dcs/sparc/sun4u/rdr_messages.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright (c) 2000 by Sun Microsystems, Inc.
24*0Sstevel@tonic-gate  * All rights reserved.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #ifndef _RDR_MESSAGES_H
28*0Sstevel@tonic-gate #define	_RDR_MESSAGES_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate /*
33*0Sstevel@tonic-gate  * WARNING: The contents of this file are shared by all projects
34*0Sstevel@tonic-gate  * that  wish to  perform  remote  Dynamic Reconfiguration  (DR)
35*0Sstevel@tonic-gate  * operations. Copies of this file can be found in the following
36*0Sstevel@tonic-gate  * locations:
37*0Sstevel@tonic-gate  *
38*0Sstevel@tonic-gate  *	Project	    Location
39*0Sstevel@tonic-gate  *	-------	    --------
40*0Sstevel@tonic-gate  *	Solaris	    usr/src/cmd/dcs/sparc/sun4u/%M%
41*0Sstevel@tonic-gate  *	SMS	    src/sms/lib/librdr/%M%
42*0Sstevel@tonic-gate  *
43*0Sstevel@tonic-gate  * In order for proper communication to occur,  the files in the
44*0Sstevel@tonic-gate  * above locations must match exactly. Any changes that are made
45*0Sstevel@tonic-gate  * to this file should  be made to all of the files in the list.
46*0Sstevel@tonic-gate  */
47*0Sstevel@tonic-gate 
48*0Sstevel@tonic-gate /*
49*0Sstevel@tonic-gate  * This file is the interface to the Remote DR (RDR) module. It
50*0Sstevel@tonic-gate  * contains prototypes for all relevant network operations such
51*0Sstevel@tonic-gate  * as establishing a connection, sending and receiving messages,
52*0Sstevel@tonic-gate  * and closing a connection. Also contained is an enumeration of
53*0Sstevel@tonic-gate  * the error codes returned by these functions.
54*0Sstevel@tonic-gate  */
55*0Sstevel@tonic-gate 
56*0Sstevel@tonic-gate #ifdef __cplusplus
57*0Sstevel@tonic-gate extern "C" {
58*0Sstevel@tonic-gate #endif
59*0Sstevel@tonic-gate 
60*0Sstevel@tonic-gate #include <sys/socket.h>
61*0Sstevel@tonic-gate 
62*0Sstevel@tonic-gate /*
63*0Sstevel@tonic-gate  * The DCA and DCS link this module in different ways. Because
64*0Sstevel@tonic-gate  * of this, they each expect to find the headers in different
65*0Sstevel@tonic-gate  * places. SMSLIB_TARGET will be defined for the DCA.
66*0Sstevel@tonic-gate  */
67*0Sstevel@tonic-gate #ifdef SMSLIB_TARGET
68*0Sstevel@tonic-gate 
69*0Sstevel@tonic-gate #include <librdr/remote_cfg.h>
70*0Sstevel@tonic-gate #include <librdr/rdr_param_types.h>
71*0Sstevel@tonic-gate #include <libscri/rsrc_info.h>
72*0Sstevel@tonic-gate 
73*0Sstevel@tonic-gate #else /* SMSLIB_TARGET */
74*0Sstevel@tonic-gate 
75*0Sstevel@tonic-gate #include "remote_cfg.h"
76*0Sstevel@tonic-gate #include "rdr_param_types.h"
77*0Sstevel@tonic-gate #include "rsrc_info.h"
78*0Sstevel@tonic-gate 
79*0Sstevel@tonic-gate #endif /* SMSLIB_TARGET */
80*0Sstevel@tonic-gate 
81*0Sstevel@tonic-gate 
82*0Sstevel@tonic-gate int rdr_open(int family);
83*0Sstevel@tonic-gate 
84*0Sstevel@tonic-gate int rdr_init(int fd, struct sockaddr *addr, int *opts, int num_opts, int blog);
85*0Sstevel@tonic-gate 
86*0Sstevel@tonic-gate int rdr_connect_clnt(int fd, struct sockaddr *addr);
87*0Sstevel@tonic-gate 
88*0Sstevel@tonic-gate int rdr_connect_srv(int fd);
89*0Sstevel@tonic-gate 
90*0Sstevel@tonic-gate int rdr_reject(int fd);
91*0Sstevel@tonic-gate 
92*0Sstevel@tonic-gate int rdr_close(int fd);
93*0Sstevel@tonic-gate 
94*0Sstevel@tonic-gate int rdr_snd_msg(int fd, rdr_msg_hdr_t *hdr, cfga_params_t *param, int timeout);
95*0Sstevel@tonic-gate 
96*0Sstevel@tonic-gate int rdr_rcv_msg(int fd, rdr_msg_hdr_t *hdr, cfga_params_t *param, int timeout);
97*0Sstevel@tonic-gate 
98*0Sstevel@tonic-gate int rdr_cleanup_params(rdr_msg_opcode_t message_opcode, cfga_params_t *param);
99*0Sstevel@tonic-gate 
100*0Sstevel@tonic-gate 
101*0Sstevel@tonic-gate /*
102*0Sstevel@tonic-gate  * Return values for the RDR public functions. They
103*0Sstevel@tonic-gate  * are offset to prevent overlapping with DCS error
104*0Sstevel@tonic-gate  * codes, libcfgadm error codes, and DCA error codes.
105*0Sstevel@tonic-gate  */
106*0Sstevel@tonic-gate typedef enum {
107*0Sstevel@tonic-gate 	RDR_OK,
108*0Sstevel@tonic-gate 	RDR_ERROR = 500,
109*0Sstevel@tonic-gate 	RDR_NET_ERR,
110*0Sstevel@tonic-gate 	RDR_TIMEOUT,
111*0Sstevel@tonic-gate 	RDR_ABORTED,
112*0Sstevel@tonic-gate 	RDR_DISCONNECT,
113*0Sstevel@tonic-gate 	RDR_MSG_INVAL,
114*0Sstevel@tonic-gate 	RDR_MEM_ALLOC
115*0Sstevel@tonic-gate } rdr_err_t;
116*0Sstevel@tonic-gate 
117*0Sstevel@tonic-gate 
118*0Sstevel@tonic-gate #ifdef __cplusplus
119*0Sstevel@tonic-gate }
120*0Sstevel@tonic-gate #endif
121*0Sstevel@tonic-gate 
122*0Sstevel@tonic-gate #endif /* _RDR_MESSAGES_H */
123