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