0

Why is rpcgen known as a protocol compiler ? I am aware of the basics of Remote Procedure Call but m unaware of the term Protocol Compiler and cannot find a solution anywhere.

user1707873
  • 1,307
  • 2
  • 10
  • 10

2 Answers2

0

The rpcgen takes dot-x file, with protocol description, as an input and generates files required to implement client and service got defined protocols. For example, let say you want to create a service to calculate string length. You have to provide dot-x with your protocol:

/* strlen.x */
program STRLEN {
    version STRLENVERS {
        int strlen(string) = 1;
    } = 1;
} = 117

This is your protocol. In general, we use rpcgen to generate files with stubs in C, but thare are other 'compiles' as well, which will generate python or java code.

For xdr language syntax, check official docs: http://docs.oracle.com/cd/E19683-01/816-1435/xdrproto-ex-70/index.html

kofemann
  • 4,217
  • 1
  • 34
  • 39
0

in the case of rpcgen ,then it is used as an extra compiler - it compiles new files based on a protocol file '.x' - inside the protocol file you specify what the rpcgen should compile for you.

the rpcgen uses a specific protocol for its .x file - the XDR Language Specification

serup
  • 3,676
  • 2
  • 30
  • 34