xref: /freebsd/include/rpc/clnt_soc.h (revision 2e322d379631c3bd6107e295f3e5d814c7845fc7)
18360efbdSAlfred Perlstein /*	$NetBSD: clnt_soc.h,v 1.1 2000/06/02 22:57:55 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) 1984 - 1991 by Sun Microsystems, Inc.
338360efbdSAlfred Perlstein  */
348360efbdSAlfred Perlstein 
358360efbdSAlfred Perlstein /*
368360efbdSAlfred Perlstein  * clnt.h - Client side remote procedure call interface.
378360efbdSAlfred Perlstein  */
388360efbdSAlfred Perlstein 
398360efbdSAlfred Perlstein #ifndef _RPC_CLNT_SOC_H
408360efbdSAlfred Perlstein #define _RPC_CLNT_SOC_H
418360efbdSAlfred Perlstein 
428360efbdSAlfred Perlstein /* derived from clnt_soc.h 1.3 88/12/17 SMI     */
438360efbdSAlfred Perlstein 
448360efbdSAlfred Perlstein /*
458360efbdSAlfred Perlstein  * All the following declarations are only for backward compatibility
468360efbdSAlfred Perlstein  * with TS-RPC.
478360efbdSAlfred Perlstein  */
488360efbdSAlfred Perlstein 
498360efbdSAlfred Perlstein #include <sys/cdefs.h>
508360efbdSAlfred Perlstein 
518360efbdSAlfred Perlstein #define UDPMSGSIZE      8800    /* rpc imposed limit on udp msg size */
528360efbdSAlfred Perlstein 
538360efbdSAlfred Perlstein /*
548360efbdSAlfred Perlstein  * TCP based rpc
558360efbdSAlfred Perlstein  * CLIENT *
568360efbdSAlfred Perlstein  * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
578360efbdSAlfred Perlstein  *	struct sockaddr_in *raddr;
588360efbdSAlfred Perlstein  *	u_long prog;
598360efbdSAlfred Perlstein  *	u_long version;
608360efbdSAlfred Perlstein  *	register int *sockp;
618360efbdSAlfred Perlstein  *	u_int sendsz;
628360efbdSAlfred Perlstein  *	u_int recvsz;
638360efbdSAlfred Perlstein  */
648360efbdSAlfred Perlstein __BEGIN_DECLS
65bb28f3c2SWarner Losh extern CLIENT *clnttcp_create(struct sockaddr_in *, u_long, u_long, int *,
66bb28f3c2SWarner Losh 			      u_int, u_int);
678360efbdSAlfred Perlstein __END_DECLS
688360efbdSAlfred Perlstein 
698360efbdSAlfred Perlstein /*
708360efbdSAlfred Perlstein  * Raw (memory) rpc.
718360efbdSAlfred Perlstein  */
728360efbdSAlfred Perlstein __BEGIN_DECLS
73bb28f3c2SWarner Losh extern CLIENT *clntraw_create(u_long, u_long);
748360efbdSAlfred Perlstein __END_DECLS
758360efbdSAlfred Perlstein 
768360efbdSAlfred Perlstein 
778360efbdSAlfred Perlstein /*
788360efbdSAlfred Perlstein  * UDP based rpc.
798360efbdSAlfred Perlstein  * CLIENT *
808360efbdSAlfred Perlstein  * clntudp_create(raddr, program, version, wait, sockp)
818360efbdSAlfred Perlstein  *	struct sockaddr_in *raddr;
828360efbdSAlfred Perlstein  *	u_long program;
838360efbdSAlfred Perlstein  *	u_long version;
848360efbdSAlfred Perlstein  *	struct timeval wait;
858360efbdSAlfred Perlstein  *	int *sockp;
868360efbdSAlfred Perlstein  *
878360efbdSAlfred Perlstein  * Same as above, but you specify max packet sizes.
888360efbdSAlfred Perlstein  * CLIENT *
898360efbdSAlfred Perlstein  * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
908360efbdSAlfred Perlstein  *	struct sockaddr_in *raddr;
918360efbdSAlfred Perlstein  *	u_long program;
928360efbdSAlfred Perlstein  *	u_long version;
938360efbdSAlfred Perlstein  *	struct timeval wait;
948360efbdSAlfred Perlstein  *	int *sockp;
958360efbdSAlfred Perlstein  *	u_int sendsz;
968360efbdSAlfred Perlstein  *	u_int recvsz;
978360efbdSAlfred Perlstein  */
988360efbdSAlfred Perlstein __BEGIN_DECLS
99bb28f3c2SWarner Losh extern CLIENT *clntudp_create(struct sockaddr_in *, u_long, u_long,
100bb28f3c2SWarner Losh 			      struct timeval, int *);
101bb28f3c2SWarner Losh extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, u_long, u_long,
102bb28f3c2SWarner Losh 				 struct timeval, int *, u_int, u_int);
1038360efbdSAlfred Perlstein __END_DECLS
1048360efbdSAlfred Perlstein 
1058360efbdSAlfred Perlstein #endif /* _RPC_CLNT_SOC_H */
106