home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / nsu / root / usr / include / sys / timod.h / timod
Text File  |  1998-08-19  |  5KB  |  147 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. #ifndef _NET_TIMOD_H    /* wrapper symbol for kernel use */
  12. #define _NET_TIMOD_H    /* subject to change without notice */
  13.  
  14. #ident    "@(#)timod.h    1.4"
  15. #ident    "$Header: $"
  16.  
  17. #if defined(__cplusplus)
  18. extern "C" {
  19. #endif
  20.  
  21. #ifdef _KERNEL_HEADERS
  22.  
  23. #include <util/types.h>    /* REQUIRED */
  24.  
  25. #elif defined(_KERNEL) || defined(_KMEMUSER)
  26.  
  27. #include <sys/types.h>    /* REQUIRED */
  28.  
  29. #endif /* _KERNEL_HEADERS */
  30.  
  31. /* Internal flags used by the library  and providers */
  32.  
  33. #define USED        0x00001    /* date structure in use. */
  34. #define    FATAL        0x00002    /* fatal error M_ERROR occurred   */
  35. #define    WAITIOCACK    0x00004    /* waiting for info for ioctl act */
  36. #define    MORE        0x00008    /* more data */
  37. #define    EXPEDITED    0x00010    /* processing expedited TSDU */
  38. #define    CLTS        0x00020    /* connectionless transport */
  39. #define    COTS        0x00040    /* connection-oriented transport */
  40. #define    CONNWAIT    0x00100    /* waiting for connect confirmation */
  41. #define    LOCORDREL    0x00200    /* local end has orderly released */
  42. #define    REMORDREL    0x00400    /* remote end had orderly released */
  43. #define    NAMEPROC    0x00800    /* processing a NAME ioctl */
  44. #define FLOWCNTL    0x01000    /* endpoint normal data is flow controlled */
  45. #define FLOWCNTLEX    0x02000    /* endpoint expedited data is flow controlled */
  46. #define IPV6MAPPED    0x04000 /* using ipv4 mapped ipv6 addresses */
  47. #define XTIOPTS        0x08000 /* using xti options */
  48.  
  49. /* Internal buffer size (in bytes) pre-allocated for address fields */
  50. #define PRADDRSZ    128
  51.  
  52. /* Sleep timeout in open */
  53. #define TIMWAIT    (1*HZ)
  54.  
  55. /* Timod ioctls */
  56. #define        TIMOD         ('T'<<8)
  57. #define        TI_GETINFO    (TIMOD|140)
  58. #define        TI_OPTMGMT    (TIMOD|141)
  59. #define        TI_BIND        (TIMOD|142)
  60. #define        TI_UNBIND    (TIMOD|143)
  61. #define        TI_GETMYNAME    (TIMOD|144)
  62. #define        TI_GETPEERNAME    (TIMOD|145)
  63. #define        TI_SETMYNAME    (TIMOD|146)
  64. #define        TI_SETPEERNAME    (TIMOD|147)
  65.  
  66. /*
  67.  * ioctl telling provider that options are in XTI format.
  68.  * This is a pass-thru for timod.
  69.  */
  70. #define        TI_OPTMGMT_XTI    (TIMOD|201)
  71.  
  72. /* Timod Id (returned by ioctl(I_GETTP) */
  73. #define        TIMOD_ID    3
  74.  
  75. /* TI interface user level structure - one per open file */
  76. struct _ti_user {
  77.     ulong    ti_flags;    /* flags              */
  78.     int    ti_rcvsize;    /* rcv buffer size    */
  79.     char   *ti_rcvbuf;    /* rcv buffer         */
  80.     int    ti_ctlsize;    /* ctl buffer size    */
  81.     char   *ti_ctlbuf;    /* ctl buffer         */
  82.     char   *ti_lookdbuf;    /* look data buffer   */
  83.     char   *ti_lookcbuf;    /* look ctl buffer    */
  84.     int    ti_lookdsize;   /* look data buf size */
  85.     int    ti_lookcsize;   /* look ctl buf size  */
  86.     int    ti_maxpsz;    /* TIDU size          */
  87.     long    ti_servtype;    /* service type       */
  88.     int     ti_lookflg;    /* buffered look flag */
  89.     int    ti_state;    /* user level state   */
  90.     int    ti_ocnt;    /* # outstanding connect indications */
  91.         int     ti_qlen;        /* connect indication queue size */
  92.         int     ti_tsdu;        /* the amount of TSDU supported by provider */
  93.         ulong   ti_provider_flgs; /* user visible provider flags */
  94. #ifdef _REENTRANT
  95.     mutex_t    lock;    /* lock for this structure */
  96. #endif /* _REENTRANT */
  97.     long    ti_etsdu;       /* amount of etsdu supported by provider */
  98.     long    ti_cdata;       /* max connect data size supp. by provider */
  99.     long    ti_ddata;       /* max discon data size supp. by provider */
  100.     long    ti_addrsize;    /* address buf. size supp. by provider */
  101.     long    ti_optsize;     /* options buf. size supp. by provider */
  102.     char    ti_xtiopt;    /* if != 0, then check options for XTI format */
  103.     char    ti_socket;    /* if != 0, then transport is a socket */
  104. };
  105.  
  106. /* Old TI interface user level structure - needed for compatibility */
  107.  
  108. struct _oldti_user {
  109.     ushort    ti_flags;    /* flags              */
  110.     int    ti_rcvsize;    /* rcv buffer size    */
  111.     char   *ti_rcvbuf;    /* rcv buffer         */
  112.     int    ti_ctlsize;    /* ctl buffer size    */
  113.     char   *ti_ctlbuf;    /* ctl buffer         */
  114.     char   *ti_lookdbuf;    /* look data buffer   */
  115.     char   *ti_lookcbuf;    /* look ctl buffer    */
  116.     int    ti_lookdsize;   /* look data buf size */
  117.     int    ti_lookcsize;   /* look ctl buf size  */
  118.     int    ti_maxpsz;    /* TIDU size          */
  119.     long    ti_servtype;    /* service type       */
  120.     int     ti_lookflg;    /* buffered look flag */
  121. };
  122.  
  123. #define OPENFILES     ulimit(4, 0)
  124.  
  125. #ifdef _KERNEL
  126.  
  127. /*
  128.  * Routine to be used by transport providers to process
  129.  * TI_GETMYNAME and TI_GETPEERNAME ioctls.
  130.  */
  131. extern int ti_doname(queue_t *, mblk_t *, caddr_t, uint, caddr_t, uint);
  132.  
  133. /*
  134.  * Return values for ti_doname.
  135.  */
  136. #define DONAME_FAIL    0    /* failing ioctl (done) */
  137. #define DONAME_DONE    1    /* done processing */
  138. #define DONAME_CONT    2    /* continue proceesing (not done yet)*/
  139.  
  140. #endif /* _KERNEL */
  141.  
  142. #if defined(__cplusplus)
  143.     }
  144. #endif
  145.  
  146. #endif /* _NET_TIMOD_H */
  147.