home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / nwsrvr / root.23 / usr / include / sys / ncpipx_app.h / ncpipx_app.h
Encoding:
C/C++ Source or Header  |  1998-08-19  |  7.6 KB  |  194 lines

  1. /*
  2.  * Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  3.  *                                                                         
  4.  *        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  5.  *                   SANTA CRUZ OPERATION INC.                             
  6.  *                                                                         
  7.  *   The copyright notice above does not evidence any actual or intended   
  8.  *   publication of such source code.                                      
  9.  */
  10.  
  11. /* $Novell-NWU: $Header: /proj6/ncps/nwu_top/nws/include/sys/ncpipx_app.h,v 1.2 1996/04/05 22:58:14 vtag Exp $ */
  12. /*
  13.  * Copyright 1991, 1992 Novell, Inc. 
  14.  * All Rights Reserved.
  15.  *
  16.  * This work is subject to U.S. and International copyright laws and
  17.  * treaties.  No part of this work may be used, practiced, performed,
  18.  * copied, distributed, revised, modified, translated, abridged,
  19.  * condensed, expanded, collected, compiled, linked, recast,
  20.  * transformed or adapted without the prior written consent
  21.  * of Novell.  Any use or exploitation of this work without
  22.  * authorization could subject the perpetrator to criminal and
  23.  * civil liability.
  24.  */
  25.  
  26. #ifndef _NCPIPX_APP_H
  27. #define _NCPIPX_APP_H
  28.  
  29. #ident "@(#)ncpipx_app.h    1.2"
  30.  
  31. #ifdef _KERNEL_HEADERS
  32. #include <util/types.h>
  33. #include <nwu/nwnet/include/ipx_app.h>
  34. #else
  35. #include <sys/types.h>
  36. #include "sys/ipx_app.h"
  37. #endif
  38.  
  39. /*
  40. **    Data returned in response to NMX_PSI_INFO Ioctl request
  41. */
  42. typedef struct {
  43.     time_t    IStartTime;        /* Time module loaded */
  44.     uint32    IHashSize;        /* Number of hash table/client entries */
  45.     uint32    INumClients;    /* Number of active client entries */
  46.     uint32    IMaxClients;    /* Maximum Clients active at one time */
  47.     uint32    IDownMsgTotal;    /* Total Number of Down Stream Messages */
  48.     uint32    IDownMsgResp;    /* Number of Down Stream Message Responses */
  49.     uint32    IDownMsgCont;    /* Number of Down Stream Message Continue */
  50.     uint32    IDownMsgEnd;    /* Number of Down Stream Message No Data */
  51.     uint32    IDownUnsol;        /* Number of Down Stream Message Unsolitied */
  52.     uint32    IDownDropped;    /* Number of Down Stream Message Dropped */
  53.     uint32    IIoctl;            /* Number of Ioctl Commands */
  54.     uint32    IUpMsgs;        /* Number of Upstream Messages received */
  55.     uint32    IUpMsgsPulledup;/* Number of Upstream Messages pulled up */
  56.     uint32    IUpMsgsDropped;    /* Number of Upstream Messages Dropped */
  57.     uint32    IUpBurstDropped;/* Number of Upstream Packet Burst Dropped */
  58.     uint32    IUpBurstClientBusy;/* Number of Upstream Packet read/sys msgs */
  59.                             /*     dropped because client already processing msg */
  60.     uint32    IUpBurstEngineBusy;/* Number of Upstream Packet Burst begin write */
  61.                             /*    msgs dropped because no engines available */
  62.     uint32    IUpNCPSent;        /* Number of NCP Messages Sent Upstream */
  63.     uint32    IUpBurstSysSent;/* Number of Burst System Requests Sent Upstream */
  64.     uint32    IUpBurstReadSent;/* Number of Burst Read Requests Sent Upstream */
  65.     uint32    IUpBurstWriteSent;/* Number of Burst Write Requests Sent Upstream */
  66.     uint32    IUpBurstFragsSent;/* Number of Burst Write Fragments Sent Upstrm */
  67.     uint32    IUpBurstExpedite;/* Number Pkt Burst Messages Expedited Upstream */
  68.     uint32    IHashEntries;    /* Number of Entries made in hash table */
  69.     uint32    IHashMissed;    /* Number of Entries made, not first in hash table*/
  70.     uint32    IClientBusy;    /* Number of Client Busy responses sent */
  71.     uint32    INemuxBusy;        /* Number of Nemux Busy responses sent */
  72.     uint32    IBurstNemuxBusy;/* Number of Nemux Busy begin burst write dropped */
  73.     uint32    IStatNoBegin;    /* Stats enabled - Number of end NCP w/o begin */
  74.     uint32    INumInfoClients;/* # of client struct returned by CLIENT_INFO ioctl */
  75. } NxInfo_t;
  76.  
  77. /*
  78.  *    Data returned in response to NXI_CLIENT_INFO Ioctl request
  79.  */
  80. typedef struct {
  81.     ipxAddr_t         NClientAddress;    /* Client Source IPX Address */
  82.     uint8             NMsgType;            /* Message Type */
  83.     uint8             NFlags;            /* Flag bits */
  84.     int16             NHash;                /* Hash Index for this entry */
  85.     uint16             NBurstNumber;        /* Current Unique Burst Number */
  86.     uint16             NSendDelay;        /* Pkt Brst Read send delay in ticks */
  87.     void            *Nmpt;                /* MPT Token from NEMUX */
  88. } NxClInfo_t;
  89.  
  90. #ifdef XIOC
  91. #undef XIOC
  92. #endif
  93. #define XIOC(t) (('n' << 8) | t)
  94.  
  95. #define NXI_INITIALIZE    XIOC(1)        /* Initialize */
  96. #define NXI_CLIENT_INFO    XIOC(2)        /* Get Client Structures */
  97. /*
  98. **    Structure to set initialization parameters
  99. */
  100. typedef struct {
  101.     int        IMaxProcesses;            /* Number of Max NWU Processes */
  102.     int        IMaxLicensedConn;        /* Number of Licensed Connections */
  103. } NxInit_t;
  104.  
  105. /*
  106. **    Enable/Disable statistics - requires no data structure
  107. */
  108. #define NXI_STATISTICS_ON    XIOC(3)    /* Enable Statistics, no ncpipx Q */
  109. #define NXI_STATISTICS_ONQ    XIOC(4)    /* Enable Statistics, ncpipx Q */
  110.  
  111. #define NXI_STATISTICS_OFF    XIOC(5)    /* Disable Statistics */
  112.  
  113. #define NXI_STATISTICS        XIOC(6)    /* Get Statistics */
  114. /*
  115. **  Structure for statistics of an individual NCP.  All results are in
  116. **    nanoseconds
  117. **
  118. **  To compute processing time mean for an NCP
  119. **
  120. **  double ncpMean( nxNcpStat_t *statbuf)
  121. **  {
  122. **      if( statbuf->Count == 0)
  123. **          return( statbuf->TimeSum);
  124. **      else
  125. **          return( statbuf->TimeSum / statbuf->Count);
  126. **  }
  127. **
  128. **  To compute processing time standard deviation for an NCP
  129. **
  130. **  double ncpStandardDeviation( nxNcpStat_t *statbuf)
  131. **  {
  132. **      if( statbuf->Count <= 1)
  133. **          return( 0.0);
  134. **      else
  135. **          return( sqrt((statbuf->TimeSum2
  136. **                  - ((statbuf->TimeSum * statbuf->TimeSum) / statbuf->Count))
  137. **                  / (statbuf->Count - 1)));
  138. **  }
  139. */
  140. typedef struct {
  141.     uint16    RequestType;    /* NCP request type */
  142.     uint8    Function;        /* NCP request function */
  143.     uint8    SubFunction;    /* NCP request subfunction */
  144.     uint32    Count;            /* Count of NCPs processed */
  145.     uint32    TimeSum;        /* Sum of all delta elapsed time processing NCPs */
  146.     uint32    TimeSum2;        /* Sum delta elapsed time processing NCPs squared */
  147. } NxNcpStat_t;
  148.  
  149. /*
  150. ** When sending an NXI_STATISTICS ioctl request via the nemux NMXI_IOCTL
  151. ** request, the NxStats_t structure is returned with filled nxNcpStat
  152. ** structures.  NNXI_STATISTICS forms nxStats_t size message blocks,
  153. ** fills each with complete NxNcpStat_t structures, and sends them up stream
  154. ** as data until the all statistics have been sent upstream to the calling
  155. ** process.  It then returns from the ioctl with no errors.
  156. **
  157. ** If a failure occurs, the functon returns a -1 and the ioctl fails.
  158. ** If data blocks were sent, the entry after the last NxNcpStat_t entry
  159. ** will be have RequestType set to 0xFFFF, indicating end of data sent.
  160. **
  161. ** After the calling process receives the ioctl status, and if the ioctl was
  162. ** successful, it retrieves the data with the read or getmsg system calls.
  163. */
  164.  
  165. #define MAX_NCP_STATS 70
  166.  
  167. typedef struct {
  168.     NxNcpStat_t    NcpStats[MAX_NCP_STATS];
  169. } NxStats_t;
  170.  
  171. /*
  172. ** Values for PsInfo for the NCP protocol
  173. */
  174. /*
  175. **    Request Msgs (Upstream, set by NCPIPX)
  176. */
  177. #define NCP_REQUEST            (1<<1)    /* NCP request msg */
  178. #define NCP_BURST_READ        (1<<2)    /* NCP burst read msg */
  179. #define NCP_BURST_WRITE        (1<<3)    /* NCP burst write, or sys during write */
  180. #define NCP_BURST_SYSTEM    (1<<4)    /* NCP system msg, has own msg context */
  181. #define NCP_WBURST_DUP_REQ    (1<<5)    /* NCP duplicate burst write request pkt */
  182. #define NCP_GOT_CHKSUM        (1<<7)    /* Msg had a valid checksum */
  183. /*
  184. **    Response Msgs (Downstream, set by user process)
  185. */
  186. #define NCP_RESP_DATA_END    (1<<1)    /* Msg response w/data, end of msg */
  187. #define NCP_RESP_NODATA_END    (1<<2)    /* Msg response no/data, end of msg */
  188. #define NCP_RESP_DATA_CONT    (1<<3)    /* Msg response w/data, continue msg */
  189. #define NCP_UNSOL_DATA        (1<<4)    /* Unsolicited msg */
  190. #define NCP_KILL_CLIENT        (1<<5)    /* Client Terminated */
  191. #define NCP_DO_CHKSUM        (1<<7)    /* Generate checksum on msg */
  192.  
  193. #endif /* _NCPIPX_APP_H */
  194.