Remote Administration Daemon Developer Guide

Exit Print View

Updated: July 2014
 
 

Overview

The top-level element in an ADR definition document is an api. The api element has one mandatory attribute, name, which is used to name the output files. The element contains one or more derived type or interface definitions. Because there is no requirement that an interface use derived types, there is no requirement that any derived types be specified in an API document. To enable consumers to use the data typing defined by ADR for non-interface purposes, there is no requirement that an interface is defined either. However, note that either a derived type or an interface must be defined.

Two derived types are available for definition and use by interfaces: a structured type that can be defined with a struct element, and an enumeration type that can be defined with an enum element. Interfaces are defined using interface elements. The derived types defined in an API document are available for use by all interfaces defined in that document.

This is what an API looks like:

Example 4-1  Skeleton API document
<api xmlns="http://xmlns.oracle.com/radadr" name="com.oracle.solaris.rad.example" register="true">
        <version/>
        <struct>...</struct>
        <struct>...</struct>
        <enum>...</enum>
        <interface>...</interface>
        <interface>...</interface>
</api>

The xmlns is required to indicate the type of the XML document. The name attribute is identifying the name of the API, the namespace within which all subsidiary interfaces are to be found. There are additional attributes to assist in the generation of server module code.

The register attribute is a boolean which is optional and true by default. If true, then radadrgen will automatically generates a _rad_reg() function when generating server implementation code. If false, the function is not generated and the module author will need to provide a _rad_reg() function. This option is primarily provided for the creation of special types of modules, such as protocol or transport modules, in general it does not need to be specified, since the default generated function is enough for most purposes.