1 0 stevel /* 2 0 stevel * CDDL HEADER START 3 0 stevel * 4 0 stevel * The contents of this file are subject to the terms of the 5 0 stevel * Common Development and Distribution License, Version 1.0 only 6 0 stevel * (the "License"). You may not use this file except in compliance 7 0 stevel * with the License. 8 0 stevel * 9 0 stevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 0 stevel * or http://www.opensolaris.org/os/licensing. 11 0 stevel * See the License for the specific language governing permissions 12 0 stevel * and limitations under the License. 13 0 stevel * 14 0 stevel * When distributing Covered Code, include this CDDL HEADER in each 15 0 stevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 0 stevel * If applicable, add the following below this CDDL HEADER, with the 17 0 stevel * fields enclosed by brackets "[]" replaced with your own identifying 18 0 stevel * information: Portions Copyright [yyyy] [name of copyright owner] 19 0 stevel * 20 0 stevel * CDDL HEADER END 21 0 stevel */ 22 0 stevel %/* 23 0 stevel % * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24 0 stevel % * Use is subject to license terms. 25 0 stevel % */ 26 0 stevel 27 0 stevel %/* from bootparam_prot.x */ 28 0 stevel 29 0 stevel #ifdef RPC_HDR 30 0 stevel % 31 0 stevel %#pragma ident "%Z%%M% %I% %E% SMI" 32 0 stevel % 33 0 stevel #endif 34 0 stevel 35 0 stevel /* 36 0 stevel * RPC for bootparms service. 37 0 stevel * There are two procedures: 38 0 stevel * WHOAMI takes a net address and returns a client name and also a 39 0 stevel * likely net address for routing 40 0 stevel * GETFILE takes a client name and file identifier and returns the 41 0 stevel * server name, server net address and pathname for the file. 42 0 stevel * file identifiers typically include root, swap, pub and dump 43 0 stevel */ 44 0 stevel const MAX_MACHINE_NAME = 255; 45 0 stevel const MAX_PATH_LEN = 1024; 46 0 stevel const MAX_FILEID = 32; 47 0 stevel const IP_ADDR_TYPE = 1; 48 0 stevel 49 0 stevel typedef string bp_machine_name_t<MAX_MACHINE_NAME>; 50 0 stevel typedef string bp_path_t<MAX_PATH_LEN>; 51 0 stevel typedef string bp_fileid_t<MAX_FILEID>; 52 0 stevel 53 0 stevel struct ip_addr_t { 54 0 stevel char net; 55 0 stevel char host; 56 0 stevel char lh; 57 0 stevel char impno; 58 0 stevel }; 59 0 stevel 60 0 stevel union bp_address switch (int address_type) { 61 0 stevel case IP_ADDR_TYPE: 62 0 stevel ip_addr_t ip_addr; 63 0 stevel }; 64 0 stevel 65 0 stevel struct bp_whoami_arg { 66 0 stevel bp_address client_address; 67 0 stevel }; 68 0 stevel 69 0 stevel struct bp_whoami_res { 70 0 stevel bp_machine_name_t client_name; 71 0 stevel bp_machine_name_t domain_name; 72 0 stevel bp_address router_address; 73 0 stevel }; 74 0 stevel 75 0 stevel struct bp_getfile_arg { 76 0 stevel bp_machine_name_t client_name; 77 0 stevel bp_fileid_t file_id; 78 0 stevel }; 79 0 stevel 80 0 stevel struct bp_getfile_res { 81 0 stevel bp_machine_name_t server_name; 82 0 stevel bp_address server_address; 83 0 stevel bp_path_t server_path; 84 0 stevel }; 85 0 stevel 86 0 stevel program BOOTPARAMPROG { 87 0 stevel version BOOTPARAMVERS { 88 0 stevel bp_whoami_res BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1; 89 0 stevel bp_getfile_res BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2; 90 0 stevel } = 1; 91 0 stevel } = 100026; 92