xdrgen: Add generator code for XDR width macrosIntroduce logic in the code generators to emit maxsize (XDRwidth) definitions. In C, these are pre-processor macros.Signed-off-by: Chuck Lever <chu
xdrgen: Add generator code for XDR width macrosIntroduce logic in the code generators to emit maxsize (XDRwidth) definitions. In C, these are pre-processor macros.Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
show more ...
xdrgen: Implement big-endian enumsSigned-off-by: Chuck Lever <chuck.lever@oracle.com>
xdrgen: Rename "enum yada" types as just "yada"This simplifies the generated C code and makes way for supportingbig-endian XDR enums.Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
xdrgen: Rename enum's declaration Jinja2 template"close.j2" is a confusing name.Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
tools: Add xdrgenAdd a Python-based tool for translating XDR specifications into XDRencoder and decoder functions written in the Linux kernel's C codingstyle. The generator attempts to match the
tools: Add xdrgenAdd a Python-based tool for translating XDR specifications into XDRencoder and decoder functions written in the Linux kernel's C codingstyle. The generator attempts to match the usual C coding style ofthe Linux kernel's SunRPC consumers.This approach is similar to the netlink code generator intools/net/ynl .The maintainability benefits of machine-generated XDR code include:- Stronger type checking- Reduces the number of bugs introduced by human error- Makes the XDR code easier to audit and analyze- Enables rapid prototyping of new RPC-based protocols- Hardens the layering between protocol logic and marshaling- Makes it easier to add observability on demand- Unit tests might be built for both the tool and (automatically) for the generated codeIn addition, converting the XDR layer to use memory-safe languagessuch as Rust will be easier if much of the code can be convertedautomatically.Tested-by: Jeff Layton <jlayton@kernel.org>Signed-off-by: Chuck Lever <chuck.lever@oracle.com>