Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/ntirpc/rpc/types.h
$ cat -n /usr/include/ntirpc/rpc/types.h 1 /* $NetBSD: types.h,v 1.13 2000/06/13 01:02:44 thorpej Exp $ */ 2 3 /* 4 * Copyright (c) 2009, Sun Microsystems, Inc. 5 * Copyright (c) 2012-2017 Red Hat, Inc. and/or its affiliates. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * 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 documentation 14 * and/or other materials provided with the distribution. 15 * - Neither the name of Sun Microsystems, Inc. nor the names of its 16 * contributors may be used to endorse or promote products derived 17 * 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, THE 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * 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 THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 * 31 * from: @(#)types.h 1.18 87/07/24 SMI 32 * from: @(#)types.h 2.3 88/08/15 4.0 RPCSRC 33 * $FreeBSD: src/include/rpc/types.h,v 1.10.6.1 2003/12/18 00:59:50 peter Exp $ 34 */ 35 36 /* 37 * Rpc additions to
38 */ 39 #ifndef _TIRPC_TYPES_H 40 #define _TIRPC_TYPES_H 41 42 #ifdef _MSC_VER 43 #include
44 #else 45 #include
46 #endif 47 #include
48 #include
49 #include
50 51 #if defined(_WIN32) 52 53 #define __BEGIN_DECLS 54 #define __END_DECLS 55 56 /* integral types */ 57 #ifndef _MSC_VER 58 #include <_bsd_types.h> /* XXX mingw (defines u_long) */ 59 #endif 60 typedef uint8_t u_char; 61 typedef uint16_t u_int16_t; 62 typedef uint16_t u_short_t; 63 typedef uint16_t u_short; 64 typedef uint32_t u_int; 65 typedef uint32_t u_int32_t; 66 typedef int64_t quad_t; 67 typedef uint64_t u_int64_t; 68 typedef uint64_t u_quad_t; 69 70 /* misc */ 71 typedef uint32_t uid_t; 72 typedef uint32_t gid_t; 73 74 struct iovec { 75 void *iov_base; 76 size_t iov_len; 77 }; 78 79 #include
80 #include
/* XXX mingw */ 81 82 #endif 83 84 typedef int32_t bool_t; 85 typedef int32_t enum_t; 86 87 typedef u_int32_t rpcprog_t; 88 typedef u_int32_t rpcvers_t; 89 typedef u_int32_t rpcproc_t; 90 typedef u_int32_t rpcprot_t; 91 typedef u_int32_t rpcport_t; 92 typedef int32_t rpc_inline_t; 93 94 #ifndef NULL 95 #define NULL 0 96 #endif 97 #define __dontcare__ -1 98 99 #define honey_badger __dontcare__ 100 101 #ifndef FALSE 102 #define FALSE (0) 103 #endif 104 #ifndef TRUE 105 #define TRUE (1) 106 #endif 107 108 /* 109 * Package params support 110 */ 111 112 #define TIRPC_GET_PARAMETERS 0 113 #define TIRPC_PUT_PARAMETERS 1 114 #define TIRPC_GET_DEBUG_FLAGS 2 115 #define TIRPC_SET_DEBUG_FLAGS 3 116 #define TIRPC_GET_OTHER_FLAGS 4 117 #define TIRPC_SET_OTHER_FLAGS 5 118 119 /* 120 * Debug flags support 121 */ 122 123 #define TIRPC_FLAG_NONE 0x0000000 124 #define TIRPC_DEBUG_FLAG_NONE 0x0000000 125 #define TIRPC_DEBUG_FLAG_ERROR 0x0000001 126 #define TIRPC_DEBUG_FLAG_EVENT 0x0000002 127 #define TIRPC_DEBUG_FLAG_WARN 0x0000004 128 #define TIRPC_DEBUG_FLAG_LOCK 0x0000008 129 #define TIRPC_DEBUG_FLAG_REFCNT 0x0000010 130 #define TIRPC_DEBUG_FLAG_RBTREE 0x0000020 131 #define TIRPC_DEBUG_FLAG_RPCSEC_GSS 0x0000040 132 #define TIRPC_DEBUG_FLAG_AUTH 0x0000080 133 #define TIRPC_DEBUG_FLAG_CLNT_DG 0x0000100 134 #define TIRPC_DEBUG_FLAG_CLNT_RDMA 0x0000200 135 #define TIRPC_DEBUG_FLAG_CLNT_SCTP 0x0000400 136 #define TIRPC_DEBUG_FLAG_CLNT_VC 0x0000800 137 #define TIRPC_DEBUG_FLAG_CLNT_BCAST 0x0001000 138 #define TIRPC_DEBUG_FLAG_CLNT_RAW 0x0002000 139 #define TIRPC_DEBUG_FLAG_CLNT_REQ 0x0004000 140 #define TIRPC_DEBUG_FLAG_CLNT 0x0008000 141 #define TIRPC_DEBUG_FLAG_SVC_DG 0x0010000 142 #define TIRPC_DEBUG_FLAG_SVC_RDMA 0x0020000 143 #define TIRPC_DEBUG_FLAG_SVC_SCTP 0x0040000 144 #define TIRPC_DEBUG_FLAG_SVC_VC 0x0080000 145 #define TIRPC_DEBUG_FLAG_SVC_RQST 0x0100000 146 #define TIRPC_DEBUG_FLAG_SVC_XPRT 0x0200000 147 #define TIRPC_DEBUG_FLAG_SVC 0x0400000 148 #define TIRPC_DEBUG_FLAG_XDR 0x0800000 149 #define TIRPC_DEBUG_FLAG_WORKER 0x1000000 150 #define TIRPC_DEBUG_FLAG_RPC_MSG 0x2000000 151 #define TIRPC_DEBUG_FLAG_RPC_RDMA 0x4000000 152 #define TIRPC_DEBUG_FLAG_XDR_RDMA 0x8000000 153 154 /* or symbolic names for default */ 155 #define TIRPC_DEBUG_FLAG_DEFAULT \ 156 (TIRPC_DEBUG_FLAG_ERROR | \ 157 TIRPC_DEBUG_FLAG_EVENT | \ 158 TIRPC_DEBUG_FLAG_WARN) 159 160 #define TIRPC_DEBUG_FLAG_CLNT_RPCB (TIRPC_DEBUG_FLAG_CLNT) 161 162 typedef void *(*mem_1_size_t) (size_t, 163 const char *file, int line, const char *function); 164 typedef void *(*mem_2_size_t) (size_t, size_t, 165 const char *file, int line, const char *function); 166 typedef void *(*mem_p_size_t) (void *, size_t, 167 const char *file, int line, const char *function); 168 typedef void (*mem_free_size_t) (void *, size_t); 169 typedef void (*mem_format_t) (const char *fmt, ...); 170 typedef void (*mem_char_t) (const char *); 171 172 /* 173 * Package params support 174 */ 175 typedef struct tirpc_pkg_params { 176 uint32_t debug_flags; 177 uint32_t other_flags; 178 mem_char_t thread_name_; 179 mem_format_t warnx_; 180 mem_free_size_t free_size_; 181 mem_1_size_t malloc_; 182 mem_2_size_t aligned_; 183 mem_2_size_t calloc_; 184 mem_p_size_t realloc_; 185 } tirpc_pkg_params; 186 187 extern tirpc_pkg_params __ntirpc_pkg_params; 188 189 #include
190 191 #define __warnx(flags, ...) \ 192 do { \ 193 if (__ntirpc_pkg_params.debug_flags & (flags)) { \ 194 __ntirpc_pkg_params.warnx_(__VA_ARGS__); \ 195 } \ 196 } while (0) 197 198 #define __debug_flag(flags) (__ntirpc_pkg_params.debug_flags & (flags)) 199 200 #define mem_alloc(size) __ntirpc_pkg_params.malloc_((size), \ 201 __FILE__, __LINE__, __func__) 202 #define mem_aligned(align, size) __ntirpc_pkg_params.aligned_((align), (size), \ 203 __FILE__, __LINE__, __func__) 204 #define mem_calloc(count, size) __ntirpc_pkg_params.calloc_((count), (size), \ 205 __FILE__, __LINE__, __func__) 206 #define mem_realloc(p, size) __ntirpc_pkg_params.realloc_((p), (size), \ 207 __FILE__, __LINE__, __func__) 208 #define mem_zalloc(size) __ntirpc_pkg_params.calloc_(1, (size), \ 209 __FILE__, __LINE__, __func__) 210 211 static inline void 212 mem_free(void *p, size_t n) 213 { 214 __ntirpc_pkg_params.free_size_(p, n); 215 } 216 217 /* 218 * Uses allocator with indirections, if any. 219 */ 220 221 #include
222 223 static inline void * 224 mem_strdup_(const char *s, const char *file, int line, const char *function) 225 { 226 size_t l = strlen(s) + 1; 227 void *t = __ntirpc_pkg_params.malloc_(l, file, line, function); 228 229 memcpy(t, s, l); 230 return (t); 231 } 232 233 #define mem_strdup(s) mem_strdup_((s), __FILE__, __LINE__, __func__) 234 235 #ifndef _MSC_VER 236 #include
237 #include
238 #endif 239 #include
240 #include
241 242 /* 243 * The netbuf structure is defined here, because FreeBSD / NetBSD only use 244 * it inside the RPC code. It's in
on SVR4, but it would be confusing 245 * to have an xti.h, since FreeBSD / NetBSD do not support XTI/TLI. 246 */ 247 248 /* 249 * The netbuf structure is used for transport-independent address storage. 250 */ 251 struct netbuf { 252 unsigned int maxlen; 253 unsigned int len; 254 void *buf; 255 }; 256 257 struct rpc_address { 258 struct netbuf nb; 259 struct sockaddr_storage ss; /* address buffer */ 260 }; 261 262 /* 263 * The format of the addres and options arguments of the XTI t_bind call. 264 * Only provided for compatibility, it should not be used. 265 */ 266 267 struct t_bind { 268 struct netbuf addr; 269 unsigned int qlen; 270 }; 271 272 /* 273 * Internal library and rpcbind use. This is not an exported interface, do 274 * not use. 275 */ 276 struct __rpc_sockinfo { 277 int si_af; 278 int si_proto; 279 int si_socktype; 280 int si_alen; 281 }; 282 283 #endif /* _TIRPC_TYPES_H */
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™