GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: lib/librpcsvc/klm_prot.c Lines: 0 79 0.0 %
Date: 2017-11-13 Branches: 0 64 0.0 %

Line Branch Exec Source
1
/*
2
 * Please do not edit this file.
3
 * It was generated using rpcgen.
4
 */
5
6
#include "klm_prot.h"
7
8
bool_t
9
xdr_klm_stats(XDR *xdrs, klm_stats *objp)
10
{
11
12
	if (!xdr_enum(xdrs, (enum_t *)objp))
13
		return (FALSE);
14
	return (TRUE);
15
}
16
17
bool_t
18
xdr_klm_lock(XDR *xdrs, klm_lock *objp)
19
{
20
21
22
	if (!xdr_string(xdrs, &objp->server_name, LM_MAXSTRLEN))
23
		return (FALSE);
24
	if (!xdr_netobj(xdrs, &objp->fh))
25
		return (FALSE);
26
	if (!xdr_int(xdrs, &objp->pid))
27
		return (FALSE);
28
	if (!xdr_u_int(xdrs, &objp->l_offset))
29
		return (FALSE);
30
	if (!xdr_u_int(xdrs, &objp->l_len))
31
		return (FALSE);
32
	return (TRUE);
33
}
34
35
bool_t
36
xdr_klm_holder(XDR *xdrs, klm_holder *objp)
37
{
38
39
	int32_t *buf;
40
41
	if (xdrs->x_op == XDR_ENCODE) {
42
		buf = (int32_t *)XDR_INLINE(xdrs,
43
		    4 * BYTES_PER_XDR_UNIT);
44
		if (buf == NULL) {
45
			if (!xdr_bool(xdrs, &objp->exclusive))
46
				return (FALSE);
47
			if (!xdr_int(xdrs, &objp->svid))
48
				return (FALSE);
49
			if (!xdr_u_int(xdrs, &objp->l_offset))
50
				return (FALSE);
51
			if (!xdr_u_int(xdrs, &objp->l_len))
52
				return (FALSE);
53
		} else {
54
			IXDR_PUT_BOOL(buf, objp->exclusive);
55
			IXDR_PUT_LONG(buf, objp->svid);
56
			IXDR_PUT_U_LONG(buf, objp->l_offset);
57
			IXDR_PUT_U_LONG(buf, objp->l_len);
58
		}
59
		return (TRUE);
60
	} else if (xdrs->x_op == XDR_DECODE) {
61
		buf = (int32_t *)XDR_INLINE(xdrs,
62
		    4 * BYTES_PER_XDR_UNIT);
63
		if (buf == NULL) {
64
			if (!xdr_bool(xdrs, &objp->exclusive))
65
				return (FALSE);
66
			if (!xdr_int(xdrs, &objp->svid))
67
				return (FALSE);
68
			if (!xdr_u_int(xdrs, &objp->l_offset))
69
				return (FALSE);
70
			if (!xdr_u_int(xdrs, &objp->l_len))
71
				return (FALSE);
72
		} else {
73
			objp->exclusive = IXDR_GET_BOOL(buf);
74
			objp->svid = IXDR_GET_LONG(buf);
75
			objp->l_offset = IXDR_GET_U_LONG(buf);
76
			objp->l_len = IXDR_GET_U_LONG(buf);
77
		}
78
		return (TRUE);
79
	}
80
81
	if (!xdr_bool(xdrs, &objp->exclusive))
82
		return (FALSE);
83
	if (!xdr_int(xdrs, &objp->svid))
84
		return (FALSE);
85
	if (!xdr_u_int(xdrs, &objp->l_offset))
86
		return (FALSE);
87
	if (!xdr_u_int(xdrs, &objp->l_len))
88
		return (FALSE);
89
	return (TRUE);
90
}
91
92
bool_t
93
xdr_klm_stat(XDR *xdrs, klm_stat *objp)
94
{
95
96
97
	if (!xdr_klm_stats(xdrs, &objp->stat))
98
		return (FALSE);
99
	return (TRUE);
100
}
101
102
bool_t
103
xdr_klm_testrply(XDR *xdrs, klm_testrply *objp)
104
{
105
106
	if (!xdr_klm_stats(xdrs, &objp->stat))
107
		return (FALSE);
108
	switch (objp->stat) {
109
	case klm_denied:
110
		if (!xdr_klm_holder(xdrs, &objp->klm_testrply_u.holder))
111
			return (FALSE);
112
		break;
113
	default:
114
		break;
115
	}
116
	return (TRUE);
117
}
118
119
bool_t
120
xdr_klm_lockargs(XDR *xdrs, klm_lockargs *objp)
121
{
122
123
124
	if (!xdr_bool(xdrs, &objp->block))
125
		return (FALSE);
126
	if (!xdr_bool(xdrs, &objp->exclusive))
127
		return (FALSE);
128
	if (!xdr_klm_lock(xdrs, &objp->alock))
129
		return (FALSE);
130
	return (TRUE);
131
}
132
133
bool_t
134
xdr_klm_testargs(XDR *xdrs, klm_testargs *objp)
135
{
136
137
138
	if (!xdr_bool(xdrs, &objp->exclusive))
139
		return (FALSE);
140
	if (!xdr_klm_lock(xdrs, &objp->alock))
141
		return (FALSE);
142
	return (TRUE);
143
}
144
145
bool_t
146
xdr_klm_unlockargs(XDR *xdrs, klm_unlockargs *objp)
147
{
148
149
150
	if (!xdr_klm_lock(xdrs, &objp->alock))
151
		return (FALSE);
152
	return (TRUE);
153
}