1dfdcada3SDoug Rabson /* 2dfdcada3SDoug Rabson * Please do not edit this file. 3dfdcada3SDoug Rabson * It was generated using rpcgen. 4dfdcada3SDoug Rabson */ 5dfdcada3SDoug Rabson 6dfdcada3SDoug Rabson #ifndef _RPCB_PROT_H_RPCGEN 7dfdcada3SDoug Rabson #define _RPCB_PROT_H_RPCGEN 8dfdcada3SDoug Rabson 9dfdcada3SDoug Rabson #include <rpc/rpc.h> 10dfdcada3SDoug Rabson 11dfdcada3SDoug Rabson #ifdef __cplusplus 12dfdcada3SDoug Rabson extern "C" { 13dfdcada3SDoug Rabson #endif 14dfdcada3SDoug Rabson 152e322d37SHiroki Sato /*- 16*51369649SPedro F. Giffuni * SPDX-License-Identifier: BSD-3-Clause 17*51369649SPedro F. Giffuni * 182e322d37SHiroki Sato * Copyright (c) 2009, Sun Microsystems, Inc. 192e322d37SHiroki Sato * All rights reserved. 202e322d37SHiroki Sato * 212e322d37SHiroki Sato * Redistribution and use in source and binary forms, with or without 222e322d37SHiroki Sato * modification, are permitted provided that the following conditions are met: 232e322d37SHiroki Sato * - Redistributions of source code must retain the above copyright notice, 242e322d37SHiroki Sato * this list of conditions and the following disclaimer. 252e322d37SHiroki Sato * - Redistributions in binary form must reproduce the above copyright notice, 262e322d37SHiroki Sato * this list of conditions and the following disclaimer in the documentation 272e322d37SHiroki Sato * and/or other materials provided with the distribution. 282e322d37SHiroki Sato * - Neither the name of Sun Microsystems, Inc. nor the names of its 292e322d37SHiroki Sato * contributors may be used to endorse or promote products derived 302e322d37SHiroki Sato * from this software without specific prior written permission. 312e322d37SHiroki Sato * 322e322d37SHiroki Sato * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 332e322d37SHiroki Sato * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 342e322d37SHiroki Sato * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 352e322d37SHiroki Sato * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 362e322d37SHiroki Sato * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 372e322d37SHiroki Sato * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 382e322d37SHiroki Sato * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 392e322d37SHiroki Sato * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 402e322d37SHiroki Sato * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 412e322d37SHiroki Sato * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 422e322d37SHiroki Sato * POSSIBILITY OF SUCH DAMAGE. 43dfdcada3SDoug Rabson */ 44dfdcada3SDoug Rabson /* 45dfdcada3SDoug Rabson * Copyright (c) 1988 by Sun Microsystems, Inc. 46dfdcada3SDoug Rabson */ 47dfdcada3SDoug Rabson /* from rpcb_prot.x */ 48dfdcada3SDoug Rabson 49dfdcada3SDoug Rabson #ifndef _KERNEL 50dfdcada3SDoug Rabson 51dfdcada3SDoug Rabson 52dfdcada3SDoug Rabson /* 53dfdcada3SDoug Rabson * The following procedures are supported by the protocol in version 3: 54dfdcada3SDoug Rabson * 55dfdcada3SDoug Rabson * RPCBPROC_NULL() returns () 56dfdcada3SDoug Rabson * takes nothing, returns nothing 57dfdcada3SDoug Rabson * 58dfdcada3SDoug Rabson * RPCBPROC_SET(rpcb) returns (bool_t) 59dfdcada3SDoug Rabson * TRUE is success, FALSE is failure. Registers the tuple 60dfdcada3SDoug Rabson * [prog, vers, address, owner, netid]. 61dfdcada3SDoug Rabson * Finds out owner and netid information on its own. 62dfdcada3SDoug Rabson * 63dfdcada3SDoug Rabson * RPCBPROC_UNSET(rpcb) returns (bool_t) 64dfdcada3SDoug Rabson * TRUE is success, FALSE is failure. Un-registers tuple 65dfdcada3SDoug Rabson * [prog, vers, netid]. addresses is ignored. 66dfdcada3SDoug Rabson * If netid is NULL, unregister all. 67dfdcada3SDoug Rabson * 68dfdcada3SDoug Rabson * RPCBPROC_GETADDR(rpcb) returns (string). 69dfdcada3SDoug Rabson * 0 is failure. Otherwise returns the universal address where the 70dfdcada3SDoug Rabson * triple [prog, vers, netid] is registered. Ignore address and owner. 71dfdcada3SDoug Rabson * 72dfdcada3SDoug Rabson * RPCBPROC_DUMP() RETURNS (rpcblist_ptr) 73dfdcada3SDoug Rabson * used to dump the entire rpcbind maps 74dfdcada3SDoug Rabson * 75dfdcada3SDoug Rabson * RPCBPROC_CALLIT(rpcb_rmtcallargs) 76dfdcada3SDoug Rabson * RETURNS (rpcb_rmtcallres); 77dfdcada3SDoug Rabson * Calls the procedure on the remote machine. If it is not registered, 78dfdcada3SDoug Rabson * this procedure is quiet; i.e. it does not return error information!!! 79dfdcada3SDoug Rabson * This routine only passes null authentication parameters. 80dfdcada3SDoug Rabson * It has no interface to xdr routines for RPCBPROC_CALLIT. 81dfdcada3SDoug Rabson * 82dfdcada3SDoug Rabson * RPCBPROC_GETTIME() returns (int). 83dfdcada3SDoug Rabson * Gets the remote machines time 84dfdcada3SDoug Rabson * 85dfdcada3SDoug Rabson * RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf) 86dfdcada3SDoug Rabson * Returns the netbuf address from universal address. 87dfdcada3SDoug Rabson * 88dfdcada3SDoug Rabson * RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string) 89dfdcada3SDoug Rabson * Returns the universal address from netbuf address. 90dfdcada3SDoug Rabson * 91dfdcada3SDoug Rabson * END OF RPCBIND VERSION 3 PROCEDURES 92dfdcada3SDoug Rabson */ 93dfdcada3SDoug Rabson /* 94dfdcada3SDoug Rabson * Except for RPCBPROC_CALLIT, the procedures above are carried over to 95dfdcada3SDoug Rabson * rpcbind version 4. Those below are added or modified for version 4. 96dfdcada3SDoug Rabson * NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER 97dfdcada3SDoug Rabson * AS RPCBPROC_CALLIT. 98dfdcada3SDoug Rabson * 99dfdcada3SDoug Rabson * RPCBPROC_BCAST(rpcb_rmtcallargs) 100dfdcada3SDoug Rabson * RETURNS (rpcb_rmtcallres); 101dfdcada3SDoug Rabson * Calls the procedure on the remote machine. If it is not registered, 102dfdcada3SDoug Rabson * this procedure IS quiet; i.e. it DOES NOT return error information!!! 103dfdcada3SDoug Rabson * This routine should be used for broadcasting and nothing else. 104dfdcada3SDoug Rabson * 105dfdcada3SDoug Rabson * RPCBPROC_GETVERSADDR(rpcb) returns (string). 106dfdcada3SDoug Rabson * 0 is failure. Otherwise returns the universal address where the 107dfdcada3SDoug Rabson * triple [prog, vers, netid] is registered. Ignore address and owner. 108dfdcada3SDoug Rabson * Same as RPCBPROC_GETADDR except that if the given version number 109dfdcada3SDoug Rabson * is not available, the address is not returned. 110dfdcada3SDoug Rabson * 111dfdcada3SDoug Rabson * RPCBPROC_INDIRECT(rpcb_rmtcallargs) 112dfdcada3SDoug Rabson * RETURNS (rpcb_rmtcallres); 113dfdcada3SDoug Rabson * Calls the procedure on the remote machine. If it is not registered, 114dfdcada3SDoug Rabson * this procedure is NOT quiet; i.e. it DOES return error information!!! 115dfdcada3SDoug Rabson * as any normal application would expect. 116dfdcada3SDoug Rabson * 117dfdcada3SDoug Rabson * RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr). 118dfdcada3SDoug Rabson * Same as RPCBPROC_GETADDR except that it returns a list of all the 119dfdcada3SDoug Rabson * addresses registered for the combination (prog, vers) (for all 120dfdcada3SDoug Rabson * transports). 121dfdcada3SDoug Rabson * 122dfdcada3SDoug Rabson * RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers) 123dfdcada3SDoug Rabson * Returns the statistics about the kind of requests received by rpcbind. 124dfdcada3SDoug Rabson */ 125dfdcada3SDoug Rabson 126dfdcada3SDoug Rabson /* 127dfdcada3SDoug Rabson * A mapping of (program, version, network ID) to address 128dfdcada3SDoug Rabson */ 129dfdcada3SDoug Rabson 130dfdcada3SDoug Rabson struct rpcb { 131dfdcada3SDoug Rabson rpcprog_t r_prog; 132dfdcada3SDoug Rabson rpcvers_t r_vers; 133dfdcada3SDoug Rabson char *r_netid; 134dfdcada3SDoug Rabson char *r_addr; 135dfdcada3SDoug Rabson char *r_owner; 136dfdcada3SDoug Rabson }; 137dfdcada3SDoug Rabson typedef struct rpcb rpcb; 138dfdcada3SDoug Rabson 139dfdcada3SDoug Rabson typedef rpcb RPCB; 140dfdcada3SDoug Rabson 141dfdcada3SDoug Rabson 142dfdcada3SDoug Rabson /* 143dfdcada3SDoug Rabson * A list of mappings 144dfdcada3SDoug Rabson * 145dfdcada3SDoug Rabson * Below are two definitions for the rpcblist structure. This is done because 146dfdcada3SDoug Rabson * xdr_rpcblist() is specified to take a struct rpcblist **, rather than a 147dfdcada3SDoug Rabson * struct rpcblist * that rpcgen would produce. One version of the rpcblist 148dfdcada3SDoug Rabson * structure (actually called rp__list) is used with rpcgen, and the other is 149dfdcada3SDoug Rabson * defined only in the header file for compatibility with the specified 150dfdcada3SDoug Rabson * interface. 151dfdcada3SDoug Rabson */ 152dfdcada3SDoug Rabson 153dfdcada3SDoug Rabson struct rp__list { 154dfdcada3SDoug Rabson rpcb rpcb_map; 155dfdcada3SDoug Rabson struct rp__list *rpcb_next; 156dfdcada3SDoug Rabson }; 157dfdcada3SDoug Rabson typedef struct rp__list rp__list; 158dfdcada3SDoug Rabson 159dfdcada3SDoug Rabson typedef rp__list *rpcblist_ptr; 160dfdcada3SDoug Rabson 161dfdcada3SDoug Rabson typedef struct rp__list rpcblist; 162dfdcada3SDoug Rabson typedef struct rp__list RPCBLIST; 163dfdcada3SDoug Rabson 164dfdcada3SDoug Rabson #ifndef __cplusplus 165dfdcada3SDoug Rabson struct rpcblist { 166dfdcada3SDoug Rabson RPCB rpcb_map; 167dfdcada3SDoug Rabson struct rpcblist *rpcb_next; 168dfdcada3SDoug Rabson }; 169dfdcada3SDoug Rabson #endif 170dfdcada3SDoug Rabson 171dfdcada3SDoug Rabson #ifdef __cplusplus 172dfdcada3SDoug Rabson extern "C" { 173dfdcada3SDoug Rabson #endif 174dfdcada3SDoug Rabson extern bool_t xdr_rpcblist(XDR *, rpcblist**); 175dfdcada3SDoug Rabson #ifdef __cplusplus 176dfdcada3SDoug Rabson } 177dfdcada3SDoug Rabson #endif 178dfdcada3SDoug Rabson 179dfdcada3SDoug Rabson 180dfdcada3SDoug Rabson /* 181dfdcada3SDoug Rabson * Arguments of remote calls 182dfdcada3SDoug Rabson */ 183dfdcada3SDoug Rabson 184dfdcada3SDoug Rabson struct rpcb_rmtcallargs { 185dfdcada3SDoug Rabson rpcprog_t prog; 186dfdcada3SDoug Rabson rpcvers_t vers; 187dfdcada3SDoug Rabson rpcproc_t proc; 188dfdcada3SDoug Rabson struct { 189dfdcada3SDoug Rabson u_int args_len; 190dfdcada3SDoug Rabson char *args_val; 191dfdcada3SDoug Rabson } args; 192dfdcada3SDoug Rabson }; 193dfdcada3SDoug Rabson typedef struct rpcb_rmtcallargs rpcb_rmtcallargs; 194dfdcada3SDoug Rabson 195dfdcada3SDoug Rabson /* 196dfdcada3SDoug Rabson * Client-side only representation of rpcb_rmtcallargs structure. 197dfdcada3SDoug Rabson * 198dfdcada3SDoug Rabson * The routine that XDRs the rpcb_rmtcallargs structure must deal with the 199dfdcada3SDoug Rabson * opaque arguments in the "args" structure. xdr_rpcb_rmtcallargs() needs to 200dfdcada3SDoug Rabson * be passed the XDR routine that knows the args' structure. This routine 201dfdcada3SDoug Rabson * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since 202dfdcada3SDoug Rabson * the application being called already knows the args structure. So we use a 203dfdcada3SDoug Rabson * different "XDR" structure on the client side, r_rpcb_rmtcallargs, which 204dfdcada3SDoug Rabson * includes the args' XDR routine. 205dfdcada3SDoug Rabson */ 206dfdcada3SDoug Rabson struct r_rpcb_rmtcallargs { 207dfdcada3SDoug Rabson rpcprog_t prog; 208dfdcada3SDoug Rabson rpcvers_t vers; 209dfdcada3SDoug Rabson rpcproc_t proc; 210dfdcada3SDoug Rabson struct { 211dfdcada3SDoug Rabson u_int args_len; 212dfdcada3SDoug Rabson char *args_val; 213dfdcada3SDoug Rabson } args; 214dfdcada3SDoug Rabson xdrproc_t xdr_args; /* encodes args */ 215dfdcada3SDoug Rabson }; 216dfdcada3SDoug Rabson 217dfdcada3SDoug Rabson 218dfdcada3SDoug Rabson /* 219dfdcada3SDoug Rabson * Results of the remote call 220dfdcada3SDoug Rabson */ 221dfdcada3SDoug Rabson 222dfdcada3SDoug Rabson struct rpcb_rmtcallres { 223dfdcada3SDoug Rabson char *addr; 224dfdcada3SDoug Rabson struct { 225dfdcada3SDoug Rabson u_int results_len; 226dfdcada3SDoug Rabson char *results_val; 227dfdcada3SDoug Rabson } results; 228dfdcada3SDoug Rabson }; 229dfdcada3SDoug Rabson typedef struct rpcb_rmtcallres rpcb_rmtcallres; 230dfdcada3SDoug Rabson 231dfdcada3SDoug Rabson /* 232dfdcada3SDoug Rabson * Client-side only representation of rpcb_rmtcallres structure. 233dfdcada3SDoug Rabson */ 234dfdcada3SDoug Rabson struct r_rpcb_rmtcallres { 235dfdcada3SDoug Rabson char *addr; 236dfdcada3SDoug Rabson struct { 237dfdcada3SDoug Rabson uint32_t results_len; 238dfdcada3SDoug Rabson char *results_val; 239dfdcada3SDoug Rabson } results; 240dfdcada3SDoug Rabson xdrproc_t xdr_res; /* decodes results */ 241dfdcada3SDoug Rabson }; 242dfdcada3SDoug Rabson 243dfdcada3SDoug Rabson /* 244dfdcada3SDoug Rabson * rpcb_entry contains a merged address of a service on a particular 245dfdcada3SDoug Rabson * transport, plus associated netconfig information. A list of rpcb_entrys 246dfdcada3SDoug Rabson * is returned by RPCBPROC_GETADDRLIST. See netconfig.h for values used 247dfdcada3SDoug Rabson * in r_nc_* fields. 248dfdcada3SDoug Rabson */ 249dfdcada3SDoug Rabson 250dfdcada3SDoug Rabson struct rpcb_entry { 251dfdcada3SDoug Rabson char *r_maddr; 252dfdcada3SDoug Rabson char *r_nc_netid; 253dfdcada3SDoug Rabson u_int r_nc_semantics; 254dfdcada3SDoug Rabson char *r_nc_protofmly; 255dfdcada3SDoug Rabson char *r_nc_proto; 256dfdcada3SDoug Rabson }; 257dfdcada3SDoug Rabson typedef struct rpcb_entry rpcb_entry; 258dfdcada3SDoug Rabson 259dfdcada3SDoug Rabson /* 260dfdcada3SDoug Rabson * A list of addresses supported by a service. 261dfdcada3SDoug Rabson */ 262dfdcada3SDoug Rabson 263dfdcada3SDoug Rabson struct rpcb_entry_list { 264dfdcada3SDoug Rabson rpcb_entry rpcb_entry_map; 265dfdcada3SDoug Rabson struct rpcb_entry_list *rpcb_entry_next; 266dfdcada3SDoug Rabson }; 267dfdcada3SDoug Rabson typedef struct rpcb_entry_list rpcb_entry_list; 268dfdcada3SDoug Rabson 269dfdcada3SDoug Rabson typedef rpcb_entry_list *rpcb_entry_list_ptr; 270dfdcada3SDoug Rabson 271dfdcada3SDoug Rabson /* 272dfdcada3SDoug Rabson * rpcbind statistics 273dfdcada3SDoug Rabson */ 274dfdcada3SDoug Rabson 275dfdcada3SDoug Rabson #define rpcb_highproc_2 RPCBPROC_CALLIT 276dfdcada3SDoug Rabson #define rpcb_highproc_3 RPCBPROC_TADDR2UADDR 277dfdcada3SDoug Rabson #define rpcb_highproc_4 RPCBPROC_GETSTAT 278dfdcada3SDoug Rabson #define RPCBSTAT_HIGHPROC 13 279dfdcada3SDoug Rabson #define RPCBVERS_STAT 3 280dfdcada3SDoug Rabson #define RPCBVERS_4_STAT 2 281dfdcada3SDoug Rabson #define RPCBVERS_3_STAT 1 282dfdcada3SDoug Rabson #define RPCBVERS_2_STAT 0 283dfdcada3SDoug Rabson 284dfdcada3SDoug Rabson /* Link list of all the stats about getport and getaddr */ 285dfdcada3SDoug Rabson 286dfdcada3SDoug Rabson struct rpcbs_addrlist { 287dfdcada3SDoug Rabson rpcprog_t prog; 288dfdcada3SDoug Rabson rpcvers_t vers; 289dfdcada3SDoug Rabson int success; 290dfdcada3SDoug Rabson int failure; 291dfdcada3SDoug Rabson char *netid; 292dfdcada3SDoug Rabson struct rpcbs_addrlist *next; 293dfdcada3SDoug Rabson }; 294dfdcada3SDoug Rabson typedef struct rpcbs_addrlist rpcbs_addrlist; 295dfdcada3SDoug Rabson 296dfdcada3SDoug Rabson /* Link list of all the stats about rmtcall */ 297dfdcada3SDoug Rabson 298dfdcada3SDoug Rabson struct rpcbs_rmtcalllist { 299dfdcada3SDoug Rabson rpcprog_t prog; 300dfdcada3SDoug Rabson rpcvers_t vers; 301dfdcada3SDoug Rabson rpcproc_t proc; 302dfdcada3SDoug Rabson int success; 303dfdcada3SDoug Rabson int failure; 304dfdcada3SDoug Rabson int indirect; 305dfdcada3SDoug Rabson char *netid; 306dfdcada3SDoug Rabson struct rpcbs_rmtcalllist *next; 307dfdcada3SDoug Rabson }; 308dfdcada3SDoug Rabson typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist; 309dfdcada3SDoug Rabson 310dfdcada3SDoug Rabson typedef int rpcbs_proc[RPCBSTAT_HIGHPROC]; 311dfdcada3SDoug Rabson 312dfdcada3SDoug Rabson typedef rpcbs_addrlist *rpcbs_addrlist_ptr; 313dfdcada3SDoug Rabson 314dfdcada3SDoug Rabson typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr; 315dfdcada3SDoug Rabson 316dfdcada3SDoug Rabson struct rpcb_stat { 317dfdcada3SDoug Rabson rpcbs_proc info; 318dfdcada3SDoug Rabson int setinfo; 319dfdcada3SDoug Rabson int unsetinfo; 320dfdcada3SDoug Rabson rpcbs_addrlist_ptr addrinfo; 321dfdcada3SDoug Rabson rpcbs_rmtcalllist_ptr rmtinfo; 322dfdcada3SDoug Rabson }; 323dfdcada3SDoug Rabson typedef struct rpcb_stat rpcb_stat; 324dfdcada3SDoug Rabson 325dfdcada3SDoug Rabson /* 326dfdcada3SDoug Rabson * One rpcb_stat structure is returned for each version of rpcbind 327dfdcada3SDoug Rabson * being monitored. 328dfdcada3SDoug Rabson */ 329dfdcada3SDoug Rabson 330dfdcada3SDoug Rabson typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT]; 331dfdcada3SDoug Rabson 332dfdcada3SDoug Rabson /* 333dfdcada3SDoug Rabson * We don't define netbuf in RPCL, since it would contain structure member 334dfdcada3SDoug Rabson * names that would conflict with the definition of struct netbuf in 335dfdcada3SDoug Rabson * <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here, 336dfdcada3SDoug Rabson * and implement it ourselves in rpc/rpcb_prot.c. 337dfdcada3SDoug Rabson */ 338dfdcada3SDoug Rabson #ifdef __cplusplus 339dfdcada3SDoug Rabson extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *); 340dfdcada3SDoug Rabson 341dfdcada3SDoug Rabson #else /* __STDC__ */ 342dfdcada3SDoug Rabson extern bool_t xdr_netbuf(XDR *, struct netbuf *); 343dfdcada3SDoug Rabson 344dfdcada3SDoug Rabson #endif 345dfdcada3SDoug Rabson 346dfdcada3SDoug Rabson #define RPCBVERS_3 RPCBVERS 347dfdcada3SDoug Rabson #define RPCBVERS_4 RPCBVERS4 348dfdcada3SDoug Rabson 349dfdcada3SDoug Rabson #else /* ndef _KERNEL */ 350dfdcada3SDoug Rabson #ifdef __cplusplus 351dfdcada3SDoug Rabson extern "C" { 352dfdcada3SDoug Rabson #endif 353dfdcada3SDoug Rabson 354dfdcada3SDoug Rabson /* 355dfdcada3SDoug Rabson * A mapping of (program, version, network ID) to address 356dfdcada3SDoug Rabson */ 357dfdcada3SDoug Rabson struct rpcb { 358dfdcada3SDoug Rabson rpcprog_t r_prog; /* program number */ 359dfdcada3SDoug Rabson rpcvers_t r_vers; /* version number */ 360dfdcada3SDoug Rabson char *r_netid; /* network id */ 361dfdcada3SDoug Rabson char *r_addr; /* universal address */ 362dfdcada3SDoug Rabson char *r_owner; /* owner of the mapping */ 363dfdcada3SDoug Rabson }; 364dfdcada3SDoug Rabson typedef struct rpcb RPCB; 365dfdcada3SDoug Rabson 366dfdcada3SDoug Rabson /* 367dfdcada3SDoug Rabson * A list of mappings 368dfdcada3SDoug Rabson */ 369dfdcada3SDoug Rabson struct rpcblist { 370dfdcada3SDoug Rabson RPCB rpcb_map; 371dfdcada3SDoug Rabson struct rpcblist *rpcb_next; 372dfdcada3SDoug Rabson }; 373dfdcada3SDoug Rabson typedef struct rpcblist RPCBLIST; 374dfdcada3SDoug Rabson typedef struct rpcblist *rpcblist_ptr; 375dfdcada3SDoug Rabson 376dfdcada3SDoug Rabson /* 377dfdcada3SDoug Rabson * Remote calls arguments 378dfdcada3SDoug Rabson */ 379dfdcada3SDoug Rabson struct rpcb_rmtcallargs { 380dfdcada3SDoug Rabson rpcprog_t prog; /* program number */ 381dfdcada3SDoug Rabson rpcvers_t vers; /* version number */ 382dfdcada3SDoug Rabson rpcproc_t proc; /* procedure number */ 383dfdcada3SDoug Rabson uint32_t arglen; /* arg len */ 384dfdcada3SDoug Rabson caddr_t args_ptr; /* argument */ 385dfdcada3SDoug Rabson xdrproc_t xdr_args; /* XDR routine for argument */ 386dfdcada3SDoug Rabson }; 387dfdcada3SDoug Rabson typedef struct rpcb_rmtcallargs rpcb_rmtcallargs; 388dfdcada3SDoug Rabson 389dfdcada3SDoug Rabson /* 390dfdcada3SDoug Rabson * Remote calls results 391dfdcada3SDoug Rabson */ 392dfdcada3SDoug Rabson struct rpcb_rmtcallres { 393dfdcada3SDoug Rabson char *addr_ptr; /* remote universal address */ 394dfdcada3SDoug Rabson uint32_t resultslen; /* results length */ 395dfdcada3SDoug Rabson caddr_t results_ptr; /* results */ 396dfdcada3SDoug Rabson xdrproc_t xdr_results; /* XDR routine for result */ 397dfdcada3SDoug Rabson }; 398dfdcada3SDoug Rabson typedef struct rpcb_rmtcallres rpcb_rmtcallres; 399dfdcada3SDoug Rabson 400dfdcada3SDoug Rabson struct rpcb_entry { 401dfdcada3SDoug Rabson char *r_maddr; 402dfdcada3SDoug Rabson char *r_nc_netid; 403dfdcada3SDoug Rabson unsigned int r_nc_semantics; 404dfdcada3SDoug Rabson char *r_nc_protofmly; 405dfdcada3SDoug Rabson char *r_nc_proto; 406dfdcada3SDoug Rabson }; 407dfdcada3SDoug Rabson typedef struct rpcb_entry rpcb_entry; 408dfdcada3SDoug Rabson 409dfdcada3SDoug Rabson /* 410dfdcada3SDoug Rabson * A list of addresses supported by a service. 411dfdcada3SDoug Rabson */ 412dfdcada3SDoug Rabson 413dfdcada3SDoug Rabson struct rpcb_entry_list { 414dfdcada3SDoug Rabson rpcb_entry rpcb_entry_map; 415dfdcada3SDoug Rabson struct rpcb_entry_list *rpcb_entry_next; 416dfdcada3SDoug Rabson }; 417dfdcada3SDoug Rabson typedef struct rpcb_entry_list rpcb_entry_list; 418dfdcada3SDoug Rabson 419dfdcada3SDoug Rabson typedef rpcb_entry_list *rpcb_entry_list_ptr; 420dfdcada3SDoug Rabson 421dfdcada3SDoug Rabson /* 422dfdcada3SDoug Rabson * rpcbind statistics 423dfdcada3SDoug Rabson */ 424dfdcada3SDoug Rabson 425dfdcada3SDoug Rabson #define rpcb_highproc_2 RPCBPROC_CALLIT 426dfdcada3SDoug Rabson #define rpcb_highproc_3 RPCBPROC_TADDR2UADDR 427dfdcada3SDoug Rabson #define rpcb_highproc_4 RPCBPROC_GETSTAT 428dfdcada3SDoug Rabson #define RPCBSTAT_HIGHPROC 13 429dfdcada3SDoug Rabson #define RPCBVERS_STAT 3 430dfdcada3SDoug Rabson #define RPCBVERS_4_STAT 2 431dfdcada3SDoug Rabson #define RPCBVERS_3_STAT 1 432dfdcada3SDoug Rabson #define RPCBVERS_2_STAT 0 433dfdcada3SDoug Rabson 434dfdcada3SDoug Rabson /* Link list of all the stats about getport and getaddr */ 435dfdcada3SDoug Rabson 436dfdcada3SDoug Rabson struct rpcbs_addrlist { 437dfdcada3SDoug Rabson rpcprog_t prog; 438dfdcada3SDoug Rabson rpcvers_t vers; 439dfdcada3SDoug Rabson int success; 440dfdcada3SDoug Rabson int failure; 441dfdcada3SDoug Rabson char *netid; 442dfdcada3SDoug Rabson struct rpcbs_addrlist *next; 443dfdcada3SDoug Rabson }; 444dfdcada3SDoug Rabson typedef struct rpcbs_addrlist rpcbs_addrlist; 445dfdcada3SDoug Rabson 446dfdcada3SDoug Rabson /* Link list of all the stats about rmtcall */ 447dfdcada3SDoug Rabson 448dfdcada3SDoug Rabson struct rpcbs_rmtcalllist { 449dfdcada3SDoug Rabson rpcprog_t prog; 450dfdcada3SDoug Rabson rpcvers_t vers; 451dfdcada3SDoug Rabson rpcproc_t proc; 452dfdcada3SDoug Rabson int success; 453dfdcada3SDoug Rabson int failure; 454dfdcada3SDoug Rabson int indirect; 455dfdcada3SDoug Rabson char *netid; 456dfdcada3SDoug Rabson struct rpcbs_rmtcalllist *next; 457dfdcada3SDoug Rabson }; 458dfdcada3SDoug Rabson typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist; 459dfdcada3SDoug Rabson 460dfdcada3SDoug Rabson typedef int rpcbs_proc[RPCBSTAT_HIGHPROC]; 461dfdcada3SDoug Rabson 462dfdcada3SDoug Rabson typedef rpcbs_addrlist *rpcbs_addrlist_ptr; 463dfdcada3SDoug Rabson 464dfdcada3SDoug Rabson typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr; 465dfdcada3SDoug Rabson 466dfdcada3SDoug Rabson struct rpcb_stat { 467dfdcada3SDoug Rabson rpcbs_proc info; 468dfdcada3SDoug Rabson int setinfo; 469dfdcada3SDoug Rabson int unsetinfo; 470dfdcada3SDoug Rabson rpcbs_addrlist_ptr addrinfo; 471dfdcada3SDoug Rabson rpcbs_rmtcalllist_ptr rmtinfo; 472dfdcada3SDoug Rabson }; 473dfdcada3SDoug Rabson typedef struct rpcb_stat rpcb_stat; 474dfdcada3SDoug Rabson 475dfdcada3SDoug Rabson /* 476dfdcada3SDoug Rabson * One rpcb_stat structure is returned for each version of rpcbind 477dfdcada3SDoug Rabson * being monitored. 478dfdcada3SDoug Rabson */ 479dfdcada3SDoug Rabson 480dfdcada3SDoug Rabson typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT]; 481dfdcada3SDoug Rabson 482dfdcada3SDoug Rabson #ifdef __cplusplus 483dfdcada3SDoug Rabson } 484dfdcada3SDoug Rabson #endif 485dfdcada3SDoug Rabson 486dfdcada3SDoug Rabson #endif /* ndef _KERNEL */ 487dfdcada3SDoug Rabson 488dfdcada3SDoug Rabson #define _PATH_RPCBINDSOCK "/var/run/rpcbind.sock" 489dfdcada3SDoug Rabson 490dfdcada3SDoug Rabson #define RPCBPROG ((unsigned long)(100000)) 491dfdcada3SDoug Rabson #define RPCBVERS ((unsigned long)(3)) 492dfdcada3SDoug Rabson 493dfdcada3SDoug Rabson extern void rpcbprog_3(struct svc_req *rqstp, SVCXPRT *transp); 494dfdcada3SDoug Rabson #define RPCBPROC_SET ((unsigned long)(1)) 495dfdcada3SDoug Rabson extern bool_t * rpcbproc_set_3(RPCB *, CLIENT *); 496dfdcada3SDoug Rabson extern bool_t * rpcbproc_set_3_svc(RPCB *, struct svc_req *); 497dfdcada3SDoug Rabson #define RPCBPROC_UNSET ((unsigned long)(2)) 498dfdcada3SDoug Rabson extern bool_t * rpcbproc_unset_3(RPCB *, CLIENT *); 499dfdcada3SDoug Rabson extern bool_t * rpcbproc_unset_3_svc(RPCB *, struct svc_req *); 500dfdcada3SDoug Rabson #define RPCBPROC_GETADDR ((unsigned long)(3)) 501dfdcada3SDoug Rabson extern char ** rpcbproc_getaddr_3(RPCB *, CLIENT *); 502dfdcada3SDoug Rabson extern char ** rpcbproc_getaddr_3_svc(RPCB *, struct svc_req *); 503dfdcada3SDoug Rabson #define RPCBPROC_DUMP ((unsigned long)(4)) 504dfdcada3SDoug Rabson extern rpcblist_ptr * rpcbproc_dump_3(void *, CLIENT *); 505dfdcada3SDoug Rabson extern rpcblist_ptr * rpcbproc_dump_3_svc(void *, struct svc_req *); 506dfdcada3SDoug Rabson #define RPCBPROC_CALLIT ((unsigned long)(5)) 507dfdcada3SDoug Rabson extern rpcb_rmtcallres * rpcbproc_callit_3(rpcb_rmtcallargs *, CLIENT *); 508dfdcada3SDoug Rabson extern rpcb_rmtcallres * rpcbproc_callit_3_svc(rpcb_rmtcallargs *, struct svc_req *); 509dfdcada3SDoug Rabson #define RPCBPROC_GETTIME ((unsigned long)(6)) 510dfdcada3SDoug Rabson extern u_int * rpcbproc_gettime_3(void *, CLIENT *); 511dfdcada3SDoug Rabson extern u_int * rpcbproc_gettime_3_svc(void *, struct svc_req *); 512dfdcada3SDoug Rabson #define RPCBPROC_UADDR2TADDR ((unsigned long)(7)) 513dfdcada3SDoug Rabson extern struct netbuf * rpcbproc_uaddr2taddr_3(char **, CLIENT *); 514dfdcada3SDoug Rabson extern struct netbuf * rpcbproc_uaddr2taddr_3_svc(char **, struct svc_req *); 515dfdcada3SDoug Rabson #define RPCBPROC_TADDR2UADDR ((unsigned long)(8)) 516dfdcada3SDoug Rabson extern char ** rpcbproc_taddr2uaddr_3(struct netbuf *, CLIENT *); 517dfdcada3SDoug Rabson extern char ** rpcbproc_taddr2uaddr_3_svc(struct netbuf *, struct svc_req *); 518dfdcada3SDoug Rabson extern int rpcbprog_3_freeresult(SVCXPRT *, xdrproc_t, caddr_t); 519dfdcada3SDoug Rabson #define RPCBVERS4 ((unsigned long)(4)) 520dfdcada3SDoug Rabson 521dfdcada3SDoug Rabson extern void rpcbprog_4(struct svc_req *rqstp, SVCXPRT *transp); 522dfdcada3SDoug Rabson extern bool_t * rpcbproc_set_4(RPCB *, CLIENT *); 523dfdcada3SDoug Rabson extern bool_t * rpcbproc_set_4_svc(RPCB *, struct svc_req *); 524dfdcada3SDoug Rabson extern bool_t * rpcbproc_unset_4(RPCB *, CLIENT *); 525dfdcada3SDoug Rabson extern bool_t * rpcbproc_unset_4_svc(RPCB *, struct svc_req *); 526dfdcada3SDoug Rabson extern char ** rpcbproc_getaddr_4(RPCB *, CLIENT *); 527dfdcada3SDoug Rabson extern char ** rpcbproc_getaddr_4_svc(RPCB *, struct svc_req *); 528dfdcada3SDoug Rabson extern rpcblist_ptr * rpcbproc_dump_4(void *, CLIENT *); 529dfdcada3SDoug Rabson extern rpcblist_ptr * rpcbproc_dump_4_svc(void *, struct svc_req *); 530dfdcada3SDoug Rabson #define RPCBPROC_BCAST ((unsigned long)(RPCBPROC_CALLIT)) 531dfdcada3SDoug Rabson extern rpcb_rmtcallres * rpcbproc_bcast_4(rpcb_rmtcallargs *, CLIENT *); 532dfdcada3SDoug Rabson extern rpcb_rmtcallres * rpcbproc_bcast_4_svc(rpcb_rmtcallargs *, struct svc_req *); 533dfdcada3SDoug Rabson extern u_int * rpcbproc_gettime_4(void *, CLIENT *); 534dfdcada3SDoug Rabson extern u_int * rpcbproc_gettime_4_svc(void *, struct svc_req *); 535dfdcada3SDoug Rabson extern struct netbuf * rpcbproc_uaddr2taddr_4(char **, CLIENT *); 536dfdcada3SDoug Rabson extern struct netbuf * rpcbproc_uaddr2taddr_4_svc(char **, struct svc_req *); 537dfdcada3SDoug Rabson extern char ** rpcbproc_taddr2uaddr_4(struct netbuf *, CLIENT *); 538dfdcada3SDoug Rabson extern char ** rpcbproc_taddr2uaddr_4_svc(struct netbuf *, struct svc_req *); 539dfdcada3SDoug Rabson #define RPCBPROC_GETVERSADDR ((unsigned long)(9)) 540dfdcada3SDoug Rabson extern char ** rpcbproc_getversaddr_4(RPCB *, CLIENT *); 541dfdcada3SDoug Rabson extern char ** rpcbproc_getversaddr_4_svc(RPCB *, struct svc_req *); 542dfdcada3SDoug Rabson #define RPCBPROC_INDIRECT ((unsigned long)(10)) 543dfdcada3SDoug Rabson extern rpcb_rmtcallres * rpcbproc_indirect_4(rpcb_rmtcallargs *, CLIENT *); 544dfdcada3SDoug Rabson extern rpcb_rmtcallres * rpcbproc_indirect_4_svc(rpcb_rmtcallargs *, struct svc_req *); 545dfdcada3SDoug Rabson #define RPCBPROC_GETADDRLIST ((unsigned long)(11)) 546dfdcada3SDoug Rabson extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4(RPCB *, CLIENT *); 547dfdcada3SDoug Rabson extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4_svc(RPCB *, struct svc_req *); 548dfdcada3SDoug Rabson #define RPCBPROC_GETSTAT ((unsigned long)(12)) 549dfdcada3SDoug Rabson extern rpcb_stat * rpcbproc_getstat_4(void *, CLIENT *); 550dfdcada3SDoug Rabson extern rpcb_stat * rpcbproc_getstat_4_svc(void *, struct svc_req *); 551dfdcada3SDoug Rabson extern int rpcbprog_4_freeresult(SVCXPRT *, xdrproc_t, caddr_t); 552dfdcada3SDoug Rabson 553dfdcada3SDoug Rabson /* the xdr functions */ 554dfdcada3SDoug Rabson extern bool_t xdr_rpcb(XDR *, RPCB *); 555dfdcada3SDoug Rabson #ifndef _KERNEL 556dfdcada3SDoug Rabson extern bool_t xdr_rp__list(XDR *, rp__list*); 557dfdcada3SDoug Rabson #endif 558dfdcada3SDoug Rabson extern bool_t xdr_rpcblist_ptr(XDR *, rpcblist_ptr*); 559dfdcada3SDoug Rabson extern bool_t xdr_rpcb_rmtcallargs(XDR *, rpcb_rmtcallargs*); 560dfdcada3SDoug Rabson extern bool_t xdr_rpcb_rmtcallres(XDR *, rpcb_rmtcallres*); 561dfdcada3SDoug Rabson extern bool_t xdr_rpcb_entry(XDR *, rpcb_entry*); 562dfdcada3SDoug Rabson extern bool_t xdr_rpcb_entry_list(XDR *, rpcb_entry_list*); 563dfdcada3SDoug Rabson extern bool_t xdr_rpcb_entry_list_ptr(XDR *, rpcb_entry_list_ptr*); 564dfdcada3SDoug Rabson extern bool_t xdr_rpcbs_addrlist(XDR *, rpcbs_addrlist*); 565dfdcada3SDoug Rabson extern bool_t xdr_rpcbs_rmtcalllist(XDR *, rpcbs_rmtcalllist*); 566dfdcada3SDoug Rabson extern bool_t xdr_rpcbs_proc(XDR *, rpcbs_proc); 567dfdcada3SDoug Rabson extern bool_t xdr_rpcbs_addrlist_ptr(XDR *, rpcbs_addrlist_ptr*); 568dfdcada3SDoug Rabson extern bool_t xdr_rpcbs_rmtcalllist_ptr(XDR *, rpcbs_rmtcalllist_ptr*); 569dfdcada3SDoug Rabson extern bool_t xdr_rpcb_stat(XDR *, rpcb_stat*); 570dfdcada3SDoug Rabson extern bool_t xdr_rpcb_stat_byvers(XDR *, rpcb_stat_byvers); 571dfdcada3SDoug Rabson 572dfdcada3SDoug Rabson #ifdef __cplusplus 573dfdcada3SDoug Rabson } 574dfdcada3SDoug Rabson #endif 575dfdcada3SDoug Rabson 576dfdcada3SDoug Rabson #endif /* !_RPCB_PROT_H_RPCGEN */ 577