EFI_PXE_BASE_CODE_PROTOCOL has interface to set the TTL and ToS value, but
not used by the UdpWrite() interface. The code always use a hard coded 16
for the TTL and 0 for ToS.
This patch update the UpdWrite() to use the TTL and ToS which have been set
by the SetParameters().
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-By: Samer El-Haj-Mahmoud <elhaj@hpe.com>
/** @file\r
This implementation of EFI_PXE_BASE_CODE_PROTOCOL and EFI_LOAD_FILE_PROTOCOL.\r
\r
/** @file\r
This implementation of EFI_PXE_BASE_CODE_PROTOCOL and EFI_LOAD_FILE_PROTOCOL.\r
\r
- Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
&Private->SubnetMask.v4,\r
&Private->GatewayIp.v4,\r
&Private->CurSrcPort,\r
&Private->SubnetMask.v4,\r
&Private->GatewayIp.v4,\r
&Private->CurSrcPort,\r
+ DoNotFragment,\r
+ Private->Mode.TTL,\r
+ Private->Mode.ToS\r
/** @file\r
Support functions implementation for UefiPxeBc Driver.\r
\r
/** @file\r
Support functions implementation for UefiPxeBc Driver.\r
\r
- Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
@param[in, out] SrcPort The pointer to the source port.\r
@param[in] DoNotFragment If TRUE, fragment is not enabled.\r
Otherwise, fragment is enabled.\r
@param[in, out] SrcPort The pointer to the source port.\r
@param[in] DoNotFragment If TRUE, fragment is not enabled.\r
Otherwise, fragment is enabled.\r
+ @param[in] TTL The time to live field of the IP header. \r
+ @param[in] ToS The type of service field of the IP header.\r
\r
@retval EFI_SUCCESS Successfully configured this instance.\r
@retval Others Failed to configure this instance.\r
\r
@retval EFI_SUCCESS Successfully configured this instance.\r
@retval Others Failed to configure this instance.\r
IN EFI_IPv4_ADDRESS *SubnetMask,\r
IN EFI_IPv4_ADDRESS *Gateway,\r
IN OUT UINT16 *SrcPort,\r
IN EFI_IPv4_ADDRESS *SubnetMask,\r
IN EFI_IPv4_ADDRESS *Gateway,\r
IN OUT UINT16 *SrcPort,\r
- IN BOOLEAN DoNotFragment\r
+ IN BOOLEAN DoNotFragment,\r
+ IN UINT8 TTL,\r
+ IN UINT8 ToS\r
)\r
{\r
EFI_UDP4_CONFIG_DATA Udp4CfgData;\r
)\r
{\r
EFI_UDP4_CONFIG_DATA Udp4CfgData;\r
\r
Udp4CfgData.TransmitTimeout = PXEBC_DEFAULT_LIFETIME;\r
Udp4CfgData.ReceiveTimeout = PXEBC_DEFAULT_LIFETIME;\r
\r
Udp4CfgData.TransmitTimeout = PXEBC_DEFAULT_LIFETIME;\r
Udp4CfgData.ReceiveTimeout = PXEBC_DEFAULT_LIFETIME;\r
- Udp4CfgData.TypeOfService = DEFAULT_ToS;\r
- Udp4CfgData.TimeToLive = DEFAULT_TTL;\r
+ Udp4CfgData.TypeOfService = ToS;\r
+ Udp4CfgData.TimeToLive = TTL;\r
Udp4CfgData.AllowDuplicatePort = TRUE;\r
Udp4CfgData.DoNotFragment = DoNotFragment;\r
\r
Udp4CfgData.AllowDuplicatePort = TRUE;\r
Udp4CfgData.DoNotFragment = DoNotFragment;\r
\r
/** @file\r
Support functions declaration for UefiPxeBc Driver.\r
\r
/** @file\r
Support functions declaration for UefiPxeBc Driver.\r
\r
- Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
/**\r
This function is to configure a UDPv4 instance for UdpWrite.\r
\r
/**\r
This function is to configure a UDPv4 instance for UdpWrite.\r
\r
- @param[in] Udp4 Pointer to EFI_UDP4_PROTOCOL.\r
- @param[in] StationIp Pointer to the station address.\r
- @param[in] SubnetMask Pointer to the subnet mask.\r
- @param[in] Gateway Pointer to the gateway address.\r
- @param[in, out] SrcPort Pointer to the source port.\r
- @param[in] DoNotFragment The flag of DoNotFragment bit in the IPv4\r
- packet.\r
+ @param[in] Udp4 The pointer to EFI_UDP4_PROTOCOL.\r
+ @param[in] StationIp The pointer to the station address.\r
+ @param[in] SubnetMask The pointer to the subnet mask.\r
+ @param[in] Gateway The pointer to the gateway address.\r
+ @param[in, out] SrcPort The pointer to the source port.\r
+ @param[in] DoNotFragment If TRUE, fragment is not enabled.\r
+ Otherwise, fragment is enabled.\r
+ @param[in] TTL The time to live field of the IP header. \r
+ @param[in] ToS The type of service field of the IP header.\r
\r
@retval EFI_SUCCESS Successfully configured this instance.\r
@retval Others Failed to configure this instance.\r
\r
@retval EFI_SUCCESS Successfully configured this instance.\r
@retval Others Failed to configure this instance.\r
IN EFI_IPv4_ADDRESS *SubnetMask,\r
IN EFI_IPv4_ADDRESS *Gateway,\r
IN OUT UINT16 *SrcPort,\r
IN EFI_IPv4_ADDRESS *SubnetMask,\r
IN EFI_IPv4_ADDRESS *Gateway,\r
IN OUT UINT16 *SrcPort,\r
- IN BOOLEAN DoNotFragment\r
+ IN BOOLEAN DoNotFragment,\r
+ IN UINT8 TTL,\r
+ IN UINT8 ToS\r