[OpenAFS] exposing RPC code<->name mappings via rxgen extension, a library, and a new utility

Steven Jenkins steven.jenkins@gmail.com
Thu, 15 Jan 2009 14:00:09 -0500

I would like to expose RPC code<->name mappings so that other programs
within OpenAFS can avoid hard-coding the mappings, as well as be able
to export them to the users (who might find them useful in debugging
network traces, for example, where their particular tool does not know
what a particular opcode corresponds to). From a user-level, it would
work as follows:

$ translate_rpc -name PR_INewEntry

It would accomplish this by extending rxgen to pul the procedure
identifier and opcode from the specification file: e.g., given the
following hunks of code:

"package" <Package_ident>
 <Procedure description option>:

        ["proc"] [<Procedure_ident>] [<ServerStub_ident>]
            <Argument list> ["split" | "multi"]
            ["=" <Opcode_ident>] ";"

would produce new tables which would automatically go into the .h file
for that specification file: e.g.,

<Package_ident>_name[<Opcode_ident>] = <Procedure_ident>
<Package_ident>_opcode[<Procedure_ident> = <Opcode_ident>

Then, in src/util, we would #include those .h files in
translate_rpc.h. translate_rpc_lib.c would export two functions:


which other programs could use.

translate_rpc.c would implement the user-level command.

Any concerns about that approach and/or the utility itself?

Steven Jenkins
End Point Corporation