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.

pxe_tftp.c 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. /** @file
  2. *
  3. * PXE TFTP API
  4. *
  5. */
  6. /*
  7. * Copyright (C) 2004 Michael Brown <mbrown@fensystems.co.uk>.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of the
  12. * License, or any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. */
  23. #include <stdlib.h>
  24. #include <stdio.h>
  25. #include <byteswap.h>
  26. #include <gpxe/uaccess.h>
  27. #include <gpxe/in.h>
  28. #include <gpxe/tftp.h>
  29. #include <gpxe/posix_io.h>
  30. #include <pxe.h>
  31. /** File descriptor for "single-file-only" PXE TFTP transfer */
  32. static int pxe_single_fd = -1;
  33. /** Block size for "single-file-only" PXE TFTP transfer */
  34. static size_t pxe_single_blksize;
  35. /** Current block index for "single-file-only" PXE TFTP transfer */
  36. static unsigned int pxe_single_blkidx;
  37. /** Length of a PXE-derived URI
  38. *
  39. * The "single-file-only" API calls use a filename field of 128 bytes.
  40. * 256 bytes provides plenty of space for constructing the (temporary)
  41. * full URI.
  42. */
  43. #define PXE_URI_LEN 256
  44. /**
  45. * Build PXE URI string
  46. *
  47. * @v uri_string URI string to fill in
  48. * @v ipaddress Server IP address (in network byte order)
  49. * @v port Server port (in network byte order)
  50. * @v filename File name
  51. * @v blksize Requested block size, or 0
  52. *
  53. * The URI string buffer must be at least @c PXE_URI_LEN bytes long.
  54. */
  55. static void pxe_tftp_build_uri ( char *uri_string,
  56. uint32_t ipaddress, unsigned int port,
  57. const unsigned char *filename,
  58. int blksize ) {
  59. struct in_addr address;
  60. address.s_addr = ipaddress;
  61. if ( ! port )
  62. port = htons ( TFTP_PORT );
  63. if ( ! blksize )
  64. blksize = TFTP_MAX_BLKSIZE;
  65. tftp_set_request_blksize ( blksize );
  66. snprintf ( uri_string, PXE_URI_LEN, "tftp://%s:%d%s%s",
  67. inet_ntoa ( address ), ntohs ( port ),
  68. ( ( filename[0] == '/' ) ? "" : "/" ), filename );
  69. }
  70. /**
  71. * TFTP OPEN
  72. *
  73. * @v tftp_open Pointer to a struct s_PXENV_TFTP_OPEN
  74. * @v s_PXENV_TFTP_OPEN::ServerIPAddress TFTP server IP address
  75. * @v s_PXENV_TFTP_OPEN::GatewayIPAddress Relay agent IP address, or 0.0.0.0
  76. * @v s_PXENV_TFTP_OPEN::FileName Name of file to open
  77. * @v s_PXENV_TFTP_OPEN::TFTPPort TFTP server UDP port
  78. * @v s_PXENV_TFTP_OPEN::PacketSize TFTP blksize option to request
  79. * @ret #PXENV_EXIT_SUCCESS File was opened
  80. * @ret #PXENV_EXIT_FAILURE File was not opened
  81. * @ret s_PXENV_TFTP_OPEN::Status PXE status code
  82. * @ret s_PXENV_TFTP_OPEN::PacketSize Negotiated blksize
  83. * @err #PXENV_STATUS_TFTP_INVALID_PACKET_SIZE Requested blksize too small
  84. *
  85. * Opens a TFTP connection for downloading a file a block at a time
  86. * using pxenv_tftp_read().
  87. *
  88. * If s_PXENV_TFTP_OPEN::GatewayIPAddress is 0.0.0.0, normal IP
  89. * routing will take place. See the relevant
  90. * @ref pxe_routing "implementation note" for more details.
  91. *
  92. * Because we support arbitrary protocols, most of which have no
  93. * notion of "block size" and will return data in arbitrary-sized
  94. * chunks, we cheat and pretend to the caller that the blocksize is
  95. * always accepted as-is.
  96. *
  97. * On x86, you must set the s_PXE::StatusCallout field to a nonzero
  98. * value before calling this function in protected mode. You cannot
  99. * call this function with a 32-bit stack segment. (See the relevant
  100. * @ref pxe_x86_pmode16 "implementation note" for more details.)
  101. *
  102. * @note According to the PXE specification version 2.1, this call
  103. * "opens a file for reading/writing", though how writing is to be
  104. * achieved without the existence of an API call %pxenv_tftp_write()
  105. * is not made clear.
  106. *
  107. * @note Despite the existence of the numerous statements within the
  108. * PXE specification of the form "...if a TFTP/MTFTP or UDP connection
  109. * is active...", you cannot use pxenv_tftp_open() and
  110. * pxenv_tftp_read() to read a file via MTFTP; only via plain old
  111. * TFTP. If you want to use MTFTP, use pxenv_tftp_read_file()
  112. * instead. Astute readers will note that, since
  113. * pxenv_tftp_read_file() is an atomic operation from the point of
  114. * view of the PXE API, it is conceptually impossible to issue any
  115. * other PXE API call "if an MTFTP connection is active".
  116. */
  117. PXENV_EXIT_t pxenv_tftp_open ( struct s_PXENV_TFTP_OPEN *tftp_open ) {
  118. char uri_string[PXE_URI_LEN];
  119. DBG ( "PXENV_TFTP_OPEN" );
  120. /* Guard against callers that fail to close before re-opening */
  121. close ( pxe_single_fd );
  122. pxe_single_fd = -1;
  123. /* Construct URI */
  124. pxe_tftp_build_uri ( uri_string, tftp_open->ServerIPAddress,
  125. tftp_open->TFTPPort, tftp_open->FileName,
  126. tftp_open->PacketSize );
  127. DBG ( " %s", uri_string );
  128. /* Open URI */
  129. pxe_single_fd = open ( uri_string );
  130. if ( pxe_single_fd < 0 ) {
  131. tftp_open->Status = PXENV_STATUS ( pxe_single_fd );
  132. return PXENV_EXIT_FAILURE;
  133. }
  134. /* Record parameters for later use */
  135. pxe_single_blksize = tftp_open->PacketSize;
  136. pxe_single_blkidx = 0;
  137. tftp_open->Status = PXENV_STATUS_SUCCESS;
  138. return PXENV_EXIT_SUCCESS;
  139. }
  140. /**
  141. * TFTP CLOSE
  142. *
  143. * @v tftp_close Pointer to a struct s_PXENV_TFTP_CLOSE
  144. * @ret #PXENV_EXIT_SUCCESS File was closed successfully
  145. * @ret #PXENV_EXIT_FAILURE File was not closed
  146. * @ret s_PXENV_TFTP_CLOSE::Status PXE status code
  147. * @err None -
  148. *
  149. * Close a connection previously opened with pxenv_tftp_open(). You
  150. * must have previously opened a connection with pxenv_tftp_open().
  151. *
  152. * On x86, you must set the s_PXE::StatusCallout field to a nonzero
  153. * value before calling this function in protected mode. You cannot
  154. * call this function with a 32-bit stack segment. (See the relevant
  155. * @ref pxe_x86_pmode16 "implementation note" for more details.)
  156. */
  157. PXENV_EXIT_t pxenv_tftp_close ( struct s_PXENV_TFTP_CLOSE *tftp_close ) {
  158. DBG ( "PXENV_TFTP_CLOSE" );
  159. close ( pxe_single_fd );
  160. pxe_single_fd = -1;
  161. tftp_close->Status = PXENV_STATUS_SUCCESS;
  162. return PXENV_EXIT_SUCCESS;
  163. }
  164. /**
  165. * TFTP READ
  166. *
  167. * @v tftp_read Pointer to a struct s_PXENV_TFTP_READ
  168. * @v s_PXENV_TFTP_READ::Buffer Address of data buffer
  169. * @ret #PXENV_EXIT_SUCCESS Data was read successfully
  170. * @ret #PXENV_EXIT_FAILURE Data was not read
  171. * @ret s_PXENV_TFTP_READ::Status PXE status code
  172. * @ret s_PXENV_TFTP_READ::PacketNumber TFTP packet number
  173. * @ret s_PXENV_TFTP_READ::BufferSize Length of data written into buffer
  174. *
  175. * Reads a single packet from a connection previously opened with
  176. * pxenv_tftp_open() into the data buffer pointed to by
  177. * s_PXENV_TFTP_READ::Buffer. You must have previously opened a
  178. * connection with pxenv_tftp_open(). The data written into
  179. * s_PXENV_TFTP_READ::Buffer is just the file data; the various
  180. * network headers have already been removed.
  181. *
  182. * The buffer must be large enough to contain a packet of the size
  183. * negotiated via the s_PXENV_TFTP_OPEN::PacketSize field in the
  184. * pxenv_tftp_open() call. It is worth noting that the PXE
  185. * specification does @b not require the caller to fill in
  186. * s_PXENV_TFTP_READ::BufferSize before calling pxenv_tftp_read(), so
  187. * the PXE stack is free to ignore whatever value the caller might
  188. * place there and just assume that the buffer is large enough. That
  189. * said, it may be worth the caller always filling in
  190. * s_PXENV_TFTP_READ::BufferSize to guard against PXE stacks that
  191. * mistake it for an input parameter.
  192. *
  193. * The length of the TFTP data packet will be returned via
  194. * s_PXENV_TFTP_READ::BufferSize. If this length is less than the
  195. * blksize negotiated via s_PXENV_TFTP_OPEN::PacketSize in the call to
  196. * pxenv_tftp_open(), this indicates that the block is the last block
  197. * in the file. Note that zero is a valid length for
  198. * s_PXENV_TFTP_READ::BufferSize, and will occur when the length of
  199. * the file is a multiple of the blksize.
  200. *
  201. * The PXE specification doesn't actually state that calls to
  202. * pxenv_tftp_read() will return the data packets in strict sequential
  203. * order, though most PXE stacks will probably do so. The sequence
  204. * number of the packet will be returned in
  205. * s_PXENV_TFTP_READ::PacketNumber. The first packet in the file has
  206. * a sequence number of one, not zero.
  207. *
  208. * To guard against flawed PXE stacks, the caller should probably set
  209. * s_PXENV_TFTP_READ::PacketNumber to one less than the expected
  210. * returned value (i.e. set it to zero for the first call to
  211. * pxenv_tftp_read() and then re-use the returned s_PXENV_TFTP_READ
  212. * parameter block for subsequent calls without modifying
  213. * s_PXENV_TFTP_READ::PacketNumber between calls). The caller should
  214. * also guard against potential problems caused by flawed
  215. * implementations returning the occasional duplicate packet, by
  216. * checking that the value returned in s_PXENV_TFTP_READ::PacketNumber
  217. * is as expected (i.e. one greater than that returned from the
  218. * previous call to pxenv_tftp_read()).
  219. *
  220. * On x86, you must set the s_PXE::StatusCallout field to a nonzero
  221. * value before calling this function in protected mode. You cannot
  222. * call this function with a 32-bit stack segment. (See the relevant
  223. * @ref pxe_x86_pmode16 "implementation note" for more details.)
  224. */
  225. PXENV_EXIT_t pxenv_tftp_read ( struct s_PXENV_TFTP_READ *tftp_read ) {
  226. userptr_t buffer;
  227. ssize_t len;
  228. DBG ( "PXENV_TFTP_READ to %04x:%04x",
  229. tftp_read->Buffer.segment, tftp_read->Buffer.offset );
  230. buffer = real_to_user ( tftp_read->Buffer.segment,
  231. tftp_read->Buffer.offset );
  232. len = read_user ( pxe_single_fd, buffer, 0, pxe_single_blksize );
  233. if ( len < 0 ) {
  234. tftp_read->Status = PXENV_STATUS ( len );
  235. return PXENV_EXIT_FAILURE;
  236. }
  237. tftp_read->BufferSize = len;
  238. tftp_read->PacketNumber = ++pxe_single_blkidx;
  239. tftp_read->Status = PXENV_STATUS_SUCCESS;
  240. return PXENV_EXIT_SUCCESS;
  241. }
  242. /**
  243. * TFTP/MTFTP read file
  244. *
  245. * @v tftp_read_file Pointer to a struct s_PXENV_TFTP_READ_FILE
  246. * @v s_PXENV_TFTP_READ_FILE::FileName File name
  247. * @v s_PXENV_TFTP_READ_FILE::BufferSize Size of the receive buffer
  248. * @v s_PXENV_TFTP_READ_FILE::Buffer Address of the receive buffer
  249. * @v s_PXENV_TFTP_READ_FILE::ServerIPAddress TFTP server IP address
  250. * @v s_PXENV_TFTP_READ_FILE::GatewayIPAddress Relay agent IP address
  251. * @v s_PXENV_TFTP_READ_FILE::McastIPAddress File's multicast IP address
  252. * @v s_PXENV_TFTP_READ_FILE::TFTPClntPort Client multicast UDP port
  253. * @v s_PXENV_TFTP_READ_FILE::TFTPSrvPort Server multicast UDP port
  254. * @v s_PXENV_TFTP_READ_FILE::TFTPOpenTimeOut Time to wait for first packet
  255. * @v s_PXENV_TFTP_READ_FILE::TFTPReopenDelay MTFTP inactivity timeout
  256. * @ret #PXENV_EXIT_SUCCESS File downloaded successfully
  257. * @ret #PXENV_EXIT_FAILURE File not downloaded
  258. * @ret s_PXENV_TFTP_READ_FILE::Status PXE status code
  259. * @ret s_PXENV_TFTP_READ_FILE::BufferSize Length of downloaded file
  260. *
  261. * Downloads an entire file via either TFTP or MTFTP into the buffer
  262. * pointed to by s_PXENV_TFTP_READ_FILE::Buffer.
  263. *
  264. * The PXE specification does not make it clear how the caller
  265. * requests that MTFTP be used rather than TFTP (or vice versa). One
  266. * reasonable guess is that setting
  267. * s_PXENV_TFTP_READ_FILE::McastIPAddress to 0.0.0.0 would cause TFTP
  268. * to be used instead of MTFTP, though it is conceivable that some PXE
  269. * stacks would interpret that as "use the DHCP-provided multicast IP
  270. * address" instead. Some PXE stacks will not implement MTFTP at all,
  271. * and will always use TFTP.
  272. *
  273. * It is not specified whether or not
  274. * s_PXENV_TFTP_READ_FILE::TFTPSrvPort will be used as the TFTP server
  275. * port for TFTP (rather than MTFTP) downloads. Callers should assume
  276. * that the only way to access a TFTP server on a non-standard port is
  277. * to use pxenv_tftp_open() and pxenv_tftp_read().
  278. *
  279. * If s_PXENV_TFTP_READ_FILE::GatewayIPAddress is 0.0.0.0, normal IP
  280. * routing will take place. See the relevant
  281. * @ref pxe_routing "implementation note" for more details.
  282. *
  283. * It is interesting to note that s_PXENV_TFTP_READ_FILE::Buffer is an
  284. * #ADDR32_t type, i.e. nominally a flat physical address. Some PXE
  285. * NBPs (e.g. NTLDR) are known to call pxenv_tftp_read_file() in real
  286. * mode with s_PXENV_TFTP_READ_FILE::Buffer set to an address above
  287. * 1MB. This means that PXE stacks must be prepared to write to areas
  288. * outside base memory. Exactly how this is to be achieved is not
  289. * specified, though using INT 15,87 is as close to a standard method
  290. * as any, and should probably be used. Switching to protected-mode
  291. * in order to access high memory will fail if pxenv_tftp_read_file()
  292. * is called in V86 mode; it is reasonably to expect that a V86
  293. * monitor would intercept the relatively well-defined INT 15,87 if it
  294. * wants the PXE stack to be able to write to high memory.
  295. *
  296. * Things get even more interesting if pxenv_tftp_read_file() is
  297. * called in protected mode, because there is then absolutely no way
  298. * for the PXE stack to write to an absolute physical address. You
  299. * can't even get around the problem by creating a special "access
  300. * everything" segment in the s_PXE data structure, because the
  301. * #SEGDESC_t descriptors are limited to 64kB in size.
  302. *
  303. * Previous versions of the PXE specification (e.g. WfM 1.1a) provide
  304. * a separate API call, %pxenv_tftp_read_file_pmode(), specifically to
  305. * work around this problem. The s_PXENV_TFTP_READ_FILE_PMODE
  306. * parameter block splits s_PXENV_TFTP_READ_FILE::Buffer into
  307. * s_PXENV_TFTP_READ_FILE_PMODE::BufferSelector and
  308. * s_PXENV_TFTP_READ_FILE_PMODE::BufferOffset, i.e. it provides a
  309. * protected-mode segment:offset address for the data buffer. This
  310. * API call is no longer present in version 2.1 of the PXE
  311. * specification.
  312. *
  313. * Etherboot makes the assumption that s_PXENV_TFTP_READ_FILE::Buffer
  314. * is an offset relative to the caller's data segment, when
  315. * pxenv_tftp_read_file() is called in protected mode.
  316. *
  317. * On x86, you must set the s_PXE::StatusCallout field to a nonzero
  318. * value before calling this function in protected mode. You cannot
  319. * call this function with a 32-bit stack segment. (See the relevant
  320. * @ref pxe_x86_pmode16 "implementation note" for more details.)
  321. *
  322. * @note Microsoft's NTLDR assumes that the filename passed in via
  323. * s_PXENV_TFTP_READ_FILE::FileName will be stored in the "file" field
  324. * of the stored DHCPACK packet, whence it will be returned via any
  325. * subsequent calls to pxenv_get_cached_info(). Though this is
  326. * essentially a bug in the Intel PXE implementation (not, for once,
  327. * in the specification!), it is a bug that Microsoft relies upon, and
  328. * so we implement this bug-for-bug compatibility by overwriting the
  329. * filename stored DHCPACK packet with the filename passed in
  330. * s_PXENV_TFTP_READ_FILE::FileName.
  331. *
  332. */
  333. PXENV_EXIT_t pxenv_tftp_read_file ( struct s_PXENV_TFTP_READ_FILE
  334. *tftp_read_file ) {
  335. char uri_string[PXE_URI_LEN];
  336. int fd;
  337. userptr_t buffer;
  338. size_t max_len;
  339. ssize_t frag_len;
  340. size_t len = 0;
  341. int rc = -ENOBUFS;
  342. DBG ( "PXENV_TFTP_READ_FILE" );
  343. /* Construct URI */
  344. pxe_tftp_build_uri ( uri_string, tftp_read_file->ServerIPAddress,
  345. tftp_read_file->TFTPSrvPort,
  346. tftp_read_file->FileName, 0 );
  347. DBG ( " %s", uri_string );
  348. DBG ( " to %08lx+%lx", tftp_read_file->Buffer,
  349. tftp_read_file->BufferSize );
  350. /* Open URI */
  351. fd = open ( uri_string );
  352. if ( fd < 0 ) {
  353. tftp_read_file->Status = PXENV_STATUS ( fd );
  354. return PXENV_EXIT_FAILURE;
  355. }
  356. /* Read file */
  357. buffer = phys_to_user ( tftp_read_file->Buffer );
  358. max_len = tftp_read_file->BufferSize;
  359. while ( max_len ) {
  360. frag_len = read_user ( fd, buffer, len, max_len );
  361. if ( frag_len <= 0 ) {
  362. rc = frag_len;
  363. break;
  364. }
  365. len += frag_len;
  366. max_len -= frag_len;
  367. }
  368. close ( fd );
  369. tftp_read_file->BufferSize = len;
  370. tftp_read_file->Status = PXENV_STATUS ( rc );
  371. return ( rc ? PXENV_EXIT_FAILURE : PXENV_EXIT_SUCCESS );
  372. }
  373. /**
  374. * TFTP GET FILE SIZE
  375. *
  376. * @v tftp_get_fsize Pointer to a struct s_PXENV_TFTP_GET_FSIZE
  377. * @v s_PXENV_TFTP_GET_FSIZE::ServerIPAddress TFTP server IP address
  378. * @v s_PXENV_TFTP_GET_FSIZE::GatewayIPAddress Relay agent IP address
  379. * @v s_PXENV_TFTP_GET_FSIZE::FileName File name
  380. * @ret #PXENV_EXIT_SUCCESS File size was determined successfully
  381. * @ret #PXENV_EXIT_FAILURE File size was not determined
  382. * @ret s_PXENV_TFTP_GET_FSIZE::Status PXE status code
  383. * @ret s_PXENV_TFTP_GET_FSIZE::FileSize File size
  384. *
  385. * Determine the size of a file on a TFTP server. This uses the
  386. * "tsize" TFTP option, and so will not work with a TFTP server that
  387. * does not support TFTP options, or that does not support the "tsize"
  388. * option.
  389. *
  390. * The PXE specification states that this API call will @b not open a
  391. * TFTP connection for subsequent use with pxenv_tftp_read(). (This
  392. * is somewhat daft, since the only way to obtain the file size via
  393. * the "tsize" option involves issuing a TFTP open request, but that's
  394. * life.)
  395. *
  396. * You cannot call pxenv_tftp_get_fsize() while a TFTP or UDP
  397. * connection is open.
  398. *
  399. * If s_PXENV_TFTP_GET_FSIZE::GatewayIPAddress is 0.0.0.0, normal IP
  400. * routing will take place. See the relevant
  401. * @ref pxe_routing "implementation note" for more details.
  402. *
  403. * On x86, you must set the s_PXE::StatusCallout field to a nonzero
  404. * value before calling this function in protected mode. You cannot
  405. * call this function with a 32-bit stack segment. (See the relevant
  406. * @ref pxe_x86_pmode16 "implementation note" for more details.)
  407. *
  408. * @note There is no way to specify the TFTP server port with this API
  409. * call. Though you can open a file using a non-standard TFTP server
  410. * port (via s_PXENV_TFTP_OPEN::TFTPPort or, potentially,
  411. * s_PXENV_TFTP_READ_FILE::TFTPSrvPort), you can only get the size of
  412. * a file from a TFTP server listening on the standard TFTP port.
  413. * "Consistency" is not a word in Intel's vocabulary.
  414. */
  415. PXENV_EXIT_t pxenv_tftp_get_fsize ( struct s_PXENV_TFTP_GET_FSIZE
  416. *tftp_get_fsize ) {
  417. char uri_string[PXE_URI_LEN];
  418. int fd;
  419. ssize_t size;
  420. DBG ( "PXENV_TFTP_GET_FSIZE" );
  421. /* Construct URI */
  422. pxe_tftp_build_uri ( uri_string, tftp_get_fsize->ServerIPAddress,
  423. 0, tftp_get_fsize->FileName, 0 );
  424. DBG ( " %s", uri_string );
  425. /* Open URI */
  426. fd = open ( uri_string );
  427. if ( fd < 0 ) {
  428. tftp_get_fsize->Status = PXENV_STATUS ( fd );
  429. return PXENV_EXIT_FAILURE;
  430. }
  431. /* Determine size */
  432. size = fsize ( fd );
  433. close ( fd );
  434. if ( size < 0 ) {
  435. tftp_get_fsize->Status = PXENV_STATUS ( size );
  436. return PXENV_EXIT_FAILURE;
  437. }
  438. tftp_get_fsize->FileSize = size;
  439. tftp_get_fsize->Status = PXENV_STATUS_SUCCESS;
  440. return PXENV_EXIT_SUCCESS;
  441. }