home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / opennv.exe / NVAPI.H < prev    next >
Text File  |  1992-11-04  |  7KB  |  228 lines

  1. /*
  2. **  (C) Copyright 1992 Novell, Inc.  All rights reserved.
  3. **
  4. **  File Name: nvapi.h
  5. **
  6. **  $Logfile:   G:/cs/nma/vcs/nvapi.h_v  $
  7. **  $Revision:   1.18  $
  8. **  $Date:   04 Nov 1992 17:41:40  $
  9. **  $Author:   RWONG  $
  10. **  $Log:   G:/cs/nma/vcs/nvapi.h_v  $
  11. **  
  12. **     Rev 1.18   04 Nov 1992 17:41:40   RWONG
  13. **  API calls use handles again.
  14. **  
  15. **     Rev 1.17   14 Oct 1992 13:53:50   JCHOU
  16. **  Added new error codes.
  17. **  
  18. **     Rev 1.16   13 Oct 1992 17:41:20   RWONG
  19. **  Remove NVERR_BAD_PARMLIST.
  20. **  
  21. **     Rev 1.15   13 Aug 1992 13:52:14   RWONG
  22. **  Remove unused fields.
  23. **  
  24. **     Rev 1.14   31 Jul 1992 10:12:18   JCHOU
  25. **  Added definition for NVERR_INVALID_APPL
  26. **  
  27. **     Rev 1.13   24 Jul 1992 14:42:12   RWONG
  28. **  Change MsgPtr to MsgData.
  29. **  
  30. **     Rev 1.12   14 Jul 1992 11:35:54   RWONG
  31. **  API function prototype change.  NLM name instead of nlm handle.
  32. **  
  33. **     Rev 1.11   26 Jun 1992 16:03:20   RWONG
  34. **  Handle multiple line runcmd reply.
  35. **  
  36. **     Rev 1.10   16 Jun 1992 14:05:42   JCHOU
  37. **  Added error code for no host link error and no netview participation error
  38. **  
  39. **     Rev 1.9   08 Jun 1992 14:10:12   JCHOU
  40. **  Added two fields in NVNMVT_t, i.e. DGRId and PPSAMsId for runcmd support
  41. **  
  42. **     Rev 1.8   27 May 1992 14:01:18   JCHOU
  43. **  Added DGRId and reserved fields in the NVNMVT_t to fix the design fault. We 
  44. **  want to keep track of the DGRId because there might be a case that the runcmd
  45. **  for 3rd party might come from different NetView host.
  46. **  
  47. **     Rev 1.7   13 May 1992 17:48:52   RWONG
  48. **  
  49. **     Rev 1.6   13 May 1992 15:11:42   RWONG
  50. **  Added request id to event structures.
  51. **  
  52. **     Rev 1.5   30 Apr 1992 10:53:06   RWONG
  53. **  Additional error code.  Change field name.
  54. **  
  55. **     Rev 1.4   29 Apr 1992 15:53:52   RWONG
  56. **  Add additional fields for predefined alert runtime parameters.
  57. **  
  58. **     Rev 1.3   28 Apr 1992 10:45:58   RWONG
  59. **  Error code for duplicate APPL name.
  60. **  
  61. **     Rev 1.2   22 Apr 1992 10:28:46   RWONG
  62. **  Additional error codes.  Comments.
  63. ** 
  64. **     Rev 1.1   20 Apr 1992 15:17:16   RWONG
  65. ** 
  66. **     Rev 1.0   17 Apr 1992 14:12:58   RWONG
  67. **  initial check in
  68. **
  69. */
  70.   
  71. #ifndef _NVAPI_INCLUDED
  72. #define _NVAPI_INCLUDED
  73.  
  74. #ifndef _NMVTDEF_INCLUDED
  75. #include <nmvtdef.h>
  76. #endif
  77.  
  78. /*
  79. ** Open NetView API error codes
  80. */
  81.  
  82. #define  NV_SUCCESS           (0x00000000)
  83. #define  NV_FAILURE           (~NV_SUCCESS)
  84. #define  NVERR_NO_CALLBACK    (0x00000001)
  85. #define  NVERR_MEM            (0x00000002)
  86. #define  NVERR_INVALID_NLM    (0x00000003)
  87. #define  NVERR_BAD_TYPE       (0x00000004)
  88. #define  NVERR_NO_NVPATH      (0x00000005)
  89. #define  NVERR_BAD_PARM       (0x00000006)
  90. #define  NVERR_NO_TEXT        (0x00000007)
  91. #define  NVERR_NO_PCAUSE      (0x00000008)
  92. #define  NVERR_BAD_HRL        (0x00000009)
  93. #define  NVERR_BAD_ARL        (0x0000000A)
  94. #define  NVERR_NO_EVENTID     (0x0000000B)
  95. #define  NVERR_BOTH_ARL_HRL   (0x0000000D)
  96. #define  NVERR_NO_DBNAME      (0x0000000E)
  97. #define  NVERR_NO_REGISTRATION   (0x0000000F)
  98. #define  NVERR_INVALID_DB     (0x00000010)
  99. #define  NVERR_NO_DB_REC      (0x00000011)
  100. #define  NVERR_DUP_APPL       (0x00000012)
  101. #define  NVERR_NO_HOSTLINK    (0x00000013)
  102. #define  NVERR_NO_PARTICIPATION (0x00000014)
  103. #define  NVERR_INVALID_APPL    (0x00000015)
  104. #define  NVERR_BAD_HRL_FLAG   (0x00000016)
  105. #define  NVERR_BAD_DATA_TYPE  (0x00000017)
  106.  
  107. /*
  108. ** For Novell internal use only
  109. */
  110. #define  NVERR_INVALID_CE_VER (0x000000F0)
  111.  
  112.  
  113. /*
  114. ** Open NetView API function prototypes
  115. */
  116.  
  117. /* u32_t NWNVRegister (char *appl, u32_t nlm, void (*callback)()) */
  118. u32_t NWNVRegister (char *, u32_t, void (*)());
  119.  
  120. /* u32_t NWNVDeregister (u32_t nlm) */
  121. u32_t NWNVDeregister (u32_t);
  122.  
  123. /* u32_t NWNVSend (u32_t nlm, u32_t type, void *msgstruct) */
  124. u32_t NWNVSend (u32_t, u32_t, void *);
  125.  
  126. /*
  127. ** NWNVSend() types
  128. */
  129.  
  130. #define NVTYPE_RUNCMD_RSP     0
  131. #define NVTYPE_FORMATTED      1
  132. #define NVTYPE_PREDEFINED     2
  133.  
  134. /*
  135. ** The following structures contain the input fields needed by the
  136. ** NWNVSend() routine.  The structure used depends on the type of message
  137. ** being sent.
  138. */
  139.  
  140. typedef struct {
  141. u8_t        Flags;      // Display option - see below 
  142. u8_t        RsrcId;     // A registered SNA resource type designation
  143. u8_t        Name[HRL_NAME_SZ];   // Resource name - null terminated
  144. } NVHRL_t;
  145.  
  146. /*
  147. ** Display options:
  148. **
  149. ** DISPLAY_RESOURCE     - display on initial alert display
  150. ** NODISPLAY_RESOURCE   - don't display on initial alert display
  151. */
  152.  
  153. typedef struct {
  154. u8_t        RsrcId;     // A registered SNA resource type designation
  155. u8_t        Name[ARL_NAME_SZ];   // Resource name - null terminated
  156. } NVARL_t;
  157.  
  158. /*
  159. ** This structure is used to define runtime parameters for predefined
  160. ** alerts.
  161. */
  162.  
  163. typedef struct {
  164. u8_t  SubvectorKey;        // Subvector that this parameter belongs to
  165. u8_t  SubfieldKey;        // Subfield that this parameter belongs to
  166. u8_t  DataId;                // For Detailed Data Subfield 0x82
  167. u8_t  DataPosition;     // If SubvectorKey, SubfieldKey and DataId are
  168.                         // identical for a set of parameters, use this
  169.                         // to sequentially number them e.g. 1, 2, 3...
  170.                         // Otherwise, set to 1.
  171. u8_t  DataType;         // OCTETSTRING or PRINTABLESTRING
  172. u16_t ValueLen;            // Length of the parameter
  173. u8_t  *Value;
  174. } NVParm_t;
  175.  
  176. /*
  177. ** This structure  is used for predefined alerts. Information to translate
  178. ** these events into an alert NMVT is predefined in a Btrieve database file and
  179. ** reference by the event prefix and suffix. EventPrefix (may be NULL) and
  180. ** EventSuffix are mandatory. Parameters are optional.
  181. */
  182.  
  183. typedef struct {
  184. u32_t          RequestId;     // Identifies alert in case of processing error
  185. char           *EventPrefix;        // Event identifier prefix
  186. char           *EventSuffix;        // Event identifier suffix
  187. u8_t           ParameterCount;    // Count of runtime parameters, may be 0
  188. u8_t           ARLCount;        // Count of associated resource list entries
  189. u8_t           HRLCount;        // Count of hierarchy resource list entries
  190. u8_t           reserved;
  191. u8_t           *DBName; // Name of Btrieve database file
  192. NVARL_t        *ARL;        // First associated resource list entry
  193. NVHRL_t        *HRL;        // First hierarchy resource list entry
  194. NVParm_t       *Parameters;        // First runtime parameter
  195. } NVPredefinedAlert_t;
  196.  
  197. /*
  198. ** This structure is used for fully formatted alert NMVTs, RunCMds passed as
  199. ** the second parameter to a 3rd party NLM's callback function, or RunCmd
  200. ** response NMVTs.
  201. */
  202.  
  203. typedef struct {
  204. u16_t          MsgLen;     // Line length
  205. u8_t           *MsgData;   // Text if RunCmd, otherwise NMVT data
  206. } NVMsg_t;     
  207.  
  208. typedef struct {
  209. u32_t          RequestId;    // Identifies runcmd or alert
  210. u32_t          reserved;   // for future enhancement */
  211. u32_t          MsgCount;   // Number of lines
  212. NVMsg_t        Msg[1];     // First line
  213. } NVNMVT_t;
  214.  
  215.  
  216. /*
  217. ** This structure is returned to a third party NLM through its registered
  218. ** callback function if an error has occurred in the processing of an alert.
  219. */
  220.  
  221. typedef struct {
  222. u32_t          RequestId;  // Identifies alert which had a processing error
  223. u32_t          Error;      // Error code
  224. } NVErrData_t;
  225.  
  226. #endif
  227. 
  228.