|
|
1.1 ! root 1: % run this through LaTeX with the appropriate wrapper ! 2: ! 3: \chapter {The ISODE Objects Database}\label{isobjects} ! 4: The database \file{isobjects} in the ISODE \verb"ETCDIR" directory ! 5: (usually \file{/usr/etc/}) ! 6: contains a simple mapping between ! 7: object descriptors and object identifiers. ! 8: ! 9: The database itself is an ordinary ASCII text file containing information ! 10: regarding the known objects on the host. ! 11: Each line contains ! 12: \begin{itemize} ! 13: \item the descriptor of the object, a simple string; and, ! 14: ! 15: \item the corresponding object identifier. ! 16: \end{itemize} ! 17: Blanks and/or tab characters are used to separate items. ! 18: However, double-quotes may be used to prevent separation for items containing ! 19: embedded whitspace. ! 20: The sharp character (`\verb"#"') at the beginning of a line indicates a ! 21: commentary line. ! 22: ! 23: \section {Accessing the Database}\label{isobject} ! 24: The \man libpsap(3) library contains the routines used to access the ! 25: database. ! 26: These routines ultimately manipulate an \verb"isobject" structure, ! 27: which is the internal form. ! 28: \begin{quote}\index{isobject}\small\begin{verbatim} ! 29: struct isobject { ! 30: char *io_descriptor; ! 31: ! 32: OIDentifier io_identity; ! 33: }; ! 34: \end{verbatim}\end{quote} ! 35: The elements of this structure are: ! 36: \begin{describe} ! 37: \item[\verb"io\_descriptor":] the object descriptor; and, ! 38: ! 39: \item[\verb"io\_identity":] the object identifier. ! 40: \end{describe} ! 41: ! 42: The routine \verb"getisobject" reads the next entry in the database, ! 43: opening the database if necessary. ! 44: \begin{quote}\index{getisobject}\small\begin{verbatim} ! 45: struct isobject *getisobject () ! 46: \end{verbatim}\end{quote} ! 47: It returns the manifest constant \verb"NULL" on error or end-of-file. ! 48: ! 49: The routine \verb"setisobject" opens and rewinds the database. ! 50: \begin{quote}\index{setisobject}\small\begin{verbatim} ! 51: int setisobject (f) ! 52: int f; ! 53: \end{verbatim}\end{quote} ! 54: The parameter to this procedure is: ! 55: \begin{describe} ! 56: \item[\verb"f":] the ``stayopen'' indicator, ! 57: if non-zero, then the database will remain open over subsequent calls to the ! 58: library. ! 59: \end{describe} ! 60: The routine \verb"endisobject" closes the database. ! 61: \begin{quote}\index{endisobject}\small\begin{verbatim} ! 62: int endisobject () ! 63: \end{verbatim}\end{quote} ! 64: Both of these routines return non-zero on success and zero otherwise. ! 65: ! 66: There are two routines used to fetch a particular entry in the database. ! 67: The routine \verb"getisobjectbyname" maps object descriptors into ! 68: the internal form. ! 69: \begin{quote}\index{getisobjectbyname}\small\begin{verbatim} ! 70: struct isobject *getisobjectbyname (descriptor) ! 71: char *descriptor; ! 72: \end{verbatim}\end{quote} ! 73: The parameter to this procedure is: ! 74: \begin{describe} ! 75: \item[\verb"descriptor":] the descriptor of the object. ! 76: \end{describe} ! 77: and returns the \verb"isobject" structure describing that object. ! 78: On failure, the manifest constant \verb"NULL" is returned instead. ! 79: ! 80: The routine \verb"getisobjectbyoid" performs the inverse function. ! 81: \begin{quote}\index{getisobjectbyoid}\small\begin{verbatim} ! 82: struct isobject *getisobjectbyoid (oid) ! 83: OID oid; ! 84: \end{verbatim}\end{quote} ! 85: The parameter to this procedure is: ! 86: \begin{describe} ! 87: \item[\verb"oid":] the identifier of the object. ! 88: \end{describe} ! 89: On a successful return, ! 90: an \verb"isobject" structure describing the object is returned.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.