1259117Shrs/*- 2259117Shrs * Copyright (c) 2010, Oracle America, Inc. 3259117Shrs * 4259117Shrs * Redistribution and use in source and binary forms, with or without 5259117Shrs * modification, are permitted provided that the following conditions are 6259117Shrs * met: 7259117Shrs * 8259117Shrs * * Redistributions of source code must retain the above copyright 9259117Shrs * notice, this list of conditions and the following disclaimer. 10259117Shrs * * Redistributions in binary form must reproduce the above 11259117Shrs * copyright notice, this list of conditions and the following 12259117Shrs * disclaimer in the documentation and/or other materials 13259117Shrs * provided with the distribution. 14259117Shrs * * Neither the name of the "Oracle America, Inc." nor the names of its 15259117Shrs * contributors may be used to endorse or promote products derived 16259117Shrs * from this software without specific prior written permission. 17259117Shrs * 18259117Shrs * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19259117Shrs * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20259117Shrs * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21259117Shrs * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22259117Shrs * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 23259117Shrs * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24259117Shrs * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 25259117Shrs * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26259117Shrs * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27259117Shrs * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28259117Shrs * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29259117Shrs * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 301832Swollman */ 311832Swollman 321832Swollman/* 331832Swollman * RPC for bootparms service. 341832Swollman * There are two procedures: 351832Swollman * WHOAMI takes a net address and returns a client name and also a 361832Swollman * likely net address for routing 371832Swollman * GETFILE takes a client name and file identifier and returns the 381832Swollman * server name, server net address and pathname for the file. 391832Swollman * file identifiers typically include root, swap, pub and dump 401832Swollman */ 411832Swollman 421832Swollman#ifdef RPC_HDR 431832Swollman%#include <rpc/types.h> 441832Swollman%#include <sys/time.h> 451832Swollman%#include <sys/errno.h> 466747Swpaul%#include <sys/param.h> 476747Swpaul%#include <sys/syslimits.h> 481832Swollman#else 491832Swollman%#ifndef lint 501832Swollman%/*static char sccsid[] = "from: @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro";*/ 511832Swollman%/*static char sccsid[] = "from: @(#)bootparam_prot.x 2.1 88/08/01 4.0 RPCSRC";*/ 521832Swollman%#endif /* not lint */ 53114629Sobrien%#include <sys/cdefs.h> 54114629Sobrien%__FBSDID("$FreeBSD: releng/11.0/include/rpcsvc/bootparam_prot.x 259117 2013-12-09 04:26:50Z hrs $"); 551832Swollman#endif 561832Swollman 571832Swollmanconst MAX_MACHINE_NAME = 255; 581832Swollmanconst MAX_PATH_LEN = 1024; 591832Swollmanconst MAX_FILEID = 32; 601832Swollmanconst IP_ADDR_TYPE = 1; 611832Swollman 621832Swollmantypedef string bp_machine_name_t<MAX_MACHINE_NAME>; 631832Swollmantypedef string bp_path_t<MAX_PATH_LEN>; 641832Swollmantypedef string bp_fileid_t<MAX_FILEID>; 651832Swollman 661832Swollmanstruct ip_addr_t { 671832Swollman char net; 681832Swollman char host; 691832Swollman char lh; 701832Swollman char impno; 711832Swollman}; 721832Swollman 731832Swollmanunion bp_address switch (int address_type) { 741832Swollman case IP_ADDR_TYPE: 751832Swollman ip_addr_t ip_addr; 761832Swollman}; 771832Swollman 781832Swollmanstruct bp_whoami_arg { 791832Swollman bp_address client_address; 801832Swollman}; 811832Swollman 821832Swollmanstruct bp_whoami_res { 831832Swollman bp_machine_name_t client_name; 841832Swollman bp_machine_name_t domain_name; 851832Swollman bp_address router_address; 861832Swollman}; 871832Swollman 881832Swollmanstruct bp_getfile_arg { 891832Swollman bp_machine_name_t client_name; 901832Swollman bp_fileid_t file_id; 911832Swollman}; 921832Swollman 931832Swollmanstruct bp_getfile_res { 941832Swollman bp_machine_name_t server_name; 951832Swollman bp_address server_address; 961832Swollman bp_path_t server_path; 971832Swollman}; 981832Swollman 991832Swollmanprogram BOOTPARAMPROG { 1001832Swollman version BOOTPARAMVERS { 1011832Swollman bp_whoami_res BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1; 1021832Swollman bp_getfile_res BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2; 1031832Swollman } = 1; 1041832Swollman} = 100026; 105