SRPC Interface Description Language (SIDL)
SIDL is a language for describing the interface provided by an SHRIMP Remote Procedure Call (SRPC) server. Before
implementing a server, the programmer should create an SIDL file
describing the server's interface.
By convention, SIDL files end with a ".x" suffix.
Before using SHRIMP Remote Procedure Call, you might want to try
producing a few simple SIDL files, and examining the output of the
stub generator. This should help you understand what is going on.
The SIDL Language
An SIDL file consists of a (possibly empty) set of structure definitions, followed by a set of
procedure definitions.
Data objects in SIDL can have a variety of data types. Any C datatype
is legal, except for unions and pointers. Structs are also illegal,
except for those that have been declared by a previous structure definition.
A structure definition looks like this:
STRUCT name {
fields
};
This definition defines a structure data type, equivalent to a
struct in C. Once this definition has been made, name is
considered a valid datatype. (Note that the datatype should called
"name" and not "struct name".)
The fields of the structure are like the fields of a normal C struct,
except that they must have datatypes that are
allowed by SIDL.
Here is an example of a valid structure-definition section from an SIDL file:
STRUCT mystruct {
int foo;
char bar[7];
double bigField[3][25];
};
STRUCT otherstruct {
int aField;
mystruct anotherField[6];
};
An SIDL procedure definition gives the name and arguments of a
procedure offered by the interface which is being described. A
procedure definition looks like this:
PROCEDURE name(arguments);
The arguments part looks like the arguments-section of an ordinary C
function prototype, except that:
- only legal SIDL datatypes may be used;
- open arrays are prohibited --- that is, all array dimensions must
be specified;
- the declaration of each argument may be preceded by a
passing-mode, which can be IN, OUT, or INOUT.
The passing-mode tells SRPC how that argument is used. IN means that
the argument is used to pass data from the caller to the callee on
function entry, but is invalid on function exit. OUT means that the
argument is invalid on function entry, but is used by pass data from
callee to caller on function exit. INOUT means that the argument is
used to pass data in both directions --- caller to callee on function
entry, and callee to caller on function exit.
If the passing-mode is omitted, it is assumed to be INOUT.
Here are some simple function definitions:
PROCEDURE add(IN double x, IN double y, OUT double sum);
PROCEDURE increment(INOUT int x);
Note that remotely-invoked procedures may not return a value.
(However, they may achieve the same effect by using an OUT argument.)
Ed Felten