Data Structures | |
| struct | s_PXENV_TFTP_GET_FSIZE |
| Parameter block for pxenv_tftp_get_fsize(). More... | |
Defines | |
| #define | PXENV_TFTP_GET_FSIZE 0x0025 |
| PXE API function code for pxenv_tftp_get_fsize(). | |
Typedefs | |
| typedef struct s_PXENV_TFTP_GET_FSIZE | PXENV_TFTP_GET_FSIZE_t |
Functions | |
| PXENV_EXIT_t | pxenv_tftp_get_fsize (struct s_PXENV_TFTP_GET_FSIZE *get_fsize) |
| TFTP GET FILE SIZE. | |
| #define PXENV_TFTP_GET_FSIZE 0x0025 |
PXE API function code for pxenv_tftp_get_fsize().
Definition at line 706 of file pxe_api.h.
Referenced by pxe_api_call().
| typedef struct s_PXENV_TFTP_GET_FSIZE PXENV_TFTP_GET_FSIZE_t |
| PXENV_EXIT_t pxenv_tftp_get_fsize | ( | struct s_PXENV_TFTP_GET_FSIZE * | tftp_get_fsize | ) |
TFTP GET FILE SIZE.
| tftp_get_fsize | Pointer to a struct s_PXENV_TFTP_GET_FSIZE | |
| s_PXENV_TFTP_GET_FSIZE::ServerIPAddress | TFTP server IP address | |
| s_PXENV_TFTP_GET_FSIZE::GatewayIPAddress | Relay agent IP address | |
| s_PXENV_TFTP_GET_FSIZE::FileName | File name |
| PXENV_EXIT_SUCCESS | File size was determined successfully | |
| PXENV_EXIT_FAILURE | File size was not determined | |
| s_PXENV_TFTP_GET_FSIZE::Status | PXE status code | |
| s_PXENV_TFTP_GET_FSIZE::FileSize | File size |
The PXE specification states that this API call will not open a TFTP connection for subsequent use with pxenv_tftp_read(). (This is somewhat daft, since the only way to obtain the file size via the "tsize" option involves issuing a TFTP open request, but that's life.)
You cannot call pxenv_tftp_get_fsize() while a TFTP or UDP connection is open.
If s_PXENV_TFTP_GET_FSIZE::GatewayIPAddress is 0.0.0.0, normal IP routing will take place. See the relevant implementation note for more details.
On x86, you must set the s_PXE::StatusCallout field to a nonzero value before calling this function in protected mode. You cannot call this function with a 32-bit stack segment. (See the relevant implementation note for more details.)
Definition at line 542 of file pxe_tftp.c.
References DBG, EINPROGRESS, s_PXENV_TFTP_GET_FSIZE::FileName, s_PXENV_TFTP_GET_FSIZE::FileSize, pxe_tftp_connection::max_offset, pxe_tftp_close(), pxe_tftp_open(), PXENV_EXIT_FAILURE, PXENV_EXIT_SUCCESS, PXENV_STATUS, pxe_tftp_connection::rc, s_PXENV_TFTP_GET_FSIZE::ServerIPAddress, s_PXENV_TFTP_GET_FSIZE::Status, and step().
Referenced by pxe_api_call().
00543 { 00544 int rc; 00545 00546 DBG ( "PXENV_TFTP_GET_FSIZE" ); 00547 00548 /* Open TFTP file */ 00549 if ( ( rc = pxe_tftp_open ( tftp_get_fsize->ServerIPAddress, 0, 00550 tftp_get_fsize->FileName, 0, 1 ) ) != 0 ) { 00551 tftp_get_fsize->Status = PXENV_STATUS ( rc ); 00552 return PXENV_EXIT_FAILURE; 00553 } 00554 00555 /* Wait for initial seek to arrive, and record size */ 00556 while ( ( ( rc = pxe_tftp.rc ) == -EINPROGRESS ) && 00557 ( pxe_tftp.max_offset == 0 ) ) { 00558 step(); 00559 } 00560 tftp_get_fsize->FileSize = pxe_tftp.max_offset; 00561 DBG ( " fsize=%d", tftp_get_fsize->FileSize ); 00562 00563 /* EINPROGRESS is normal; we don't wait for the whole transfer */ 00564 if ( rc == -EINPROGRESS ) 00565 rc = 0; 00566 00567 /* Close TFTP file */ 00568 pxe_tftp_close ( rc ); 00569 00570 tftp_get_fsize->Status = PXENV_STATUS ( rc ); 00571 return ( rc ? PXENV_EXIT_FAILURE : PXENV_EXIT_SUCCESS ); 00572 }
1.5.7.1