xref: /titanic_41/usr/src/cmd/dcs/sparc/sun4u/rdr_messages.h (revision 66f9d5cb3cc0652e2d9d1366fb950efbe4ca2f24)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * WARNING: The contents of this file are shared by all projects
34  * that  wish to  perform  remote  Dynamic Reconfiguration  (DR)
35  * operations. Copies of this file can be found in the following
36  * locations:
37  *
38  *	Project	    Location
39  *	-------	    --------
40  *	Solaris	    usr/src/cmd/dcs/sparc/sun4u/%M%
41  *	SMS	    src/sms/lib/librdr/%M%
42  *
43  * In order for proper communication to occur,  the files in the
44  * above locations must match exactly. Any changes that are made
45  * to this file should  be made to all of the files in the list.
46  */
47 
48 /*
49  * This file is the interface to the Remote DR (RDR) module. It
50  * contains prototypes for all relevant network operations such
51  * as establishing a connection, sending and receiving messages,
52  * and closing a connection. Also contained is an enumeration of
53  * the error codes returned by these functions.
54  */
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 #include <sys/socket.h>
61 
62 /*
63  * The DCA and DCS link this module in different ways. Because
64  * of this, they each expect to find the headers in different
65  * places. SMSLIB_TARGET will be defined for the DCA.
66  */
67 #ifdef SMSLIB_TARGET
68 
69 #include <librdr/remote_cfg.h>
70 #include <librdr/rdr_param_types.h>
71 #include <libscri/rsrc_info.h>
72 
73 #else /* SMSLIB_TARGET */
74 
75 #include "remote_cfg.h"
76 #include "rdr_param_types.h"
77 #include "rsrc_info.h"
78 
79 int rdr_setsockopt(int fd, int level, int optname, const void *optval,
80     int optlen);
81 #endif /* SMSLIB_TARGET */
82 
83 
84 int rdr_open(int family);
85 
86 int rdr_init(int fd, struct sockaddr *addr, int *opts, int num_opts, int blog);
87 
88 int rdr_connect_clnt(int fd, struct sockaddr *addr);
89 
90 int rdr_connect_srv(int fd);
91 
92 int rdr_reject(int fd);
93 
94 int rdr_close(int fd);
95 
96 int rdr_snd_msg(int fd, rdr_msg_hdr_t *hdr, cfga_params_t *param, int timeout);
97 
98 int rdr_rcv_msg(int fd, rdr_msg_hdr_t *hdr, cfga_params_t *param, int timeout);
99 
100 int rdr_cleanup_params(rdr_msg_opcode_t message_opcode, cfga_params_t *param);
101 
102 
103 /*
104  * Return values for the RDR public functions. They
105  * are offset to prevent overlapping with DCS error
106  * codes, libcfgadm error codes, and DCA error codes.
107  */
108 typedef enum {
109 	RDR_OK,
110 	RDR_ERROR = 500,
111 	RDR_NET_ERR,
112 	RDR_TIMEOUT,
113 	RDR_ABORTED,
114 	RDR_DISCONNECT,
115 	RDR_MSG_INVAL,
116 	RDR_MEM_ALLOC
117 } rdr_err_t;
118 
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif /* _RDR_MESSAGES_H */
125