Import ArpDxe, Dhcp4Dxe, Ip4Dxe, Mtftp4Dxe, PxeBcDxe and PxeDhcp4Dxe.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3492 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -118,11 +118,11 @@ Tcp4GetMode (
|
||||
|
||||
AccessPoint->UseDefaultAddress = Tcb->UseDefaultAddr;
|
||||
|
||||
EFI_IP4 (AccessPoint->StationAddress) = Tcb->LocalEnd.Ip;
|
||||
NetCopyMem (&AccessPoint->StationAddress, &Tcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
|
||||
AccessPoint->SubnetMask = Tcb->SubnetMask;
|
||||
AccessPoint->StationPort = NTOHS (Tcb->LocalEnd.Port);
|
||||
|
||||
EFI_IP4 (AccessPoint->RemoteAddress) = Tcb->RemoteEnd.Ip;
|
||||
NetCopyMem (&AccessPoint->RemoteAddress, &Tcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
|
||||
AccessPoint->RemotePort = NTOHS (Tcb->RemoteEnd.Port);
|
||||
AccessPoint->ActiveFlag = (BOOLEAN) (Tcb->State != TCP_LISTEN);
|
||||
|
||||
@@ -428,11 +428,11 @@ Tcp4ConfigurePcb (
|
||||
Tcb->TTL = CfgData->TimeToLive;
|
||||
Tcb->TOS = CfgData->TypeOfService;
|
||||
|
||||
Tcb->LocalEnd.Ip = EFI_IP4 (CfgData->AccessPoint.StationAddress);
|
||||
NetCopyMem (&Tcb->LocalEnd.Ip, &CfgData->AccessPoint.StationAddress, sizeof (IP4_ADDR));
|
||||
Tcb->LocalEnd.Port = HTONS (CfgData->AccessPoint.StationPort);
|
||||
Tcb->SubnetMask = CfgData->AccessPoint.SubnetMask;
|
||||
|
||||
Tcb->RemoteEnd.Ip = EFI_IP4 (CfgData->AccessPoint.RemoteAddress);
|
||||
NetCopyMem (&Tcb->RemoteEnd.Ip, &CfgData->AccessPoint.RemoteAddress, sizeof (IP4_ADDR));
|
||||
Tcb->RemoteEnd.Port = HTONS (CfgData->AccessPoint.RemotePort);
|
||||
|
||||
Option = CfgData->ControlOption;
|
||||
|
@@ -143,7 +143,6 @@ Tcp4DestroyTimer (
|
||||
mTcp4Timer.TimerEvent = NULL;
|
||||
}
|
||||
|
||||
//@MT: EFI_DRIVER_ENTRY_POINT (Tcp4DriverEntryPoint)
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
|
@@ -103,8 +103,8 @@ TcpSendIpPacket (
|
||||
Override.TimeToLive = 255;
|
||||
Override.DoNotFragment = FALSE;
|
||||
Override.Protocol = EFI_IP_PROTO_TCP;
|
||||
EFI_IP4 (Override.GatewayAddress) = 0;
|
||||
EFI_IP4 (Override.SourceAddress) = Src;
|
||||
NetZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
|
||||
NetCopyMem (&Override.SourceAddress, &Src, sizeof (EFI_IPv4_ADDRESS));
|
||||
|
||||
Status = IpIoSend (IpIo, Nbuf, IpSender, NULL, NULL, Dest, &Override);
|
||||
|
||||
|
@@ -144,6 +144,7 @@ Tcp4Configure (
|
||||
EFI_TCP4_OPTION *Option;
|
||||
SOCKET *Sock;
|
||||
EFI_STATUS Status;
|
||||
IP4_ADDR Ip;
|
||||
|
||||
if (NULL == This) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
@@ -153,26 +154,25 @@ Tcp4Configure (
|
||||
// Tcp protocol related parameter check will be conducted here
|
||||
//
|
||||
if (NULL != TcpConfigData) {
|
||||
if ((EFI_IP4 (TcpConfigData->AccessPoint.RemoteAddress) != 0) &&
|
||||
!Ip4IsUnicast (EFI_NTOHL (TcpConfigData->AccessPoint.RemoteAddress), 0)) {
|
||||
|
||||
NetCopyMem (&Ip, &TcpConfigData->AccessPoint.RemoteAddress, sizeof (IP4_ADDR));
|
||||
if ((Ip != 0) && !Ip4IsUnicast (NTOHL (Ip), 0)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (TcpConfigData->AccessPoint.ActiveFlag &&
|
||||
(0 == TcpConfigData->AccessPoint.RemotePort || (Ip == 0))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (!TcpConfigData->AccessPoint.UseDefaultAddress) {
|
||||
if (!Ip4IsUnicast (EFI_NTOHL (TcpConfigData->AccessPoint.StationAddress), 0) ||
|
||||
!IP4_IS_VALID_NETMASK (EFI_NTOHL (TcpConfigData->AccessPoint.SubnetMask))
|
||||
) {
|
||||
|
||||
NetCopyMem (&Ip, &TcpConfigData->AccessPoint.StationAddress, sizeof (IP4_ADDR));
|
||||
if (!Ip4IsUnicast (NTOHL (Ip), 0) || !IP4_IS_VALID_NETMASK (NTOHL (Ip))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
if (TcpConfigData->AccessPoint.ActiveFlag &&
|
||||
(0 == TcpConfigData->AccessPoint.RemotePort ||
|
||||
(EFI_IP4 (TcpConfigData->AccessPoint.RemoteAddress) == 0))
|
||||
) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
Option = TcpConfigData->ControlOption;
|
||||
if ((NULL != Option) &&
|
||||
(Option->EnableSelectiveAck || Option->EnablePathMtuDiscovery)) {
|
||||
|
@@ -32,7 +32,6 @@ extern UINT16 mTcp4RandomPort;
|
||||
//
|
||||
// Driver Produced Protocol Prototypes
|
||||
//
|
||||
//@MT:#include EFI_PROTOCOL_PRODUCER (Tcp4)
|
||||
|
||||
#define TCP4_DEBUG_ERROR(PrintArg) NET_DEBUG_ERROR ("Tcp", PrintArg)
|
||||
#define TCP4_DEBUG_WARN(PrintArg) NET_DEBUG_WARNING ("Tcp", PrintArg)
|
||||
|
@@ -267,7 +267,7 @@ TcpFindTcbByPeer (
|
||||
NET_LIST_FOR_EACH (Entry, &mTcpListenQue) {
|
||||
Tcb = NET_LIST_USER_STRUCT (Entry, TCP_CB, List);
|
||||
|
||||
if ((EFI_IP4 (*Addr) == Tcb->LocalEnd.Ip) &&
|
||||
if (EFI_IP4_EQUAL (*Addr, Tcb->LocalEnd.Ip) &&
|
||||
(LocalPort == Tcb->LocalEnd.Port)) {
|
||||
|
||||
return TRUE;
|
||||
@@ -277,7 +277,7 @@ TcpFindTcbByPeer (
|
||||
NET_LIST_FOR_EACH (Entry, &mTcpRunQue) {
|
||||
Tcb = NET_LIST_USER_STRUCT (Entry, TCP_CB, List);
|
||||
|
||||
if (((EFI_IP4 (*Addr) == Tcb->LocalEnd.Ip)) &&
|
||||
if (EFI_IP4_EQUAL (*Addr, Tcb->LocalEnd.Ip) &&
|
||||
(LocalPort == Tcb->LocalEnd.Port)) {
|
||||
|
||||
return TRUE;
|
||||
@@ -983,9 +983,9 @@ TcpSetVariableData (
|
||||
// This tcp instance belongs to the Tcp4Service.
|
||||
//
|
||||
Tcp4ServicePoint->InstanceHandle = TcpPcb->Sk->SockHandle;
|
||||
EFI_IP4 (Tcp4ServicePoint->LocalAddress) = TcpPcb->LocalEnd.Ip;
|
||||
NetCopyMem (&Tcp4ServicePoint->LocalAddress, &TcpPcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
|
||||
Tcp4ServicePoint->LocalPort = NTOHS (TcpPcb->LocalEnd.Port);
|
||||
EFI_IP4 (Tcp4ServicePoint->RemoteAddress) = TcpPcb->RemoteEnd.Ip;
|
||||
NetCopyMem (&Tcp4ServicePoint->RemoteAddress, &TcpPcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
|
||||
Tcp4ServicePoint->RemotePort = NTOHS (TcpPcb->RemoteEnd.Port);
|
||||
|
||||
Tcp4ServicePoint++;
|
||||
@@ -1005,9 +1005,9 @@ TcpSetVariableData (
|
||||
// This tcp instance belongs to the Tcp4Service.
|
||||
//
|
||||
Tcp4ServicePoint->InstanceHandle = TcpPcb->Sk->SockHandle;
|
||||
EFI_IP4 (Tcp4ServicePoint->LocalAddress) = TcpPcb->LocalEnd.Ip;
|
||||
NetCopyMem (&Tcp4ServicePoint->LocalAddress, &TcpPcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
|
||||
Tcp4ServicePoint->LocalPort = NTOHS (TcpPcb->LocalEnd.Port);
|
||||
EFI_IP4 (Tcp4ServicePoint->RemoteAddress) = TcpPcb->RemoteEnd.Ip;
|
||||
NetCopyMem (&Tcp4ServicePoint->RemoteAddress, &TcpPcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));
|
||||
Tcp4ServicePoint->RemotePort = NTOHS (TcpPcb->RemoteEnd.Port);
|
||||
|
||||
Tcp4ServicePoint++;
|
||||
|
Reference in New Issue
Block a user