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*2eaee53eSmb * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24*2eaee53eSmb * 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 /* 317c478bd9Sstevel@tonic-gate * WARNING: The contents of this file are shared by all projects 327c478bd9Sstevel@tonic-gate * that wish to perform remote Dynamic Reconfiguration (DR) 337c478bd9Sstevel@tonic-gate * operations. Copies of this file can be found in the following 347c478bd9Sstevel@tonic-gate * locations: 357c478bd9Sstevel@tonic-gate * 367c478bd9Sstevel@tonic-gate * Project Location 377c478bd9Sstevel@tonic-gate * ------- -------- 387c478bd9Sstevel@tonic-gate * Solaris usr/src/cmd/dcs/sparc/sun4u/%M% 397c478bd9Sstevel@tonic-gate * SMS src/sms/lib/librdr/%M% 407c478bd9Sstevel@tonic-gate * 417c478bd9Sstevel@tonic-gate * In order for proper communication to occur, the files in the 427c478bd9Sstevel@tonic-gate * above locations must match exactly. Any changes that are made 437c478bd9Sstevel@tonic-gate * to this file should be made to all of the files in the list. 447c478bd9Sstevel@tonic-gate */ 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gate /* 477c478bd9Sstevel@tonic-gate * This file is the interface to the Remote DR (RDR) module. It 487c478bd9Sstevel@tonic-gate * contains prototypes for all relevant network operations such 497c478bd9Sstevel@tonic-gate * as establishing a connection, sending and receiving messages, 507c478bd9Sstevel@tonic-gate * and closing a connection. Also contained is an enumeration of 517c478bd9Sstevel@tonic-gate * the error codes returned by these functions. 527c478bd9Sstevel@tonic-gate */ 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate #ifdef __cplusplus 557c478bd9Sstevel@tonic-gate extern "C" { 567c478bd9Sstevel@tonic-gate #endif 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gate #include <sys/socket.h> 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate /* 617c478bd9Sstevel@tonic-gate * The DCA and DCS link this module in different ways. Because 627c478bd9Sstevel@tonic-gate * of this, they each expect to find the headers in different 637c478bd9Sstevel@tonic-gate * places. SMSLIB_TARGET will be defined for the DCA. 647c478bd9Sstevel@tonic-gate */ 657c478bd9Sstevel@tonic-gate #ifdef SMSLIB_TARGET 667c478bd9Sstevel@tonic-gate 677c478bd9Sstevel@tonic-gate #include <librdr/remote_cfg.h> 687c478bd9Sstevel@tonic-gate #include <librdr/rdr_param_types.h> 697c478bd9Sstevel@tonic-gate #include <libscri/rsrc_info.h> 707c478bd9Sstevel@tonic-gate 717c478bd9Sstevel@tonic-gate #else /* SMSLIB_TARGET */ 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gate #include "remote_cfg.h" 747c478bd9Sstevel@tonic-gate #include "rdr_param_types.h" 757c478bd9Sstevel@tonic-gate #include "rsrc_info.h" 767c478bd9Sstevel@tonic-gate 77*2eaee53eSmb int rdr_setsockopt(int fd, int level, int optname, const void *optval, 78*2eaee53eSmb int optlen); 797c478bd9Sstevel@tonic-gate #endif /* SMSLIB_TARGET */ 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate int rdr_open(int family); 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gate int rdr_init(int fd, struct sockaddr *addr, int *opts, int num_opts, int blog); 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate int rdr_connect_clnt(int fd, struct sockaddr *addr); 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate int rdr_connect_srv(int fd); 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate int rdr_reject(int fd); 917c478bd9Sstevel@tonic-gate 927c478bd9Sstevel@tonic-gate int rdr_close(int fd); 937c478bd9Sstevel@tonic-gate 947c478bd9Sstevel@tonic-gate int rdr_snd_msg(int fd, rdr_msg_hdr_t *hdr, cfga_params_t *param, int timeout); 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate int rdr_rcv_msg(int fd, rdr_msg_hdr_t *hdr, cfga_params_t *param, int timeout); 977c478bd9Sstevel@tonic-gate 987c478bd9Sstevel@tonic-gate int rdr_cleanup_params(rdr_msg_opcode_t message_opcode, cfga_params_t *param); 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gate /* 1027c478bd9Sstevel@tonic-gate * Return values for the RDR public functions. They 1037c478bd9Sstevel@tonic-gate * are offset to prevent overlapping with DCS error 1047c478bd9Sstevel@tonic-gate * codes, libcfgadm error codes, and DCA error codes. 1057c478bd9Sstevel@tonic-gate */ 1067c478bd9Sstevel@tonic-gate typedef enum { 1077c478bd9Sstevel@tonic-gate RDR_OK, 1087c478bd9Sstevel@tonic-gate RDR_ERROR = 500, 1097c478bd9Sstevel@tonic-gate RDR_NET_ERR, 1107c478bd9Sstevel@tonic-gate RDR_TIMEOUT, 1117c478bd9Sstevel@tonic-gate RDR_ABORTED, 1127c478bd9Sstevel@tonic-gate RDR_DISCONNECT, 1137c478bd9Sstevel@tonic-gate RDR_MSG_INVAL, 1147c478bd9Sstevel@tonic-gate RDR_MEM_ALLOC 1157c478bd9Sstevel@tonic-gate } rdr_err_t; 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gate 1187c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1197c478bd9Sstevel@tonic-gate } 1207c478bd9Sstevel@tonic-gate #endif 1217c478bd9Sstevel@tonic-gate 1227c478bd9Sstevel@tonic-gate #endif /* _RDR_MESSAGES_H */ 123