summaryrefslogtreecommitdiff
path: root/tools/net/sunrpc/xdrgen/templates/C/program/decoder/argument.j2
blob: 19b219dd276d3e2a95e1beb66ca7dafe1b6cc396 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{# SPDX-License-Identifier: GPL-2.0 #}

/**
 * {{ program }}_svc_decode_{{ argument }} - Decode a {{ argument }} argument
 * @rqstp: RPC transaction context
 * @xdr: source XDR data stream
 *
 * Return values:
 *   %true: procedure arguments decoded successfully
 *   %false: decode failed
 */
bool {{ program }}_svc_decode_{{ argument }}(struct svc_rqst *rqstp, struct xdr_stream *xdr)
{
{% if argument == 'void' %}
	return xdrgen_decode_void(xdr);
{% else %}
{% if argument in structs %}
	struct {{ argument }} *argp = rqstp->rq_argp;
{% else %}
	{{ argument }} *argp = rqstp->rq_argp;
{% endif %}

	return xdrgen_decode_{{ argument }}(xdr, argp);
{% endif %}
}