18360efbdSAlfred Perlstein /* $NetBSD: svc_soc.h,v 1.1 2000/06/02 22:57:57 fvdl Exp $ */ 28360efbdSAlfred Perlstein /* $FreeBSD$ */ 38360efbdSAlfred Perlstein 4*2e322d37SHiroki Sato /*- 5*2e322d37SHiroki Sato * Copyright (c) 2009, Sun Microsystems, Inc. 6*2e322d37SHiroki Sato * All rights reserved. 78360efbdSAlfred Perlstein * 8*2e322d37SHiroki Sato * Redistribution and use in source and binary forms, with or without 9*2e322d37SHiroki Sato * modification, are permitted provided that the following conditions are met: 10*2e322d37SHiroki Sato * - Redistributions of source code must retain the above copyright notice, 11*2e322d37SHiroki Sato * this list of conditions and the following disclaimer. 12*2e322d37SHiroki Sato * - Redistributions in binary form must reproduce the above copyright notice, 13*2e322d37SHiroki Sato * this list of conditions and the following disclaimer in the documentation 14*2e322d37SHiroki Sato * and/or other materials provided with the distribution. 15*2e322d37SHiroki Sato * - Neither the name of Sun Microsystems, Inc. nor the names of its 16*2e322d37SHiroki Sato * contributors may be used to endorse or promote products derived 17*2e322d37SHiroki Sato * from this software without specific prior written permission. 188360efbdSAlfred Perlstein * 19*2e322d37SHiroki Sato * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20*2e322d37SHiroki Sato * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21*2e322d37SHiroki Sato * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22*2e322d37SHiroki Sato * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23*2e322d37SHiroki Sato * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24*2e322d37SHiroki Sato * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25*2e322d37SHiroki Sato * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26*2e322d37SHiroki Sato * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27*2e322d37SHiroki Sato * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28*2e322d37SHiroki Sato * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29*2e322d37SHiroki Sato * POSSIBILITY OF SUCH DAMAGE. 308360efbdSAlfred Perlstein */ 318360efbdSAlfred Perlstein /* 328360efbdSAlfred Perlstein * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc. 338360efbdSAlfred Perlstein */ 348360efbdSAlfred Perlstein 358360efbdSAlfred Perlstein /* 368360efbdSAlfred Perlstein * svc.h, Server-side remote procedure call interface. 378360efbdSAlfred Perlstein */ 388360efbdSAlfred Perlstein 398360efbdSAlfred Perlstein #ifndef _RPC_SVC_SOC_H 408360efbdSAlfred Perlstein #define _RPC_SVC_SOC_H 418360efbdSAlfred Perlstein #include <sys/cdefs.h> 428360efbdSAlfred Perlstein 438360efbdSAlfred Perlstein /* #pragma ident "@(#)svc_soc.h 1.11 94/04/25 SMI" */ 448360efbdSAlfred Perlstein /* svc_soc.h 1.8 89/05/01 SMI */ 458360efbdSAlfred Perlstein 468360efbdSAlfred Perlstein /* 478360efbdSAlfred Perlstein * All the following declarations are only for backward compatibility 488360efbdSAlfred Perlstein * with TS-RPC 498360efbdSAlfred Perlstein */ 508360efbdSAlfred Perlstein 518360efbdSAlfred Perlstein /* 528360efbdSAlfred Perlstein * Approved way of getting address of caller 538360efbdSAlfred Perlstein */ 548360efbdSAlfred Perlstein #define svc_getcaller(x) (&(x)->xp_raddr) 558360efbdSAlfred Perlstein 568360efbdSAlfred Perlstein /* 578360efbdSAlfred Perlstein * Service registration 588360efbdSAlfred Perlstein * 598360efbdSAlfred Perlstein * svc_register(xprt, prog, vers, dispatch, protocol) 608360efbdSAlfred Perlstein * SVCXPRT *xprt; 618360efbdSAlfred Perlstein * u_long prog; 628360efbdSAlfred Perlstein * u_long vers; 638360efbdSAlfred Perlstein * void (*dispatch)(); 648360efbdSAlfred Perlstein * int protocol; like TCP or UDP, zero means do not register 658360efbdSAlfred Perlstein */ 668360efbdSAlfred Perlstein __BEGIN_DECLS 67bb28f3c2SWarner Losh extern bool_t svc_register(SVCXPRT *, u_long, u_long, 68bb28f3c2SWarner Losh void (*)(struct svc_req *, SVCXPRT *), int); 698360efbdSAlfred Perlstein __END_DECLS 708360efbdSAlfred Perlstein 718360efbdSAlfred Perlstein /* 728360efbdSAlfred Perlstein * Service un-registration 738360efbdSAlfred Perlstein * 748360efbdSAlfred Perlstein * svc_unregister(prog, vers) 758360efbdSAlfred Perlstein * u_long prog; 768360efbdSAlfred Perlstein * u_long vers; 778360efbdSAlfred Perlstein */ 788360efbdSAlfred Perlstein __BEGIN_DECLS 79bb28f3c2SWarner Losh extern void svc_unregister(u_long, u_long); 808360efbdSAlfred Perlstein __END_DECLS 818360efbdSAlfred Perlstein 828360efbdSAlfred Perlstein 838360efbdSAlfred Perlstein /* 848360efbdSAlfred Perlstein * Memory based rpc for testing and timing. 858360efbdSAlfred Perlstein */ 868360efbdSAlfred Perlstein __BEGIN_DECLS 87bb28f3c2SWarner Losh extern SVCXPRT *svcraw_create(void); 888360efbdSAlfred Perlstein __END_DECLS 898360efbdSAlfred Perlstein 908360efbdSAlfred Perlstein 918360efbdSAlfred Perlstein /* 928360efbdSAlfred Perlstein * Udp based rpc. 938360efbdSAlfred Perlstein */ 948360efbdSAlfred Perlstein __BEGIN_DECLS 95bb28f3c2SWarner Losh extern SVCXPRT *svcudp_create(int); 96bb28f3c2SWarner Losh extern SVCXPRT *svcudp_bufcreate(int, u_int, u_int); 97bb28f3c2SWarner Losh extern int svcudp_enablecache(SVCXPRT *, u_long); 988360efbdSAlfred Perlstein __END_DECLS 998360efbdSAlfred Perlstein 1008360efbdSAlfred Perlstein 1018360efbdSAlfred Perlstein /* 1028360efbdSAlfred Perlstein * Tcp based rpc. 1038360efbdSAlfred Perlstein */ 1048360efbdSAlfred Perlstein __BEGIN_DECLS 105bb28f3c2SWarner Losh extern SVCXPRT *svctcp_create(int, u_int, u_int); 1068360efbdSAlfred Perlstein __END_DECLS 1078360efbdSAlfred Perlstein 1088360efbdSAlfred Perlstein /* 1098360efbdSAlfred Perlstein * Fd based rpc. 1108360efbdSAlfred Perlstein */ 1118360efbdSAlfred Perlstein __BEGIN_DECLS 112bb28f3c2SWarner Losh extern SVCXPRT *svcfd_create(int, u_int, u_int); 1138360efbdSAlfred Perlstein __END_DECLS 1148360efbdSAlfred Perlstein 1158360efbdSAlfred Perlstein #endif /* !_RPC_SVC_SOC_H */ 116