Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

149 lines
5.8 KiB

  1. /***************************************************************************
  2. Name : MODEMDDI.H
  3. Comment : Interface for Modem/NCU DDI
  4. Revision Log
  5. Date Name Description
  6. -------- ----- ---------------------------------------------------------
  7. ***************************************************************************/
  8. #ifndef _MODEMDDI_
  9. #define _MODEMDDI_
  10. #include <ncuparm.h>
  11. typedef struct {
  12. USHORT uSize;
  13. USHORT uClasses;
  14. USHORT uSendSpeeds;
  15. USHORT uRecvSpeeds;
  16. USHORT uHDLCSendSpeeds;
  17. USHORT uHDLCRecvSpeeds;
  18. } MODEMCAPS, far* LPMODEMCAPS;
  19. // uClasses is one or more of the below
  20. #define FAXCLASS0 0x01
  21. #define FAXCLASS1 0x02
  22. #define FAXCLASS2 0x04
  23. #define FAXCLASS2_0 0x08 // Class4==0x10
  24. // uSendSpeeds, uRecvSpeeds, uHDLCSendSpeeds and uHDLCRecvSpeeds
  25. // are one or more of the below. If V27 is provided
  26. // at 2400bps *only*, then V27 is *not* set
  27. // V27 2400 (nonHDLC) is always assumed
  28. #define V27 2 // V27ter capability at 4800 bps
  29. #define V29 1 // V29 at 7200 & 9600 bps
  30. #define V33 4 // V33 at 12000 & 14400 bps
  31. #define V17 8 // V17 at 7200 thru 14400 bps
  32. #define V27_V29_V33_V17 11 // 15 --> 11 in T30speak
  33. // used only in selecting modulation -- not in capability
  34. // #define V21 7 // V21 ch2 at 300bps
  35. // #define V27_FALLBACK 32 // V27ter capability at 2400 bps
  36. // various calls return & use these
  37. //typedef HANDLE HLINE;
  38. //typedef HANDLE HCALL;
  39. typedef HANDLE HMODEM;
  40. // NCUModemInit returns these
  41. #define INIT_OK 0
  42. #define INIT_INTERNAL_ERROR 13
  43. #define INIT_MODEMERROR 15
  44. #define INIT_PORTBUSY 16
  45. #define INIT_MODEMDEAD 17
  46. #define INIT_GETCAPS_FAIL 18
  47. #define INIT_USERCANCEL 19
  48. // NCULink takes one of these flags (mutually exclusive)
  49. #define NCULINK_HANGUP 0
  50. #define NCULINK_RX 2
  51. // NCUDial(and iModemDial), NCUTxDigit, ModemConnectTx and ModemConnectRx return one of
  52. #define CONNECT_TIMEOUT 0
  53. #define CONNECT_OK 1
  54. #define CONNECT_BUSY 2
  55. #define CONNECT_NOANSWER 3
  56. #define CONNECT_NODIALTONE 4
  57. #define CONNECT_ERROR 5
  58. #define CONNECT_BLACKLISTED 6
  59. #define CONNECT_DELAYED 7
  60. // NCULink (and iModemAnswer) returns one of the following (or OK or ERROR)
  61. #define CONNECT_RING_ERROR 7 // was ringing when tried NCULINK_TX
  62. #define CONNECT_NORING_ERROR 8 // was not ringing when tried NCULINK_RX
  63. #define CONNECT_RINGEND_ERROR 9 // stopped ringing before
  64. // NCUParams.RingsBeforeAnswer count was
  65. // was reached when tried NCULINK_RX
  66. /////// SUPPORT FOR ADAPTIVE ANSWER ////////
  67. #define CONNECT_WRONGMODE_DATAMODEM 10 // We're connected as a datamodem.
  68. // SendMode and RecvMode take one of these for uModulation
  69. #define V21_300 7 // used an arbitary vacant slot
  70. #define V27_2400 0
  71. #define V27_4800 2
  72. #define V29_9600 1
  73. #define V29_7200 3
  74. #define V33_14400 4
  75. #define V33_12000 6
  76. #define V17_START 8 // every code above this is considered V17
  77. #define V17_14400 8
  78. #define V17_12000 10
  79. #define V17_9600 9
  80. #define V17_7200 11
  81. #define ST_FLAG 0x10
  82. #define V17_14400_ST (V17_14400 | ST_FLAG)
  83. #define V17_12000_ST (V17_12000 | ST_FLAG)
  84. #define V17_9600_ST (V17_9600 | ST_FLAG)
  85. #define V17_7200_ST (V17_7200 | ST_FLAG)
  86. // SendMem take one one or more of these for uFlags
  87. // SEND_ENDFRAME must _always_ be TRUE in HDLC mode
  88. // (partial frames are no longer supported)
  89. #define SEND_FINAL 1
  90. #define SEND_ENDFRAME 2
  91. // #define SEND_STUFF 4
  92. // RecvMem and RecvMode return one these
  93. #define RECV_OK 0
  94. #define RECV_ERROR 1
  95. #define RECV_TIMEOUT 2
  96. #define RECV_WRONGMODE 3 // only Recvmode returns this
  97. #define RECV_OUTOFMEMORY 4
  98. #define RECV_EOF 8
  99. #define RECV_BADFRAME 16
  100. // Min modem recv buffer size. Used for all recvs
  101. // For IFAX30: *All* RecvMem calls will be called with exactly this size
  102. #define MIN_RECVBUFSIZE 265
  103. // Max phone number size passed into NCUDial
  104. #define MAX_PHONENUM_LEN 60
  105. // each value corresponds to one of the "Response Recvd" and
  106. // "Command Recvd" boxes in the T30 flowchart.
  107. #define ifrPHASEBresponse 58 // receiver PhaseB
  108. #define ifrTCFresponse 59 // sender after sending TCF
  109. #define ifrPOSTPAGEresponse 60 // sender after sending MPS/EOM/EOP
  110. #define ifrPHASEBcommand 64 // sender PhaseB
  111. #define ifrNODEFcommand 65 // receiver main loop (Node F)
  112. #define ifrNODEFafterWRONGMODE 71 // hint for RecvMode after WRONGMODE
  113. #define ifrEOFfromRECVMODE 72 // GetCmdResp retval if RecvMode returns EOF
  114. #endif //_MODEMDDI_