17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 23*2eaee53eSmb158278 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24*2eaee53eSmb158278 * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef _RDR_MESSAGES_H 287c478bd9Sstevel@tonic-gate #define _RDR_MESSAGES_H 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate /* 337c478bd9Sstevel@tonic-gate * WARNING: The contents of this file are shared by all projects 347c478bd9Sstevel@tonic-gate * that wish to perform remote Dynamic Reconfiguration (DR) 357c478bd9Sstevel@tonic-gate * operations. Copies of this file can be found in the following 367c478bd9Sstevel@tonic-gate * locations: 377c478bd9Sstevel@tonic-gate * 387c478bd9Sstevel@tonic-gate * Project Location 397c478bd9Sstevel@tonic-gate * ------- -------- 407c478bd9Sstevel@tonic-gate * Solaris usr/src/cmd/dcs/sparc/sun4u/%M% 417c478bd9Sstevel@tonic-gate * SMS src/sms/lib/librdr/%M% 427c478bd9Sstevel@tonic-gate * 437c478bd9Sstevel@tonic-gate * In order for proper communication to occur, the files in the 447c478bd9Sstevel@tonic-gate * above locations must match exactly. Any changes that are made 457c478bd9Sstevel@tonic-gate * to this file should be made to all of the files in the list. 467c478bd9Sstevel@tonic-gate */ 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate /* 497c478bd9Sstevel@tonic-gate * This file is the interface to the Remote DR (RDR) module. It 507c478bd9Sstevel@tonic-gate * contains prototypes for all relevant network operations such 517c478bd9Sstevel@tonic-gate * as establishing a connection, sending and receiving messages, 527c478bd9Sstevel@tonic-gate * and closing a connection. Also contained is an enumeration of 537c478bd9Sstevel@tonic-gate * the error codes returned by these functions. 547c478bd9Sstevel@tonic-gate */ 557c478bd9Sstevel@tonic-gate 567c478bd9Sstevel@tonic-gate #ifdef __cplusplus 577c478bd9Sstevel@tonic-gate extern "C" { 587c478bd9Sstevel@tonic-gate #endif 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate #include <sys/socket.h> 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gate /* 637c478bd9Sstevel@tonic-gate * The DCA and DCS link this module in different ways. Because 647c478bd9Sstevel@tonic-gate * of this, they each expect to find the headers in different 657c478bd9Sstevel@tonic-gate * places. SMSLIB_TARGET will be defined for the DCA. 667c478bd9Sstevel@tonic-gate */ 677c478bd9Sstevel@tonic-gate #ifdef SMSLIB_TARGET 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate #include <librdr/remote_cfg.h> 707c478bd9Sstevel@tonic-gate #include <librdr/rdr_param_types.h> 717c478bd9Sstevel@tonic-gate #include <libscri/rsrc_info.h> 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gate #else /* SMSLIB_TARGET */ 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gate #include "remote_cfg.h" 767c478bd9Sstevel@tonic-gate #include "rdr_param_types.h" 777c478bd9Sstevel@tonic-gate #include "rsrc_info.h" 787c478bd9Sstevel@tonic-gate 79*2eaee53eSmb158278 int rdr_setsockopt(int fd, int level, int optname, const void *optval, 80*2eaee53eSmb158278 int optlen); 817c478bd9Sstevel@tonic-gate #endif /* SMSLIB_TARGET */ 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gate int rdr_open(int family); 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate int rdr_init(int fd, struct sockaddr *addr, int *opts, int num_opts, int blog); 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate int rdr_connect_clnt(int fd, struct sockaddr *addr); 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate int rdr_connect_srv(int fd); 917c478bd9Sstevel@tonic-gate 927c478bd9Sstevel@tonic-gate int rdr_reject(int fd); 937c478bd9Sstevel@tonic-gate 947c478bd9Sstevel@tonic-gate int rdr_close(int fd); 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate int rdr_snd_msg(int fd, rdr_msg_hdr_t *hdr, cfga_params_t *param, int timeout); 977c478bd9Sstevel@tonic-gate 987c478bd9Sstevel@tonic-gate int rdr_rcv_msg(int fd, rdr_msg_hdr_t *hdr, cfga_params_t *param, int timeout); 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate int rdr_cleanup_params(rdr_msg_opcode_t message_opcode, cfga_params_t *param); 1017c478bd9Sstevel@tonic-gate 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gate /* 1047c478bd9Sstevel@tonic-gate * Return values for the RDR public functions. They 1057c478bd9Sstevel@tonic-gate * are offset to prevent overlapping with DCS error 1067c478bd9Sstevel@tonic-gate * codes, libcfgadm error codes, and DCA error codes. 1077c478bd9Sstevel@tonic-gate */ 1087c478bd9Sstevel@tonic-gate typedef enum { 1097c478bd9Sstevel@tonic-gate RDR_OK, 1107c478bd9Sstevel@tonic-gate RDR_ERROR = 500, 1117c478bd9Sstevel@tonic-gate RDR_NET_ERR, 1127c478bd9Sstevel@tonic-gate RDR_TIMEOUT, 1137c478bd9Sstevel@tonic-gate RDR_ABORTED, 1147c478bd9Sstevel@tonic-gate RDR_DISCONNECT, 1157c478bd9Sstevel@tonic-gate RDR_MSG_INVAL, 1167c478bd9Sstevel@tonic-gate RDR_MEM_ALLOC 1177c478bd9Sstevel@tonic-gate } rdr_err_t; 1187c478bd9Sstevel@tonic-gate 1197c478bd9Sstevel@tonic-gate 1207c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1217c478bd9Sstevel@tonic-gate } 1227c478bd9Sstevel@tonic-gate #endif 1237c478bd9Sstevel@tonic-gate 1247c478bd9Sstevel@tonic-gate #endif /* _RDR_MESSAGES_H */ 125