Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:25:06

0001 /*  $NetBSD: types.h,v 1.13 2000/06/13 01:02:44 thorpej Exp $   */
0002 
0003 /*
0004  * Copyright (c) 2009, Sun Microsystems, Inc.
0005  * All rights reserved.
0006  *
0007  * Redistribution and use in source and binary forms, with or without
0008  * modification, are permitted provided that the following conditions are met:
0009  * - Redistributions of source code must retain the above copyright notice,
0010  *   this list of conditions and the following disclaimer.
0011  * - Redistributions in binary form must reproduce the above copyright notice,
0012  *   this list of conditions and the following disclaimer in the documentation
0013  *   and/or other materials provided with the distribution.
0014  * - Neither the name of Sun Microsystems, Inc. nor the names of its
0015  *   contributors may be used to endorse or promote products derived
0016  *   from this software without specific prior written permission.
0017  *
0018  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0019  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0020  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0021  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
0022  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0023  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0024  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0025  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0026  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0027  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0028  * POSSIBILITY OF SUCH DAMAGE.
0029  *
0030  *  from: @(#)types.h 1.18 87/07/24 SMI
0031  *  from: @(#)types.h   2.3 88/08/15 4.0 RPCSRC
0032  * $FreeBSD: src/include/rpc/types.h,v 1.10.6.1 2003/12/18 00:59:50 peter Exp $
0033  */
0034 
0035 /*
0036  * Rpc additions to <sys/types.h>
0037  */
0038 #ifndef _TIRPC_TYPES_H
0039 #define _TIRPC_TYPES_H
0040 
0041 #include <sys/types.h>
0042 
0043 typedef int32_t bool_t;
0044 typedef int32_t enum_t;
0045 
0046 typedef u_int32_t rpcprog_t;
0047 typedef u_int32_t rpcvers_t;
0048 typedef u_int32_t rpcproc_t;
0049 typedef u_int32_t rpcprot_t;
0050 typedef u_int32_t rpcport_t;
0051 typedef   int32_t rpc_inline_t;
0052 
0053 #ifndef NULL
0054 #   define NULL 0
0055 #endif
0056 #define __dontcare__    -1
0057 
0058 #ifndef FALSE
0059 #   define FALSE    (0)
0060 #endif
0061 #ifndef TRUE
0062 #   define TRUE (1)
0063 #endif
0064 
0065 #define mem_alloc(bsize)    calloc(1, bsize)
0066 #define mem_free(ptr, bsize)    free(ptr)
0067 
0068 
0069 #if defined __APPLE_CC__ || defined __FreeBSD__ || !defined (__GLIBC__)
0070 # define __u_char_defined
0071 # define __daddr_t_defined
0072 #endif
0073 
0074 #if defined __BIONIC__
0075 typedef int64_t quad_t;
0076 typedef uint64_t u_quad_t;
0077 #endif
0078 
0079 #ifndef __u_char_defined
0080 typedef __u_char u_char;
0081 typedef __u_short u_short;
0082 typedef __u_int u_int;
0083 typedef __u_long u_long;
0084 typedef __quad_t quad_t;
0085 typedef __u_quad_t u_quad_t;
0086 typedef __fsid_t fsid_t;
0087 # define __u_char_defined
0088 #endif
0089 #ifndef __daddr_t_defined
0090 typedef __daddr_t daddr_t;
0091 typedef __caddr_t caddr_t;
0092 # define __daddr_t_defined
0093 #endif
0094 
0095 #include <sys/time.h>
0096 #include <sys/param.h>
0097 #include <stdlib.h>
0098 #include <netconfig.h>
0099 
0100 /*
0101  * The netbuf structure is defined here, because FreeBSD / NetBSD only use
0102  * it inside the RPC code. It's in <xti.h> on SVR4, but it would be confusing
0103  * to have an xti.h, since FreeBSD / NetBSD does not support XTI/TLI.
0104  */
0105 
0106 /*
0107  * The netbuf structure is used for transport-independent address storage.
0108  */
0109 struct netbuf {
0110   unsigned int maxlen;
0111   unsigned int len;
0112   void *buf;
0113 };
0114 
0115 /*
0116  * The format of the addres and options arguments of the XTI t_bind call.
0117  * Only provided for compatibility, it should not be used.
0118  */
0119 
0120 struct t_bind {
0121   struct netbuf   addr;
0122   unsigned int    qlen;
0123 };
0124 
0125 /*
0126  * Internal library and rpcbind use. This is not an exported interface, do
0127  * not use.
0128  */
0129 struct __rpc_sockinfo {
0130     int si_af; 
0131     int si_proto;
0132     int si_socktype;
0133     int si_alen;
0134 };
0135 
0136 #endif /* _TIRPC_TYPES_H */