/*1* Please do not edit this file.2* It was generated using rpcgen.3*/45#ifndef _RPCB_PROT_H_RPCGEN6#define _RPCB_PROT_H_RPCGEN78#include <rpc/rpc.h>910#ifdef __cplusplus11extern "C" {12#endif1314/*-15* SPDX-License-Identifier: BSD-3-Clause16*17* Copyright (c) 2009, Sun Microsystems, Inc.18* All rights reserved.19*20* Redistribution and use in source and binary forms, with or without21* modification, are permitted provided that the following conditions are met:22* - Redistributions of source code must retain the above copyright notice,23* this list of conditions and the following disclaimer.24* - Redistributions in binary form must reproduce the above copyright notice,25* this list of conditions and the following disclaimer in the documentation26* and/or other materials provided with the distribution.27* - Neither the name of Sun Microsystems, Inc. nor the names of its28* contributors may be used to endorse or promote products derived29* from this software without specific prior written permission.30*31* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"32* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE33* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE34* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE35* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR36* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF37* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS38* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN39* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)40* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE41* POSSIBILITY OF SUCH DAMAGE.42*/43/*44* Copyright (c) 1988 by Sun Microsystems, Inc.45*/46/* from rpcb_prot.x */4748#ifndef _KERNEL495051/*52* The following procedures are supported by the protocol in version 3:53*54* RPCBPROC_NULL() returns ()55* takes nothing, returns nothing56*57* RPCBPROC_SET(rpcb) returns (bool_t)58* TRUE is success, FALSE is failure. Registers the tuple59* [prog, vers, address, owner, netid].60* Finds out owner and netid information on its own.61*62* RPCBPROC_UNSET(rpcb) returns (bool_t)63* TRUE is success, FALSE is failure. Un-registers tuple64* [prog, vers, netid]. addresses is ignored.65* If netid is NULL, unregister all.66*67* RPCBPROC_GETADDR(rpcb) returns (string).68* 0 is failure. Otherwise returns the universal address where the69* triple [prog, vers, netid] is registered. Ignore address and owner.70*71* RPCBPROC_DUMP() RETURNS (rpcblist_ptr)72* used to dump the entire rpcbind maps73*74* RPCBPROC_CALLIT(rpcb_rmtcallargs)75* RETURNS (rpcb_rmtcallres);76* Calls the procedure on the remote machine. If it is not registered,77* this procedure is quiet; i.e. it does not return error information!!!78* This routine only passes null authentication parameters.79* It has no interface to xdr routines for RPCBPROC_CALLIT.80*81* RPCBPROC_GETTIME() returns (int).82* Gets the remote machines time83*84* RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf)85* Returns the netbuf address from universal address.86*87* RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string)88* Returns the universal address from netbuf address.89*90* END OF RPCBIND VERSION 3 PROCEDURES91*/92/*93* Except for RPCBPROC_CALLIT, the procedures above are carried over to94* rpcbind version 4. Those below are added or modified for version 4.95* NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER96* AS RPCBPROC_CALLIT.97*98* RPCBPROC_BCAST(rpcb_rmtcallargs)99* RETURNS (rpcb_rmtcallres);100* Calls the procedure on the remote machine. If it is not registered,101* this procedure IS quiet; i.e. it DOES NOT return error information!!!102* This routine should be used for broadcasting and nothing else.103*104* RPCBPROC_GETVERSADDR(rpcb) returns (string).105* 0 is failure. Otherwise returns the universal address where the106* triple [prog, vers, netid] is registered. Ignore address and owner.107* Same as RPCBPROC_GETADDR except that if the given version number108* is not available, the address is not returned.109*110* RPCBPROC_INDIRECT(rpcb_rmtcallargs)111* RETURNS (rpcb_rmtcallres);112* Calls the procedure on the remote machine. If it is not registered,113* this procedure is NOT quiet; i.e. it DOES return error information!!!114* as any normal application would expect.115*116* RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr).117* Same as RPCBPROC_GETADDR except that it returns a list of all the118* addresses registered for the combination (prog, vers) (for all119* transports).120*121* RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers)122* Returns the statistics about the kind of requests received by rpcbind.123*/124125/*126* A mapping of (program, version, network ID) to address127*/128129struct rpcb {130rpcprog_t r_prog;131rpcvers_t r_vers;132char *r_netid;133char *r_addr;134char *r_owner;135};136typedef struct rpcb rpcb;137138typedef rpcb RPCB;139140141/*142* A list of mappings143*144* Below are two definitions for the rpcblist structure. This is done because145* xdr_rpcblist() is specified to take a struct rpcblist **, rather than a146* struct rpcblist * that rpcgen would produce. One version of the rpcblist147* structure (actually called rp__list) is used with rpcgen, and the other is148* defined only in the header file for compatibility with the specified149* interface.150*/151152struct rp__list {153rpcb rpcb_map;154struct rp__list *rpcb_next;155};156typedef struct rp__list rp__list;157158typedef rp__list *rpcblist_ptr;159160typedef struct rp__list rpcblist;161typedef struct rp__list RPCBLIST;162163#ifndef __cplusplus164struct rpcblist {165RPCB rpcb_map;166struct rpcblist *rpcb_next;167};168#endif169170#ifdef __cplusplus171extern "C" {172#endif173extern bool_t xdr_rpcblist(XDR *, rpcblist**);174#ifdef __cplusplus175}176#endif177178179/*180* Arguments of remote calls181*/182183struct rpcb_rmtcallargs {184rpcprog_t prog;185rpcvers_t vers;186rpcproc_t proc;187struct {188u_int args_len;189char *args_val;190} args;191};192typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;193194/*195* Client-side only representation of rpcb_rmtcallargs structure.196*197* The routine that XDRs the rpcb_rmtcallargs structure must deal with the198* opaque arguments in the "args" structure. xdr_rpcb_rmtcallargs() needs to199* be passed the XDR routine that knows the args' structure. This routine200* doesn't need to go over-the-wire (and it wouldn't make sense anyway) since201* the application being called already knows the args structure. So we use a202* different "XDR" structure on the client side, r_rpcb_rmtcallargs, which203* includes the args' XDR routine.204*/205struct r_rpcb_rmtcallargs {206rpcprog_t prog;207rpcvers_t vers;208rpcproc_t proc;209struct {210u_int args_len;211char *args_val;212} args;213xdrproc_t xdr_args; /* encodes args */214};215216217/*218* Results of the remote call219*/220221struct rpcb_rmtcallres {222char *addr;223struct {224u_int results_len;225char *results_val;226} results;227};228typedef struct rpcb_rmtcallres rpcb_rmtcallres;229230/*231* Client-side only representation of rpcb_rmtcallres structure.232*/233struct r_rpcb_rmtcallres {234char *addr;235struct {236uint32_t results_len;237char *results_val;238} results;239xdrproc_t xdr_res; /* decodes results */240};241242/*243* rpcb_entry contains a merged address of a service on a particular244* transport, plus associated netconfig information. A list of rpcb_entrys245* is returned by RPCBPROC_GETADDRLIST. See netconfig.h for values used246* in r_nc_* fields.247*/248249struct rpcb_entry {250char *r_maddr;251char *r_nc_netid;252u_int r_nc_semantics;253char *r_nc_protofmly;254char *r_nc_proto;255};256typedef struct rpcb_entry rpcb_entry;257258/*259* A list of addresses supported by a service.260*/261262struct rpcb_entry_list {263rpcb_entry rpcb_entry_map;264struct rpcb_entry_list *rpcb_entry_next;265};266typedef struct rpcb_entry_list rpcb_entry_list;267268typedef rpcb_entry_list *rpcb_entry_list_ptr;269270/*271* rpcbind statistics272*/273274#define rpcb_highproc_2 RPCBPROC_CALLIT275#define rpcb_highproc_3 RPCBPROC_TADDR2UADDR276#define rpcb_highproc_4 RPCBPROC_GETSTAT277#define RPCBSTAT_HIGHPROC 13278#define RPCBVERS_STAT 3279#define RPCBVERS_4_STAT 2280#define RPCBVERS_3_STAT 1281#define RPCBVERS_2_STAT 0282283/* Link list of all the stats about getport and getaddr */284285struct rpcbs_addrlist {286rpcprog_t prog;287rpcvers_t vers;288int success;289int failure;290char *netid;291struct rpcbs_addrlist *next;292};293typedef struct rpcbs_addrlist rpcbs_addrlist;294295/* Link list of all the stats about rmtcall */296297struct rpcbs_rmtcalllist {298rpcprog_t prog;299rpcvers_t vers;300rpcproc_t proc;301int success;302int failure;303int indirect;304char *netid;305struct rpcbs_rmtcalllist *next;306};307typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;308309typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];310311typedef rpcbs_addrlist *rpcbs_addrlist_ptr;312313typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;314315struct rpcb_stat {316rpcbs_proc info;317int setinfo;318int unsetinfo;319rpcbs_addrlist_ptr addrinfo;320rpcbs_rmtcalllist_ptr rmtinfo;321};322typedef struct rpcb_stat rpcb_stat;323324/*325* One rpcb_stat structure is returned for each version of rpcbind326* being monitored.327*/328329typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];330331/*332* We don't define netbuf in RPCL, since it would contain structure member333* names that would conflict with the definition of struct netbuf in334* <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here,335* and implement it ourselves in rpc/rpcb_prot.c.336*/337#ifdef __cplusplus338extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *);339340#else /* __STDC__ */341extern bool_t xdr_netbuf(XDR *, struct netbuf *);342343#endif344345#define RPCBVERS_3 RPCBVERS346#define RPCBVERS_4 RPCBVERS4347348#else /* ndef _KERNEL */349#ifdef __cplusplus350extern "C" {351#endif352353/*354* A mapping of (program, version, network ID) to address355*/356struct rpcb {357rpcprog_t r_prog; /* program number */358rpcvers_t r_vers; /* version number */359char *r_netid; /* network id */360char *r_addr; /* universal address */361char *r_owner; /* owner of the mapping */362};363typedef struct rpcb RPCB;364365/*366* A list of mappings367*/368struct rpcblist {369RPCB rpcb_map;370struct rpcblist *rpcb_next;371};372typedef struct rpcblist RPCBLIST;373typedef struct rpcblist *rpcblist_ptr;374375/*376* Remote calls arguments377*/378struct rpcb_rmtcallargs {379rpcprog_t prog; /* program number */380rpcvers_t vers; /* version number */381rpcproc_t proc; /* procedure number */382uint32_t arglen; /* arg len */383caddr_t args_ptr; /* argument */384xdrproc_t xdr_args; /* XDR routine for argument */385};386typedef struct rpcb_rmtcallargs rpcb_rmtcallargs;387388/*389* Remote calls results390*/391struct rpcb_rmtcallres {392char *addr_ptr; /* remote universal address */393uint32_t resultslen; /* results length */394caddr_t results_ptr; /* results */395xdrproc_t xdr_results; /* XDR routine for result */396};397typedef struct rpcb_rmtcallres rpcb_rmtcallres;398399struct rpcb_entry {400char *r_maddr;401char *r_nc_netid;402unsigned int r_nc_semantics;403char *r_nc_protofmly;404char *r_nc_proto;405};406typedef struct rpcb_entry rpcb_entry;407408/*409* A list of addresses supported by a service.410*/411412struct rpcb_entry_list {413rpcb_entry rpcb_entry_map;414struct rpcb_entry_list *rpcb_entry_next;415};416typedef struct rpcb_entry_list rpcb_entry_list;417418typedef rpcb_entry_list *rpcb_entry_list_ptr;419420/*421* rpcbind statistics422*/423424#define rpcb_highproc_2 RPCBPROC_CALLIT425#define rpcb_highproc_3 RPCBPROC_TADDR2UADDR426#define rpcb_highproc_4 RPCBPROC_GETSTAT427#define RPCBSTAT_HIGHPROC 13428#define RPCBVERS_STAT 3429#define RPCBVERS_4_STAT 2430#define RPCBVERS_3_STAT 1431#define RPCBVERS_2_STAT 0432433/* Link list of all the stats about getport and getaddr */434435struct rpcbs_addrlist {436rpcprog_t prog;437rpcvers_t vers;438int success;439int failure;440char *netid;441struct rpcbs_addrlist *next;442};443typedef struct rpcbs_addrlist rpcbs_addrlist;444445/* Link list of all the stats about rmtcall */446447struct rpcbs_rmtcalllist {448rpcprog_t prog;449rpcvers_t vers;450rpcproc_t proc;451int success;452int failure;453int indirect;454char *netid;455struct rpcbs_rmtcalllist *next;456};457typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist;458459typedef int rpcbs_proc[RPCBSTAT_HIGHPROC];460461typedef rpcbs_addrlist *rpcbs_addrlist_ptr;462463typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr;464465struct rpcb_stat {466rpcbs_proc info;467int setinfo;468int unsetinfo;469rpcbs_addrlist_ptr addrinfo;470rpcbs_rmtcalllist_ptr rmtinfo;471};472typedef struct rpcb_stat rpcb_stat;473474/*475* One rpcb_stat structure is returned for each version of rpcbind476* being monitored.477*/478479typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT];480481#ifdef __cplusplus482}483#endif484485#endif /* ndef _KERNEL */486487#define _PATH_RPCBINDSOCK "/var/run/rpcbind.sock"488489#define RPCBPROG ((unsigned long)(100000))490#define RPCBVERS ((unsigned long)(3))491492extern void rpcbprog_3(struct svc_req *rqstp, SVCXPRT *transp);493#define RPCBPROC_SET ((unsigned long)(1))494extern bool_t * rpcbproc_set_3(RPCB *, CLIENT *);495extern bool_t * rpcbproc_set_3_svc(RPCB *, struct svc_req *);496#define RPCBPROC_UNSET ((unsigned long)(2))497extern bool_t * rpcbproc_unset_3(RPCB *, CLIENT *);498extern bool_t * rpcbproc_unset_3_svc(RPCB *, struct svc_req *);499#define RPCBPROC_GETADDR ((unsigned long)(3))500extern char ** rpcbproc_getaddr_3(RPCB *, CLIENT *);501extern char ** rpcbproc_getaddr_3_svc(RPCB *, struct svc_req *);502#define RPCBPROC_DUMP ((unsigned long)(4))503extern rpcblist_ptr * rpcbproc_dump_3(void *, CLIENT *);504extern rpcblist_ptr * rpcbproc_dump_3_svc(void *, struct svc_req *);505#define RPCBPROC_CALLIT ((unsigned long)(5))506extern rpcb_rmtcallres * rpcbproc_callit_3(rpcb_rmtcallargs *, CLIENT *);507extern rpcb_rmtcallres * rpcbproc_callit_3_svc(rpcb_rmtcallargs *, struct svc_req *);508#define RPCBPROC_GETTIME ((unsigned long)(6))509extern u_int * rpcbproc_gettime_3(void *, CLIENT *);510extern u_int * rpcbproc_gettime_3_svc(void *, struct svc_req *);511#define RPCBPROC_UADDR2TADDR ((unsigned long)(7))512extern struct netbuf * rpcbproc_uaddr2taddr_3(char **, CLIENT *);513extern struct netbuf * rpcbproc_uaddr2taddr_3_svc(char **, struct svc_req *);514#define RPCBPROC_TADDR2UADDR ((unsigned long)(8))515extern char ** rpcbproc_taddr2uaddr_3(struct netbuf *, CLIENT *);516extern char ** rpcbproc_taddr2uaddr_3_svc(struct netbuf *, struct svc_req *);517extern int rpcbprog_3_freeresult(SVCXPRT *, xdrproc_t, caddr_t);518#define RPCBVERS4 ((unsigned long)(4))519520extern void rpcbprog_4(struct svc_req *rqstp, SVCXPRT *transp);521extern bool_t * rpcbproc_set_4(RPCB *, CLIENT *);522extern bool_t * rpcbproc_set_4_svc(RPCB *, struct svc_req *);523extern bool_t * rpcbproc_unset_4(RPCB *, CLIENT *);524extern bool_t * rpcbproc_unset_4_svc(RPCB *, struct svc_req *);525extern char ** rpcbproc_getaddr_4(RPCB *, CLIENT *);526extern char ** rpcbproc_getaddr_4_svc(RPCB *, struct svc_req *);527extern rpcblist_ptr * rpcbproc_dump_4(void *, CLIENT *);528extern rpcblist_ptr * rpcbproc_dump_4_svc(void *, struct svc_req *);529#define RPCBPROC_BCAST ((unsigned long)(RPCBPROC_CALLIT))530extern rpcb_rmtcallres * rpcbproc_bcast_4(rpcb_rmtcallargs *, CLIENT *);531extern rpcb_rmtcallres * rpcbproc_bcast_4_svc(rpcb_rmtcallargs *, struct svc_req *);532extern u_int * rpcbproc_gettime_4(void *, CLIENT *);533extern u_int * rpcbproc_gettime_4_svc(void *, struct svc_req *);534extern struct netbuf * rpcbproc_uaddr2taddr_4(char **, CLIENT *);535extern struct netbuf * rpcbproc_uaddr2taddr_4_svc(char **, struct svc_req *);536extern char ** rpcbproc_taddr2uaddr_4(struct netbuf *, CLIENT *);537extern char ** rpcbproc_taddr2uaddr_4_svc(struct netbuf *, struct svc_req *);538#define RPCBPROC_GETVERSADDR ((unsigned long)(9))539extern char ** rpcbproc_getversaddr_4(RPCB *, CLIENT *);540extern char ** rpcbproc_getversaddr_4_svc(RPCB *, struct svc_req *);541#define RPCBPROC_INDIRECT ((unsigned long)(10))542extern rpcb_rmtcallres * rpcbproc_indirect_4(rpcb_rmtcallargs *, CLIENT *);543extern rpcb_rmtcallres * rpcbproc_indirect_4_svc(rpcb_rmtcallargs *, struct svc_req *);544#define RPCBPROC_GETADDRLIST ((unsigned long)(11))545extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4(RPCB *, CLIENT *);546extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4_svc(RPCB *, struct svc_req *);547#define RPCBPROC_GETSTAT ((unsigned long)(12))548extern rpcb_stat * rpcbproc_getstat_4(void *, CLIENT *);549extern rpcb_stat * rpcbproc_getstat_4_svc(void *, struct svc_req *);550extern int rpcbprog_4_freeresult(SVCXPRT *, xdrproc_t, caddr_t);551552/* the xdr functions */553extern bool_t xdr_rpcb(XDR *, RPCB *);554#ifndef _KERNEL555extern bool_t xdr_rp__list(XDR *, rp__list*);556#endif557extern bool_t xdr_rpcblist_ptr(XDR *, rpcblist_ptr*);558extern bool_t xdr_rpcb_rmtcallargs(XDR *, rpcb_rmtcallargs*);559extern bool_t xdr_rpcb_rmtcallres(XDR *, rpcb_rmtcallres*);560extern bool_t xdr_rpcb_entry(XDR *, rpcb_entry*);561extern bool_t xdr_rpcb_entry_list(XDR *, rpcb_entry_list*);562extern bool_t xdr_rpcb_entry_list_ptr(XDR *, rpcb_entry_list_ptr*);563extern bool_t xdr_rpcbs_addrlist(XDR *, rpcbs_addrlist*);564extern bool_t xdr_rpcbs_rmtcalllist(XDR *, rpcbs_rmtcalllist*);565extern bool_t xdr_rpcbs_proc(XDR *, rpcbs_proc);566extern bool_t xdr_rpcbs_addrlist_ptr(XDR *, rpcbs_addrlist_ptr*);567extern bool_t xdr_rpcbs_rmtcalllist_ptr(XDR *, rpcbs_rmtcalllist_ptr*);568extern bool_t xdr_rpcb_stat(XDR *, rpcb_stat*);569extern bool_t xdr_rpcb_stat_byvers(XDR *, rpcb_stat_byvers);570571#ifdef __cplusplus572}573#endif574575#endif /* !_RPCB_PROT_H_RPCGEN */576577578