/* $NetBSD: types.h,v 1.13 2000/06/13 01:02:44 thorpej Exp $ */12/*-3* SPDX-License-Identifier: BSD-3-Clause4*5* Copyright (c) 2009, Sun Microsystems, Inc.6* All rights reserved.7*8* Redistribution and use in source and binary forms, with or without9* modification, are permitted provided that the following conditions are met:10* - Redistributions of source code must retain the above copyright notice,11* this list of conditions and the following disclaimer.12* - Redistributions in binary form must reproduce the above copyright notice,13* this list of conditions and the following disclaimer in the documentation14* and/or other materials provided with the distribution.15* - Neither the name of Sun Microsystems, Inc. nor the names of its16* contributors may be used to endorse or promote products derived17* from this software without specific prior written permission.18*19* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"20* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE21* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE22* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE23* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR24* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF25* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS26* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN27* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)28* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE29* POSSIBILITY OF SUCH DAMAGE.30*/3132/*33* Rpc additions to <sys/types.h>34*/35#ifndef _RPC_TYPES_H36#define _RPC_TYPES_H3738#include <sys/types.h>39#include <sys/_null.h>4041typedef int32_t bool_t;42typedef int32_t enum_t;4344typedef uint32_t rpcprog_t;45typedef uint32_t rpcvers_t;46typedef uint32_t rpcproc_t;47typedef uint32_t rpcprot_t;48typedef uint32_t rpcport_t;49typedef int32_t rpc_inline_t;5051#define __dontcare__ -15253#ifndef FALSE54# define FALSE (0)55#endif56#ifndef TRUE57# define TRUE (1)58#endif5960#ifdef _KERNEL61#ifdef _SYS_MALLOC_H_62MALLOC_DECLARE(M_RPC);63#endif64#define mem_alloc(bsize) malloc(bsize, M_RPC, M_WAITOK|M_ZERO)65#define mem_free(ptr, bsize) free(ptr, M_RPC)66#else67#define mem_alloc(bsize) calloc(1, bsize)68#define mem_free(ptr, bsize) free(ptr)69#endif7071#include <sys/time.h>72#ifdef _KERNEL73#include <rpc/netconfig.h>74#else75#include <netconfig.h>76#endif7778/*79* The netbuf structure is defined here, because FreeBSD / NetBSD only use80* it inside the RPC code. It's in <xti.h> on SVR4, but it would be confusing81* to have an xti.h, since FreeBSD / NetBSD does not support XTI/TLI.82*/8384/*85* The netbuf structure is used for transport-independent address storage.86*/87struct netbuf {88unsigned int maxlen;89unsigned int len;90void *buf;91};9293/*94* The format of the address and options arguments of the XTI t_bind call.95* Only provided for compatibility, it should not be used.96*/9798struct t_bind {99struct netbuf addr;100unsigned int qlen;101};102103/*104* Internal library and rpcbind use. This is not an exported interface, do105* not use.106*/107struct __rpc_sockinfo {108int si_af;109int si_proto;110int si_socktype;111int si_alen;112};113114#endif /* !_RPC_TYPES_H */115116117