Lines Matching refs:pContext

45   TSDT_CONNECTION_CONTEXT * pContext;
57 LengthInBytes = sizeof ( *pContext );
60 (VOID **)&pContext );
65 pContext = NULL;
72 ZeroMem ( pContext, LengthInBytes );
73 CopyMem ( &pContext->RemoteAddress,
75 sizeof ( pContext->RemoteAddress ));
76 pContext->BlockSize = TFTP_MAX_BLOCK_SIZE;
77 pContext->pBuffer = &pContext->FileData[0];
78 pContext->pEnd = &pContext->pBuffer[sizeof ( pContext->pBuffer )];
79 pContext->MaxTransferSize = 0;
80 pContext->MaxTransferSize -= 1;
87 pContext,
88 (UINT8)pContext->RemoteAddress.sin_addr.s_addr,
89 (UINT8)( pContext->RemoteAddress.sin_addr.s_addr >> 8 ),
90 (UINT8)( pContext->RemoteAddress.sin_addr.s_addr >> 16 ),
91 (UINT8)( pContext->RemoteAddress.sin_addr.s_addr >> 24 ),
92 htons ( pContext->RemoteAddress.sin_port )));
97 pContext->pNext = pTftpServer->pContextList;
98 pTftpServer->pContextList = pContext;
109 DBG_EXIT_STATUS ( pContext );
110 return pContext;
131 TSDT_CONNECTION_CONTEXT * pContext;
138 pContext = pTftpServer->pContextList;
139 while ( NULL != pContext ) {
143 if (( pTftpServer->RemoteAddress.sin_addr.s_addr == pContext->RemoteAddress.sin_addr.s_addr )
144 && ( pTftpServer->RemoteAddress.sin_port == pContext->RemoteAddress.sin_port )) {
149 "0x%08x: pContext found\r\n",
150 pContext ));
157 pContext = pContext->pNext;
163 DBG_EXIT_HEX ( pContext );
164 return pContext;
173 @param [in] pContext The context structure address.
179 IN TSDT_CONNECTION_CONTEXT * pContext
196 if ( pNextContext == pContext ) {
201 pTftpServer->pContextList = pContext->pNext;
204 pPreviousContext->pNext = pContext->pNext;
219 if ( NULL != pContext ) {
223 gBS->FreePool ( pContext );
241 TSDT_CONNECTION_CONTEXT * pContext;
276 pContext = ContextFind ( pTftpServer );
281 TftpProcessRequest ( pTftpServer, pContext );
542 @param [in] pContext The context structure address.
549 IN TSDT_CONNECTION_CONTEXT * pContext,
566 pOack = &pContext->TxBuffer[0];
569 pContext->TxBytes = 2;
609 pContext->BlockSize = Value;
612 pContext->BlockSize ));
626 pOack = TftpOptionSet ( pOack, pContext->BlockSize );
628 pContext->TxBytes += pOack - pTemp;
647 pContext->Timeout = Value;
650 pContext->Timeout ));
664 pOack = TftpOptionSet ( pOack, pContext->Timeout );
666 pContext->TxBytes += pOack - pTemp;
687 pContext->LengthInBytes ));
699 pOack = TftpOptionSet ( pOack, pContext->LengthInBytes );
701 pContext->TxBytes += pOack - pTemp;
785 @param [in] pContext Connection context structure address
791 IN TSDT_CONNECTION_CONTEXT * pContext
831 if ( NULL == pContext ) {
842 if ( pContext->bExpectAck ) {
844 "ERROR - Expecting ACKs not data for pContext 0x%08x\r\n",
845 pContext ));
849 if ( pTftpServer->RxBytes > (ssize_t)( pContext->BlockSize + 2 + 2 )) {
851 "ERROR - Receive data length of %d > %d bytes (maximum block size) for pContext 0x%08x\r\n",
853 pContext->BlockSize,
854 pContext ));
861 if ( NULL == pContext ) {
871 if ( !pContext->bExpectAck ) {
873 "ERROR - Expecting data not ACKs for pContext 0x%08x\r\n",
874 pContext ));
881 if ( NULL == pContext ) {
909 if ( NULL != pContext ) {
910 ContextRemove ( pTftpServer, pContext );
916 pContext = ContextAdd ( pTftpServer );
917 if ( NULL == pContext ) {
940 pContext,
967 pContext,
992 pContext,
1002 pContext->File = (EFI_HANDLE)1;
1012 TftpOptions ( pContext, pOption, pEnd );
1021 pContext->bExpectAck = TRUE;
1022 if ( 2 < pContext->TxBytes ) {
1026 Status = TftpTxPacket ( pTftpServer, pContext );
1032 Status = TftpSendNextBlock ( pTftpServer, pContext );
1050 if (( !pContext->bExpectAck )
1051 || ( BlockNumber != pContext->AckNext )) {
1054 pContext->AckNext,
1061 if ( pContext->bEofSent ) {
1068 pContext->AckNext += 1;
1073 Status = TftpSendNextBlock ( pTftpServer, pContext );
1084 ContextRemove ( pTftpServer, pContext );
1095 @param [in] pContext The context structure address.
1105 IN TSDT_CONNECTION_CONTEXT * pContext,
1119 pBuffer = &pContext->TxBuffer[0];
1137 pContext->TxBytes = pBuffer - &pContext->TxBuffer[0];
1138 Status = TftpTxPacket ( pTftpServer, pContext );
1152 @param [in] pContext The context structure address.
1160 IN TSDT_CONNECTION_CONTEXT * pContext
1170 LengthInBytes = pContext->BlockSize;
1171 if (( pContext->LengthInBytes < TFTP_MAX_BLOCK_SIZE )
1172 || ( LengthInBytes > (ssize_t)pContext->LengthInBytes )) {
1173 LengthInBytes = (ssize_t)pContext->LengthInBytes;
1174 pContext->bEofSent = TRUE;
1180 pBuffer = &pContext->TxBuffer[0];
1183 *pBuffer++ = (UINT8)( pContext->AckNext >> 8 );
1184 *pBuffer++ = (UINT8)pContext->AckNext;
1189 pContext->TxBytes = 2 + 2 + LengthInBytes;
1192 pContext->pBuffer,
1199 Status = TftpTxPacket ( pTftpServer, pContext );
1405 @param [in] pContext The context structure address.
1413 IN TSDT_CONNECTION_CONTEXT * pContext
1430 "0x%08x: pContext sending 0x%08x bytes\r\n",
1431 pContext,
1432 pContext->TxBytes ));
1434 &pContext->TxBuffer[0],
1435 pContext->TxBytes,
1437 (struct sockaddr *)&pContext->RemoteAddress,
1438 pContext->RemoteAddress.sin_len );