Lines Matching +full:in +full:- +full:functions
1 xdrgen - Linux Kernel XDR code generator
4 ------------
7 RFC 4506. In fact, all IETF-published NFS specifications provide a
15 This RPC-level code is code that handles input directly from the
17 is needed to help ensure proper levels of security. Bugs in this
23 of the user space TI-RPC library and libc. Furthermore, the dialect
26 The Linux kernel's implementation of SunRPC-based protocols hand-roll
29 1. libtirpc (and its predecessors) operate only in user space. The
33 2. rpcgen-generated code is believed to be less efficient than code
34 that is hand-written.
40 In addition, the current hand-written code in the Linux kernel is
41 difficult to audit and prove that it implements exactly what is in
44 In order to accrue the benefits of machine-generated XDR code in the
52 ------------
56 - python3
57 - python3-lark
58 - python3-jinja2
62 - pip install 'lark[interegular]'
66 ------------------
70 the script located in tools/net/sunrpc/extract.sh.
76 ---------
80 decoding functions for the specified protocol.
89 The files are ready to use for a server-side protocol implementation,
93 that appear directly in front of the public per-procedure APIs. For
94 deeper introspection, specifying the "--annotate" flag will insert
95 additional comments in the generated code to help readers match the
99 is tagged with a GPLv2-only license.
108 ------------
117 The xdr.ebnf file in this directory contains the grammar used to
119 in xdr.ebnf. Lark parses the target XDR specification using this
125 The generators are implemented as Python classes residing in the
127 templates stored in the templates/ directory.
129 The source code is generated in the same order in which they appear
130 in the specification to ensure the generated code compiles. This
134 a compiler that can optimize in a number of ways, including:
136 - Unused functions are discarded (ie, not added to the executable)
138 - Aggressive function inlining removes unnecessary stack frames
140 - Single-arm switch statements are replaced by a single conditional
147 -------
150 encoding and decoding functions. Currently one directive is
154 ------ ----------
159 is more efficient to avoid the byte-swap when encoding or decoding
160 on little-endian machines. Such is often the case with error status
165 In this case, when generating an XDR struct or union containing a
168 non-byte-swapped value of that field.
171 ------ -------
175 In some cases, a procedure encoder or decoder function might need
177 automatically-generated functions might conflict or interfere with
178 the hand-rolled function. To avoid editing the generated source code
180 decoder functions are not included in the generated header and
190 Note that because data item encoder and decoder functions are
192 automatically excludes data item encoder and decoder functions that
196 ------ ------
211 ------ ------
215 Normally XDR encoder and decoder functions are "static". In case an
216 implementer wants to call these functions from other source code,
217 s/he can add a public pragma in the input .x file to indicate a set
218 of functions that should get a prototype in the generated header,
225 Adds these prototypes in the generated header:
230 And, in the generated source code, both of these functions appear
235 -----------
239 Generate client-side procedure functions
245 * @pages -- use xdr_read/write_pages() for the specified opaque
247 * @skip -- do not decode, but rather skip, the specified argument
253 Properly support line-by-line pass-through via the "%" decorator
258 Add a command-line option to insert trace_printk call sites in the