2 Copyright (c) 2014, Ronnie Sahlberg
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
8 1. Redistributions of source code must retain the above copyright notice, this
9 list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright notice,
11 this list of conditions and the following disclaimer in the documentation
12 and/or other materials provided with the distribution.
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 The views and conclusions contained in the software and documentation are those
26 of the authors and should not be interpreted as representing official policies,
27 either expressed or implied, of the FreeBSD Project.
31 * Please do not edit this file.
32 * It was generated using rpcgen.
35 #include "libnfs-zdr.h"
36 #include "libnfs-raw-portmap.h"
39 zdr_pmap2_mapping (ZDR
*zdrs
, pmap2_mapping
*objp
)
41 register int32_t *buf
;
45 if (zdrs
->x_op
== ZDR_ENCODE
) {
46 buf
= ZDR_INLINE (zdrs
, 4 * BYTES_PER_ZDR_UNIT
);
48 if (!zdr_u_int (zdrs
, &objp
->prog
))
50 if (!zdr_u_int (zdrs
, &objp
->vers
))
52 if (!zdr_u_int (zdrs
, &objp
->prot
))
54 if (!zdr_u_int (zdrs
, &objp
->port
))
57 IZDR_PUT_U_LONG(buf
, objp
->prog
);
58 IZDR_PUT_U_LONG(buf
, objp
->vers
);
59 IZDR_PUT_U_LONG(buf
, objp
->prot
);
60 IZDR_PUT_U_LONG(buf
, objp
->port
);
63 } else if (zdrs
->x_op
== ZDR_DECODE
) {
64 buf
= ZDR_INLINE (zdrs
, 4 * BYTES_PER_ZDR_UNIT
);
66 if (!zdr_u_int (zdrs
, &objp
->prog
))
68 if (!zdr_u_int (zdrs
, &objp
->vers
))
70 if (!zdr_u_int (zdrs
, &objp
->prot
))
72 if (!zdr_u_int (zdrs
, &objp
->port
))
75 objp
->prog
= IZDR_GET_U_LONG(buf
);
76 objp
->vers
= IZDR_GET_U_LONG(buf
);
77 objp
->prot
= IZDR_GET_U_LONG(buf
);
78 objp
->port
= IZDR_GET_U_LONG(buf
);
83 if (!zdr_u_int (zdrs
, &objp
->prog
))
85 if (!zdr_u_int (zdrs
, &objp
->vers
))
87 if (!zdr_u_int (zdrs
, &objp
->prot
))
89 if (!zdr_u_int (zdrs
, &objp
->port
))
95 zdr_pmap2_call_args (ZDR
*zdrs
, pmap2_call_args
*objp
)
97 register int32_t *buf
;
101 if (zdrs
->x_op
== ZDR_ENCODE
) {
102 buf
= ZDR_INLINE (zdrs
, 3 * BYTES_PER_ZDR_UNIT
);
104 if (!zdr_u_int (zdrs
, &objp
->prog
))
106 if (!zdr_u_int (zdrs
, &objp
->vers
))
108 if (!zdr_u_int (zdrs
, &objp
->proc
))
112 IZDR_PUT_U_LONG(buf
, objp
->prog
);
113 IZDR_PUT_U_LONG(buf
, objp
->vers
);
114 IZDR_PUT_U_LONG(buf
, objp
->proc
);
116 if (!zdr_bytes (zdrs
, (char **)&objp
->args
.args_val
, (u_int
*) &objp
->args
.args_len
, ~0))
119 } else if (zdrs
->x_op
== ZDR_DECODE
) {
120 buf
= ZDR_INLINE (zdrs
, 3 * BYTES_PER_ZDR_UNIT
);
122 if (!zdr_u_int (zdrs
, &objp
->prog
))
124 if (!zdr_u_int (zdrs
, &objp
->vers
))
126 if (!zdr_u_int (zdrs
, &objp
->proc
))
130 objp
->prog
= IZDR_GET_U_LONG(buf
);
131 objp
->vers
= IZDR_GET_U_LONG(buf
);
132 objp
->proc
= IZDR_GET_U_LONG(buf
);
134 if (!zdr_bytes (zdrs
, (char **)&objp
->args
.args_val
, (u_int
*) &objp
->args
.args_len
, ~0))
139 if (!zdr_u_int (zdrs
, &objp
->prog
))
141 if (!zdr_u_int (zdrs
, &objp
->vers
))
143 if (!zdr_u_int (zdrs
, &objp
->proc
))
145 if (!zdr_bytes (zdrs
, (char **)&objp
->args
.args_val
, (u_int
*) &objp
->args
.args_len
, ~0))
151 zdr_pmap2_call_result (ZDR
*zdrs
, pmap2_call_result
*objp
)
153 register int32_t *buf
;
156 if (!zdr_u_int (zdrs
, &objp
->port
))
158 if (!zdr_bytes (zdrs
, (char **)&objp
->res
.res_val
, (u_int
*) &objp
->res
.res_len
, ~0))
164 zdr_pmap2_mapping_list (ZDR
*zdrs
, pmap2_mapping_list
*objp
)
166 register int32_t *buf
;
169 if (!zdr_pmap2_mapping (zdrs
, &objp
->map
))
171 if (!zdr_pointer (zdrs
, (char **)&objp
->next
, sizeof (pmap2_mapping_list
), (zdrproc_t
) zdr_pmap2_mapping_list
))
177 zdr_pmap2_dump_result (ZDR
*zdrs
, pmap2_dump_result
*objp
)
179 register int32_t *buf
;
182 if (!zdr_pointer (zdrs
, (char **)&objp
->list
, sizeof (pmap2_mapping_list
), (zdrproc_t
) zdr_pmap2_mapping_list
))
188 zdr_pmap3_string_result (ZDR
*zdrs
, pmap3_string_result
*objp
)
190 register int32_t *buf
;
193 if (!zdr_string (zdrs
, &objp
->addr
, ~0))
199 zdr_pmap3_mapping (ZDR
*zdrs
, pmap3_mapping
*objp
)
201 register int32_t *buf
;
204 if (!zdr_u_int (zdrs
, &objp
->prog
))
206 if (!zdr_u_int (zdrs
, &objp
->vers
))
208 if (!zdr_string (zdrs
, &objp
->netid
, ~0))
210 if (!zdr_string (zdrs
, &objp
->addr
, ~0))
212 if (!zdr_string (zdrs
, &objp
->owner
, ~0))
218 zdr_pmap3_mapping_list (ZDR
*zdrs
, pmap3_mapping_list
*objp
)
220 register int32_t *buf
;
223 if (!zdr_pmap3_mapping (zdrs
, &objp
->map
))
225 if (!zdr_pointer (zdrs
, (char **)&objp
->next
, sizeof (pmap3_mapping_list
), (zdrproc_t
) zdr_pmap3_mapping_list
))
231 zdr_pmap3_dump_result (ZDR
*zdrs
, pmap3_dump_result
*objp
)
233 register int32_t *buf
;
236 if (!zdr_pointer (zdrs
, (char **)&objp
->list
, sizeof (pmap3_mapping_list
), (zdrproc_t
) zdr_pmap3_mapping_list
))
242 zdr_pmap3_call_args (ZDR
*zdrs
, pmap3_call_args
*objp
)
244 register int32_t *buf
;
248 if (zdrs
->x_op
== ZDR_ENCODE
) {
249 buf
= ZDR_INLINE (zdrs
, 3 * BYTES_PER_ZDR_UNIT
);
251 if (!zdr_u_int (zdrs
, &objp
->prog
))
253 if (!zdr_u_int (zdrs
, &objp
->vers
))
255 if (!zdr_u_int (zdrs
, &objp
->proc
))
259 IZDR_PUT_U_LONG(buf
, objp
->prog
);
260 IZDR_PUT_U_LONG(buf
, objp
->vers
);
261 IZDR_PUT_U_LONG(buf
, objp
->proc
);
263 if (!zdr_bytes (zdrs
, (char **)&objp
->args
.args_val
, (u_int
*) &objp
->args
.args_len
, ~0))
266 } else if (zdrs
->x_op
== ZDR_DECODE
) {
267 buf
= ZDR_INLINE (zdrs
, 3 * BYTES_PER_ZDR_UNIT
);
269 if (!zdr_u_int (zdrs
, &objp
->prog
))
271 if (!zdr_u_int (zdrs
, &objp
->vers
))
273 if (!zdr_u_int (zdrs
, &objp
->proc
))
277 objp
->prog
= IZDR_GET_U_LONG(buf
);
278 objp
->vers
= IZDR_GET_U_LONG(buf
);
279 objp
->proc
= IZDR_GET_U_LONG(buf
);
281 if (!zdr_bytes (zdrs
, (char **)&objp
->args
.args_val
, (u_int
*) &objp
->args
.args_len
, ~0))
286 if (!zdr_u_int (zdrs
, &objp
->prog
))
288 if (!zdr_u_int (zdrs
, &objp
->vers
))
290 if (!zdr_u_int (zdrs
, &objp
->proc
))
292 if (!zdr_bytes (zdrs
, (char **)&objp
->args
.args_val
, (u_int
*) &objp
->args
.args_len
, ~0))
298 zdr_pmap3_call_result (ZDR
*zdrs
, pmap3_call_result
*objp
)
300 register int32_t *buf
;
303 if (!zdr_u_int (zdrs
, &objp
->port
))
305 if (!zdr_bytes (zdrs
, (char **)&objp
->res
.res_val
, (u_int
*) &objp
->res
.res_len
, ~0))
311 zdr_pmap3_netbuf (ZDR
*zdrs
, pmap3_netbuf
*objp
)
313 register int32_t *buf
;
316 if (!zdr_u_int (zdrs
, &objp
->maxlen
))
318 if (!zdr_bytes (zdrs
, (char **)&objp
->buf
.buf_val
, (u_int
*) &objp
->buf
.buf_len
, ~0))