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.

118 lines
2.7 KiB

  1. //==========================================================================
  2. // Copyright (c) 1995, Microsoft Corporation
  3. //
  4. // File: rtdefs.h
  5. //
  6. //==========================================================================
  7. #ifndef _RTDEFS_H_
  8. #define _RTDEFS_H_
  9. #define STR_ROUTETAB "ROUTETAB.DLL"
  10. #define STR_DHCPNEWIPADDR "DHCPNEWIPADDRESS"
  11. #define POS_EXITEVENT 0
  12. #define POS_DHCPEVENT 1
  13. #define POS_LASTEVENT 2
  14. #define RT_LOCK() WaitForSingleObject(g_rtCfg.hRTMutex, INFINITE)
  15. #define RT_UNLOCK() ReleaseMutex(g_rtCfg.hRTMutex)
  16. #define CLASS_A_MASK 0x000000FFL
  17. #define CLASS_B_MASK 0x0000FFFFL
  18. #define CLASS_C_MASK 0x00FFFFFFL
  19. #define CLASS_SHIFT 5 // Make C generate hyper-optimized case
  20. #define CLA0 0 // It takes the same arg; you mask it off,
  21. #define CLA1 1 // shift, and then do a case statment with
  22. #define CLA2 2 // some code having more than one label.
  23. #define CLA3 3 // Values for class A
  24. #define CLB0 4
  25. #define CLB1 5 // B
  26. #define CLC 6 // C
  27. #define CLI 7 // Illegal
  28. // typedef to avoid globals name clash
  29. typedef struct _GLOBAL_STRUCT {
  30. DWORD dwIfCount;
  31. LPIF_ENTRY lpIfTable;
  32. DWORD dwIPAddressCount;
  33. LPIPADDRESS_ENTRY lpIPAddressTable;
  34. HANDLE hRTMutex;
  35. HANDLE hDHCPEvent;
  36. HANDLE hUpdateThreadExit;
  37. DWORD dwUpdateThreadStarted;
  38. HANDLE hUserNotifyEvent;
  39. HANDLE hTCPHandle;
  40. } GLOBAL_STRUCT, *LPGLOBAL_STRUCT;
  41. extern GLOBAL_STRUCT *g_prtcfg;
  42. #define g_rtCfg (*g_prtcfg)
  43. DWORD
  44. RTUpdateThread(
  45. LPVOID lpvParam
  46. );
  47. BOOL
  48. RTStartup(
  49. HMODULE hmodule
  50. );
  51. BOOL
  52. RTShutdown(
  53. HMODULE hmodule
  54. );
  55. VOID
  56. RTCleanUp(
  57. );
  58. DWORD
  59. RTGetTables(
  60. LPIF_ENTRY *lplpIfTable,
  61. LPDWORD lpdwIfCount,
  62. LPIPADDRESS_ENTRY *lplpAddrTable,
  63. LPDWORD lpdwAddrCount
  64. );
  65. DWORD
  66. RTGetIfTable(
  67. LPIF_ENTRY *lplpIfTable,
  68. LPDWORD lpdwIfCount
  69. );
  70. DWORD
  71. RTGetAddrTable(
  72. LPIPADDRESS_ENTRY *lplpAddrTable,
  73. LPDWORD lpdwAddrCount
  74. );
  75. DWORD
  76. OpenTcp(
  77. );
  78. DWORD
  79. TCPSetInformationEx(
  80. LPVOID lpvInBuffer,
  81. LPDWORD lpdwInSize,
  82. LPVOID lpvOutBuffer,
  83. LPDWORD lpdwOutSize
  84. );
  85. DWORD
  86. TCPQueryInformationEx(
  87. LPVOID lpvInBuffer,
  88. LPDWORD lpdwInSize,
  89. LPVOID lpvOutBuffer,
  90. LPDWORD lpdwOutSize
  91. );
  92. #endif // _RTDEFS_H_