An XObj is the fundamental identifier in the system. It can
represent either a protocol or a session. Fields which can be read or
written by the programmer are so indicated.
If you think of the x-kernel as implementing protocol and session graphs,
then each XObj represents a node in one of the graphs.
Furthermore, an object's down vector represents graph edges;
they contain pointers to the XObjs that are below the object in
the protocol or session graphs. The fields myprotl and up
link a session to the protocols that own and created the session,
respectively.
The Enable object is provided for use by the programmer in
maintaining maps that associate identifiers and protocols or sessions.
A pointer to an Enable object is often used as the internal
identifier in mapBind calls. An Enable object has a field
for reference counting. Protocol writers will find this useful in
handling xOpenEnable calls with identical participants-the
calls are redundant with respect to session creation-but they must
be reference counted in order to properly handle xOpenDisable
calls.
Most routines have a return value type of xkern_return_t,
which is either XK_SUCCESS or XK_FAILURE. Routines that
return type XObj have a failure value of ERR_XOBJ. Some
message handling routines use type xmsg_handle; see section
2.2.6. Severe error conditions will result in console error
messages and the termination of the x-kernel.
The following typedefs are used in the XObj structure and
throughout this document:
Enable Objects
Return Values
Function Types
typedef xkern_return_t ( * Pfk )();
typedef void ( * Pfv )();
typedef struct xobj * ( * Pfo )();
typedef xmsg_handle_t ( * Pfh )();
typedef int ( * Pfi )();
Next: Protocol-Protocol Operations
Up: Uniform Protocol Interface
Previous: Uniform Protocol Interface