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.

311 lines
6.1 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. netboot.h
  5. Abstract:
  6. This module defines globally used procedure and data structures used
  7. by net boot.
  8. Author:
  9. Chuck Lenzmeier (chuckl) 09-Jan-1997
  10. Revision History:
  11. --*/
  12. #ifndef _NETBOOT_
  13. #define _NETBOOT_
  14. #include <oscpkt.h> // defines NET_CARD_INFO
  15. #ifdef EFI
  16. #include <efi.h>
  17. #endif
  18. #define NET_DEVICE_ID 'dten'
  19. //
  20. // The following structure is used to define the parameters of the net
  21. // volume. Given a FileId we can access the structure context through
  22. // the structure context field in the global BlFileTable (e.g.,
  23. // BlFileTable[FileId].StructureContext).
  24. //
  25. typedef struct _NET_STRUCTURE_CONTEXT {
  26. ULONG Dummy;
  27. } NET_STRUCTURE_CONTEXT, *PNET_STRUCTURE_CONTEXT;
  28. //
  29. // The following structure is used to define the location and size of each
  30. // opened file. There is one of these of every opened file. It is part of
  31. // the union of a BL_FILE_TABLE structuure. Given a FileId we can access the
  32. // file context via the BlFileTable (e.g., BlFileTable[FileId].u.NetFileContext)
  33. //
  34. typedef struct _NET_FILE_CONTEXT {
  35. PUCHAR InMemoryCopy;
  36. ULONG FileSize;
  37. #if defined(REMOTE_BOOT)
  38. BOOLEAN CachedFile;
  39. ULONG CachedFileId;
  40. #endif // defined(REMOTE_BOOT)
  41. } NET_FILE_CONTEXT, *PNET_FILE_CONTEXT;
  42. #if defined(REMOTE_BOOT)
  43. //
  44. // The following defines are for parameter passing between loaders, when switching.
  45. // Each parameter contains a 4-byte quantity which is completely random, and then a
  46. // 4 byte checksum generated by the following formula:
  47. // CkSum = (((b1 * 2) + b2) * 2) + b3) * 2 + b4
  48. //
  49. #define NET_REBOOT_WRITE_SECRET_ONLY 0x53A590F10000073D
  50. #define NET_REBOOT_DISK_SECRET_VALID 0xE32C78B70000096F
  51. #endif // defined(REMOTE_BOOT)
  52. #define NET_REBOOT_COMMAND_CONSOLE_ONLY 0x83CDA43F000008D3
  53. #define NET_REBOOT_ASR 0x9cb2521700000863
  54. //
  55. // Global variables available outside of the "network file system" part
  56. // of the loader.
  57. //
  58. extern ULONG NetLocalIpAddress;
  59. extern ULONG NetLocalSubnetMask;
  60. extern ULONG NetServerIpAddress;
  61. extern ULONG NetGatewayIpAddress;
  62. extern CHAR NetBootPath[129];
  63. extern PCHAR NetServerShare;
  64. extern UCHAR NetBootIniContents[1020 + 1];
  65. extern UCHAR NetBootIniPath[256 + 1];
  66. extern USHORT NetMaxTranUnit; // MTU
  67. extern USHORT NetHwAddrLen; // actual length of hardware address
  68. extern USHORT NetHwType; // Type of protocol at the hardware level from rfc1010
  69. extern BOOLEAN NetBootTftpUsedPassword2;
  70. #if defined(_IA64_)
  71. extern EFI_PXE_BASE_CODE *PXEClient;
  72. extern EFI_HANDLE PXEHandle;
  73. #endif
  74. #if defined(REMOTE_BOOT)
  75. extern BOOLEAN NetBootRepin;
  76. extern BOOLEAN NetworkBootRom;
  77. extern BOOLEAN NetBootCSC;
  78. extern CHAR NetBootActivePartitionName[80];
  79. extern CHAR NetBootCSCPartitionName[80];
  80. extern BOOLEAN NetBootSearchedForCSC;
  81. #endif // defined(REMOTE_BOOT)
  82. //
  83. // Define ARC hooks.
  84. //
  85. ARC_STATUS
  86. NetArcClose (
  87. IN ULONG FileId
  88. );
  89. ARC_STATUS
  90. NetArcOpen (
  91. IN CHAR * FIRMWARE_PTR OpenPath,
  92. IN OPEN_MODE OpenMode,
  93. OUT ULONG * FIRMWARE_PTR FileId
  94. );
  95. //
  96. // Define file I/O prototypes.
  97. //
  98. ARC_STATUS
  99. NetClose (
  100. IN ULONG FileId
  101. );
  102. ARC_STATUS
  103. NetMount (
  104. IN CHAR * FIRMWARE_PTR MountPath,
  105. IN MOUNT_OPERATION Operation
  106. );
  107. ARC_STATUS
  108. NetOpen (
  109. IN CHAR * FIRMWARE_PTR OpenPath,
  110. IN OPEN_MODE OpenMode,
  111. OUT ULONG * FIRMWARE_PTR FileId
  112. );
  113. ARC_STATUS
  114. NetRead (
  115. IN ULONG FileId,
  116. OUT VOID * FIRMWARE_PTR Buffer,
  117. IN ULONG Length,
  118. OUT ULONG * FIRMWARE_PTR Count
  119. );
  120. ARC_STATUS
  121. NetGetReadStatus (
  122. IN ULONG FileId
  123. );
  124. ARC_STATUS
  125. NetSeek (
  126. IN ULONG FileId,
  127. IN LARGE_INTEGER * FIRMWARE_PTR Offset,
  128. IN SEEK_MODE SeekMode
  129. );
  130. ARC_STATUS
  131. NetWrite (
  132. IN ULONG FileId,
  133. IN VOID * FIRMWARE_PTR Buffer,
  134. IN ULONG Length,
  135. OUT ULONG * FIRMWARE_PTR Count
  136. );
  137. ARC_STATUS
  138. NetGetFileInformation (
  139. IN ULONG FileId,
  140. OUT FILE_INFORMATION * FIRMWARE_PTR Buffer
  141. );
  142. ARC_STATUS
  143. NetSetFileInformation (
  144. IN ULONG FileId,
  145. IN ULONG AttributeFlags,
  146. IN ULONG AttributeMask
  147. );
  148. ARC_STATUS
  149. NetRename (
  150. IN ULONG FileId,
  151. IN CHAR * FIRMWARE_PTR NewFileName
  152. );
  153. ARC_STATUS
  154. NetGetDirectoryEntry (
  155. IN ULONG FileId,
  156. IN DIRECTORY_ENTRY * FIRMWARE_PTR DirEntry,
  157. IN ULONG NumberDir,
  158. OUT ULONG * FIRMWARE_PTR CountDir
  159. );
  160. ARC_STATUS
  161. NetInitialize (
  162. VOID
  163. );
  164. VOID
  165. NetTerminate (
  166. VOID
  167. );
  168. //
  169. //
  170. // Define network helper functions for the loaders.
  171. //
  172. NTSTATUS
  173. NetQueryCardInfo(
  174. IN OUT PNET_CARD_INFO CardInfo
  175. );
  176. NTSTATUS
  177. NetQueryDriverInfo(
  178. IN PNET_CARD_INFO CardInfo,
  179. IN PCHAR SetupPath,
  180. IN PCHAR NtBootPathName,
  181. IN OUT PWCHAR HardwareId,
  182. IN ULONG HardwareIdLength, // in bytes
  183. IN OUT PWCHAR DriverName,
  184. IN OUT PCHAR DriverNameAnsi,
  185. IN ULONG DriverNameLength, // in bytes
  186. IN OUT PWCHAR ServiceName,
  187. IN ULONG ServiceNameLength, // in bytes
  188. OUT PCHAR * Registry,
  189. OUT ULONG * RegistryLength
  190. );
  191. #if defined(REMOTE_BOOT)
  192. NTSTATUS
  193. NetCopyHalAndKernel(
  194. IN PCHAR HalName,
  195. IN PCHAR Guid,
  196. IN ULONG GuidLength
  197. );
  198. NTSTATUS
  199. NetPrepareIpsec(
  200. IN ULONG InboundSpi,
  201. OUT ULONG * SessionKey,
  202. OUT ULONG * OutboundSpi
  203. );
  204. #endif // defined(REMOTE_BOOT)
  205. VOID
  206. GetGuid(
  207. OUT PUCHAR *Guid,
  208. OUT PULONG GuidLength
  209. );
  210. VOID
  211. NetGetRebootParameters(
  212. OUT PULONGLONG Param OPTIONAL,
  213. OUT PUCHAR RebootFile OPTIONAL,
  214. OUT PUCHAR SifFile OPTIONAL,
  215. OUT PUCHAR User OPTIONAL,
  216. OUT PUCHAR Domain OPTIONAL,
  217. OUT PUCHAR Password OPTIONAL,
  218. OUT PUCHAR AdministratorPassword OPTIONAL,
  219. IN BOOLEAN ClearRestartBlock
  220. );
  221. NTSTATUS
  222. NetSoftReboot(
  223. IN PUCHAR NextBootFile,
  224. IN ULONGLONG Param,
  225. IN PUCHAR RebootFile OPTIONAL,
  226. IN PUCHAR SifFile OPTIONAL,
  227. IN PUCHAR User OPTIONAL,
  228. IN PUCHAR Domain OPTIONAL,
  229. IN PUCHAR Password OPTIONAL,
  230. IN PUCHAR AdministratorPassword OPTIONAL
  231. );
  232. ARC_STATUS
  233. NetFillNetworkLoaderBlock (
  234. PNETWORK_LOADER_BLOCK NetworkLoaderBlock
  235. );
  236. #if defined(_ALPHA_)
  237. #define NetFindCSCPartitionName() FALSE
  238. #else
  239. BOOLEAN
  240. NetFindCSCPartitionName(
  241. VOID
  242. );
  243. #endif
  244. #endif // _NETBOOT_