sunrpc

Understanding XDR specification to create a *.x file

会有一股神秘感。 提交于 2019-12-24 02:07:54
问题 I have been looking through several websites on the Internet and actually wanted to know how do we write specification in a .x file to generate equivalent functions in .c file for RPC. Every site I visited suggested to use following kind of specification in *.x file: program ADD_PROG { version ADD_VERS { int ADD(intpair) = 1; } = 1; } = 0x23451111; So, to understand practically, I obtained gm_protocol.x from an open-source project known as ganglia and generated equivalent C source code (gm

Can't Encode Arguments in Remote Procedure Call for Server Registration

雨燕双飞 提交于 2019-12-10 15:44:26
问题 I'm going a bit crazy trying to figure out why this isn't working. I'm using sunrpc, but the generated server code throws the following: Cannot register service: RPC: Can't encode arguments unable to register (MYRPC, MYRPC_V1, udp). I have no idea why this is happening. I'm doing the following to generate the stubs: $ rpcgen -NMC myrpc.x Here's my XDR struct imgdata{ opaque data<>; }; program MYRPC { version MYRPC_V1 { imgdata minify(imgdata) = 1; } = 1; } = 0x30D0D0DFF; I don't get any