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.

68 lines
1.9 KiB

  1. // FSM.h : This file contains the Finite State Machine ...
  2. // Created: Feb '98
  3. // Author : a-rakeba
  4. // History:
  5. // Copyright (C) 1998 Microsoft Corporation
  6. // All rights reserved.
  7. // Microsoft Confidential
  8. #if !defined( _FSM_H_ )
  9. #define _FSM_H_
  10. #include "cmnhdr.h"
  11. #include <windows.h>
  12. #include <rfcproto.h>
  13. // Telnet Socket-Input FSM States
  14. // just to make it obvious TS_ prefix means Telnet State
  15. #define TS_DATA 0 // normal data processing
  16. #define TS_IAC 1 // have seen IAC
  17. #define TS_WOPT 2 // have seen IAC- { WILL | WONT }
  18. #define TS_DOPT 3 // have seen IAC- { DO | DONT }
  19. #define TS_SUBNEG 4 // have seen IAC-SB
  20. #define TS_SUBIAC 5 // have seen IAC-SB-...-IAC
  21. //#define NUM_TS_STATES 6 // number of TS_* states
  22. //Telnet Option Subnegotiation FSM States
  23. //just to make it obvious SS_ prefix means Subnegotiation State
  24. #define SS_START 0 // initial state
  25. #define SS_TERMTYPE 1 // TERMINAL_TYPE option subnegotiation
  26. #define SS_AUTH1 2 // AUTHENTICATION option subnegotiation
  27. #define SS_AUTH2 3
  28. #define SS_NAWS 4
  29. #define SS_END_FAIL 5
  30. #define SS_END_SUCC 6
  31. #define SS_NEW_ENVIRON1 7 //NEW_ENVIRON sub negotiation
  32. #define SS_NEW_ENVIRON2 8 //NEW_ENVIRON sub negotiation
  33. #define SS_NEW_ENVIRON3 9 //NEW_ENVIRON sub negotiation
  34. #define SS_NEW_ENVIRON4 10 //NEW_ENVIRON sub negotiation
  35. #define SS_NEW_ENVIRON5 11 //NEW_ENVIRON sub negotiation
  36. #define FS_INVALID 0xFF // an invalid state number
  37. #define TC_ANY (NUM_CHARS+1) // match any character
  38. typedef
  39. void (CRFCProtocol::*PMFUNCACTION)
  40. ( LPBYTE* ppPutBack, PUCHAR* pBuffer, BYTE b );
  41. //#pragma pack(4)
  42. typedef struct {
  43. UCHAR uchCurrState;
  44. WORD wInputChar;
  45. //BYTE pad2[6];
  46. UCHAR uchNextState;
  47. //BYTE pad3[6];
  48. PMFUNCACTION pmfnAction;
  49. } FSM_TRANSITION;
  50. #endif //_FSM_H_