OpenTransportProtocol.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:184k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       OpenTransportProtocol.h
  3.  
  4.      Contains:   Definitions likely to be used by low-level protocol stack implementation.
  5.  
  6.      Version:    Technology: 2.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1993-2001 by Apple Computer, Inc. and Mentat Inc., all rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __OPENTRANSPORTPROTOCOL__
  18. #define __OPENTRANSPORTPROTOCOL__
  19. #ifndef __CONDITIONALMACROS__
  20. #include "ConditionalMacros.h"
  21. #endif
  22. #if CALL_NOT_IN_CARBON
  23. #ifndef __FILES__
  24. #include "Files.h"
  25. #endif
  26. #ifndef __CODEFRAGMENTS__
  27. #include "CodeFragments.h"
  28. #endif
  29. #endif  /* CALL_NOT_IN_CARBON */
  30. #ifndef __OPENTRANSPORT__
  31. #include "OpenTransport.h"
  32. #endif
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39. #if PRAGMA_IMPORT
  40. #pragma import on
  41. #endif
  42. #if PRAGMA_STRUCT_ALIGN
  43.     #pragma options align=mac68k
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45.     #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47.     #pragma pack(2)
  48. #endif
  49. #if defined(__MWERKS__) && TARGET_CPU_68K
  50.     #pragma push
  51.     #pragma pointers_in_D0
  52. #endif
  53. /* ***** Setup Default Compiler Variables ******/
  54. /*
  55.    OTKERNEL is used to indicate whether the code is being built
  56.    for the kernel environment.  It defaults to 0.  If you include
  57.    "OpenTransportKernel.h" before including this file,
  58.    it will be 1 and you will only be able to see stuff available
  59.    to kernel code.
  60.    As we've included "OpenTransport.h" and it defaults this variable
  61.    to 0 if it's not already been defined, it should always be defined
  62.    by the time we get here.  So we just assert that.  Assertions in
  63.    header files!  Cool (-:
  64. */
  65. #ifndef OTKERNEL
  66. #error OpenTransportProtocol.h expects OpenTransport.h to set up OTKERNEL.
  67. #endif  /* !defined(OTKERNEL) */
  68. /* ***** Shared Client Memory ******/
  69. #if !OTKERNEL
  70. /*
  71.    These allocators allocate memory in the shared client pool,
  72.    which is shared between all clients and is not disposed when
  73.    a particular client goes away.  See DTS Technote ooo
  74.    "Understanding Open Transport Memory Management" for details.
  75. */
  76. #if CALL_NOT_IN_CARBON
  77. EXTERN_API_C( void *)
  78. OTAllocSharedClientMem          (OTByteCount            size);
  79. EXTERN_API_C( void )
  80. OTFreeSharedClientMem           (void *                 mem);
  81. #endif  /* CALL_NOT_IN_CARBON */
  82. #endif  /* !OTKERNEL */
  83. /* ***** UNIX Types ******/
  84. #if CALL_NOT_IN_CARBON
  85. /*
  86.    On UNIX, uid_t and gid_t are defined to be big enough
  87.    to hold a user ID and group ID respectively.  As Mac OS
  88.    has no such concepts, we just define them as UInt32 place
  89.    holders.
  90. */
  91. typedef UInt32                          uid_t;
  92. typedef UInt32                          gid_t;
  93. /* Similarly, dev_t is a UNIX type for denoting a device number.*/
  94. typedef UInt32                          dev_t;
  95. /* ***** From the Mentat "strstat.h" ******/
  96. /* module statistics structure */
  97. struct module_stat {
  98.     long                            ms_pcnt;                    /* count of calls to put proc */
  99.     long                            ms_scnt;                    /* count of calls to service proc */
  100.     long                            ms_ocnt;                    /* count of calls to open proc */
  101.     long                            ms_ccnt;                    /* count of calls to close proc */
  102.     long                            ms_acnt;                    /* count of calls to admin proc */
  103.     char *                          ms_xptr;                    /* pointer to private statistics */
  104.     short                           ms_xsize;                   /* length of private statistics buffer */
  105. };
  106. typedef struct module_stat              module_stat;
  107. /* ***** From the Mentat "cred.h" ******/
  108. struct cred {
  109.     UInt16                          cr_ref;                     /* reference count on processes using cred structures */
  110.     UInt16                          cr_ngroups;                 /* number of groups in cr_groups */
  111.     uid_t                           cr_uid;                     /* effective user id */
  112.     gid_t                           cr_gid;                     /* effective group id */
  113.     uid_t                           cr_ruid;                    /* real user id */
  114.     gid_t                           cr_rgid;                    /* real group id */
  115.     uid_t                           cr_suid;                    /* user id saved by exec */
  116.     gid_t                           cr_sgid;                    /* group id saved by exec */
  117.     gid_t                           cr_groups[1];               /* supplementary groups list */
  118. };
  119. typedef struct cred                     cred;
  120. typedef cred                            cred_t;
  121. /* Free return structure for esballoc */
  122. typedef CALLBACK_API_C( void , FreeFuncType )(char *arg);
  123. struct free_rtn {
  124.     FreeFuncType                    free_func;                  /* Routine to call to free buffer */
  125.     char *                          free_arg;                   /* Parameter to free_func */
  126. };
  127. typedef struct free_rtn                 free_rtn;
  128. typedef free_rtn                        frtn_t;
  129. /* data descriptor */
  130. typedef struct datab                    datab;
  131. union datab_db_f {
  132.     datab *                         freep;
  133.     free_rtn *                      frtnp;
  134. };
  135. typedef union datab_db_f                datab_db_f;
  136. struct datab {
  137.     datab_db_f                      db_f;
  138.     unsigned char *                 db_base;                    /* first byte of buffer */
  139.     unsigned char *                 db_lim;                     /* last byte+1 of buffer */
  140.     unsigned char                   db_ref;                     /* count of messages pointing to block*/
  141.     unsigned char                   db_type;                    /* message type */
  142.     unsigned char                   db_iswhat;                  /* message status */
  143.     unsigned char                   db_filler2;                 /* for spacing */
  144.     UInt32                          db_size;                    /* used internally */
  145.     unsigned char *                 db_msgaddr;                 /* used internally */
  146.     long                            db_filler;
  147. };
  148. typedef datab                           dblk_t;
  149. #define db_freep        db_f.freep
  150. #define db_frtnp        db_f.frtnp
  151. /* message block */
  152. struct msgb {
  153.     struct msgb *                   b_next;                     /* next message on queue */
  154.     struct msgb *                   b_prev;                     /* previous message on queue */
  155.     struct msgb *                   b_cont;                     /* next message block of message */
  156.     unsigned char *                 b_rptr;                     /* first unread data byte in buffer */
  157.     unsigned char *                 b_wptr;                     /* first unwritten data byte */
  158.     datab *                         b_datap;                    /* data block */
  159.     unsigned char                   b_band;                     /* message priority */
  160.     unsigned char                   b_pad1;
  161.     unsigned short                  b_flag;
  162. #ifdef  MSGB_XTRA
  163.     MSGB_XTRA
  164. #endif
  165. };
  166. typedef struct msgb                     msgb;
  167. typedef msgb                            mblk_t;
  168. /* mblk flags */
  169. enum {
  170.     MSGMARK                     = 0x01,                         /* last byte of message is tagged */
  171.     MSGNOLOOP                   = 0x02,                         /* don't pass message to write-side of stream */
  172.     MSGDELIM                    = 0x04,                         /* message is delimited */
  173.     MSGNOGET                    = 0x08
  174. };
  175. /* STREAMS environments are expected to define these constants in a public header file.*/
  176. enum {
  177.     STRCTLSZ                    = 256,                          /* Maximum Control buffer size for messages   */
  178.     STRMSGSZ                    = 8192                          /* Maximum # data bytes for messages   */
  179. };
  180. /* Message types */
  181. enum {
  182.     QNORM                       = 0,
  183.     M_DATA                      = 0,                            /* Ordinary data */
  184.     M_PROTO                     = 1,                            /* Internal control info and data */
  185.     M_BREAK                     = 0x08,                         /* Request a driver to send a break */
  186.     M_PASSFP                    = 0x09,                         /* Used to pass a file pointer */
  187.     M_SIG                       = 0x0B,                         /* Requests a signal to be sent */
  188.     M_DELAY                     = 0x0C,                         /* Request a real-time delay */
  189.     M_CTL                       = 0x0D,                         /* For inter-module communication */
  190.     M_IOCTL                     = 0x0E,                         /* Used internally for I_STR requests */
  191.     M_SETOPTS                   = 0x10,                         /* Alters characteristics of Stream head */
  192.     M_RSE                       = 0x11                          /* Reserved for internal use */
  193. };
  194. /* MPS private type */
  195. enum {
  196.     M_MI                        = 0x40,
  197.     M_MI_READ_RESET             = 1,
  198.     M_MI_READ_SEEK              = 2,
  199.     M_MI_READ_END               = 4
  200. };
  201. /* Priority messages types */
  202. enum {
  203.     QPCTL                       = 0x80,
  204.     M_IOCACK                    = 0x81,                         /* Positive ack of previous M_IOCTL */
  205.     M_IOCNAK                    = 0x82,                         /* Previous M_IOCTL failed */
  206.     M_PCPROTO                   = 0x83,                         /* Same as M_PROTO except for priority */
  207.     M_PCSIG                     = 0x84,                         /* Priority signal */
  208.     M_FLUSH                     = 0x86,                         /* Requests modules to flush queues */
  209.     M_STOP                      = 0x87,                         /* Request drivers to stop output */
  210.     M_START                     = 0x88,                         /* Request drivers to start output */
  211.     M_HANGUP                    = 0x89,                         /* Driver can no longer produce data */
  212.     M_ERROR                     = 0x8A,                         /* Reports downstream error condition */
  213.     M_READ                      = 0x8B,                         /* Reports client read at Stream head */
  214.     M_COPYIN                    = 0x8C,                         /* Requests the Stream to copy data in for a module */
  215.     M_COPYOUT                   = 0x8D,                         /* Requests the Stream to copy data out for a module */
  216.     M_IOCDATA                   = 0x8E,                         /* Status from M_COPYIN/M_COPYOUT message */
  217.     M_PCRSE                     = 0x90,                         /* Reserved for internal use */
  218.     M_STOPI                     = 0x91,                         /* Request drivers to stop input */
  219.     M_STARTI                    = 0x92,                         /* Request drivers to start input */
  220.     M_HPDATA                    = 0x93                          /* MPS-private type; high priority data */
  221. };
  222. /* Defines for flush messages */
  223. enum {
  224.     FLUSHALL                    = 1,
  225.     FLUSHDATA                   = 0
  226. };
  227. enum {
  228.     NOERROR                     = -1                            /* used in M_ERROR messages */
  229. };
  230. typedef struct sth_s sth_s;
  231. typedef struct sqh_s sqh_s;
  232. typedef struct q_xtra q_xtra;
  233. #if OTKERNEL
  234. /*
  235.    module_info is aligned differently on 68K than
  236.    on PowerPC.  Yucky.  I can't defined a conditionalised
  237.    pad field because a) you can't conditionalise specific
  238.    fields in the interface definition language used to
  239.    create Universal Interfaces, and b) lots of code 
  240.    assigns C structured constants to global variables
  241.    of this type, and these assignments break if you
  242.    add an extra field to the type.  Instead, I
  243.    set the alignment appropriately before defining the 
  244.    structure.  The problem with doing that is that
  245.    the interface definition language doesn't allow
  246.    my to set the alignment in the middle of a file,
  247.    so I have to do this via "pass throughs".  This
  248.    works fine for the well known languages (C, Pascal),
  249.    but may cause problems for other languages (Java,
  250.    Asm).
  251. */
  252. #if TARGET_CPU_PPC
  253.  #pragma options align=power
  254. #endif
  255. struct module_info {
  256.     unsigned short                  mi_idnum;                   /* module ID number */
  257.     char *                          mi_idname;                  /* module name */
  258.     long                            mi_minpsz;                  /* min pkt size, for developer use */
  259.     long                            mi_maxpsz;                  /* max pkt size, for developer use */
  260.     unsigned long                   mi_hiwat;                   /* hi-water mark, for flow control */
  261.     unsigned long                   mi_lowat;                   /* lo-water mark, for flow control */
  262. };
  263. typedef struct module_info              module_info;
  264. typedef module_info *                   module_infoPtr;
  265. #if TARGET_CPU_PPC
  266.  #pragma options align=reset
  267. #endif
  268. typedef struct queue                    queue;
  269. typedef CALLBACK_API_C( OTInt32 , admin_t )(void );
  270. typedef CALLBACK_API_C( void , bufcall_t )(long size);
  271. typedef CALLBACK_API_C( void , bufcallp_t )(long size);
  272. typedef CALLBACK_API_C( OTInt32 , closep_t )(queue *q, OTInt32 foo, cred_t *cred);
  273. typedef CALLBACK_API_C( OTInt32 , old_closep_t )(queue *q);
  274. typedef CALLBACK_API_C( OTInt32 , openp_t )(queue *q, dev_t *dev, OTInt32 foo, OTInt32 bar, cred_t *cred);
  275. typedef CALLBACK_API_C( OTInt32 , openOld_t )(queue *q, dev_t dev, OTInt32 foo, OTInt32 bar);
  276. typedef CALLBACK_API_C( OTInt32 , old_openp_t )(queue *q, dev_t dev, OTInt32 foo, OTInt32 bar);
  277. typedef CALLBACK_API_C( OTInt32 , closeOld_t )(queue *q);
  278. typedef CALLBACK_API_C( OTInt32 , putp_t )(queue *q, msgb *mp);
  279. typedef CALLBACK_API_C( OTInt32 , srvp_t )(queue *q);
  280. struct qinit {
  281.     putp_t                          qi_putp;                    /* put procedure */
  282.     srvp_t                          qi_srvp;                    /* service procedure */
  283.     openp_t                         qi_qopen;                   /* called on each open or a push */
  284.     closep_t                        qi_qclose;                  /* called on last close or a pop */
  285.     admin_t                         qi_qadmin;                  /* reserved for future use */
  286.     module_info *                   qi_minfo;                   /* information structure */
  287.     module_stat *                   qi_mstat;                   /* statistics structure - optional */
  288. };
  289. typedef struct qinit                    qinit;
  290. /* defines module or driver */
  291. struct streamtab {
  292.     qinit *                         st_rdinit;                  /* defines read QUEUE */
  293.     qinit *                         st_wrinit;                  /* defines write QUEUE */
  294.     qinit *                         st_muxrinit;                /* for multiplexing drivers only */
  295.     qinit *                         st_muxwinit;                /* ditto */
  296. };
  297. typedef struct streamtab                streamtab;
  298. struct qband {
  299.     struct qband *                  qb_next;                    /* next band for this queue */
  300.     unsigned long                   qb_count;                   /* weighted count of characters in this band */
  301.     msgb *                          qb_first;                   /* head of message queue */
  302.     msgb *                          qb_last;                    /* tail of message queue */
  303.     unsigned long                   qb_hiwat;                   /* high water mark */
  304.     unsigned long                   qb_lowat;                   /* low water mark */
  305.     unsigned short                  qb_flag;                    /* ooo.state */
  306.     short                           qb_pad1;                    /* ooo reserved */
  307. };
  308. typedef struct qband                    qband;
  309. typedef qband                           qband_t;
  310. union queue_q_u {
  311.     queue *                         q_u_link;                   /* link to scheduling queue */
  312.     sqh_s *                         q_u_sqh_parent;
  313. };
  314. typedef union queue_q_u                 queue_q_u;
  315. struct queue {
  316.     qinit *                         q_qinfo;                    /* procedures and limits for queue */
  317.     msgb *                          q_first;                    /* head of message queue */
  318.     msgb *                          q_last;                     /* tail of message queue */
  319.     struct queue *                  q_next;                     /* next queue in Stream */
  320.     queue_q_u                       q_u;
  321.     char *                          q_ptr;                      /* to private data structure */
  322.     unsigned long                   q_count;                    /* weighted count of characters on q */
  323.     long                            q_minpsz;                   /* min packet size accepted */
  324.     long                            q_maxpsz;                   /* max packet size accepted */
  325.     unsigned long                   q_hiwat;                    /* high water mark, for flow control */
  326.     unsigned long                   q_lowat;                    /* low water mark */
  327.     qband *                         q_bandp;                    /* band information */
  328.     unsigned short                  q_flag;                     /* ooo queue state */
  329.     unsigned char                   q_nband;                    /* ooo number of bands */
  330.     unsigned char                   q_pad1[1];                  /* ooo reserved */
  331.     q_xtra *                        q_osx;                      /* Pointer to OS-dependent extra stuff */
  332.     struct queue *                  q_ffcp;                     /* Forward flow control pointer */
  333.     struct queue *                  q_bfcp;                     /* Backward flow control pointer */
  334. };
  335. typedef queue *                         queuePtr;
  336. typedef queue                           queue_t;
  337. #define q_link          q_u.q_u_link
  338. #define q_sqh_parent    q_u.q_u_sqh_parent
  339. /* queue_t flag defines */
  340. enum {
  341.     QREADR                      = 0x01,                         /* This queue is a read queue */
  342.     QNOENB                      = 0x02,                         /* Don't enable in putq */
  343.     QFULL                       = 0x04,                         /* The queue is full */
  344.     QWANTR                      = 0x08,                         /* The queue should be scheduled in the next putq */
  345.     QWANTW                      = 0x10,                         /* The stream should be back enabled when this queue drains */
  346.     QUSE                        = 0x20,                         /* The queue is allocated and ready for use */
  347.     QENAB                       = 0x40,                         /* The queue is scheduled (on the run queue) */
  348.     QBACK                       = 0x80,                         /* The queue has been back enabled */
  349.     QOLD                        = 0x0100,                       /* Module supports old style opens and closes */
  350.     QHLIST                      = 0x0200,                       /* The Stream head is doing something with this queue (Not supported by MPS) */
  351.     QWELDED                     = 0x0400,                       /* Mentat flag for welded queues */
  352.     QUNWELDING                  = 0x0800,                       /* Queue is scheduled to be unwelded */
  353.     QPROTECTED                  = 0x1000,                       /* Mentat flag for unsafe q access */
  354.     QEXCOPENCLOSE               = 0x2000                        /* Queue wants exclusive open/close calls */
  355. };
  356. /* qband_t flag defines */
  357. enum {
  358.     QB_FULL                     = 0x01,                         /* The band is full */
  359.     QB_WANTW                    = 0x02,                         /* The stream should be back enabled when this band/queue drains */
  360.     QB_BACK                     = 0x04                          /* The queue has been back enabled */
  361. };
  362. #else
  363. /*
  364.    Client code views a queue_t as a simple cookie.
  365.    The real definition lives above and is only available
  366.    to kernel code.
  367. */
  368. struct queue {
  369.     UInt32                          dummy;
  370. };
  371. typedef struct queue                    queue;
  372. typedef SInt32                          queue_t;
  373. #endif  /* OTKERNEL */
  374. /* structure contained in M_COPYIN/M_COPYOUT messages */
  375. typedef unsigned char *                 caddr_t;
  376. struct copyreq {
  377.     SInt32                          cq_cmd;                     /* ioctl command (from ioc_cmd) */
  378.     cred *                          cq_cr;                      /* pointer to full credentials */
  379.     UInt32                          cq_id;                      /* ioctl id (from ioc_id) */
  380.     caddr_t                         cq_addr;                    /* address to copy data to/from */
  381.     UInt32                          cq_size;                    /* number of bytes to copy */
  382.     SInt32                          cq_flag;                    /* state */
  383.     mblk_t *                        cq_private;                 /* private state information */
  384.     long                            cq_filler[4];
  385. };
  386. typedef struct copyreq                  copyreq;
  387. #define cq_uid  cq_cr->cr_uid
  388. #define cq_gid  cq_cr->cr_gid
  389. /* copyreq defines */
  390. enum {
  391.     STRCANON                    = 0x01,                         /* b_cont data block contains canonical format specifier */
  392.     RECOPY                      = 0x02                          /* perform I_STR copyin again this time using canonical format specifier */
  393. };
  394. /* structure contained in M_IOCDATA message block */
  395. struct copyresp {
  396.     SInt32                          cp_cmd;                     /* ioctl command (from ioc_cmd) */
  397.     cred *                          cp_cr;                      /* pointer to full credentials */
  398.     UInt32                          cp_id;                      /* ioctl id (from ioc_id) */
  399.     caddr_t                         cp_rval;                    /* status of request; 0 for success; error value for failure */
  400.     UInt32                          cp_pad1;
  401.     SInt32                          cp_pad2;
  402.     mblk_t *                        cp_private;                 /* private state information */
  403.     long                            cp_filler[4];
  404. };
  405. typedef struct copyresp                 copyresp;
  406. #define cp_uid  cp_cr->cr_uid
  407. #define cp_gid  cp_cr->cr_gid
  408. /* structure contained in an M_IOCTL message block */
  409. struct iocblk {
  410.     SInt32                          ioc_cmd;                    /* ioctl command type */
  411.     cred *                          ioc_cr;                     /* pointer to full credentials */
  412.     UInt32                          ioc_id;                     /* ioctl id */
  413.     UInt32                          ioc_count;                  /* count of bytes in data field */
  414.     SInt32                          ioc_error;                  /* error code */
  415.     SInt32                          ioc_rval;                   /* return value */
  416.     long                            ioc_filler[4];
  417. };
  418. typedef struct iocblk                   iocblk;
  419. #define ioc_uid ioc_cr->cr_uid
  420. #define ioc_gid ioc_cr->cr_gid
  421. enum {
  422.     TRANSPARENT                 = (unsigned long)0xFFFFFFFF
  423. };
  424. /* Used in M_IOCTL mblks to muxes (ioc_cmd I_LINK) */
  425. struct linkblk {
  426.     queue *                         l_qtop;                     /* lowest level write queue of upper stream */
  427.     queue *                         l_qbot;                     /* highest level write queue of lower stream */
  428.     SInt32                          l_index;                    /* system-unique index for lower stream */
  429.     long                            l_pad[5];
  430. };
  431. typedef struct linkblk                  linkblk;
  432. /* structure contained in an M_PASSFP message block */
  433. struct strpfp {
  434.     unsigned long                   pass_file_cookie;           /* file 'pointer' */
  435.     unsigned short                  pass_uid;                   /* user id of sending stream */
  436.     unsigned short                  pass_gid;
  437.     sth_s *                         pass_sth;                   /* Stream head pointer of passed stream */
  438. };
  439. typedef struct strpfp                   strpfp;
  440. /* structure contained in an M_SETOPTS message block */
  441. struct stroptions {
  442.     unsigned long                   so_flags;                   /* options to set */
  443.     short                           so_readopt;                 /* read option */
  444.     unsigned short                  so_wroff;                   /* write offset */
  445.     long                            so_minpsz;                  /* minimum read packet size */
  446.     long                            so_maxpsz;                  /* maximum read packet size */
  447.     unsigned long                   so_hiwat;                   /* read queue high-water mark */
  448.     unsigned long                   so_lowat;                   /* read queue low-water mark */
  449.     unsigned char                   so_band;                    /* band for water marks */
  450.     unsigned char                   so_filler[3];               /* added for alignment */
  451.     unsigned long                   so_poll_set;                /* poll events to set */
  452.     unsigned long                   so_poll_clr;                /* poll events to clear */
  453. };
  454. typedef struct stroptions               stroptions;
  455. /* definitions for so_flags field */
  456. enum {
  457.     SO_ALL                      = 0x7FFF,                       /* Update all options */
  458.     SO_READOPT                  = 0x0001,                       /* Set the read mode */
  459.     SO_WROFF                    = 0x0002,                       /* Insert an offset in write M_DATA mblks */
  460.     SO_MINPSZ                   = 0x0004,                       /* Change the min packet size on sth rq */
  461.     SO_MAXPSZ                   = 0x0008,                       /* Change the max packet size on sth rq */
  462.     SO_HIWAT                    = 0x0010,                       /* Change the high water mark on sth rq */
  463.     SO_LOWAT                    = 0x0020,                       /* Change the low water mark */
  464.     SO_MREADON                  = 0x0040,                       /* Request M_READ messages */
  465.     SO_MREADOFF                 = 0x0080,                       /* Don't gen M_READ messages */
  466.     SO_NDELON                   = 0x0100,                       /* old TTY semantics for O_NDELAY reads and writes */
  467.     SO_NDELOFF                  = 0x0200,                       /* STREAMS semantics for O_NDELAY reads and writes */
  468.     SO_ISTTY                    = 0x0400,                       /* Become a controlling tty */
  469.     SO_ISNTTY                   = 0x0800,                       /* No longer a controlling tty */
  470.     SO_TOSTOP                   = 0x1000,                       /* Stop on background writes */
  471.     SO_TONSTOP                  = 0x2000,                       /* Don't stop on background writes */
  472.     SO_BAND                     = 0x4000,                       /* Water marks are for a band */
  473.     SO_POLL_SET                 = 0x8000,                       /* Set events to poll */
  474.     SO_POLL_CLR                 = 0x00010000                    /* Clear events to poll */
  475. };
  476. /* Buffer Allocation Priority */
  477. enum {
  478.     BPRI_LO                     = 1,
  479.     BPRI_MED                    = 2,
  480.     BPRI_HI                     = 3
  481. };
  482. enum {
  483.     INFPSZ                      = -1
  484. };
  485. /** Test whether message is a data message */
  486. #define datamsg(type)   ((type) == M_DATA || (type) == M_PROTO || (type) == M_PCPROTO  ||  (type) == M_DELAY)
  487. enum {
  488.     CLONEOPEN                   = 0x02,
  489.     MODOPEN                     = 0x01,
  490.     OPENFAIL                    = -1
  491. };
  492. /* Enumeration values for strqget and strqset */
  493. typedef SInt32 qfields;
  494. enum {
  495.     QHIWAT                      = 0,
  496.     QLOWAT                      = 1,
  497.     QMAXPSZ                     = 2,
  498.     QMINPSZ                     = 3,
  499.     QCOUNT                      = 4,
  500.     QFIRST                      = 5,
  501.     QLAST                       = 6,
  502.     QFLAG                       = 7,
  503.     QBAD                        = 8
  504. };
  505. typedef qfields                         qfields_t;
  506. #endif  /* CALL_NOT_IN_CARBON */
  507. /* ***** From the Mentat "stropts.h" ******/
  508. enum {
  509.     I_NREAD                     = ((MIOC_STREAMIO << 8) | 1),   /* return the number of bytes in 1st msg */
  510.     I_PUSH                      = ((MIOC_STREAMIO << 8) | 2),   /* push module just below stream head */
  511.     I_POP                       = ((MIOC_STREAMIO << 8) | 3),   /* pop module below stream head */
  512.     I_LOOK                      = ((MIOC_STREAMIO << 8) | 4),   /* retrieve name of first stream module */
  513.     I_FLUSH                     = ((MIOC_STREAMIO << 8) | 5),   /* flush all input and/or output queues */
  514.     I_SRDOPT                    = ((MIOC_STREAMIO << 8) | 6),   /* set the read mode */
  515.     I_GRDOPT                    = ((MIOC_STREAMIO << 8) | 7),   /* get the current read mode */
  516.     I_STR                       = ((MIOC_STREAMIO << 8) | 8),   /* create an internal ioctl message      */
  517.     I_SETSIG                    = ((MIOC_STREAMIO << 8) | 9),   /* request SIGPOLL signal on events */
  518.     I_GETSIG                    = ((MIOC_STREAMIO << 8) | 10),  /* query the registered events */
  519.     I_FIND                      = ((MIOC_STREAMIO << 8) | 11),  /* check for module in stream          */
  520.     I_LINK                      = ((MIOC_STREAMIO << 8) | 12),  /* connect stream under mux fd */
  521.     I_UNLINK                    = ((MIOC_STREAMIO << 8) | 13),  /* disconnect two streams */
  522.     I_PEEK                      = ((MIOC_STREAMIO << 8) | 15),  /* peek at data on read queue */
  523.     I_FDINSERT                  = ((MIOC_STREAMIO << 8) | 16),  /* create a message and send downstream */
  524.     I_SENDFD                    = ((MIOC_STREAMIO << 8) | 17),  /* send an fd to a connected pipe stream */
  525.     I_RECVFD                    = ((MIOC_STREAMIO << 8) | 18),  /* retrieve a file descriptor */
  526.     I_FLUSHBAND                 = ((MIOC_STREAMIO << 8) | 19),  /* flush a particular input and/or output band */
  527.     I_SWROPT                    = ((MIOC_STREAMIO << 8) | 20),  /* set the write mode */
  528.     I_GWROPT                    = ((MIOC_STREAMIO << 8) | 21),  /* get the current write mode */
  529.     I_LIST                      = ((MIOC_STREAMIO << 8) | 22),  /* get a list of all modules on a stream  */
  530.     I_ATMARK                    = ((MIOC_STREAMIO << 8) | 23),  /* check to see if the next message is "marked" */
  531.     I_CKBAND                    = ((MIOC_STREAMIO << 8) | 24),  /* check for a message of a particular band */
  532.     I_GETBAND                   = ((MIOC_STREAMIO << 8) | 25),  /* get the band of the next message to be read */
  533.     I_CANPUT                    = ((MIOC_STREAMIO << 8) | 26),  /* check to see if a message may be passed on a stream */
  534.     I_SETCLTIME                 = ((MIOC_STREAMIO << 8) | 27),  /* set the close timeout wait */
  535.     I_GETCLTIME                 = ((MIOC_STREAMIO << 8) | 28),  /* get the current close timeout wait */
  536.     I_PLINK                     = ((MIOC_STREAMIO << 8) | 29),  /* permanently connect a stream under a mux */
  537.     I_PUNLINK                   = ((MIOC_STREAMIO << 8) | 30),  /* disconnect a permanent link */
  538.     I_GETMSG                    = ((MIOC_STREAMIO << 8) | 40),  /* getmsg() system call */
  539.     I_PUTMSG                    = ((MIOC_STREAMIO << 8) | 41),  /* putmsg() system call */
  540.     I_POLL                      = ((MIOC_STREAMIO << 8) | 42),  /* poll() system call */
  541.     I_SETDELAY                  = ((MIOC_STREAMIO << 8) | 43),  /* set blocking status */
  542.     I_GETDELAY                  = ((MIOC_STREAMIO << 8) | 44),  /* get blocking status */
  543.     I_RUN_QUEUES                = ((MIOC_STREAMIO << 8) | 45),  /* sacrifice for the greater good */
  544.     I_GETPMSG                   = ((MIOC_STREAMIO << 8) | 46),  /* getpmsg() system call */
  545.     I_PUTPMSG                   = ((MIOC_STREAMIO << 8) | 47),  /* putpmsg() system call */
  546.     I_AUTOPUSH                  = ((MIOC_STREAMIO << 8) | 48),  /* for systems that cannot do the autopush in open */
  547.     I_PIPE                      = ((MIOC_STREAMIO << 8) | 49),  /* for pipe library call */
  548.     I_HEAP_REPORT               = ((MIOC_STREAMIO << 8) | 50),  /* get heap statistics */
  549.     I_FIFO                      = ((MIOC_STREAMIO << 8) | 51)   /* for fifo library call */
  550. };
  551. /* priority message request on putmsg() or strpeek */
  552. enum {
  553.     RS_HIPRI                    = 0x01
  554. };
  555. /* flags for getpmsg and putpmsg */
  556. enum {
  557.     MSG_HIPRI                   = 0x01,
  558.     MSG_BAND                    = 0x02,                         /* Retrieve a message from a particular band */
  559.     MSG_ANY                     = 0x04                          /* Retrieve a message from any band */
  560. };
  561. /* return values from getmsg(), 0 indicates all ok */
  562. enum {
  563.     MORECTL                     = 0x01,                         /* more control info available */
  564.     MOREDATA                    = 0x02                          /* more data available */
  565. };
  566. enum {
  567.     FMNAMESZ                    = 31                            /* maximum length of a module or device name */
  568. };
  569. /* Infinite poll wait time */
  570. enum {
  571.     INFTIM                      = (unsigned long)0xFFFFFFFF
  572. };
  573. /* flush requests */
  574. enum {
  575.     FLUSHR                      = 0x01,                         /* Flush the read queue */
  576.     FLUSHW                      = 0x02,                         /* Flush the write queue */
  577.     FLUSHRW                     = (FLUSHW | FLUSHR)             /* Flush both */
  578. };
  579. enum {
  580.     FLUSHBAND                   = 0x40                          /* Flush a particular band */
  581. };
  582. /* I_FLUSHBAND */
  583. struct bandinfo {
  584.     unsigned char                   bi_pri;                     /* Band to flush */
  585.     char                            pad1;
  586.     SInt32                          bi_flag;                    /* One of the above flush requests */
  587. };
  588. typedef struct bandinfo                 bandinfo;
  589. /* flags for I_ATMARK */
  590. enum {
  591.     ANYMARK                     = 0x01,                         /* Check if message is marked */
  592.     LASTMARK                    = 0x02                          /* Check if this is the only message marked */
  593. };
  594. /* signal event masks */
  595. enum {
  596.     S_INPUT                     = 0x01,                         /* A non-M_PCPROTO message has arrived */
  597.     S_HIPRI                     = 0x02,                         /* A priority (M_PCPROTO) message is available */
  598.     S_OUTPUT                    = 0x04,                         /* The write queue is no longer full */
  599.     S_MSG                       = 0x08,                         /* A signal message has reached the front of read queue */
  600.     S_RDNORM                    = 0x10,                         /* A non-priority message is available */
  601.     S_RDBAND                    = 0x20,                         /* A banded messsage is available */
  602.     S_WRNORM                    = 0x40,                         /* Same as S_OUTPUT */
  603.     S_WRBAND                    = 0x80,                         /* A priority band exists and is writable */
  604.     S_ERROR                     = 0x0100,                       /* Error message has arrived */
  605.     S_HANGUP                    = 0x0200,                       /* Hangup message has arrived */
  606.     S_BANDURG                   = 0x0400                        /* Use SIGURG instead of SIGPOLL on S_RDBAND signals */
  607. };
  608. /* read mode bits for I_S|GRDOPT; choose one of the following */
  609. enum {
  610.     RNORM                       = 0x01,                         /* byte-stream mode, default */
  611.     RMSGD                       = 0x02,                         /* message-discard mode */
  612.     RMSGN                       = 0x04,                         /* message-nondiscard mode */
  613.     RFILL                       = 0x08                          /* fill read buffer mode (PSE private) */
  614. };
  615. /* More read modes, these are bitwise or'ed with the modes above */
  616. enum {
  617.     RPROTNORM                   = 0x10,                         /* Normal handling of M_PROTO/M_PCPROTO messages, default */
  618.     RPROTDIS                    = 0x20,                         /* Discard M_PROTO/M_PCPROTO message blocks */
  619.     RPROTDAT                    = 0x40                          /* Convert M_PROTO/M_PCPROTO message blocks into M_DATA */
  620. };
  621. /* write modes for I_S|GWROPT */
  622. enum {
  623.     SNDZERO                     = 0x01                          /* Send a zero-length message downstream on a write of zero bytes */
  624. };
  625. enum {
  626.     MUXID_ALL                   = -1                            /* Unlink all lower streams for I_UNLINK and I_PUNLINK */
  627. };
  628. /*
  629.    strbuf is moved to "OpenTransport.h" because that header file
  630.    exports provider routines that take it as a parameter.
  631. */
  632. /* structure of ioctl data on I_FDINSERT */
  633. struct strfdinsert {
  634.     strbuf                          ctlbuf;
  635.     strbuf                          databuf;
  636.     long                            flags;                      /* type of message, 0 or RS_HIPRI */
  637.     long                            fildes;                     /* fd of other stream (FDCELL) */
  638.     SInt32                          offset;                     /* where to put other stream read qp */
  639. };
  640. typedef struct strfdinsert              strfdinsert;
  641. /* I_LIST structures */
  642. struct str_mlist {
  643.     char                            l_name[32];
  644. };
  645. typedef struct str_mlist                str_mlist;
  646. struct str_list {
  647.     SInt32                          sl_nmods;                   /* number of modules in sl_modlist array */
  648.     str_mlist *                     sl_modlist;
  649. };
  650. typedef struct str_list                 str_list;
  651. /* I_PEEK structure */
  652. struct strpeek {
  653.     strbuf                          ctlbuf;
  654.     strbuf                          databuf;
  655.     long                            flags;                      /* if RS_HIPRI, get priority messages only */
  656. };
  657. typedef struct strpeek                  strpeek;
  658. /* structure for getpmsg and putpmsg */
  659. struct strpmsg {
  660.     strbuf                          ctlbuf;
  661.     strbuf                          databuf;
  662.     SInt32                          band;
  663.     long                            flags;
  664. };
  665. typedef struct strpmsg                  strpmsg;
  666. /* structure of ioctl data on I_RECVFD */
  667. struct strrecvfd {
  668.     long                            fd;                         /* new file descriptor (FDCELL) */
  669.     unsigned short                  uid;                        /* user id of sending stream */
  670.     unsigned short                  gid;
  671.     char                            fill[8];
  672. };
  673. typedef struct strrecvfd                strrecvfd;
  674. /* structure of ioctl data on I_STR */
  675. struct strioctl {
  676.     SInt32                          ic_cmd;                     /* downstream command */
  677.     SInt32                          ic_timout;                  /* ACK/NAK timeout */
  678.     SInt32                          ic_len;                     /* length of data arg */
  679.     char *                          ic_dp;                      /* ptr to data arg */
  680. };
  681. typedef struct strioctl                 strioctl;
  682. /* ***** From the Mentat "strlog.h" ******/
  683. struct log_ctl {
  684.     short                           mid;
  685.     short                           sid;
  686.     char                            level;
  687.     char                            pad1;
  688.     short                           flags;
  689.     long                            ltime;
  690.     long                            ttime;
  691.     SInt32                          seq_no;
  692. };
  693. typedef struct log_ctl                  log_ctl;
  694. enum {
  695.     SL_FATAL                    = 0x01,                         /* Fatal error */
  696.     SL_NOTIFY                   = 0x02,                         /* Notify the system administrator */
  697.     SL_ERROR                    = 0x04,                         /* Pass message to error logger */
  698.     SL_TRACE                    = 0x08,                         /* Pass message to tracer */
  699.     SL_CONSOLE                  = 0x00,                         /* Console messages are disabled */
  700.     SL_WARN                     = 0x20,                         /* Warning */
  701.     SL_NOTE                     = 0x40                          /* Notice this message */
  702. };
  703. struct trace_ids {
  704.     short                           ti_mid;
  705.     short                           ti_sid;
  706.     char                            ti_level;
  707. };
  708. typedef struct trace_ids                trace_ids;
  709. enum {
  710.     I_TRCLOG                    = ((MIOC_STRLOG << 8) | 1),
  711.     I_ERRLOG                    = ((MIOC_STRLOG << 8) | 2)
  712. };
  713. enum {
  714.     LOGMSGSZ                    = 128
  715. };
  716. /* ***** From the Mentat "tihdr.h" ******/
  717. #if CALL_NOT_IN_CARBON
  718. /* TPI Primitives*/
  719. enum {
  720.     T_BIND_REQ = 101,
  721.   T_CONN_REQ = 102,           /* connection request */
  722.    T_CONN_RES = 103,           /* respond to connection indication */
  723.  T_DATA_REQ = 104,
  724.   T_DISCON_REQ = 105,
  725.     T_EXDATA_REQ = 106,
  726.     T_INFO_REQ = 107,
  727.   T_OPTMGMT_REQ = 108,
  728.    T_ORDREL_REQ = 109,
  729.     T_UNBIND_REQ = 110,
  730.     T_UNITDATA_REQ = 111,
  731.   T_ADDR_REQ = 112,           /* Get address request              */
  732.  T_UREQUEST_REQ = 113,       /* UnitRequest (transaction) req    */
  733.  T_REQUEST_REQ = 114,        /* Request (CO transaction) req     */
  734.  T_UREPLY_REQ = 115,         /* UnitRequest (transaction) req    */
  735.  T_REPLY_REQ = 116,          /* REPLY (CO transaction) req       */
  736.  T_CANCELREQUEST_REQ = 117,  /* Cancel outgoing request          */
  737.  T_CANCELREPLY_REQ = 118,    /* Cancel incoming request          */
  738.  T_REGNAME_REQ = 119,        /* Request name registration        */
  739.  T_DELNAME_REQ = 120,        /* Request delete name registration */
  740.  T_LKUPNAME_REQ = 121,       /* Request name lookup              */
  741.     T_BIND_ACK = 122,
  742.   T_CONN_CON = 123,           /* connection confirmation          */
  743.  T_CONN_IND = 124,           /* incoming connection indication   */
  744.  T_DATA_IND = 125,
  745.   T_DISCON_IND = 126,
  746.     T_ERROR_ACK = 127,
  747.  T_EXDATA_IND = 128,
  748.     T_INFO_ACK = 129,
  749.   T_OK_ACK = 130,
  750.     T_OPTMGMT_ACK = 131,
  751.    T_ORDREL_IND = 132,
  752.     T_UNITDATA_IND = 133,
  753.   T_UDERROR_IND = 134,
  754.    T_ADDR_ACK = 135,           /* Get address ack                  */
  755.  T_UREQUEST_IND = 136,       /* UnitRequest (transaction) ind    */
  756.  T_REQUEST_IND = 137,        /* Request (CO transaction) ind     */
  757.  T_UREPLY_IND = 138,         /* Incoming unit reply              */
  758.  T_REPLY_IND = 139,          /* Incoming reply                   */
  759.  T_UREPLY_ACK = 140,         /* outgoing Unit Reply is complete  */
  760.  T_REPLY_ACK = 141,          /* outgoing Reply is complete       */
  761.  T_RESOLVEADDR_REQ = 142,
  762.    T_RESOLVEADDR_ACK = 143,
  763.   T_LKUPNAME_CON = 146,       /* Results of name lookup           */
  764.  T_LKUPNAME_RES = 147,       /* Partial results of name lookup   */
  765.  T_REGNAME_ACK = 148,        /* Request name registration        */
  766.  T_SEQUENCED_ACK = 149,      /* Sequenced version of OK or ERROR ACK */
  767.     T_EVENT_IND = 160           /* Miscellaneous event Indication       */
  768. };
  769. /* State values */
  770. enum {
  771.     TS_UNBND                    = 1,
  772.     TS_WACK_BREQ                = 2,
  773.     TS_WACK_UREQ                = 3,
  774.     TS_IDLE                     = 4,
  775.     TS_WACK_OPTREQ              = 5,
  776.     TS_WACK_CREQ                = 6,
  777.     TS_WCON_CREQ                = 7,
  778.     TS_WRES_CIND                = 8,
  779.     TS_WACK_CRES                = 9,
  780.     TS_DATA_XFER                = 10,
  781.     TS_WIND_ORDREL              = 11,
  782.     TS_WREQ_ORDREL              = 12,
  783.     TS_WACK_DREQ6               = 13,
  784.     TS_WACK_DREQ7               = 14,
  785.     TS_WACK_DREQ9               = 15,
  786.     TS_WACK_DREQ10              = 16,
  787.     TS_WACK_DREQ11              = 17,
  788.     TS_WACK_ORDREL              = 18,
  789.     TS_NOSTATES                 = 19,
  790.     TS_BAD_STATE                = 19
  791. };
  792. /* Transport events */
  793. enum {
  794.     TE_OPENED                   = 1,
  795.     TE_BIND                     = 2,
  796.     TE_OPTMGMT                  = 3,
  797.     TE_UNBIND                   = 4,
  798.     TE_CLOSED                   = 5,
  799.     TE_CONNECT1                 = 6,
  800.     TE_CONNECT2                 = 7,
  801.     TE_ACCEPT1                  = 8,
  802.     TE_ACCEPT2                  = 9,
  803.     TE_ACCEPT3                  = 10,
  804.     TE_SND                      = 11,
  805.     TE_SNDDIS1                  = 12,
  806.     TE_SNDDIS2                  = 13,
  807.     TE_SNDREL                   = 14,
  808.     TE_SNDUDATA                 = 15,
  809.     TE_LISTEN                   = 16,
  810.     TE_RCVCONNECT               = 17,
  811.     TE_RCV                      = 18,
  812.     TE_RCVDIS1                  = 19,
  813.     TE_RCVDIS2                  = 20,
  814.     TE_RCVDIS3                  = 21,
  815.     TE_RCVREL                   = 22,
  816.     TE_RCVUDATA                 = 23,
  817.     TE_RCVUDERR                 = 24,
  818.     TE_PASS_CONN                = 25,
  819.     TE_BAD_EVENT                = 26
  820. };
  821. struct T_addr_ack {
  822.     long                            PRIM_type;                  /* Always T_ADDR_ACK */
  823.     long                            LOCADDR_length;
  824.     long                            LOCADDR_offset;
  825.     long                            REMADDR_length;
  826.     long                            REMADDR_offset;
  827. };
  828. typedef struct T_addr_ack               T_addr_ack;
  829. struct T_addr_req {
  830.     long                            PRIM_type;                  /* Always T_ADDR_REQ */
  831. };
  832. typedef struct T_addr_req               T_addr_req;
  833. struct T_bind_ack {
  834.     long                            PRIM_type;                  /* always T_BIND_ACK */
  835.     long                            ADDR_length;
  836.     long                            ADDR_offset;
  837.     unsigned long                   CONIND_number;
  838. };
  839. typedef struct T_bind_ack               T_bind_ack;
  840. struct T_bind_req {
  841.     long                            PRIM_type;                  /* always T_BIND_REQ */
  842.     long                            ADDR_length;
  843.     long                            ADDR_offset;
  844.     unsigned long                   CONIND_number;
  845. };
  846. typedef struct T_bind_req               T_bind_req;
  847. struct T_conn_con {
  848.     long                            PRIM_type;                  /* always T_CONN_CON */
  849.     long                            RES_length;                 /* responding address length */
  850.     long                            RES_offset;
  851.     long                            OPT_length;
  852.     long                            OPT_offset;
  853. };
  854. typedef struct T_conn_con               T_conn_con;
  855. struct T_conn_ind {
  856.     long                            PRIM_type;                  /* always T_CONN_IND */
  857.     long                            SRC_length;
  858.     long                            SRC_offset;
  859.     long                            OPT_length;
  860.     long                            OPT_offset;
  861.     long                            SEQ_number;
  862. };
  863. typedef struct T_conn_ind               T_conn_ind;
  864. struct T_conn_req {
  865.     long                            PRIM_type;                  /* always T_CONN_REQ */
  866.     long                            DEST_length;
  867.     long                            DEST_offset;
  868.     long                            OPT_length;
  869.     long                            OPT_offset;
  870. };
  871. typedef struct T_conn_req               T_conn_req;
  872. struct T_conn_res {
  873.     long                            PRIM_type;                  /* always T_CONN_RES */
  874.     queue *                         QUEUE_ptr;
  875.     long                            OPT_length;
  876.     long                            OPT_offset;
  877.     long                            SEQ_number;
  878. };
  879. typedef struct T_conn_res               T_conn_res;
  880. struct T_data_ind {
  881.     long                            PRIM_type;                  /* always T_DATA_IND */
  882.     long                            MORE_flag;
  883. };
  884. typedef struct T_data_ind               T_data_ind;
  885. struct T_data_req {
  886.     long                            PRIM_type;                  /* always T_DATA_REQ */
  887.     long                            MORE_flag;
  888. };
  889. typedef struct T_data_req               T_data_req;
  890. struct T_discon_ind {
  891.     long                            PRIM_type;                  /* always T_DISCON_IND */
  892.     long                            DISCON_reason;
  893.     long                            SEQ_number;
  894. };
  895. typedef struct T_discon_ind             T_discon_ind;
  896. struct T_discon_req {
  897.     long                            PRIM_type;                  /* always T_DISCON_REQ */
  898.     long                            SEQ_number;
  899. };
  900. typedef struct T_discon_req             T_discon_req;
  901. struct T_exdata_ind {
  902.     long                            PRIM_type;                  /* always T_EXDATA_IND */
  903.     long                            MORE_flag;
  904. };
  905. typedef struct T_exdata_ind             T_exdata_ind;
  906. struct T_exdata_req {
  907.     long                            PRIM_type;                  /* always T_EXDATA_REQ */
  908.     long                            MORE_flag;
  909. };
  910. typedef struct T_exdata_req             T_exdata_req;
  911. struct T_error_ack {
  912.     long                            PRIM_type;                  /* always T_ERROR_ACK */
  913.     long                            ERROR_prim;                 /* primitive in error */
  914.     long                            TLI_error;
  915.     long                            UNIX_error;
  916. };
  917. typedef struct T_error_ack              T_error_ack;
  918. struct T_info_ack {
  919.     long                            PRIM_type;                  /* always T_INFO_ACK */
  920.     long                            TSDU_size;                  /* max TSDU size */
  921.     long                            ETSDU_size;                 /* max ETSDU size */
  922.     long                            CDATA_size;                 /* connect data size */
  923.     long                            DDATA_size;                 /* disconnect data size */
  924.     long                            ADDR_size;                  /* TSAP size */
  925.     long                            OPT_size;                   /* options size */
  926.     long                            TIDU_size;                  /* TIDU size */
  927.     long                            SERV_type;                  /* service type */
  928.     long                            CURRENT_state;              /* current state */
  929.     long                            PROVIDER_flag;              /* provider flags (see xti.h for defines) */
  930. };
  931. typedef struct T_info_ack               T_info_ack;
  932. /* Provider flags */
  933. enum {
  934.     SENDZERO                    = 0x0001,                       /* supports 0-length TSDU's */
  935.     XPG4_1                      = 0x0002                        /* provider supports recent stuff */
  936. };
  937. struct T_info_req {
  938.     long                            PRIM_type;                  /* always T_INFO_REQ */
  939. };
  940. typedef struct T_info_req               T_info_req;
  941. struct T_ok_ack {
  942.     long                            PRIM_type;                  /* always T_OK_ACK */
  943.     long                            CORRECT_prim;
  944. };
  945. typedef struct T_ok_ack                 T_ok_ack;
  946. struct T_optmgmt_ack {
  947.     long                            PRIM_type;                  /* always T_OPTMGMT_ACK */
  948.     long                            OPT_length;
  949.     long                            OPT_offset;
  950.     long                            MGMT_flags;
  951. };
  952. typedef struct T_optmgmt_ack            T_optmgmt_ack;
  953. struct T_optmgmt_req {
  954.     long                            PRIM_type;                  /* always T_OPTMGMT_REQ */
  955.     long                            OPT_length;
  956.     long                            OPT_offset;
  957.     long                            MGMT_flags;
  958. };
  959. typedef struct T_optmgmt_req            T_optmgmt_req;
  960. struct T_ordrel_ind {
  961.     long                            PRIM_type;                  /* always T_ORDREL_IND */
  962. };
  963. typedef struct T_ordrel_ind             T_ordrel_ind;
  964. struct T_ordrel_req {
  965.     long                            PRIM_type;                  /* always T_ORDREL_REQ */
  966. };
  967. typedef struct T_ordrel_req             T_ordrel_req;
  968. struct T_unbind_req {
  969.     long                            PRIM_type;                  /* always T_UNBIND_REQ */
  970. };
  971. typedef struct T_unbind_req             T_unbind_req;
  972. struct T_uderror_ind {
  973.     long                            PRIM_type;                  /* always T_UDERROR_IND */
  974.     long                            DEST_length;
  975.     long                            DEST_offset;
  976.     long                            OPT_length;
  977.     long                            OPT_offset;
  978.     long                            ERROR_type;
  979. };
  980. typedef struct T_uderror_ind            T_uderror_ind;
  981. struct T_unitdata_ind {
  982.     long                            PRIM_type;                  /* always T_UNITDATA_IND */
  983.     long                            SRC_length;
  984.     long                            SRC_offset;
  985.     long                            OPT_length;
  986.     long                            OPT_offset;
  987. };
  988. typedef struct T_unitdata_ind           T_unitdata_ind;
  989. struct T_unitdata_req {
  990.     long                            PRIM_type;                  /* always T_UNITDATA_REQ */
  991.     long                            DEST_length;
  992.     long                            DEST_offset;
  993.     long                            OPT_length;
  994.     long                            OPT_offset;
  995. };
  996. typedef struct T_unitdata_req           T_unitdata_req;
  997. struct T_resolveaddr_ack {
  998.     long                            PRIM_type;                  /* always T_RESOLVEADDR_ACK */
  999.     long                            SEQ_number;
  1000.     long                            ADDR_length;
  1001.     long                            ADDR_offset;
  1002.     long                            ORIG_client;
  1003.     long                            ORIG_data;
  1004.     long                            TLI_error;
  1005.     long                            UNIX_error;
  1006. };
  1007. typedef struct T_resolveaddr_ack        T_resolveaddr_ack;
  1008. struct T_resolveaddr_req {
  1009.     long                            PRIM_type;                  /* always T_RESOLVEADDR_REQ */
  1010.     long                            SEQ_number;
  1011.     long                            ADDR_length;
  1012.     long                            ADDR_offset;
  1013.     long                            ORIG_client;
  1014.     long                            ORIG_data;
  1015.     long                            MAX_milliseconds;
  1016. };
  1017. typedef struct T_resolveaddr_req        T_resolveaddr_req;
  1018. struct T_unitreply_ind {
  1019.     long                            PRIM_type;                  /* Always T_UREPLY_IND */
  1020.     long                            SEQ_number;
  1021.     long                            OPT_length;
  1022.     long                            OPT_offset;
  1023.     long                            REP_flags;
  1024.     long                            TLI_error;
  1025.     long                            UNIX_error;
  1026. };
  1027. typedef struct T_unitreply_ind          T_unitreply_ind;
  1028. struct T_unitrequest_ind {
  1029.     long                            PRIM_type;                  /* Always T_UREQUEST_IND */
  1030.     long                            SEQ_number;
  1031.     long                            SRC_length;
  1032.     long                            SRC_offset;
  1033.     long                            OPT_length;
  1034.     long                            OPT_offset;
  1035.     long                            REQ_flags;
  1036. };
  1037. typedef struct T_unitrequest_ind        T_unitrequest_ind;
  1038. struct T_unitrequest_req {
  1039.     long                            PRIM_type;                  /* Always T_UREQUEST_REQ */
  1040.     long                            SEQ_number;
  1041.     long                            DEST_length;
  1042.     long                            DEST_offset;
  1043.     long                            OPT_length;
  1044.     long                            OPT_offset;
  1045.     long                            REQ_flags;
  1046. };
  1047. typedef struct T_unitrequest_req        T_unitrequest_req;
  1048. struct T_unitreply_req {
  1049.     long                            PRIM_type;                  /* Always T_UREPLY_REQ */
  1050.     long                            SEQ_number;
  1051.     long                            OPT_length;
  1052.     long                            OPT_offset;
  1053.     long                            REP_flags;
  1054. };
  1055. typedef struct T_unitreply_req          T_unitreply_req;
  1056. struct T_unitreply_ack {
  1057.     long                            PRIM_type;                  /* Always T_UREPLY_ACK */
  1058.     long                            SEQ_number;
  1059.     long                            TLI_error;
  1060.     long                            UNIX_error;
  1061. };
  1062. typedef struct T_unitreply_ack          T_unitreply_ack;
  1063. struct T_cancelrequest_req {
  1064.     long                            PRIM_type;                  /* Always T_CANCELREQUEST_REQ */
  1065.     long                            SEQ_number;
  1066. };
  1067. typedef struct T_cancelrequest_req      T_cancelrequest_req;
  1068. struct T_cancelreply_req {
  1069.     long                            PRIM_type;                  /* Always T_CANCELREPLY_REQ */
  1070.     long                            SEQ_number;
  1071. };
  1072. typedef struct T_cancelreply_req        T_cancelreply_req;
  1073. struct T_reply_ind {
  1074.     long                            PRIM_type;                  /* Always T_REPLY_IND */
  1075.     long                            SEQ_number;
  1076.     long                            OPT_length;
  1077.     long                            OPT_offset;
  1078.     long                            REP_flags;
  1079.     long                            TLI_error;
  1080.     long                            UNIX_error;
  1081. };
  1082. typedef struct T_reply_ind              T_reply_ind;
  1083. struct T_request_ind {
  1084.     long                            PRIM_type;                  /* Always T_REQUEST_IND */
  1085.     long                            SEQ_number;
  1086.     long                            OPT_length;
  1087.     long                            OPT_offset;
  1088.     long                            REQ_flags;
  1089. };
  1090. typedef struct T_request_ind            T_request_ind;
  1091. struct T_request_req {
  1092.     long                            PRIM_type;                  /* Always T_REQUEST_REQ */
  1093.     long                            SEQ_number;
  1094.     long                            OPT_length;
  1095.     long                            OPT_offset;
  1096.     long                            REQ_flags;
  1097. };
  1098. typedef struct T_request_req            T_request_req;
  1099. struct T_reply_req {
  1100.     long                            PRIM_type;                  /* Always T_REPLY_REQ */
  1101.     long                            SEQ_number;
  1102.     long                            OPT_length;
  1103.     long                            OPT_offset;
  1104.     long                            REP_flags;
  1105. };
  1106. typedef struct T_reply_req              T_reply_req;
  1107. struct T_reply_ack {
  1108.     long                            PRIM_type;                  /* Always T_REPLY_ACK */
  1109.     long                            SEQ_number;
  1110.     long                            TLI_error;
  1111.     long                            UNIX_error;
  1112. };
  1113. typedef struct T_reply_ack              T_reply_ack;
  1114. struct T_regname_req {
  1115.     long                            PRIM_type;                  /* Always T_REGNAME_REQ */
  1116.     long                            SEQ_number;                 /* Reply is sequence ack */
  1117.     long                            NAME_length;
  1118.     long                            NAME_offset;
  1119.     long                            ADDR_length;
  1120.     long                            ADDR_offset;
  1121.     long                            REQ_flags;
  1122. };
  1123. typedef struct T_regname_req            T_regname_req;
  1124. struct T_regname_ack {
  1125.     long                            PRIM_type;                  /* always T_REGNAME_ACK     */
  1126.     long                            SEQ_number;
  1127.     long                            REG_id;
  1128.     long                            ADDR_length;
  1129.     long                            ADDR_offset;
  1130. };
  1131. typedef struct T_regname_ack            T_regname_ack;
  1132. struct T_delname_req {
  1133.     long                            PRIM_type;                  /* Always T_DELNAME_REQ */
  1134.     long                            SEQ_number;                 /* Reply is sequence ack */
  1135.     long                            NAME_length;
  1136.     long                            NAME_offset;
  1137. };
  1138. typedef struct T_delname_req            T_delname_req;
  1139. struct T_lkupname_req {
  1140.     long                            PRIM_type;                  /* Always T_LKUPNAME_REQ */
  1141.     long                            SEQ_number;                 /* Reply is sequence ack */
  1142.     long                            NAME_length;                /* ... or T_LKUPNAME_CON */
  1143.     long                            NAME_offset;
  1144.     long                            ADDR_length;
  1145.     long                            ADDR_offset;
  1146.     long                            MAX_number;
  1147.     long                            MAX_milliseconds;
  1148.     long                            REQ_flags;
  1149. };
  1150. typedef struct T_lkupname_req           T_lkupname_req;
  1151. struct T_lkupname_con {
  1152.     long                            PRIM_type;                  /* Either T_LKUPNAME_CON */
  1153.     long                            SEQ_number;                 /* Or T_LKUPNAME_RES */
  1154.     long                            NAME_length;
  1155.     long                            NAME_offset;
  1156.     long                            RSP_count;
  1157.     long                            RSP_cumcount;
  1158. };
  1159. typedef struct T_lkupname_con           T_lkupname_con;
  1160. struct T_sequence_ack {
  1161.     long                            PRIM_type;                  /* always T_SEQUENCED_ACK     */
  1162.     long                            ORIG_prim;                  /* original primitive        */
  1163.     long                            SEQ_number;
  1164.     long                            TLI_error;
  1165.     long                            UNIX_error;
  1166. };
  1167. typedef struct T_sequence_ack           T_sequence_ack;
  1168. struct T_event_ind {
  1169.     long                            PRIM_type;                  /* always T_EVENT_IND        */
  1170.     long                            EVENT_code;
  1171.     long                            EVENT_cookie;
  1172. };
  1173. typedef struct T_event_ind              T_event_ind;
  1174. union T_primitives {
  1175.     long                        type;
  1176.     long                            primType;
  1177.     T_addr_ack                      taddrack;
  1178.     T_bind_ack                      tbindack;
  1179.     T_bind_req                      tbindreq;
  1180.     T_conn_con                      tconncon;
  1181.     T_conn_ind                      tconnind;
  1182.     T_conn_req                      tconnreq;
  1183.     T_conn_res                      tconnres;
  1184.     T_data_ind                      tdataind;
  1185.     T_data_req                      tdatareq;
  1186.     T_discon_ind                    tdisconind;
  1187.     T_discon_req                    tdisconreq;
  1188.     T_exdata_ind                    texdataind;
  1189.     T_exdata_req                    texdatareq;
  1190.     T_error_ack                     terrorack;
  1191.     T_info_ack                      tinfoack;
  1192.     T_info_req                      tinforeq;
  1193.     T_ok_ack                        tokack;
  1194.     T_optmgmt_ack                   toptmgmtack;
  1195.     T_optmgmt_req                   toptmgmtreq;
  1196.     T_ordrel_ind                    tordrelind;
  1197.     T_ordrel_req                    tordrelreq;
  1198.     T_unbind_req                    tunbindreq;
  1199.     T_uderror_ind                   tuderrorind;
  1200.     T_unitdata_ind                  tunitdataind;
  1201.     T_unitdata_req                  tunitdatareq;
  1202.     T_unitreply_ind                 tunitreplyind;
  1203.     T_unitrequest_ind               tunitrequestind;
  1204.     T_unitrequest_req               tunitrequestreq;
  1205.     T_unitreply_req                 tunitreplyreq;
  1206.     T_unitreply_ack                 tunitreplyack;
  1207.     T_reply_ind                     treplyind;
  1208.     T_request_ind                   trequestind;
  1209.     T_request_req                   trequestreq;
  1210.     T_reply_req                     treplyreq;
  1211.     T_reply_ack                     treplyack;
  1212.     T_cancelrequest_req             tcancelreqreq;
  1213.     T_resolveaddr_req               tresolvereq;
  1214.     T_resolveaddr_ack               tresolveack;
  1215.     T_regname_req                   tregnamereq;
  1216.     T_regname_ack                   tregnameack;
  1217.     T_delname_req                   tdelnamereq;
  1218.     T_lkupname_req                  tlkupnamereq;
  1219.     T_lkupname_con                  tlkupnamecon;
  1220.     T_sequence_ack                  tsequenceack;
  1221.     T_event_ind                     teventind;
  1222. };
  1223. typedef union T_primitives              T_primitives;
  1224. /* ***** From the Mentat "dlpi.h" ******/
  1225. /*
  1226.    This header file has encoded the values so an existing driver
  1227.    or user which was written with the Logical Link Interface(LLI)
  1228.    can migrate to the DLPI interface in a binary compatible manner.
  1229.    Any fields which require a specific format or value are flagged
  1230.    with a comment containing the message LLI compatibility.
  1231. */
  1232. /* DLPI revision definition history*/
  1233. enum {
  1234.     DL_CURRENT_VERSION          = 0x02,                         /* current version of dlpi */
  1235.     DL_VERSION_2                = 0x02                          /* version of dlpi March 12,1991 */
  1236. };
  1237. enum {
  1238.     DL_INFO_REQ                 = 0x00,                         /* Information Req, LLI compatibility */
  1239.     DL_INFO_ACK                 = 0x03,                         /* Information Ack, LLI compatibility */
  1240.     DL_ATTACH_REQ               = 0x0B,                         /* Attach a PPA */
  1241.     DL_DETACH_REQ               = 0x0C,                         /* Detach a PPA */
  1242.     DL_BIND_REQ                 = 0x01,                         /* Bind dlsap address, LLI compatibility */
  1243.     DL_BIND_ACK                 = 0x04,                         /* Dlsap address bound, LLI compatibility */
  1244.     DL_UNBIND_REQ               = 0x02,                         /* Unbind dlsap address, LLI compatibility */
  1245.     DL_OK_ACK                   = 0x06,                         /* Success acknowledgment, LLI compatibility */
  1246.     DL_ERROR_ACK                = 0x05,                         /* Error acknowledgment, LLI compatibility */
  1247.     DL_SUBS_BIND_REQ            = 0x1B,                         /* Bind Subsequent DLSAP address */
  1248.     DL_SUBS_BIND_ACK            = 0x1C,                         /* Subsequent DLSAP address bound */
  1249.     DL_SUBS_UNBIND_REQ          = 0x15,                         /* Subsequent unbind */
  1250.     DL_ENABMULTI_REQ            = 0x1D,                         /* Enable multicast addresses */
  1251.     DL_DISABMULTI_REQ           = 0x1E,                         /* Disable multicast addresses */
  1252.     DL_PROMISCON_REQ            = 0x1F,                         /* Turn on promiscuous mode */
  1253.     DL_PROMISCOFF_REQ           = 0x20,                         /* Turn off promiscuous mode */
  1254.     DL_UNITDATA_REQ             = 0x07,                         /* datagram send request, LLI compatibility */
  1255.     DL_UNITDATA_IND             = 0x08,                         /* datagram receive indication, LLI compatibility */
  1256.     DL_UDERROR_IND              = 0x09,                         /* datagram error indication, LLI compatibility */
  1257.     DL_UDQOS_REQ                = 0x0A,                         /* set QOS for subsequent datagram transmissions */
  1258.     DL_CONNECT_REQ              = 0x0D,                         /* Connect request */
  1259.     DL_CONNECT_IND              = 0x0E,                         /* Incoming connect indication */
  1260.     DL_CONNECT_RES              = 0x0F,                         /* Accept previous connect indication */
  1261.     DL_CONNECT_CON              = 0x10,                         /* Connection established */
  1262.     DL_TOKEN_REQ                = 0x11,                         /* Passoff token request */
  1263.     DL_TOKEN_ACK                = 0x12,                         /* Passoff token ack */
  1264.     DL_DISCONNECT_REQ           = 0x13,                         /* Disconnect request */
  1265.     DL_DISCONNECT_IND           = 0x14,                         /* Disconnect indication */
  1266.     DL_RESET_REQ                = 0x17,                         /* Reset service request */
  1267.     DL_RESET_IND                = 0x18,                         /* Incoming reset indication */
  1268.     DL_RESET_RES                = 0x19,                         /* Complete reset processing */
  1269.     DL_RESET_CON                = 0x1A,                         /* Reset processing complete */
  1270.     DL_DATA_ACK_REQ             = 0x21,                         /* data unit transmission request */
  1271.     DL_DATA_ACK_IND             = 0x22,                         /* Arrival of a command PDU */
  1272.     DL_DATA_ACK_STATUS_IND      = 0x23,                         /* Status indication of DATA_ACK_REQ*/
  1273.     DL_REPLY_REQ                = 0x24,                         /* Request a DLSDU from the remote */
  1274.     DL_REPLY_IND                = 0x25,                         /* Arrival of a command PDU */
  1275.     DL_REPLY_STATUS_IND         = 0x26,                         /* Status indication of REPLY_REQ */
  1276.     DL_REPLY_UPDATE_REQ         = 0x27,                         /* Hold a DLSDU for transmission */
  1277.     DL_REPLY_UPDATE_STATUS_IND  = 0x28,                         /* Status of REPLY_UPDATE req */
  1278.     DL_XID_REQ                  = 0x29,                         /* Request to send an XID PDU */
  1279.     DL_XID_IND                  = 0x2A,                         /* Arrival of an XID PDU */
  1280.     DL_XID_RES                  = 0x2B,                         /* request to send a response XID PDU*/
  1281.     DL_XID_CON                  = 0x2C,                         /* Arrival of a response XID PDU */
  1282.     DL_TEST_REQ                 = 0x2D,                         /* TEST command request */
  1283.     DL_TEST_IND                 = 0x2E,                         /* TEST response indication */
  1284.     DL_TEST_RES                 = 0x2F,                         /* TEST response */
  1285.     DL_TEST_CON                 = 0x30,                         /* TEST Confirmation */
  1286.     DL_PHYS_ADDR_REQ            = 0x31,                         /* Request to get physical addr */
  1287.     DL_PHYS_ADDR_ACK            = 0x32,                         /* Return physical addr */
  1288.     DL_SET_PHYS_ADDR_REQ        = 0x33,                         /* set physical addr */
  1289.     DL_GET_STATISTICS_REQ       = 0x34,                         /* Request to get statistics */
  1290.     DL_GET_STATISTICS_ACK       = 0x35                          /* Return statistics */
  1291. };
  1292. /* DLPI interface states*/
  1293. enum {
  1294.     DL_UNATTACHED               = 0x04,                         /* PPA not attached */
  1295.     DL_ATTACH_PENDING           = 0x05,                         /* Waiting ack of DL_ATTACH_REQ */
  1296.     DL_DETACH_PENDING           = 0x06,                         /* Waiting ack of DL_DETACH_REQ */
  1297.     DL_UNBOUND                  = 0x00,                         /* PPA attached, LLI compatibility */
  1298.     DL_BIND_PENDING             = 0x01,                         /* Waiting ack of DL_BIND_REQ, LLI compatibility */
  1299.     DL_UNBIND_PENDING           = 0x02,                         /* Waiting ack of DL_UNBIND_REQ, LLI compatibility */
  1300.     DL_IDLE                     = 0x03,                         /* dlsap bound, awaiting use, LLI compatibility */
  1301.     DL_UDQOS_PENDING            = 0x07,                         /* Waiting ack of DL_UDQOS_REQ */
  1302.     DL_OUTCON_PENDING           = 0x08,                         /* outgoing connection, awaiting DL_CONN_CON */
  1303.     DL_INCON_PENDING            = 0x09,                         /* incoming connection, awaiting DL_CONN_RES */
  1304.     DL_CONN_RES_PENDING         = 0x0A,                         /* Waiting ack of DL_CONNECT_RES */
  1305.     DL_DATAXFER                 = 0x0B,                         /* connection-oriented data transfer */
  1306.     DL_USER_RESET_PENDING       = 0x0C,                         /* user initiated reset, awaiting DL_RESET_CON */
  1307.     DL_PROV_RESET_PENDING       = 0x0D,                         /* provider initiated reset, awaiting DL_RESET_RES */
  1308.     DL_RESET_RES_PENDING        = 0x0E,                         /* Waiting ack of DL_RESET_RES */
  1309.     DL_DISCON8_PENDING          = 0x0F,                         /* Waiting ack of DL_DISC_REQ when in DL_OUTCON_PENDING */
  1310.     DL_DISCON9_PENDING          = 0x10,                         /* Waiting ack of DL_DISC_REQ when in DL_INCON_PENDING */
  1311.     DL_DISCON11_PENDING         = 0x11,                         /* Waiting ack of DL_DISC_REQ when in DL_DATAXFER */
  1312.     DL_DISCON12_PENDING         = 0x12,                         /* Waiting ack of DL_DISC_REQ when in DL_USER_RESET_PENDING */
  1313.     DL_DISCON13_PENDING         = 0x13,                         /* Waiting ack of DL_DISC_REQ when in DL_DL_PROV_RESET_PENDING */
  1314.     DL_SUBS_BIND_PND            = 0x14,                         /* Waiting ack of DL_SUBS_BIND_REQ */
  1315.     DL_SUBS_UNBIND_PND          = 0x15                          /* Waiting ack of DL_SUBS_UNBIND_REQ */
  1316. };
  1317. /* DL_ERROR_ACK error return values*/
  1318. enum {
  1319.     DL_ACCESS                   = 0x02,                         /* Improper permissions for request, LLI compatibility */
  1320.     DL_BADADDR                  = 0x01,                         /* DLSAP address in improper format or invalid */
  1321.     DL_BADCORR                  = 0x05,                         /* Sequence number not from outstanding DL_CONN_IND */
  1322.     DL_BADDATA                  = 0x06,                         /* User data exceeded provider limit */
  1323.     DL_BADPPA                   = 0x08,                         /* Specified PPA was invalid */
  1324.     DL_BADPRIM                  = 0x09,                         /* Primitive received is not known by DLS provider */
  1325.     DL_BADQOSPARAM              = 0x0A,                         /* QOS parameters contained invalid values */
  1326.     DL_BADQOSTYPE               = 0x0B,                         /* QOS structure type is unknown or unsupported */
  1327.     DL_BADSAP                   = 0x00,                         /* Bad LSAP selector, LLI compatibility */
  1328.     DL_BADTOKEN                 = 0x0C,                         /* Token used not associated with an active stream */
  1329.     DL_BOUND                    = 0x0D,                         /* Attempted second bind with dl_max_conind or    */
  1330.                                                                 /*    dl_conn_mgmt > 0 on same DLSAP or PPA */
  1331.     DL_INITFAILED               = 0x0E,                         /* Physical Link initialization failed */
  1332.     DL_NOADDR                   = 0x0F,                         /* Provider couldn't allocate alternate address */
  1333.     DL_NOTINIT                  = 0x10,                         /* Physical Link not initialized */
  1334.     DL_OUTSTATE                 = 0x03,                         /* Primitive issued in improper state, LLI compatibility */
  1335.     DL_SYSERR                   = 0x04,                         /* UNIX system error occurred, LLI compatibility */
  1336.     DL_UNSUPPORTED              = 0x07,                         /* Requested service not supplied by provider */
  1337.     DL_UNDELIVERABLE            = 0x11,                         /* Previous data unit could not be delivered */
  1338.     DL_NOTSUPPORTED             = 0x12,                         /* Primitive is known but not supported by DLS provider */
  1339.     DL_TOOMANY                  = 0x13,                         /* limit exceeded */
  1340.     DL_NOTENAB                  = 0x14,                         /* Promiscuous mode not enabled */
  1341.     DL_BUSY                     = 0x15,                         /* Other streams for a particular PPA in the post-attached state */
  1342.     DL_NOAUTO                   = 0x16,                         /* Automatic handling of XID & TEST responses not supported */
  1343.     DL_NOXIDAUTO                = 0x17,                         /* Automatic handling of XID not supported */
  1344.     DL_NOTESTAUTO               = 0x18,                         /* Automatic handling of TEST not supported */
  1345.     DL_XIDAUTO                  = 0x19,                         /* Automatic handling of XID response */
  1346.     DL_TESTAUTO                 = 0x1A,                         /* AUtomatic handling of TEST response*/
  1347.     DL_PENDING                  = 0x1B                          /* pending outstanding connect indications */
  1348. };
  1349. /* DLPI media types supported*/
  1350. enum {
  1351.     DL_CSMACD                   = 0x00,                         /* IEEE 802.3 CSMA/CD network, LLI Compatibility */
  1352.     DL_TPB                      = 0x01,                         /* IEEE 802.4 Token Passing Bus, LLI Compatibility */
  1353.     DL_TPR                      = 0x02,                         /* IEEE 802.5 Token Passing Ring, LLI Compatibility */
  1354.     DL_METRO                    = 0x03,                         /* IEEE 802.6 Metro Net, LLI Compatibility */
  1355.     DL_ETHER                    = 0x04,                         /* Ethernet Bus, LLI Compatibility */
  1356.     DL_HDLC                     = 0x05,                         /* ISO HDLC protocol support, bit synchronous */
  1357.     DL_CHAR                     = 0x06,                         /* Character Synchronous protocol support, eg BISYNC */
  1358.     DL_CTCA                     = 0x07,                         /* IBM Channel-to-Channel Adapter */
  1359.     DL_FDDI                     = 0x08,                         /* Fiber Distributed data interface */
  1360.     DL_OTHER                    = 0x09                          /* Any other medium not listed above */
  1361. };
  1362. /*
  1363.    DLPI provider service supported.
  1364.    These must be allowed to be bitwise-OR for dl_service_mode in
  1365.    DL_INFO_ACK.
  1366. */
  1367. enum {
  1368.     DL_CODLS                    = 0x01,                         /* support connection-oriented service */
  1369.     DL_CLDLS                    = 0x02,                         /* support connectionless data link service */
  1370.     DL_ACLDLS                   = 0x04                          /* support acknowledged connectionless service*/
  1371. };
  1372. /*
  1373.    DLPI provider style.
  1374.    The DLPI provider style which determines whether a provider
  1375.    requires a DL_ATTACH_REQ to inform the provider which PPA
  1376.    user messages should be sent/received on.
  1377. */
  1378. enum {
  1379.     DL_STYLE1                   = 0x0500,                       /* PPA is implicitly bound by open(2) */
  1380.     DL_STYLE2                   = 0x0501                        /* PPA must be explicitly bound via DL_ATTACH_REQ */
  1381. };
  1382. /* DLPI Originator for Disconnect and Resets*/
  1383. enum {
  1384.     DL_PROVIDER                 = 0x0700,
  1385.     DL_USER                     = 0x0701
  1386. };
  1387. /* DLPI Disconnect Reasons*/
  1388. enum {
  1389.     DL_CONREJ_DEST_UNKNOWN      = 0x0800,
  1390.     DL_CONREJ_DEST_UNREACH_PERMANENT = 0x0801,
  1391.     DL_CONREJ_DEST_UNREACH_TRANSIENT = 0x0802,
  1392.     DL_CONREJ_QOS_UNAVAIL_PERMANENT = 0x0803,
  1393.     DL_CONREJ_QOS_UNAVAIL_TRANSIENT = 0x0804,
  1394.     DL_CONREJ_PERMANENT_COND    = 0x0805,
  1395.     DL_CONREJ_TRANSIENT_COND    = 0x0806,
  1396.     DL_DISC_ABNORMAL_CONDITION  = 0x0807,
  1397.     DL_DISC_NORMAL_CONDITION    = 0x0808,
  1398.     DL_DISC_PERMANENT_CONDITION = 0x0809,
  1399.     DL_DISC_TRANSIENT_CONDITION = 0x080A,
  1400.     DL_DISC_UNSPECIFIED         = 0x080B
  1401. };
  1402. /* DLPI Reset Reasons*/
  1403. enum {
  1404.     DL_RESET_FLOW_CONTROL       = 0x0900,
  1405.     DL_RESET_LINK_ERROR         = 0x0901,
  1406.     DL_RESET_RESYNCH            = 0x0902
  1407. };
  1408. /* DLPI status values for acknowledged connectionless data transfer*/
  1409. enum {
  1410.     DL_CMD_MASK                 = 0x0F,                         /* mask for command portion of status */
  1411.     DL_CMD_OK                   = 0x00,                         /* Command Accepted */
  1412.     DL_CMD_RS                   = 0x01,                         /* Unimplemented or inactivated service */
  1413.     DL_CMD_UE                   = 0x05,                         /* Data Link User interface error */
  1414.     DL_CMD_PE                   = 0x06,                         /* Protocol error */
  1415.     DL_CMD_IP                   = 0x07,                         /* Permanent implementation dependent error*/
  1416.     DL_CMD_UN                   = 0x09,                         /* Resources temporarily unavailable */
  1417.     DL_CMD_IT                   = 0x0F,                         /* Temporary implementation dependent error */
  1418.     DL_RSP_MASK                 = 0xF0,                         /* mask for response portion of status */
  1419.     DL_RSP_OK                   = 0x00,                         /* Response DLSDU present */
  1420.     DL_RSP_RS                   = 0x10,                         /* Unimplemented or inactivated service */
  1421.     DL_RSP_NE                   = 0x30,                         /* Response DLSDU never submitted */
  1422.     DL_RSP_NR                   = 0x40,                         /* Response DLSDU not requested */
  1423.     DL_RSP_UE                   = 0x50,                         /* Data Link User interface error */
  1424.     DL_RSP_IP                   = 0x70,                         /* Permanent implementation dependent error */
  1425.     DL_RSP_UN                   = 0x90,                         /* Resources temporarily unavailable */
  1426.     DL_RSP_IT                   = 0xF0                          /* Temporary implementation dependent error */
  1427. };
  1428. /* Service Class values for acknowledged connectionless data transfer*/
  1429. enum {
  1430.     DL_RQST_RSP                 = 0x01,                         /* Use acknowledge capability in MAC sublayer*/
  1431.     DL_RQST_NORSP               = 0x02                          /* No acknowledgement service requested */
  1432. };
  1433. /* DLPI address type definition*/
  1434. enum {
  1435.     DL_FACT_PHYS_ADDR           = 0x01,                         /* factory physical address */
  1436.     DL_CURR_PHYS_ADDR           = 0x02                          /* current physical address */
  1437. };
  1438. /* DLPI flag definitions*/
  1439. enum {
  1440.     DL_POLL_FINAL               = 0x01                          /* if set,indicates poll/final bit set*/
  1441. };
  1442. /* XID and TEST responses supported by the provider*/
  1443. enum {
  1444.     DL_AUTO_XID                 = 0x01,                         /* provider will respond to XID */
  1445.     DL_AUTO_TEST                = 0x02                          /* provider will respond to TEST */
  1446. };
  1447. /* Subsequent bind type*/
  1448. enum {
  1449.     DL_PEER_BIND                = 0x01,                         /* subsequent bind on a peer addr */
  1450.     DL_HIERARCHICAL_BIND        = 0x02                          /* subs_bind on a hierarchical addr*/
  1451. };
  1452. /* DLPI promiscuous mode definitions*/
  1453. enum {
  1454.     DL_PROMISC_PHYS             = 0x01,                         /* promiscuous mode at phys level */
  1455.     DL_PROMISC_SAP              = 0x02,                         /* promiscous mode at sap level */
  1456.     DL_PROMISC_MULTI            = 0x03                          /* promiscuous mode for multicast */
  1457. };
  1458. /*
  1459.    DLPI Quality Of Service definition for use in QOS structure definitions.
  1460.    The QOS structures are used in connection establishment, DL_INFO_ACK,
  1461.    and setting connectionless QOS values.
  1462. */
  1463. /*
  1464.    Throughput
  1465.    
  1466.    This parameter is specified for both directions.
  1467. */
  1468. struct dl_through_t {
  1469.     SInt32                          dl_target_value;            /* desired bits/second desired */
  1470.     SInt32                          dl_accept_value;            /* min. acceptable bits/second */
  1471. };
  1472. typedef struct dl_through_t             dl_through_t;
  1473. /*
  1474.    transit delay specification
  1475.    
  1476.    This parameter is specified for both directions.
  1477.    expressed in milliseconds assuming a DLSDU size of 128 octets.
  1478.    The scaling of the value to the current DLSDU size is provider dependent.
  1479. */
  1480. struct dl_transdelay_t {
  1481.     SInt32                          dl_target_value;            /* desired value of service */
  1482.     SInt32                          dl_accept_value;            /* min. acceptable value of service */
  1483. };
  1484. typedef struct dl_transdelay_t          dl_transdelay_t;
  1485. /*
  1486.    priority specification
  1487.    priority range is 0-100, with 0 being highest value.
  1488. */
  1489. struct dl_priority_t {
  1490.     SInt32                          dl_min;
  1491.     SInt32                          dl_max;
  1492. };
  1493. typedef struct dl_priority_t            dl_priority_t;
  1494. /* protection specification*/
  1495. enum {
  1496.     DL_NONE                     = 0x0B01,                       /* no protection supplied */
  1497.     DL_MONITOR                  = 0x0B02,                       /* protection against passive monitoring */
  1498.     DL_MAXIMUM                  = 0x0B03                        /* protection against modification, replay, addition, or deletion */
  1499. };
  1500. struct dl_protect_t {
  1501.     SInt32                          dl_min;
  1502.     SInt32                          dl_max;
  1503. };
  1504. typedef struct dl_protect_t             dl_protect_t;
  1505. /*
  1506.    Resilience specification
  1507.    probabilities are scaled by a factor of 10,000 with a time interval
  1508.    of 10,000 seconds.
  1509. */
  1510. struct dl_resilience_t {
  1511.     SInt32                          dl_disc_prob;               /* probability of provider init DISC */
  1512.     SInt32                          dl_reset_prob;              /* probability of provider init RESET */
  1513. };
  1514. typedef struct dl_resilience_t          dl_resilience_t;
  1515. /*
  1516.     QOS type definition to be used for negotiation with the
  1517.     remote end of a connection, or a connectionless unitdata request.
  1518.     There are two type definitions to handle the negotiation 
  1519.     process at connection establishment. The typedef dl_qos_range_t
  1520.     is used to present a range for parameters. This is used
  1521.     in the DL_CONNECT_REQ and DL_CONNECT_IND messages. The typedef
  1522.     dl_qos_sel_t is used to select a specific value for the QOS
  1523.     parameters. This is used in the DL_CONNECT_RES, DL_CONNECT_CON,
  1524.     and DL_INFO_ACK messages to define the selected QOS parameters
  1525.     for a connection.
  1526.     NOTE
  1527.     A DataLink provider which has unknown values for any of the fields
  1528.     will use a value of DL_UNKNOWN for all values in the fields.
  1529.     NOTE
  1530.     A QOS parameter value of DL_QOS_DONT_CARE informs the DLS
  1531.     provider the user requesting this value doesn't care 
  1532.     what the QOS parameter is set to. This value becomes the
  1533.     least possible value in the range of QOS parameters.
  1534.     The order of the QOS parameter range is then:
  1535.         DL_QOS_DONT_CARE < 0 < MAXIMUM QOS VALUE
  1536. */
  1537. enum {
  1538.     DL_UNKNOWN                  = -1,
  1539.     DL_QOS_DONT_CARE            = -2
  1540. };
  1541. /*
  1542.     Every QOS structure has the first 4 bytes containing a type
  1543.     field, denoting the definition of the rest of the structure.
  1544.     This is used in the same manner has the dl_primitive variable
  1545.     is in messages.
  1546.     The following list is the defined QOS structure type values and structures.
  1547. */
  1548. enum {
  1549.     DL_QOS_CO_RANGE1            = 0x0101,                       /* QOS range struct. for Connection modeservice */
  1550.     DL_QOS_CO_SEL1              = 0x0102,                       /* QOS selection structure */
  1551.     DL_QOS_CL_RANGE1            = 0x0103,                       /* QOS range struct. for connectionless*/
  1552.     DL_QOS_CL_SEL1              = 0x0104                        /* QOS selection for connectionless mode*/
  1553. };
  1554. struct dl_qos_co_range1_t {
  1555.     UInt32                          dl_qos_type;
  1556.     dl_through_t                    dl_rcv_throughput;          /* desired and acceptable*/
  1557.     dl_transdelay_t                 dl_rcv_trans_delay;         /* desired and acceptable*/
  1558.     dl_through_t                    dl_xmt_throughput;
  1559.     dl_transdelay_t                 dl_xmt_trans_delay;
  1560.     dl_priority_t                   dl_priority;                /* min and max values */
  1561.     dl_protect_t                    dl_protection;              /* min and max values */
  1562.     SInt32                          dl_residual_error;
  1563.     dl_resilience_t                 dl_resilience;
  1564. };
  1565. typedef struct dl_qos_co_range1_t       dl_qos_co_range1_t;
  1566. struct dl_qos_co_sel1_t {
  1567.     UInt32                          dl_qos_type;
  1568.     SInt32                          dl_rcv_throughput;
  1569.     SInt32                          dl_rcv_trans_delay;
  1570.     SInt32                          dl_xmt_throughput;
  1571.     SInt32                          dl_xmt_trans_delay;
  1572.     SInt32                          dl_priority;
  1573.     SInt32                          dl_protection;
  1574.     SInt32                          dl_residual_error;
  1575.     dl_resilience_t                 dl_resilience;
  1576. };
  1577. typedef struct dl_qos_co_sel1_t         dl_qos_co_sel1_t;
  1578. struct dl_qos_cl_range1_t {
  1579.     UInt32                          dl_qos_type;
  1580.     dl_transdelay_t                 dl_trans_delay;
  1581.     dl_priority_t                   dl_priority;
  1582.     dl_protect_t                    dl_protection;
  1583.     SInt32                          dl_residual_error;
  1584. };
  1585. typedef struct dl_qos_cl_range1_t       dl_qos_cl_range1_t;
  1586. struct dl_qos_cl_sel1_t {
  1587.     UInt32                          dl_qos_type;
  1588.     SInt32                          dl_trans_delay;
  1589.     SInt32                          dl_priority;
  1590.     SInt32                          dl_protection;
  1591.     SInt32                          dl_residual_error;
  1592. };
  1593. typedef struct dl_qos_cl_sel1_t         dl_qos_cl_sel1_t;
  1594. /*
  1595.     DLPI interface primitive definitions.
  1596.     Each primitive is sent as a stream message. It is possible that
  1597.     the messages may be viewed as a sequence of bytes that have the
  1598.     following form without any padding. The structure definition
  1599.     of the following messages may have to change depending on the
  1600.     underlying hardware architecture and crossing of a hardware
  1601.     boundary with a different hardware architecture.
  1602.     Fields in the primitives having a name of the form
  1603.     dl_reserved cannot be used and have the value of
  1604.     binary zero, no bits turned on.
  1605.     Each message has the name defined followed by the
  1606.     stream message type (M_PROTO, M_PCPROTO, M_DATA)
  1607.  */
  1608. /* LOCAL MANAGEMENT SERVICE PRIMITIVES*/
  1609. /* DL_INFO_REQ, M_PCPROTO type*/
  1610. struct dl_info_req_t {
  1611.     UInt32                          dl_primitive;               /* set to DL_INFO_REQ */
  1612. };
  1613. typedef struct dl_info_req_t            dl_info_req_t;
  1614. /* DL_INFO_ACK, M_PCPROTO type*/
  1615. struct dl_info_ack_t {
  1616.     UInt32                          dl_primitive;               /* set to DL_INFO_ACK */
  1617.     UInt32                          dl_max_sdu;                 /* Max bytes in a DLSDU */
  1618.     UInt32                          dl_min_sdu;                 /* Min bytes in a DLSDU */
  1619.     UInt32                          dl_addr_length;             /* length of DLSAP address */
  1620.     UInt32                          dl_mac_type;                /* type of medium supported*/
  1621.     UInt32                          dl_reserved;                /* value set to zero */
  1622.     UInt32                          dl_current_state;           /* state of DLPI interface */
  1623.     SInt32                          dl_sap_length;              /* current length of SAP part of dlsap address */
  1624.     UInt32                          dl_service_mode;            /* CO, CL or ACL */
  1625.     UInt32                          dl_qos_length;              /* length of qos values */
  1626.     UInt32                          dl_qos_offset;              /* offset from beg. of block*/
  1627.     UInt32                          dl_qos_range_length;        /* available range of qos */
  1628.     UInt32                          dl_qos_range_offset;        /* offset from beg. of block*/
  1629.     UInt32                          dl_provider_style;          /* style1 or style2 */
  1630.     UInt32                          dl_addr_offset;             /* offset of the dlsap addr */
  1631.     UInt32                          dl_version;                 /* version number */
  1632.     UInt32                          dl_brdcst_addr_length;      /* length of broadcast addr */
  1633.     UInt32                          dl_brdcst_addr_offset;      /* offset from beg. of block*/
  1634.     UInt32                          dl_growth;                  /* set to zero */
  1635. };
  1636. typedef struct dl_info_ack_t            dl_info_ack_t;
  1637. /* DL_ATTACH_REQ, M_PROTO type*/
  1638. struct dl_attach_req_t {
  1639.     UInt32                          dl_primitive;               /* set to DL_ATTACH_REQ*/
  1640.     UInt32                          dl_ppa;                     /* id of the PPA */
  1641. };
  1642. typedef struct dl_attach_req_t          dl_attach_req_t;
  1643. /* DL_DETACH_REQ, M_PROTO type*/
  1644. struct dl_detach_req_t {
  1645.     UInt32                          dl_primitive;               /* set to DL_DETACH_REQ */
  1646. };
  1647. typedef struct dl_detach_req_t          dl_detach_req_t;
  1648. /* DL_BIND_REQ, M_PROTO type*/
  1649. struct dl_bind_req_t {
  1650.     UInt32                          dl_primitive;               /* set to DL_BIND_REQ */
  1651.     UInt32                          dl_sap;                     /* info to identify dlsap addr*/
  1652.     UInt32                          dl_max_conind;              /* max # of outstanding con_ind*/
  1653.     UInt16                          dl_service_mode;            /* CO, CL or ACL */
  1654.     UInt16                          dl_conn_mgmt;               /* if non-zero, is con-mgmt stream*/
  1655.     UInt32                          dl_xidtest_flg;             /* if set to 1 indicates automatic initiation of test and xid frames */
  1656. };
  1657. typedef struct dl_bind_req_t            dl_bind_req_t;
  1658. /* DL_BIND_ACK, M_PCPROTO type*/
  1659. struct dl_bind_ack_t {
  1660.     UInt32                          dl_primitive;               /* DL_BIND_ACK */
  1661.     UInt32                          dl_sap;                     /* DLSAP addr info */
  1662.     UInt32                          dl_addr_length;             /* length of complete DLSAP addr */
  1663.     UInt32                          dl_addr_offset;             /* offset from beginning of M_PCPROTO*/
  1664.     UInt32                          dl_max_conind;              /* allowed max. # of con-ind */
  1665.     UInt32                          dl_xidtest_flg;             /* responses supported by provider*/
  1666. };
  1667. typedef struct dl_bind_ack_t            dl_bind_ack_t;
  1668. /* DL_SUBS_BIND_REQ, M_PROTO type*/
  1669. struct dl_subs_bind_req_t {
  1670.     UInt32                          dl_primitive;               /* DL_SUBS_BIND_REQ */
  1671.     UInt32                          dl_subs_sap_offset;         /* offset of subs_sap */
  1672.     UInt32                          dl_subs_sap_length;         /* length of subs_sap */
  1673.     UInt32                          dl_subs_bind_class;         /* peer or hierarchical */
  1674. };
  1675. typedef struct dl_subs_bind_req_t       dl_subs_bind_req_t;
  1676. /* DL_SUBS_BIND_ACK, M_PCPROTO type*/
  1677. struct dl_subs_bind_ack_t {
  1678.     UInt32                          dl_primitive;               /* DL_SUBS_BIND_ACK */
  1679.     UInt32                          dl_subs_sap_offset;         /* offset of subs_sap */
  1680.     UInt32                          dl_subs_sap_length;         /* length of subs_sap */
  1681. };
  1682. typedef struct dl_subs_bind_ack_t       dl_subs_bind_ack_t;
  1683. /* DL_UNBIND_REQ, M_PROTO type*/
  1684. struct dl_unbind_req_t {
  1685.     UInt32                          dl_primitive;               /* DL_UNBIND_REQ */
  1686. };
  1687. typedef struct dl_unbind_req_t          dl_unbind_req_t;
  1688. /* DL_SUBS_UNBIND_REQ, M_PROTO type*/
  1689. struct dl_subs_unbind_req_t {
  1690.     UInt32                          dl_primitive;               /* DL_SUBS_UNBIND_REQ */
  1691.     UInt32                          dl_subs_sap_offset;         /* offset of subs_sap */
  1692.     UInt32                          dl_subs_sap_length;         /* length of subs_sap */
  1693. };
  1694. typedef struct dl_subs_unbind_req_t     dl_subs_unbind_req_t;
  1695. /* DL_OK_ACK, M_PCPROTO type*/
  1696. struct dl_ok_ack_t {
  1697.     UInt32                          dl_primitive;               /* DL_OK_ACK */
  1698.     UInt32                          dl_correct_primitive;       /* primitive being acknowledged */
  1699. };
  1700. typedef struct dl_ok_ack_t              dl_ok_ack_t;
  1701. /* DL_ERROR_ACK, M_PCPROTO type*/
  1702. struct dl_error_ack_t {
  1703.     UInt32                          dl_primitive;               /* DL_ERROR_ACK */
  1704.     UInt32                          dl_error_primitive;         /* primitive in error */
  1705.     UInt32                          dl_errno;                   /* DLPI error code */
  1706.     UInt32                          dl_unix_errno;              /* UNIX system error code */
  1707. };
  1708. typedef struct dl_error_ack_t           dl_error_ack_t;
  1709. /* DL_ENABMULTI_REQ, M_PROTO type*/
  1710. struct dl_enabmulti_req_t {
  1711.     UInt32                          dl_primitive;               /* DL_ENABMULTI_REQ */
  1712.     UInt32                          dl_addr_length;             /* length of multicast address */
  1713.     UInt32                          dl_addr_offset;             /* offset from beg. of M_PROTO block*/
  1714. };
  1715. typedef struct dl_enabmulti_req_t       dl_enabmulti_req_t;
  1716. /* DL_DISABMULTI_REQ, M_PROTO type*/
  1717. struct dl_disabmulti_req_t {
  1718.     UInt32                          dl_primitive;               /* DL_DISABMULTI_REQ */
  1719.     UInt32                          dl_addr_length;             /* length of multicast address */
  1720.     UInt32                          dl_addr_offset;             /* offset from beg. of M_PROTO block*/
  1721. };
  1722. typedef struct dl_disabmulti_req_t      dl_disabmulti_req_t;
  1723. /* DL_PROMISCON_REQ, M_PROTO type*/
  1724. struct dl_promiscon_req_t {
  1725.     UInt32                          dl_primitive;               /* DL_PROMISCON_REQ */
  1726.     UInt32                          dl_level;                   /* physical,SAP level or ALL multicast*/
  1727. };
  1728. typedef struct dl_promiscon_req_t       dl_promiscon_req_t;
  1729. /* DL_PROMISCOFF_REQ, M_PROTO type*/
  1730. struct dl_promiscoff_req_t {
  1731.     UInt32                          dl_primitive;               /* DL_PROMISCOFF_REQ */
  1732.     UInt32                          dl_level;                   /* Physical,SAP level or ALL multicast*/
  1733. };
  1734. typedef struct dl_promiscoff_req_t      dl_promiscoff_req_t;
  1735. /* Primitives to get and set the Physical address*/
  1736. /* DL_PHYS_ADDR_REQ, M_PROTO type*/
  1737. struct dl_phys_addr_req_t {
  1738.     UInt32                          dl_primitive;               /* DL_PHYS_ADDR_REQ */
  1739.     UInt32                          dl_addr_type;               /* factory or current physical addr */
  1740. };
  1741. typedef struct dl_phys_addr_req_t       dl_phys_addr_req_t;
  1742. /* DL_PHYS_ADDR_ACK, M_PCPROTO type*/
  1743. struct dl_phys_addr_ack_t {
  1744.     UInt32                          dl_primitive;               /* DL_PHYS_ADDR_ACK */
  1745.     UInt32                          dl_addr_length;             /* length of the physical addr */
  1746.     UInt32                          dl_addr_offset;             /* offset from beg. of block */
  1747. };
  1748. typedef struct dl_phys_addr_ack_t       dl_phys_addr_ack_t;
  1749. /* DL_SET_PHYS_ADDR_REQ, M_PROTO type*/
  1750. struct dl_set_phys_addr_req_t {
  1751.     UInt32                          dl_primitive;               /* DL_SET_PHYS_ADDR_REQ */
  1752.     UInt32                          dl_addr_length;             /* length of physical addr */
  1753.     UInt32                          dl_addr_offset;             /* offset from beg. of block */
  1754. };
  1755. typedef struct dl_set_phys_addr_req_t   dl_set_phys_addr_req_t;
  1756. /* Primitives to get statistics*/
  1757. /* DL_GET_STATISTICS_REQ, M_PROTO type*/
  1758. struct dl_get_statistics_req_t {
  1759.     UInt32                          dl_primitive;               /* DL_GET_STATISTICS_REQ */
  1760. };
  1761. typedef struct dl_get_statistics_req_t  dl_get_statistics_req_t;
  1762. /* DL_GET_STATISTICS_ACK, M_PCPROTO type*/
  1763. struct dl_get_statistics_ack_t {
  1764.     UInt32                          dl_primitive;               /* DL_GET_STATISTICS_ACK */
  1765.     UInt32                          dl_stat_length;             /* length of statistics structure*/
  1766.     UInt32                          dl_stat_offset;             /* offset from beg. of block */
  1767. };
  1768. typedef struct dl_get_statistics_ack_t  dl_get_statistics_ack_t;
  1769. /* CONNECTION-ORIENTED SERVICE PRIMITIVES*/
  1770. /* DL_CONNECT_REQ, M_PROTO type*/
  1771. struct dl_connect_req_t {
  1772.     UInt32                          dl_primitive;               /* DL_CONNECT_REQ */
  1773.     UInt32                          dl_dest_addr_length;        /* len. of dlsap addr*/
  1774.     UInt32                          dl_dest_addr_offset;        /* offset */
  1775.     UInt32                          dl_qos_length;              /* len. of QOS parm val*/
  1776.     UInt32                          dl_qos_offset;              /* offset */
  1777.     UInt32                          dl_growth;                  /* set to zero */
  1778. };
  1779. typedef struct dl_connect_req_t         dl_connect_req_t;
  1780. /* DL_CONNECT_IND, M_PROTO type*/
  1781. struct dl_connect_ind_t {
  1782.     UInt32                          dl_primitive;               /* DL_CONNECT_IND */
  1783.     UInt32                          dl_correlation;             /* provider's correlation token*/
  1784.     UInt32                          dl_called_addr_length;      /* length of called address */
  1785.     UInt32                          dl_called_addr_offset;      /* offset from beginning of block */
  1786.     UInt32                          dl_calling_addr_length;     /* length of calling address */
  1787.     UInt32                          dl_calling_addr_offset;     /* offset from beginning of block */
  1788.     UInt32                          dl_qos_length;              /* length of qos structure */
  1789.     UInt32                          dl_qos_offset;              /* offset from beginning of block */
  1790.     UInt32                          dl_growth;                  /* set to zero */
  1791. };
  1792. typedef struct dl_connect_ind_t         dl_connect_ind_t;
  1793. /* DL_CONNECT_RES, M_PROTO type*/
  1794. struct dl_connect_res_t {