bootparam_prot.x revision 272850
1272850Shrs/*- 2272850Shrs * Copyright (c) 2010, Oracle America, Inc. 3272850Shrs * 4272850Shrs * Redistribution and use in source and binary forms, with or without 5272850Shrs * modification, are permitted provided that the following conditions are 6272850Shrs * met: 7272850Shrs * 8272850Shrs * * Redistributions of source code must retain the above copyright 9272850Shrs * notice, this list of conditions and the following disclaimer. 10272850Shrs * * Redistributions in binary form must reproduce the above 11272850Shrs * copyright notice, this list of conditions and the following 12272850Shrs * disclaimer in the documentation and/or other materials 13272850Shrs * provided with the distribution. 14272850Shrs * * Neither the name of the "Oracle America, Inc." nor the names of its 15272850Shrs * contributors may be used to endorse or promote products derived 16272850Shrs * from this software without specific prior written permission. 17272850Shrs * 18272850Shrs * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19272850Shrs * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20272850Shrs * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21272850Shrs * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22272850Shrs * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 23272850Shrs * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24272850Shrs * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 25272850Shrs * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26272850Shrs * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27272850Shrs * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28272850Shrs * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29272850Shrs * 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: stable/10/include/rpcsvc/bootparam_prot.x 272850 2014-10-09 23:05:32Z 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