Coda Distributed File System
multi.h
Go to the documentation of this file.
1/* BLURB lgpl
2
3 Coda File System
4 Release 8
5
6 Copyright (c) 1987-2025 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU Library General Public Licence Version 2, as
11shown in the file LICENSE. The technical and financial contributors to
12Coda are listed in the file CREDITS.
13
14 Additional copyrights
15
16#*/
17
18/*
19 IBM COPYRIGHT NOTICE
20
21 Copyright (C) 1986
22 International Business Machines Corporation
23 All Rights Reserved
24
25This file contains some code identical to or derived from the 1986
26version of the Andrew File System ("AFS"), which is owned by the IBM
27Corporation. This code is provided "AS IS" and IBM does not warrant
28that it is free of infringement of any intellectual rights of any
29third party. IBM disclaims liability of any kind for any damages
30whatsoever resulting directly or indirectly from use of this software
31or of any derivative work. Carnegie Mellon University has obtained
32permission to modify, distribute and sublicense this code, which is
33based on Version 2 of AFS and does not contain the features and
34enhancements that are part of Version 3 of AFS. Version 3 of AFS is
35commercially available and supported by Transarc Corporation,
36Pittsburgh, PA.
37
38*/
39
40#include <rpc2/rpc2.h>
41#include <rpc2/se.h>
42
43#ifndef _MULTI_H_
44#define _MULTI_H_
45
46#define MAXSERVERS 100
47
48typedef long RPC2_HandleResult_func(int HowMany, RPC2_Handle ConnList[],
49 long offset, long rpcval, ...);
50
51/* union for packing and unpacking unspecified arguments (identified by
52 * parallel ARG structure
53 */
54typedef union PARM { /* PARM will always be 4 bytes */
71 union PARM *structp;
72 union PARM **structpp;
74
75/* used to pass information through RPC2_MultiRPC() call */
76typedef struct arg_info {
82
83/* Macros to simplify use of MultiRPC; these used to be
84 in files venus/comm.h and res/rescomm.h (duplicated!)
85 in Coda; moved them here since they are really not
86 Coda-specific (Satya, 5/23/95) */
87
88#define ARG_MARSHALL(mode, type, name, object, howmany) \
89 type *name##_ptrs[howmany] __attribute__((unused)); \
90 type name##_bufs[howmany]; \
91 { \
92 memset(&name##_bufs, 0, sizeof(type) * howmany); \
93 for (unsigned int name##_local_i = 0; name##_local_i < howmany; \
94 name##_local_i++) { \
95 name##_ptrs[name##_local_i] = &name##_bufs[name##_local_i]; \
96 if (mode == IN_OUT_MODE) \
97 name##_bufs[name##_local_i] = (object); \
98 } \
99 }
100
101#define ARG_MARSHALL_BS(mode, type, name, object, howmany, maxbslen) \
102 type *name##_ptrs[howmany]; \
103 type name##_bufs[howmany]; \
104 char name##_data[maxbslen * howmany]; \
105 { \
106 for (unsigned int name##_local_i = 0; name##_local_i < howmany; \
107 name##_local_i++) { \
108 name##_ptrs[name##_local_i] = &name##_bufs[name##_local_i]; \
109 if (mode == OUT_MODE) \
110 (object).SeqLen = 0; \
111 name##_bufs[name##_local_i] = (object); \
112 name##_bufs[name##_local_i].SeqBody = \
113 (RPC2_ByteSeq) & name##_data[name##_local_i * maxbslen]; \
114 if ((object).SeqLen > 0) \
115 memcpy(name##_bufs[name##_local_i].SeqBody, (object).SeqBody, \
116 (int)(object).SeqLen); \
117 } \
118 }
119
120#define ARG_MARSHALL_ARRAY(mode, type, name, numelts, maxelts, object, \
121 howmany) \
122 type *name##_ptrs[howmany]; \
123 type name##_bufs[howmany][maxelts]; /* maxelts must be a constant */ \
124 { \
125 for (unsigned int name##_local_i = 0; name##_local_i < howmany; \
126 name##_local_i++) { \
127 name##_ptrs[name##_local_i] = name##_bufs[name##_local_i]; \
128 if (mode == IN_OUT_MODE) { \
129 for (unsigned int name##_local_j = 0; \
130 name##_local_j < numelts; name##_local_j++) \
131 name##_bufs[name##_local_i][name##_local_j] = \
132 (object)[name##_local_j]; \
133 } \
134 } \
135 }
136
137#define ARG_UNMARSHALL(name, object, ix) (object) = name##_bufs[ix];
138
139#define ARG_UNMARSHALL_BS(name, object, ix) \
140 { \
141 RPC2_Integer seqlen = name##_bufs[ix].SeqLen; \
142 (object).SeqLen = seqlen; \
143 if (seqlen > 0) \
144 memcpy((object).SeqBody, name##_bufs[ix].SeqBody, (int)seqlen); \
145 }
146
147#define ARG_UNMARSHALL_ARRAY(name, numelts, object, ix) \
148 { \
149 for (unsigned int name##_local_i = 0; name##_local_i < (numelts); \
150 name##_local_i++) \
151 (object)[name##_local_i] = name##_bufs[ix][name##_local_i]; \
152 }
153
154#endif /* _MULTI_H_ */
long RPC2_HandleResult_func(int HowMany, RPC2_Handle ConnList[], long offset, long rpcval,...)
Definition: multi.h:48
struct arg_info ARG_INFO
union PARM PARM
RPC2_Byte RPC2_EncryptionKey[RPC2_KEYSIZE]
Definition: rpc2.h:336
int32_t RPC2_Integer
Definition: rpc2.h:297
uint32_t RPC2_Unsigned
Definition: rpc2.h:300
RPC2_Integer RPC2_Handle
Definition: rpc2.h:345
RPC2_ByteSeq RPC2_String
Definition: rpc2.h:312
uint8_t RPC2_Byte
Definition: rpc2.h:302
Definition: rpc2.h:324
Definition: rpc2.h:316
Definition: se.h:148
Definition: multi.h:76
ARG * ArgTypes
Definition: multi.h:77
int ArgCount
Definition: multi.h:80
RPC2_HandleResult_func * HandleResult
Definition: multi.h:79
PARM * Args
Definition: multi.h:78
Definition: rpc2.h:588
Definition: multi.h:54
RPC2_BoundedBS ** bbsp
Definition: multi.h:66
RPC2_CountedBS ** cbsp
Definition: multi.h:64
RPC2_Byte byte
Definition: multi.h:59
RPC2_Unsigned unsgned
Definition: multi.h:57
RPC2_String string
Definition: multi.h:61
RPC2_EncryptionKey ** keyp
Definition: multi.h:68
RPC2_CountedBS * cbs
Definition: multi.h:63
RPC2_Integer ** integerp
Definition: multi.h:56
RPC2_BoundedBS * bbs
Definition: multi.h:65
RPC2_Handle * cidp
Definition: multi.h:69
union PARM ** structpp
Definition: multi.h:72
SE_Descriptor * sedp
Definition: multi.h:70
RPC2_Integer integer
Definition: multi.h:55
RPC2_String ** stringp
Definition: multi.h:62
RPC2_EncryptionKey * key
Definition: multi.h:67
RPC2_Unsigned ** unsgnedp
Definition: multi.h:58
union PARM * structp
Definition: multi.h:71
RPC2_Byte ** bytep
Definition: multi.h:60