2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A/*
2N/A * rad protocol definitions
2N/A *
2N/A * We don't use straight RPC since we have additional requirements:
2N/A * - We need multiple outstanding requests that get distinct results
2N/A * - We need asynchronous notifications
2N/A *
2N/A * At the same time, we can make things simpler. Which is good because
2N/A * Java doesn't have an RPC client.
2N/A */
2N/A
2N/A/*
2N/A * We programmatically impose an limit on the request size, but it is
2N/A * still possible for the XDR-encoded content of a request to deny
2N/A * service by specifying string, array, or opaque sizes that don't
2N/A * match the actual amount of data sent.
2N/A *
2N/A * Solaris's xdr_string implementation protects us from XDR strings
2N/A * with exaggerated sizes. Unfortunately xdr_bytes and xdr_array do
2N/A * not. So that we can safely use rpcgen to implement our protocol,
2N/A * we enforce the following limits on our non-string variable-length
2N/A * quanities.
2N/A */
2N/Aconst MAXARGS = 16;
2N/Aconst MAXARGLEN = 16336;
2N/A
2N/A/*
2N/A * Request definitions
2N/A */
2N/A
2N/Astruct wiretime {
2N/A hyper seconds;
2N/A int nanos;
2N/A};
2N/A
2N/Atypedef string objectname<>;
2N/A
2N/Atypedef opaque argument<MAXARGLEN>;
2N/A
2N/Astruct op_invoke {
2N/A hyper id;
2N/A string mname<>;
2N/A argument args<MAXARGS>;
2N/A};
2N/A
2N/Astruct resp_invoke {
2N/A argument result;
2N/A};
2N/A
2N/A
2N/Astruct op_getattr {
2N/A hyper id;
2N/A string attribute<>;
2N/A};
2N/A
2N/Astruct resp_getattr {
2N/A argument result;
2N/A};
2N/A
2N/A
2N/Astruct op_setattr {
2N/A hyper id;
2N/A string attribute<>;
2N/A argument value;
2N/A};
2N/A
2N/A/*
2N/Astruct resp_setattr {
2N/A};
2N/A*/
2N/A
2N/Astruct op_lookup {
2N/A objectname name;
2N/A bool describe;
2N/A};
2N/A
2N/A/* Not actually used; see xdr_object_t & datatype.x */
2N/A/*
2N/Astruct resp_lookup {
2N/A hyper objectid;
2N/A hyper typeid;
2N/A bool isdefined;
2N/A ( if isdefined, definition )
2N/A};
2N/A*/
2N/A
2N/Astruct op_define {
2N/A hyper id;
2N/A};
2N/A
2N/A/* Not actually used; see xdr_object_t & datatype.x */
2N/A/*
2N/Astruct resp_define {
2N/A ( definition )
2N/A};
2N/A*/
2N/A
2N/Astruct op_list {
2N/A objectname pattern;
2N/A};
2N/A
2N/Astruct resp_list {
2N/A objectname objects<>;
2N/A};
2N/A
2N/A
2N/Astruct op_subscribe {
2N/A hyper id;
2N/A string event<>;
2N/A};
2N/A
2N/A/* resp_subscribe {}; */
2N/A
2N/A
2N/Astruct op_unsubscribe {
2N/A hyper id;
2N/A string event<>;
2N/A};
2N/A
2N/A/* resp_unsubscribe {}; */
2N/A
2N/A/*
2N/A * Request/response protocol
2N/A */
2N/Astruct server_hello {
2N/A string protocol<3>; /* Protocol name, "RAD" */
2N/A int min_ver; /* Minimum supported version */
2N/A int max_ver; /* Maximum supported version */
2N/A};
2N/A
2N/Astruct client_hello {
2N/A string protocol<3>; /* Protocol name, "RAD" */
2N/A int ver; /* Selected version */
2N/A string locale<256>; /* Client locale */
2N/A};
2N/A
2N/A/* Container operations */
2N/Aenum operation {
2N/A INVOKE,
2N/A GETATTR,
2N/A SETATTR,
2N/A LOOKUP,
2N/A DEFINE,
2N/A LIST,
2N/A SUB,
2N/A UNSUB
2N/A};
2N/A
2N/Astruct request {
2N/A hyper serial;
2N/A operation op;
2N/A opaque payload<>;
2N/A};
2N/A
2N/Astruct fault {
2N/A opaque payload<>;
2N/A};
2N/A
2N/Astruct response_data {
2N/A int error;
2N/A opaque payload<>;
2N/A};
2N/A
2N/Astruct event_data {
2N/A hyper source;
2N/A hyper sequence;
2N/A wiretime timestamp; /* Seconds, nanoseconds since Epoch */
2N/A string type<>;
2N/A opaque payload<>;
2N/A};
2N/A
2N/Aunion message switch (hyper serial) {
2N/Acase 0:
2N/A event_data edata;
2N/Adefault:
2N/A response_data rdata;
2N/A};