xref: /titanic_50/usr/src/cmd/dcs/sparc/sun4u/rdr_messages.h (revision fa9e4066f08beec538e775443c5be79dd423fcab)
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 (c) 2000 by Sun Microsystems, Inc.
24  * All rights reserved.
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 #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