xref: /onnv-gate/usr/src/cmd/dcs/sparc/sun4u/rdr_messages.h (revision 1120:f038ea42ae91)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
23*1120Smb158278  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*1120Smb158278  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef _RDR_MESSAGES_H
280Sstevel@tonic-gate #define	_RDR_MESSAGES_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
310Sstevel@tonic-gate 
320Sstevel@tonic-gate /*
330Sstevel@tonic-gate  * WARNING: The contents of this file are shared by all projects
340Sstevel@tonic-gate  * that  wish to  perform  remote  Dynamic Reconfiguration  (DR)
350Sstevel@tonic-gate  * operations. Copies of this file can be found in the following
360Sstevel@tonic-gate  * locations:
370Sstevel@tonic-gate  *
380Sstevel@tonic-gate  *	Project	    Location
390Sstevel@tonic-gate  *	-------	    --------
400Sstevel@tonic-gate  *	Solaris	    usr/src/cmd/dcs/sparc/sun4u/%M%
410Sstevel@tonic-gate  *	SMS	    src/sms/lib/librdr/%M%
420Sstevel@tonic-gate  *
430Sstevel@tonic-gate  * In order for proper communication to occur,  the files in the
440Sstevel@tonic-gate  * above locations must match exactly. Any changes that are made
450Sstevel@tonic-gate  * to this file should  be made to all of the files in the list.
460Sstevel@tonic-gate  */
470Sstevel@tonic-gate 
480Sstevel@tonic-gate /*
490Sstevel@tonic-gate  * This file is the interface to the Remote DR (RDR) module. It
500Sstevel@tonic-gate  * contains prototypes for all relevant network operations such
510Sstevel@tonic-gate  * as establishing a connection, sending and receiving messages,
520Sstevel@tonic-gate  * and closing a connection. Also contained is an enumeration of
530Sstevel@tonic-gate  * the error codes returned by these functions.
540Sstevel@tonic-gate  */
550Sstevel@tonic-gate 
560Sstevel@tonic-gate #ifdef __cplusplus
570Sstevel@tonic-gate extern "C" {
580Sstevel@tonic-gate #endif
590Sstevel@tonic-gate 
600Sstevel@tonic-gate #include <sys/socket.h>
610Sstevel@tonic-gate 
620Sstevel@tonic-gate /*
630Sstevel@tonic-gate  * The DCA and DCS link this module in different ways. Because
640Sstevel@tonic-gate  * of this, they each expect to find the headers in different
650Sstevel@tonic-gate  * places. SMSLIB_TARGET will be defined for the DCA.
660Sstevel@tonic-gate  */
670Sstevel@tonic-gate #ifdef SMSLIB_TARGET
680Sstevel@tonic-gate 
690Sstevel@tonic-gate #include <librdr/remote_cfg.h>
700Sstevel@tonic-gate #include <librdr/rdr_param_types.h>
710Sstevel@tonic-gate #include <libscri/rsrc_info.h>
720Sstevel@tonic-gate 
730Sstevel@tonic-gate #else /* SMSLIB_TARGET */
740Sstevel@tonic-gate 
750Sstevel@tonic-gate #include "remote_cfg.h"
760Sstevel@tonic-gate #include "rdr_param_types.h"
770Sstevel@tonic-gate #include "rsrc_info.h"
780Sstevel@tonic-gate 
79*1120Smb158278 int rdr_setsockopt(int fd, int level, int optname, const void *optval,
80*1120Smb158278     int optlen);
810Sstevel@tonic-gate #endif /* SMSLIB_TARGET */
820Sstevel@tonic-gate 
830Sstevel@tonic-gate 
840Sstevel@tonic-gate int rdr_open(int family);
850Sstevel@tonic-gate 
860Sstevel@tonic-gate int rdr_init(int fd, struct sockaddr *addr, int *opts, int num_opts, int blog);
870Sstevel@tonic-gate 
880Sstevel@tonic-gate int rdr_connect_clnt(int fd, struct sockaddr *addr);
890Sstevel@tonic-gate 
900Sstevel@tonic-gate int rdr_connect_srv(int fd);
910Sstevel@tonic-gate 
920Sstevel@tonic-gate int rdr_reject(int fd);
930Sstevel@tonic-gate 
940Sstevel@tonic-gate int rdr_close(int fd);
950Sstevel@tonic-gate 
960Sstevel@tonic-gate int rdr_snd_msg(int fd, rdr_msg_hdr_t *hdr, cfga_params_t *param, int timeout);
970Sstevel@tonic-gate 
980Sstevel@tonic-gate int rdr_rcv_msg(int fd, rdr_msg_hdr_t *hdr, cfga_params_t *param, int timeout);
990Sstevel@tonic-gate 
1000Sstevel@tonic-gate int rdr_cleanup_params(rdr_msg_opcode_t message_opcode, cfga_params_t *param);
1010Sstevel@tonic-gate 
1020Sstevel@tonic-gate 
1030Sstevel@tonic-gate /*
1040Sstevel@tonic-gate  * Return values for the RDR public functions. They
1050Sstevel@tonic-gate  * are offset to prevent overlapping with DCS error
1060Sstevel@tonic-gate  * codes, libcfgadm error codes, and DCA error codes.
1070Sstevel@tonic-gate  */
1080Sstevel@tonic-gate typedef enum {
1090Sstevel@tonic-gate 	RDR_OK,
1100Sstevel@tonic-gate 	RDR_ERROR = 500,
1110Sstevel@tonic-gate 	RDR_NET_ERR,
1120Sstevel@tonic-gate 	RDR_TIMEOUT,
1130Sstevel@tonic-gate 	RDR_ABORTED,
1140Sstevel@tonic-gate 	RDR_DISCONNECT,
1150Sstevel@tonic-gate 	RDR_MSG_INVAL,
1160Sstevel@tonic-gate 	RDR_MEM_ALLOC
1170Sstevel@tonic-gate } rdr_err_t;
1180Sstevel@tonic-gate 
1190Sstevel@tonic-gate 
1200Sstevel@tonic-gate #ifdef __cplusplus
1210Sstevel@tonic-gate }
1220Sstevel@tonic-gate #endif
1230Sstevel@tonic-gate 
1240Sstevel@tonic-gate #endif /* _RDR_MESSAGES_H */
125