174462Salfred/* $NetBSD: svc_soc.h,v 1.1 2000/06/02 22:57:57 fvdl Exp $ */ 274462Salfred/* $FreeBSD$ */ 374462Salfred 4258578Shrs/*- 5258578Shrs * Copyright (c) 2009, Sun Microsystems, Inc. 6258578Shrs * All rights reserved. 7258578Shrs * 8258578Shrs * Redistribution and use in source and binary forms, with or without 9258578Shrs * modification, are permitted provided that the following conditions are met: 10258578Shrs * - Redistributions of source code must retain the above copyright notice, 11258578Shrs * this list of conditions and the following disclaimer. 12258578Shrs * - Redistributions in binary form must reproduce the above copyright notice, 13258578Shrs * this list of conditions and the following disclaimer in the documentation 14258578Shrs * and/or other materials provided with the distribution. 15258578Shrs * - Neither the name of Sun Microsystems, Inc. nor the names of its 16258578Shrs * contributors may be used to endorse or promote products derived 17258578Shrs * from this software without specific prior written permission. 18258578Shrs * 19258578Shrs * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20258578Shrs * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21258578Shrs * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22258578Shrs * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23258578Shrs * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24258578Shrs * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25258578Shrs * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26258578Shrs * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27258578Shrs * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28258578Shrs * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29258578Shrs * POSSIBILITY OF SUCH DAMAGE. 3074462Salfred */ 3174462Salfred/* 3274462Salfred * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc. 3374462Salfred */ 3474462Salfred 3574462Salfred/* 3674462Salfred * svc.h, Server-side remote procedure call interface. 3774462Salfred */ 3874462Salfred 3974462Salfred#ifndef _RPC_SVC_SOC_H 4074462Salfred#define _RPC_SVC_SOC_H 4174462Salfred#include <sys/cdefs.h> 4274462Salfred 4374462Salfred/* #pragma ident "@(#)svc_soc.h 1.11 94/04/25 SMI" */ 4474462Salfred/* svc_soc.h 1.8 89/05/01 SMI */ 4574462Salfred 4674462Salfred/* 4774462Salfred * All the following declarations are only for backward compatibility 4874462Salfred * with TS-RPC 4974462Salfred */ 5074462Salfred 5174462Salfred/* 5274462Salfred * Approved way of getting address of caller 5374462Salfred */ 5474462Salfred#define svc_getcaller(x) (&(x)->xp_raddr) 5574462Salfred 5674462Salfred/* 5774462Salfred * Service registration 5874462Salfred * 5974462Salfred * svc_register(xprt, prog, vers, dispatch, protocol) 6074462Salfred * SVCXPRT *xprt; 6174462Salfred * u_long prog; 6274462Salfred * u_long vers; 6374462Salfred * void (*dispatch)(); 6474462Salfred * int protocol; like TCP or UDP, zero means do not register 6574462Salfred */ 6674462Salfred__BEGIN_DECLS 6793032Simpextern bool_t svc_register(SVCXPRT *, u_long, u_long, 6893032Simp void (*)(struct svc_req *, SVCXPRT *), int); 6974462Salfred__END_DECLS 7074462Salfred 7174462Salfred/* 7274462Salfred * Service un-registration 7374462Salfred * 7474462Salfred * svc_unregister(prog, vers) 7574462Salfred * u_long prog; 7674462Salfred * u_long vers; 7774462Salfred */ 7874462Salfred__BEGIN_DECLS 7993032Simpextern void svc_unregister(u_long, u_long); 8074462Salfred__END_DECLS 8174462Salfred 8274462Salfred 8374462Salfred/* 8474462Salfred * Memory based rpc for testing and timing. 8574462Salfred */ 8674462Salfred__BEGIN_DECLS 8793032Simpextern SVCXPRT *svcraw_create(void); 8874462Salfred__END_DECLS 8974462Salfred 9074462Salfred 9174462Salfred/* 9274462Salfred * Udp based rpc. 9374462Salfred */ 9474462Salfred__BEGIN_DECLS 9593032Simpextern SVCXPRT *svcudp_create(int); 9693032Simpextern SVCXPRT *svcudp_bufcreate(int, u_int, u_int); 9793032Simpextern int svcudp_enablecache(SVCXPRT *, u_long); 9874462Salfred__END_DECLS 9974462Salfred 10074462Salfred 10174462Salfred/* 10274462Salfred * Tcp based rpc. 10374462Salfred */ 10474462Salfred__BEGIN_DECLS 10593032Simpextern SVCXPRT *svctcp_create(int, u_int, u_int); 10674462Salfred__END_DECLS 10774462Salfred 10874462Salfred/* 10974462Salfred * Fd based rpc. 11074462Salfred */ 11174462Salfred__BEGIN_DECLS 11293032Simpextern SVCXPRT *svcfd_create(int, u_int, u_int); 11374462Salfred__END_DECLS 11474462Salfred 11574462Salfred#endif /* !_RPC_SVC_SOC_H */ 116