Home | History | Annotate | Download | only in rpc
      1 /*
      2  * Copyright (c) 2010, Oracle America, Inc.
      3  * Redistribution and use in source and binary forms, with or without
      4  * modification, are permitted provided that the following conditions are
      5  * met:
      6  *
      7  *     * Redistributions of source code must retain the above copyright
      8  *       notice, this list of conditions and the following disclaimer.
      9  *     * Redistributions in binary form must reproduce the above
     10  *       copyright notice, this list of conditions and the following
     11  *       disclaimer in the documentation and/or other materials
     12  *       provided with the distribution.
     13  *     * Neither the name of the "Oracle America, Inc." nor the names of its
     14  *       contributors may be used to endorse or promote products derived
     15  *       from this software without specific prior written permission.
     16  *
     17  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     18  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     19  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     20  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
     21  *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
     22  *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     23  *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
     24  *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     25  *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     26  *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
     27  *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     28  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     29  */
     30 /* fixincludes should not add extern "C" to this file */
     31 /*
     32  * Rpc additions to <sys/types.h>
     33  */
     34 #ifndef _RPC_TYPES_H
     35 #define _RPC_TYPES_H 1
     36 
     37 typedef int bool_t;
     38 typedef int enum_t;
     39 /* This needs to be changed to uint32_t in the future */
     40 typedef unsigned long rpcprog_t;
     41 typedef unsigned long rpcvers_t;
     42 typedef unsigned long rpcproc_t;
     43 typedef unsigned long rpcprot_t;
     44 typedef unsigned long rpcport_t;
     45 
     46 #define        __dontcare__    -1
     47 
     48 #ifndef FALSE
     49 #      define  FALSE   (0)
     50 #endif
     51 
     52 #ifndef TRUE
     53 #      define  TRUE    (1)
     54 #endif
     55 
     56 #ifndef NULL
     57 #      define  NULL 0
     58 #endif
     59 
     60 #include <stdlib.h>		/* For malloc decl.  */
     61 #define mem_alloc(bsize)	malloc(bsize)
     62 /*
     63  * XXX: This must not use the second argument, or code in xdr_array.c needs
     64  * to be modified.
     65  */
     66 #define mem_free(ptr, bsize)	free(ptr)
     67 
     68 #ifndef makedev /* ie, we haven't already included it */
     69 #include <sys/types.h>
     70 #endif
     71 
     72 #ifndef __u_char_defined
     73 typedef __u_char u_char;
     74 typedef __u_short u_short;
     75 typedef __u_int u_int;
     76 typedef __u_long u_long;
     77 typedef __quad_t quad_t;
     78 typedef __u_quad_t u_quad_t;
     79 typedef __fsid_t fsid_t;
     80 # define __u_char_defined
     81 #endif
     82 #ifndef __daddr_t_defined
     83 typedef __daddr_t daddr_t;
     84 typedef __caddr_t caddr_t;
     85 # define __daddr_t_defined
     86 #endif
     87 
     88 #include <sys/time.h>
     89 #include <sys/param.h>
     90 
     91 #include <netinet/in.h>
     92 
     93 #ifndef INADDR_LOOPBACK
     94 #define       INADDR_LOOPBACK         (u_long)0x7F000001
     95 #endif
     96 #ifndef MAXHOSTNAMELEN
     97 #define        MAXHOSTNAMELEN  64
     98 #endif
     99 
    100 #endif /* rpc/types.h */
    101