home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / header45.zip / genio.h < prev    next >
C/C++ Source or Header  |  1999-05-11  |  11KB  |  231 lines

  1. /***************************************************************************/
  2. /* IBM CONFIDENTIAL                                                        */
  3. /* OCO Source Materials                                                    */
  4. /* IBM TCP/IP for OS/2                                                     */
  5. /* (c) Copyright IBM Corp 1992,1997                                        */
  6. /* The source code for this program is not published or otherwise          */
  7. /* divested of its trade secrets, irrespective of what has been            */
  8. /* deposited with the U.S. Copyright Office                                */
  9. /***************************************************************************/
  10. /* [db3l] Changes for flexible support for serial interfaces */
  11. #ifndef GENIO_H
  12. #define GENIO_H
  13. #define  CALL_SOCKET          0x40
  14. #define  CALL_BIND            0x41
  15. #define  CALL_LISTEN          0x42
  16. #define  CALL_ACCEPT          0x43
  17. #define  CALL_CONNECT         0x44
  18. #define  CALL_SENDTO          0x45
  19. #define  CALL_SEND            0x46
  20. #define  CALL_SENDMSG         0x47
  21. #define  CALL_RECVFROM        0x48
  22. #define  CALL_RECV            0x49
  23. /* start 40518 send_file */
  24. #define  CALL_SEND_FILE       0x4C
  25. /* end 40518 send_file */
  26.  
  27. /* for AF_NB (netbios) support */
  28. #define  CALL_NB_HOST         0x4f
  29.  
  30. #define  CALL_RECVMSG         0x50
  31. #define  CALL_SHUTDOWN        0x51
  32. #define  CALL_SETSOCKOPT      0x52
  33. #define  CALL_GETSOCKOPT      0x53
  34. #define  CALL_GETSOCKNAME     0x54
  35. #define  CALL_GETPEERNAME     0x55
  36. #define  CALL_CLOSE           0x56
  37. #define  CALL_IOCTL           0x57
  38. #define  CALL_SELECT          0x58
  39. #define  CALL_GETHOSTID       0x59
  40. #define  CALL_START_INTHREAD  0x5A
  41. #define  CALL_SYSCTL          0x5B /* this is actually a callgate */
  42. #define  CALL_WINSELECT       0x5C /* winsock style select */
  43.  
  44. /* #ifdef ACC_EX */
  45. #define CALL_ACCEPTEX         0x5E /* AcceptEx() call */
  46. /* #endif */
  47.  
  48. #ifdef SNACKETS
  49. #define  CALL_SNACKETS        0x5f
  50. #endif
  51. #define  CALL_DEBUG           0x60
  52. #define  CALL_GETVERSION      0x61
  53.  
  54. #define  CALL_INIT            0x62
  55. #define  CALL_UIPCTIM1        0x63
  56. #define  CALL_UIPCTIM2        0x64
  57. #define  CALL_IFTIMER         0x65
  58. #define  CALL_ARPTIMER        0x66
  59. #define  CALL_LOINPUT         0x67
  60. #define  CALL_GETVARS         0x68
  61. #define  CALL_ENTRYS          0x69
  62. #define  CALL_OLD_SLATTACH    0x6a      /* [db3l] No longer used, but not */
  63. #define  CALL_OLD_SLIPINPUT   0x6b      /* reused to avoid conflicts with */
  64. #define  CALL_OLD_SLIPOUTPUT  0x6c      /* older code.                    */
  65. #define  CALL_FORWARD         0x6d
  66. #define  CALL_CANCEL          0x6e
  67. #define  CALL_PUSH            0x6f
  68. #define  CALL_CONNEXISTS      0x70
  69. #define  CALL_ABORT           0x71
  70. #define  CALL_ASYNCHEVENT     0x72
  71.  
  72. #ifdef X25
  73. #define  CALL_X25ATTACH       0x73
  74. #define  CALL_X25INPUT        0x74
  75. #define  CALL_X25OUTPUT       0x75
  76. #endif
  77.  
  78. #define  CALL_READV           0x78
  79. #define  CALL_WRITEV          0x79
  80.  
  81. #define  CALL_20              0x7A
  82. #define  CALL_ISFORWARD       0x7b
  83. #define  CALL_WASCANCEL       0x7c
  84. #define  CALL_ENQEVENT        0x7d
  85. #define  CALL_STARTTRACE      0x7E
  86. #define  CALL_GETTRACE        0x7F
  87. #define  CALL_STOPTRACE       0x51
  88.  
  89. /*012594JRM add CALL_SETINET*/
  90. #define  CALL_SETINET         0x4a
  91. #define  CALL_GETINET         0x4b
  92.  
  93. /* [db3l] Serial Interface IOCtls - Provides interface for COM driver code */
  94. #define  CALL_SLATTACH        0xC0      /* Attach a serial interface    */
  95. #define  CALL_SLDETACH        0xC1      /* Detach a serial interface    */
  96. #define  CALL_SLGETPARMS      0xC2      /* Obtain interface parameters  */
  97. #define  CALL_SLSETPARMS      0xC3      /* Change interface parameters  */
  98. #define  CALL_SLINPUT         0xC4      /* Input from serial interface  */
  99. #define  CALL_SLOUTPUT        0xC5      /* Output to serial interface   */
  100. #define  CALL_SLOUTPUTCANCEL  0xC6      /* Cancel blocked SLOUTPUT      */
  101.  
  102. #ifdef SNALINK
  103. #define  CALL_SNAL_ATTACH     0xC7
  104. #define  CALL_SNAL_INPUT      0xC8
  105. #define  CALL_SNAL_OUTPUT     0xC9
  106. #endif
  107. #define  CALL_RECV2           0xCA
  108. #define  CALL_RECV3           0xCB
  109.  
  110. #define  CALL_GETDBGBUF       0xf0      /* gets debug flags for tracing */
  111. #define  CALL_SETDBGFLAG      0xf1      /* sets debug flags for tracing */
  112. #define  CALL_SELTOFLAT       0xf2      /* convert 16:16 to linear addr */
  113. #define  CALL_FREEDBGMEM      0xf3      /* free acquired debug mem */
  114. #define  CALL_VERIFY          0xf4      /* verify pointers */
  115.  
  116. #define DeviceIO 11
  117. #define ICFG_INETVER          1
  118.  
  119.  
  120. /*------------------------------------------------------------*/
  121.  
  122. /* [db3l] Structure parameters for new IOCtls */
  123.  
  124. /* Structures used in various IOCtls */
  125.  
  126. /* INET Pointers */
  127.  
  128. typedef char * inetptr_t;
  129. #define _INETPTR_T_
  130.  
  131. /* Structures for Serial Interface IOCtls */
  132.  
  133. #define IFATTACH_VERSION  1
  134. #define IFATTACH_MAXNAME 12      /* Maximum name size (including ending \0) */
  135. #define IFATTACH_MAXDESCR 45     /* Matches ifmib.ifDescr[] size in if.h    */
  136.  
  137. /* Flags for high portion of if_flags - low portion is standard IFF_* flags */
  138. #define IFF_PRIORITYQUEUE 0x00010000L   /* Priority interactive queuing     */
  139. #define IFF_NOICMP        0x00020000L   /* Don't allow ICMP traffic         */
  140. #define IFF_NOINTFLAGS    0x80000000L   /* Non-zero value with no meaning   */
  141.  
  142. #ifndef __32BIT__
  143. #pragma pack(1)
  144. #endif
  145. /* This is the old ifattach struct with u_short for if_speed */
  146. struct ifAttachOld {                    /* For ATTACH/DETACH,GET/SETPARMS   */
  147.    unsigned short version;              /* Structure version                */
  148.    unsigned short length;               /* Length of supplied structure     */
  149.    char intf_name[IFATTACH_MAXNAME];    /* Interface name                   */
  150.    unsigned short intf_unit;            /* Unit number (0-3)                */
  151.    unsigned short intf_mtu;             /* MTU for interface                */
  152.    unsigned short intf_speed;           /* Estimated speed (for ifmib)      */
  153.    unsigned long  intf_flags;           /* Initial interface flags          */
  154.    unsigned short intf_rtt;             /* Estimated rtt, rttvar and rttmin */
  155.    unsigned short intf_rttvar;          /*   for routes making use of this  */
  156.    unsigned short intf_rttmin;          /*   interface (in ms)              */
  157.    unsigned short intf_sendpipe;        /* Maximum send/recv pipes (socket  */
  158.    unsigned short intf_recvpipe;        /*   buffers and TCP windows)       */
  159.    unsigned short intf_ssthresh;        /* Slow-start threshold (segments)  */
  160.    unsigned short intf_maxqueue;        /* Maximum interface queue size     */
  161.    unsigned short intf_maxfastq;        /* Maximum fast queue size          */
  162.    inetptr_t      intf_eflags;          /* pointer to ifp->if_eflags (u_long) */
  163.    char           intf_descr[IFATTACH_MAXDESCR];
  164.                                         /* MIB II ifDescr for this intf     */
  165.    unsigned short intf_type;            /* MIB II ifType for this intf      */
  166. };
  167. #ifndef __32BIT__
  168. #pragma pack()
  169.  
  170. #pragma pack(1)
  171. #endif
  172. struct ifattach {                       /* For ATTACH/DETACH,GET/SETPARMS   */
  173.    unsigned short version;              /* Structure version                */
  174.    unsigned short length;               /* Length of supplied structure     */
  175.    char intf_name[IFATTACH_MAXNAME];    /* Interface name                   */
  176.    unsigned short intf_unit;            /* Unit number (0-3)                */
  177.    unsigned short intf_mtu;             /* MTU for interface                */
  178.    unsigned short intf_speed;           /* Estimated speed (for ifmib)      */
  179.    unsigned long  intf_flags;           /* Initial interface flags          */
  180.    unsigned short intf_rtt;             /* Estimated rtt, rttvar and rttmin */
  181.    unsigned short intf_rttvar;          /*   for routes making use of this  */
  182.    unsigned short intf_rttmin;          /*   interface (in ms)              */
  183.    unsigned short intf_sendpipe;        /* Maximum send/recv pipes (socket  */
  184.    unsigned short intf_recvpipe;        /*   buffers and TCP windows)       */
  185.    unsigned short intf_ssthresh;        /* Slow-start threshold (segments)  */
  186.    unsigned short intf_maxqueue;        /* Maximum interface queue size     */
  187.    unsigned short intf_maxfastq;        /* Maximum fast queue size          */
  188.    inetptr_t      intf_eflags;          /* pointer to ifp->if_eflags (u_long) */
  189.    char           intf_descr[IFATTACH_MAXDESCR];
  190.                                         /* MIB II ifDescr for this intf     */
  191.    unsigned short intf_type;            /* MIB II ifType for this intf      */
  192.    /* sk jan 24 1995 */
  193.    unsigned long  intf_lspeed;          /* if_speed declared up is short.   */
  194.                                         /* cannot change it for back-compat */
  195. };
  196. #ifndef __32BIT__
  197. #pragma pack()
  198. #endif
  199.  
  200. #define IFATTACH_MINLEN ((u_long)&(((struct ifattach *)0)->intf_eflags) & 0xffff)
  201. #define VALID_IFATTACH_MEMBER(_i, _m) ((((u_long)&((_i)->_m) - (u_long)(_i)) + \
  202.                                         sizeof((_i)->_m)) <= (_i)->length)
  203.  
  204. /* if (if_unit==IFATTACH_UNIT) then if_sl.c will try to allocate if_unit*/
  205. #define IFATTACH_UNIT                  (unsigned short)-1
  206.  
  207. #define PKTF_PRIORITY   1               /* Priority queued traffic          */
  208. #ifndef __32BIT__
  209. #pragma pack(1)
  210. #endif
  211. struct slpacket {                       /* For INPUT/OUTPUT                 */
  212.    unsigned short version;              /* Structure version                */
  213.    unsigned short length;               /* Length of supplied structure     */
  214.    unsigned short if_unit;              /* Interface unit number            */
  215.    unsigned short pkt_flags;            /* Packet flags                     */
  216.    unsigned short datalength;           /* Data length                      */
  217.    inetptr_t      data;                 /* Packet data                      */
  218.    unsigned long  ip_dest;              /* IP destination                   */
  219. };
  220. #ifndef __32BIT__
  221. #pragma pack()
  222. #endif
  223.  
  224. #define SLPACKET_VERSION 1
  225. #define SLPACKET_MINLEN ((u_long)&(((struct slpacket *)0)->ip_dest) & 0xffff)
  226. #define VALID_SLPACKET_MEMBER(_i, _m) ((((u_long)&((_i)->_m) - (u_long)(_i)) + \
  227.                                         sizeof((_i)->_m)) <= (_i)->length)
  228.  
  229. #define MAXTRACEBYTES 31000
  230. #endif /* GENIO_H */
  231.