fix possible wrong cast to 32-bit unsigned
[deb_libnfs.git] / portmap / libnfs-raw-portmap.c
CommitLineData
763cd6e3
RS
1/*
2 * Please do not edit this file.
3 * It was generated using rpcgen.
4 */
5
6#include "libnfs-zdr.h"
7#include "libnfs-raw-portmap.h"
8
9bool_t
10zdr_pmap_mapping (ZDR *zdrs, pmap_mapping *objp)
11{
12 register int32_t *buf;
9c29b498 13 buf = NULL;
763cd6e3
RS
14
15
16 if (zdrs->x_op == ZDR_ENCODE) {
17 buf = ZDR_INLINE (zdrs, 4 * BYTES_PER_ZDR_UNIT);
18 if (buf == NULL) {
19 if (!zdr_u_int (zdrs, &objp->prog))
20 return FALSE;
21 if (!zdr_u_int (zdrs, &objp->vers))
22 return FALSE;
23 if (!zdr_u_int (zdrs, &objp->prot))
24 return FALSE;
25 if (!zdr_u_int (zdrs, &objp->port))
26 return FALSE;
27 } else {
28 IZDR_PUT_U_LONG(buf, objp->prog);
29 IZDR_PUT_U_LONG(buf, objp->vers);
30 IZDR_PUT_U_LONG(buf, objp->prot);
31 IZDR_PUT_U_LONG(buf, objp->port);
32 }
33 return TRUE;
34 } else if (zdrs->x_op == ZDR_DECODE) {
35 buf = ZDR_INLINE (zdrs, 4 * BYTES_PER_ZDR_UNIT);
36 if (buf == NULL) {
37 if (!zdr_u_int (zdrs, &objp->prog))
38 return FALSE;
39 if (!zdr_u_int (zdrs, &objp->vers))
40 return FALSE;
41 if (!zdr_u_int (zdrs, &objp->prot))
42 return FALSE;
43 if (!zdr_u_int (zdrs, &objp->port))
44 return FALSE;
45 } else {
46 objp->prog = IZDR_GET_U_LONG(buf);
47 objp->vers = IZDR_GET_U_LONG(buf);
48 objp->prot = IZDR_GET_U_LONG(buf);
49 objp->port = IZDR_GET_U_LONG(buf);
50 }
51 return TRUE;
52 }
53
54 if (!zdr_u_int (zdrs, &objp->prog))
55 return FALSE;
56 if (!zdr_u_int (zdrs, &objp->vers))
57 return FALSE;
58 if (!zdr_u_int (zdrs, &objp->prot))
59 return FALSE;
60 if (!zdr_u_int (zdrs, &objp->port))
61 return FALSE;
62 return TRUE;
63}
64
65bool_t
66zdr_pmap_call_args (ZDR *zdrs, pmap_call_args *objp)
67{
68 register int32_t *buf;
9c29b498 69 buf = NULL;
763cd6e3
RS
70
71
72 if (zdrs->x_op == ZDR_ENCODE) {
73 buf = ZDR_INLINE (zdrs, 3 * BYTES_PER_ZDR_UNIT);
74 if (buf == NULL) {
75 if (!zdr_u_int (zdrs, &objp->prog))
76 return FALSE;
77 if (!zdr_u_int (zdrs, &objp->vers))
78 return FALSE;
79 if (!zdr_u_int (zdrs, &objp->proc))
80 return FALSE;
81
82 } else {
83 IZDR_PUT_U_LONG(buf, objp->prog);
84 IZDR_PUT_U_LONG(buf, objp->vers);
85 IZDR_PUT_U_LONG(buf, objp->proc);
86 }
87 if (!zdr_bytes (zdrs, (char **)&objp->args.args_val, (u_int *) &objp->args.args_len, ~0))
88 return FALSE;
89 return TRUE;
90 } else if (zdrs->x_op == ZDR_DECODE) {
91 buf = ZDR_INLINE (zdrs, 3 * BYTES_PER_ZDR_UNIT);
92 if (buf == NULL) {
93 if (!zdr_u_int (zdrs, &objp->prog))
94 return FALSE;
95 if (!zdr_u_int (zdrs, &objp->vers))
96 return FALSE;
97 if (!zdr_u_int (zdrs, &objp->proc))
98 return FALSE;
99
100 } else {
101 objp->prog = IZDR_GET_U_LONG(buf);
102 objp->vers = IZDR_GET_U_LONG(buf);
103 objp->proc = IZDR_GET_U_LONG(buf);
104 }
105 if (!zdr_bytes (zdrs, (char **)&objp->args.args_val, (u_int *) &objp->args.args_len, ~0))
106 return FALSE;
107 return TRUE;
108 }
109
110 if (!zdr_u_int (zdrs, &objp->prog))
111 return FALSE;
112 if (!zdr_u_int (zdrs, &objp->vers))
113 return FALSE;
114 if (!zdr_u_int (zdrs, &objp->proc))
115 return FALSE;
116 if (!zdr_bytes (zdrs, (char **)&objp->args.args_val, (u_int *) &objp->args.args_len, ~0))
117 return FALSE;
118 return TRUE;
119}
120
121bool_t
122zdr_pmap_call_result (ZDR *zdrs, pmap_call_result *objp)
123{
124 register int32_t *buf;
9c29b498 125 buf = NULL;
763cd6e3
RS
126
127 if (!zdr_u_int (zdrs, &objp->port))
128 return FALSE;
129 if (!zdr_bytes (zdrs, (char **)&objp->res.res_val, (u_int *) &objp->res.res_len, ~0))
130 return FALSE;
131 return TRUE;
132}