1 1.4 andvar /* $NetBSD: types.h,v 1.4 2021/08/02 12:56:22 andvar Exp $ */ 2 1.1 hannken 3 1.1 hannken /* 4 1.1 hannken * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 5 1.1 hannken * unrestricted use provided that this legend is included on all tape 6 1.1 hannken * media and as a part of the software program in whole or part. Users 7 1.1 hannken * may copy or modify Sun RPC without charge, but are not authorized 8 1.1 hannken * to license or distribute it to anyone else except as part of a product or 9 1.1 hannken * program developed by the user. 10 1.1 hannken * 11 1.1 hannken * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 12 1.1 hannken * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 13 1.1 hannken * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 14 1.1 hannken * 15 1.1 hannken * Sun RPC is provided with no support and without any obligation on the 16 1.1 hannken * part of Sun Microsystems, Inc. to assist in its use, correction, 17 1.1 hannken * modification or enhancement. 18 1.1 hannken * 19 1.1 hannken * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 20 1.1 hannken * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 21 1.1 hannken * OR ANY PART THEREOF. 22 1.1 hannken * 23 1.1 hannken * In no event will Sun Microsystems, Inc. be liable for any lost revenue 24 1.1 hannken * or profits or other special, indirect and consequential damages, even if 25 1.1 hannken * Sun has been advised of the possibility of such damages. 26 1.1 hannken * 27 1.1 hannken * Sun Microsystems, Inc. 28 1.1 hannken * 2550 Garcia Avenue 29 1.1 hannken * Mountain View, California 94043 30 1.1 hannken * 31 1.1 hannken * from: @(#)types.h 1.18 87/07/24 SMI 32 1.1 hannken * @(#)types.h 2.3 88/08/15 4.0 RPCSRC 33 1.1 hannken */ 34 1.1 hannken 35 1.1 hannken /* 36 1.1 hannken * Rpc additions to <sys/types.h> 37 1.1 hannken */ 38 1.1 hannken #ifndef _RPC_TYPES_H_ 39 1.1 hannken #define _RPC_TYPES_H_ 40 1.1 hannken 41 1.1 hannken #include <sys/types.h> 42 1.1 hannken 43 1.1 hannken typedef int32_t bool_t; 44 1.1 hannken typedef int32_t enum_t; 45 1.1 hannken 46 1.1 hannken typedef uint32_t rpcprog_t; 47 1.1 hannken typedef uint32_t rpcvers_t; 48 1.1 hannken typedef uint32_t rpcproc_t; 49 1.1 hannken typedef uint32_t rpcprot_t; 50 1.1 hannken typedef uint32_t rpcport_t; 51 1.1 hannken typedef int32_t rpc_inline_t; 52 1.1 hannken 53 1.1 hannken #define __dontcare__ -1 54 1.1 hannken 55 1.1 hannken #ifndef FALSE 56 1.1 hannken # define FALSE (0) 57 1.1 hannken #endif 58 1.1 hannken #ifndef TRUE 59 1.1 hannken # define TRUE (1) 60 1.1 hannken #endif 61 1.1 hannken #ifndef NULL 62 1.1 hannken # define NULL 0 63 1.1 hannken #endif 64 1.1 hannken 65 1.2 hannken #if defined(_KERNEL) || defined(_STANDALONE) 66 1.2 hannken 67 1.2 hannken #define warn(msg,...) /**/ 68 1.2 hannken 69 1.2 hannken #include <sys/kmem.h> 70 1.2 hannken 71 1.2 hannken #define mem_alloc(bsize) kmem_alloc(bsize, KM_SLEEP) 72 1.2 hannken #define mem_free(ptr, bsize) kmem_free(ptr, bsize) 73 1.2 hannken 74 1.2 hannken #else /* _KERNEL || _STANDALONE */ 75 1.2 hannken 76 1.1 hannken #define mem_alloc(bsize) calloc((size_t)1, bsize) 77 1.1 hannken #define mem_free(ptr, bsize) free(ptr) 78 1.1 hannken 79 1.1 hannken #include <sys/time.h> 80 1.1 hannken #include <netconfig.h> 81 1.1 hannken 82 1.1 hannken /* 83 1.1 hannken * The netbuf structure is defined here, because NetBSD only uses it inside 84 1.1 hannken * the RPC code. It's in <xti.h> on SVR4, but it would be confusing to 85 1.1 hannken * have an xti.h, since NetBSD does not support XTI/TLI. 86 1.1 hannken */ 87 1.1 hannken 88 1.1 hannken /* 89 1.1 hannken * The netbuf structure is used for transport-independent address storage. 90 1.1 hannken */ 91 1.1 hannken struct netbuf { 92 1.1 hannken unsigned int maxlen; 93 1.1 hannken unsigned int len; 94 1.1 hannken void *buf; 95 1.1 hannken }; 96 1.1 hannken 97 1.1 hannken /* 98 1.4 andvar * The format of the address and options arguments of the XTI t_bind call. 99 1.1 hannken * Only provided for compatibility, it should not be used. 100 1.1 hannken */ 101 1.1 hannken 102 1.1 hannken struct t_bind { 103 1.1 hannken struct netbuf addr; 104 1.1 hannken unsigned int qlen; 105 1.1 hannken }; 106 1.1 hannken 107 1.1 hannken /* 108 1.1 hannken * Internal library and rpcbind use. This is not an exported interface, do 109 1.1 hannken * not use. 110 1.1 hannken */ 111 1.1 hannken struct __rpc_sockinfo { 112 1.1 hannken int si_af; 113 1.1 hannken int si_proto; 114 1.1 hannken int si_socktype; 115 1.1 hannken int si_alen; 116 1.1 hannken }; 117 1.1 hannken 118 1.2 hannken #endif /* _KERNEL || _STANDALONE */ 119 1.2 hannken 120 1.1 hannken #endif /* !_RPC_TYPES_H_ */ 121