Source code of Windows XP (NT5)
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.

248 lines
9.5 KiB

  1. /***************************************************************************
  2. Name : AWNSFAPI.H
  3. Comment : Definitions of the AtWork AWBC (Basicaps) structure which is the
  4. decrypted/decooded/reformatted form of the At Work NSF and NSC
  5. Also the decrypted form of the At Work NSS
  6. Also defines the APIs for encoding/decoding AtWork NSF/NSC/NSS
  7. Copyright (c) 1993 Microsoft Corp.
  8. Revision Log
  9. Date Name Description
  10. -------- ----- ---------------------------------------------------------
  11. 08/28/93 arulm Created
  12. ***************************************************************************/
  13. #ifndef _AWNSFAPI_H
  14. #define _AWNSFAPI_H
  15. /***********************************************************************
  16. * *
  17. * NOTICE: This file has to be ANSI compilable, under GCC on UNIX *
  18. * and other ANSI compiles. Be sure to use no MS C specific features *
  19. * In particular, don't use // for comments!!!! *
  20. * *
  21. ***********************************************************************/
  22. #ifdef PORTABLE /** -DPORTABLE on machines with flat 32-bit model **/
  23. #ifdef STDCALL
  24. # define WINAPI __stdcall
  25. # define EXPORTAWBC __stdcall
  26. #else
  27. # define WINAPI
  28. # define EXPORTAWBC
  29. #endif
  30. # define FAR
  31. # define NEAR
  32. # define PASCAL
  33. # define CALLBACK
  34. # define __export
  35. # define _export
  36. # define max(a, b) (((a) > (b)) ? (a) : (b))
  37. typedef short BOOL;
  38. #elif defined(WIN32) /** WIN32 **/
  39. # define __export __declspec( dllexport )
  40. # define _export __declspec( dllexport )
  41. # define EXPORTAWBC WINAPI
  42. #else /** 16bit Windows */
  43. # define FAR _far
  44. # define NEAR _near
  45. # define PASCAL _pascal
  46. # define WINAPI _far _pascal
  47. # define CALLBACK _far _pascal
  48. # define EXPORTAWBC _export WINAPI
  49. typedef int BOOL;
  50. #endif /** Portable, WIN32 or WIN16 **/
  51. typedef unsigned char BYTE;
  52. typedef unsigned short WORD;
  53. typedef unsigned long DWORD;
  54. typedef unsigned short USHORT;
  55. typedef BYTE FAR* LPBYTE;
  56. typedef WORD FAR* LPWORD;
  57. #include <fr.h>
  58. #pragma pack(2) /** ensure packing is portable, i.e. 2 or more **/
  59. typedef enum {
  60. BC_NONE = 0,
  61. SEND_CAPS, /** Used to derive an NSF to send **/
  62. RECV_CAPS, /** Derived from a received NSF **/
  63. SEND_PARAMS, /** Used to derive an NSS to send **/
  64. RECV_PARAMS, /** Derived from a received NSS **/
  65. SEND_POLLREQ, /** Used to derive a NSC to send **/
  66. RECV_POLLREQ, /** Derived from a receive NSC **/
  67. SEND_ACK,
  68. RECV_ACK,
  69. SEND_DISCONNECT,
  70. RECV_DISCONNECT
  71. } BCTYPE;
  72. #define BCTYPE_FIRST RECV_CAPS
  73. #define BCTYPE_LAST RECV_POLLREQ
  74. #define MAXTOTALIDLEN 61
  75. #define MAXNSCPOLLREQ 5
  76. #ifndef NOCHALL
  77. # define POLL_CHALLENGE_LEN 10
  78. # define POLL_PASSWORD_LEN 20
  79. #endif
  80. #define MAXNSFFRAMESIZE 256 /* MAW NSx frames must be 255 bytes or less */
  81. #define MAXFIRSTNSFSIZE 38 /* The first transmitted MAW NSx frame must
  82. be 38 bytes or less */
  83. #define MAXNEXTNSFSIZE 70 /* subsequent transmitted MAW NSx frame must
  84. be 72 bytes or less */
  85. #define MAXNSFFRAMES (MAXNSCPOLLREQ+5)
  86. typedef struct
  87. {
  88. WORD PollType; /* one of the POLLTYPE_ defines below */
  89. WORD fReturnControl; /* T or F */
  90. WORD PassType;
  91. WORD wNameLen;
  92. BYTE bName[MAXTOTALIDLEN+3]; /* align on even boundary */
  93. #ifdef NOCHALL
  94. WORD wPassLen;
  95. BYTE bPass[MAXTOTALIDLEN+3]; /* align on even boundary */
  96. #else
  97. WORD wChallRespLen;
  98. BYTE bChallResp[max(POLL_PASSWORD_LEN, POLL_CHALLENGE_LEN)+2];
  99. #endif
  100. }
  101. AWBCPOLLREQ, FAR* LPAWBCPOLLREQ;
  102. typedef struct
  103. {
  104. BCTYPE bctype; /* must always be set. One of the enum values above */
  105. WORD wAWBCSize; /* size of this (fixed size) AWBC struct, must be set */
  106. WORD wAWBCVer; /* if using this header file, set it to VER_AWFXPROT100*/
  107. WORD wAWBCSig; /* Clients must set to SIG_AWFXPROT in struct passed in
  108. to the NSF encoding/decoding routines. In Structs
  109. returned from these routines this will be 0 */
  110. BYTE vMsgProtocol; /* 00==Doesn't accept linearized msgs. vMSG_SNOW==
  111. Current (WFW) version of linearizer. For NSS, ver
  112. of linearized msg, if any, following the NSS-DCS */
  113. BYTE fInwardRouting;/* 00==no inward routing */
  114. BYTE fBinaryData; /* accept binary files inside linearized msgs */
  115. BYTE vMsgCompress; /* 00==none */
  116. BYTE fDontCache; /* 1=NSF/DIS caps of this machine should _not_ be cached (see long note above)*/
  117. BYTE DataLink; /* Data-link protocols. 000==none */
  118. BYTE DataSpeed; /* Data modem modulations/speeds. 00000==none */
  119. BYTE vShortFlags; /* 00==not supported */
  120. BYTE OperatingSys; /* OS_WIN16==16bit Windows(Win3.1, WFW etc) */
  121. /* OS_ARADOR==AtWork based OSs (IFAX etc) */
  122. /* OS_WIN32== WIN32 OSs (NT, WIN95) */
  123. BYTE vSecurity; /* 00==none vSECURE_SNOW==snowball security */
  124. BYTE vInteractive; /* 00==No interactive protocol support */
  125. BYTE TextEncoding; /* Text code. TEXTCODE_ASCII==ascii */
  126. BYTE TextIdLen; /* Text ID length */
  127. BYTE Reserved1; /* Pad to even boundary before array */
  128. BYTE bTextId[MAXTOTALIDLEN+3]; /* zero-terminated */
  129. BYTE bMachineId[MAXTOTALIDLEN+3];/* machine ID */
  130. BYTE MachineIdLen; /* length of machine id */
  131. BYTE vRamboVer; /* Rambo: 00==not supported */
  132. BYTE vAddrAttach; /* 00==cannot accept address bk attachmnts */
  133. BYTE fAnyWidth; /* page pixel widths don't have to be exactly T.4 */
  134. BYTE HiEncoding; /* one or more of the HENCODE_ #defines below */
  135. BYTE HiResolution; /* one or more of the HRES_ #defines below */
  136. BYTE CutSheetSizes; /* one or more of the PSIZE_ #defines below */
  137. BYTE fOddCutSheet; /* Cut-sheet sizes other than ones listed below */
  138. BYTE vMetaFile; /* 00==metafiles not accepted */
  139. BYTE vCoverAttach; /* 00==no digital cover page renderer */
  140. BYTE fLowSpeedPoll; /* SEP/PWD/NSC poll reqs accepted */
  141. BYTE fHighSpeedPoll; /* PhaseC pollreqs accepted */
  142. /* if both the above 00, poll reqs not accepted */
  143. BYTE fFilePolling; /* Supports polling for arbitrary files */
  144. BYTE fPollByRecipAvail; /* Poll-by-Recipient msgs available */
  145. BYTE fPollByNameAvail; /* Poll-by-MessageName msgs available */
  146. BYTE fExtCapsAvail; /* Extended capabiities available */
  147. BYTE fNoShortTurn; /* NOT OK recving NSC-DTC immediately after EOM-MCF*/
  148. BYTE vMsgRelay; /* Msg relay ver. 0==no support */
  149. WORD ExtCapsCRC; /* CRC of machine's extended capabilities */
  150. struct {
  151. BYTE vMsgProtocol; /* non-zero: linearized msg follows */
  152. /* vMSG_SNOW current linearized format */
  153. BYTE vInteractive; /* non-zero: Interactive prot being invoked */
  154. }
  155. NSS;
  156. WORD wNumPollReq; /* number of poll reqs */
  157. AWBCPOLLREQ rgPollReq[MAXNSCPOLLREQ]; /* array of AWBCPOLLREQ structures */
  158. }
  159. AWBC, FAR* LPAWBC, NEAR* NPAWBC;
  160. /** Appropriate values for some of the above fields **/
  161. #define vMSG_SNOW 1 /* Snowball Linearizer version */
  162. #define vMSG_IFAX100 2 /* IFAX linearizer version */
  163. #define vSECURE_SNOW 1 /* vSecurity for Snowball (v1.00 of MAW) */
  164. #define OS_WIN16 0 /* OperatingSys for Win3.0, 3.1, WFW3.1, 3.11*/
  165. #define OS_ARADOR 1 /* OperatingSys for Arador-based systems */
  166. #define OS_WIN32 2 /* OperatingsSys for WIN32 (NT, WIN95) */
  167. #define TEXTCODE_ASCII 0 /* TextEncoding for 7-bit ASCII */
  168. #define SIG_AWFXPROT 0xYYYY
  169. #define VER_AWFXPROT100 0x100
  170. extern BOOL WINAPI IsAtWorkNSx(LPBYTE lpb, WORD wSize);
  171. extern WORD _export WINAPI AWBCtoNSx(IFR ifr, LPAWBC lpawbcIn,
  172. LPBYTE lpbOut, WORD wMaxOut, LPWORD lpwNumFrame);
  173. extern WORD _export WINAPI NSxtoAWBC(IFR ifr, LPLPFR rglpfr, WORD wNumFrame,
  174. LPAWBC lpawbcOut, WORD wAWBCSize);
  175. extern void _export WINAPI MaskAWBC(LPAWBC lpawbc, WORD wSize);
  176. #define AWERROR_OK 0
  177. #define AWERROR_BCTYPE 1
  178. #define AWERROR_SIG 2
  179. #define AWERROR_NOSPACE 3
  180. #define AWERROR_NOTAWFRAME 4
  181. #define AWERROR_NULLFRAME 5
  182. #define AWERROR_VERSION 6
  183. #define AWERROR_INVALIDBC 7
  184. #pragma pack()
  185. #endif /** _AWNSFAPI_H **/