xref: /netbsd-src/common/include/rpc/types.h (revision 077d1c0f365db1f9f0315d24fd965951eb1d90f2)
1*077d1c0fSandvar /*	$NetBSD: types.h,v 1.4 2021/08/02 12:56:22 andvar Exp $	*/
26f60c4f9Shannken 
36f60c4f9Shannken /*
46f60c4f9Shannken  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
56f60c4f9Shannken  * unrestricted use provided that this legend is included on all tape
66f60c4f9Shannken  * media and as a part of the software program in whole or part.  Users
76f60c4f9Shannken  * may copy or modify Sun RPC without charge, but are not authorized
86f60c4f9Shannken  * to license or distribute it to anyone else except as part of a product or
96f60c4f9Shannken  * program developed by the user.
106f60c4f9Shannken  *
116f60c4f9Shannken  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
126f60c4f9Shannken  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
136f60c4f9Shannken  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
146f60c4f9Shannken  *
156f60c4f9Shannken  * Sun RPC is provided with no support and without any obligation on the
166f60c4f9Shannken  * part of Sun Microsystems, Inc. to assist in its use, correction,
176f60c4f9Shannken  * modification or enhancement.
186f60c4f9Shannken  *
196f60c4f9Shannken  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
206f60c4f9Shannken  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
216f60c4f9Shannken  * OR ANY PART THEREOF.
226f60c4f9Shannken  *
236f60c4f9Shannken  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
246f60c4f9Shannken  * or profits or other special, indirect and consequential damages, even if
256f60c4f9Shannken  * Sun has been advised of the possibility of such damages.
266f60c4f9Shannken  *
276f60c4f9Shannken  * Sun Microsystems, Inc.
286f60c4f9Shannken  * 2550 Garcia Avenue
296f60c4f9Shannken  * Mountain View, California  94043
306f60c4f9Shannken  *
316f60c4f9Shannken  *	from: @(#)types.h 1.18 87/07/24 SMI
326f60c4f9Shannken  *	@(#)types.h	2.3 88/08/15 4.0 RPCSRC
336f60c4f9Shannken  */
346f60c4f9Shannken 
356f60c4f9Shannken /*
366f60c4f9Shannken  * Rpc additions to <sys/types.h>
376f60c4f9Shannken  */
386f60c4f9Shannken #ifndef _RPC_TYPES_H_
396f60c4f9Shannken #define _RPC_TYPES_H_
406f60c4f9Shannken 
416f60c4f9Shannken #include <sys/types.h>
426f60c4f9Shannken 
436f60c4f9Shannken typedef int32_t bool_t;
446f60c4f9Shannken typedef int32_t enum_t;
456f60c4f9Shannken 
466f60c4f9Shannken typedef uint32_t rpcprog_t;
476f60c4f9Shannken typedef uint32_t rpcvers_t;
486f60c4f9Shannken typedef uint32_t rpcproc_t;
496f60c4f9Shannken typedef uint32_t rpcprot_t;
506f60c4f9Shannken typedef uint32_t rpcport_t;
516f60c4f9Shannken typedef   int32_t rpc_inline_t;
526f60c4f9Shannken 
536f60c4f9Shannken #define __dontcare__	-1
546f60c4f9Shannken 
556f60c4f9Shannken #ifndef FALSE
566f60c4f9Shannken #	define FALSE	(0)
576f60c4f9Shannken #endif
586f60c4f9Shannken #ifndef TRUE
596f60c4f9Shannken #	define TRUE	(1)
606f60c4f9Shannken #endif
616f60c4f9Shannken #ifndef NULL
626f60c4f9Shannken #	define NULL	0
636f60c4f9Shannken #endif
646f60c4f9Shannken 
65c7814b62Shannken #if defined(_KERNEL) || defined(_STANDALONE)
66c7814b62Shannken 
67c7814b62Shannken #define warn(msg,...) /**/
68c7814b62Shannken 
69c7814b62Shannken #include <sys/kmem.h>
70c7814b62Shannken 
71c7814b62Shannken #define mem_alloc(bsize)	kmem_alloc(bsize, KM_SLEEP)
72c7814b62Shannken #define mem_free(ptr, bsize)	kmem_free(ptr, bsize)
73c7814b62Shannken 
74c7814b62Shannken #else /* _KERNEL || _STANDALONE */
75c7814b62Shannken 
766f60c4f9Shannken #define mem_alloc(bsize)	calloc((size_t)1, bsize)
776f60c4f9Shannken #define mem_free(ptr, bsize)	free(ptr)
786f60c4f9Shannken 
796f60c4f9Shannken #include <sys/time.h>
806f60c4f9Shannken #include <netconfig.h>
816f60c4f9Shannken 
826f60c4f9Shannken /*
836f60c4f9Shannken  * The netbuf structure is defined here, because NetBSD only uses it inside
846f60c4f9Shannken  * the RPC code. It's in <xti.h> on SVR4, but it would be confusing to
856f60c4f9Shannken  * have an xti.h, since NetBSD does not support XTI/TLI.
866f60c4f9Shannken  */
876f60c4f9Shannken 
886f60c4f9Shannken /*
896f60c4f9Shannken  * The netbuf structure is used for transport-independent address storage.
906f60c4f9Shannken  */
916f60c4f9Shannken struct netbuf {
926f60c4f9Shannken 	unsigned int maxlen;
936f60c4f9Shannken 	unsigned int len;
946f60c4f9Shannken 	void *buf;
956f60c4f9Shannken };
966f60c4f9Shannken 
976f60c4f9Shannken /*
98*077d1c0fSandvar  * The format of the address and options arguments of the XTI t_bind call.
996f60c4f9Shannken  * Only provided for compatibility, it should not be used.
1006f60c4f9Shannken  */
1016f60c4f9Shannken 
1026f60c4f9Shannken struct t_bind {
1036f60c4f9Shannken 	struct netbuf   addr;
1046f60c4f9Shannken 	unsigned int    qlen;
1056f60c4f9Shannken };
1066f60c4f9Shannken 
1076f60c4f9Shannken /*
1086f60c4f9Shannken  * Internal library and rpcbind use. This is not an exported interface, do
1096f60c4f9Shannken  * not use.
1106f60c4f9Shannken  */
1116f60c4f9Shannken struct __rpc_sockinfo {
1126f60c4f9Shannken 	int si_af;
1136f60c4f9Shannken 	int si_proto;
1146f60c4f9Shannken 	int si_socktype;
1156f60c4f9Shannken 	int si_alen;
1166f60c4f9Shannken };
1176f60c4f9Shannken 
118c7814b62Shannken #endif /* _KERNEL || _STANDALONE */
119c7814b62Shannken 
1206f60c4f9Shannken #endif /* !_RPC_TYPES_H_ */
121