174462Salfred/* $NetBSD: types.h,v 1.13 2000/06/13 01:02:44 thorpej Exp $ */ 274462Salfred 3261046Smav/*- 4261046Smav * Copyright (c) 2009, Sun Microsystems, Inc. 5261046Smav * All rights reserved. 68858Srgrimes * 7261046Smav * Redistribution and use in source and binary forms, with or without 8261046Smav * modification, are permitted provided that the following conditions are met: 9261046Smav * - Redistributions of source code must retain the above copyright notice, 10261046Smav * this list of conditions and the following disclaimer. 11261046Smav * - Redistributions in binary form must reproduce the above copyright notice, 12261046Smav * this list of conditions and the following disclaimer in the documentation 13261046Smav * and/or other materials provided with the distribution. 14261046Smav * - Neither the name of Sun Microsystems, Inc. nor the names of its 15261046Smav * contributors may be used to endorse or promote products derived 16261046Smav * from this software without specific prior written permission. 17261046Smav * 18261046Smav * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19261046Smav * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20261046Smav * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21261046Smav * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22261046Smav * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23261046Smav * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24261046Smav * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25261046Smav * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26261046Smav * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27261046Smav * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28261046Smav * POSSIBILITY OF SUCH DAMAGE. 298858Srgrimes * 301903Swollman * from: @(#)types.h 1.18 87/07/24 SMI 311903Swollman * from: @(#)types.h 2.3 88/08/15 4.0 RPCSRC 3250473Speter * $FreeBSD$ 331839Swollman */ 341839Swollman 351839Swollman/* 361839Swollman * Rpc additions to <sys/types.h> 371839Swollman */ 381903Swollman#ifndef _RPC_TYPES_H 391903Swollman#define _RPC_TYPES_H 401839Swollman 4174462Salfred#include <sys/types.h> 42123257Smarcel#include <sys/_null.h> 4374462Salfred 4474462Salfredtypedef int32_t bool_t; 4574462Salfredtypedef int32_t enum_t; 4674462Salfred 47177633Sdfrtypedef uint32_t rpcprog_t; 48177633Sdfrtypedef uint32_t rpcvers_t; 49177633Sdfrtypedef uint32_t rpcproc_t; 50177633Sdfrtypedef uint32_t rpcprot_t; 51177633Sdfrtypedef uint32_t rpcport_t; 52177633Sdfrtypedef int32_t rpc_inline_t; 5374462Salfred 541839Swollman#define __dontcare__ -1 551903Swollman 561903Swollman#ifndef FALSE 571903Swollman# define FALSE (0) 581903Swollman#endif 591903Swollman#ifndef TRUE 601903Swollman# define TRUE (1) 611903Swollman#endif 621839Swollman 63177633Sdfr#ifdef _KERNEL 64177633Sdfr#ifdef _SYS_MALLOC_H_ 65177633SdfrMALLOC_DECLARE(M_RPC); 66177633Sdfr#endif 67177633Sdfr#define mem_alloc(bsize) malloc(bsize, M_RPC, M_WAITOK|M_ZERO) 68177633Sdfr#define mem_free(ptr, bsize) free(ptr, M_RPC) 69177633Sdfr#else 7074462Salfred#define mem_alloc(bsize) calloc(1, bsize) 711839Swollman#define mem_free(ptr, bsize) free(ptr) 72177633Sdfr#endif 731839Swollman 741839Swollman#include <sys/time.h> 75177633Sdfr#ifdef _KERNEL 76177633Sdfr#include <rpc/netconfig.h> 77177633Sdfr#else 7874462Salfred#include <netconfig.h> 79168606Spjd#endif 801839Swollman 8174462Salfred/* 8274462Salfred * The netbuf structure is defined here, because FreeBSD / NetBSD only use 8374462Salfred * it inside the RPC code. It's in <xti.h> on SVR4, but it would be confusing 8474462Salfred * to have an xti.h, since FreeBSD / NetBSD does not support XTI/TLI. 8574462Salfred */ 8674462Salfred 8774462Salfred/* 8874462Salfred * The netbuf structure is used for transport-independent address storage. 8974462Salfred */ 9074462Salfredstruct netbuf { 9174462Salfred unsigned int maxlen; 9274462Salfred unsigned int len; 9374462Salfred void *buf; 9474462Salfred}; 9574462Salfred 9674462Salfred/* 9774462Salfred * The format of the addres and options arguments of the XTI t_bind call. 9874462Salfred * Only provided for compatibility, it should not be used. 9974462Salfred */ 10074462Salfred 10174462Salfredstruct t_bind { 10274462Salfred struct netbuf addr; 10374462Salfred unsigned int qlen; 10474462Salfred}; 10574462Salfred 10674462Salfred/* 10774462Salfred * Internal library and rpcbind use. This is not an exported interface, do 10874462Salfred * not use. 10974462Salfred */ 11074462Salfredstruct __rpc_sockinfo { 11174462Salfred int si_af; 11274462Salfred int si_proto; 11374462Salfred int si_socktype; 11474462Salfred int si_alen; 11574462Salfred}; 11674462Salfred 1171903Swollman#endif /* !_RPC_TYPES_H */ 118