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