\r
if (CompletionEvent == NULL) {\r
while (DhcpSb->IoStatus == EFI_ALREADY_STARTED) {\r
- DhcpSb->UdpIo->Udp->Poll (DhcpSb->UdpIo->Udp);\r
+ DhcpSb->UdpIo->Protocol.Udp4->Poll (DhcpSb->UdpIo->Protocol.Udp4);\r
}\r
\r
return DhcpSb->IoStatus;\r
\r
if (CompletionEvent == NULL) {\r
while (DhcpSb->IoStatus == EFI_ALREADY_STARTED) {\r
- DhcpSb->UdpIo->Udp->Poll (DhcpSb->UdpIo->Udp);\r
+ DhcpSb->UdpIo->Protocol.Udp4->Poll (DhcpSb->UdpIo->Protocol.Udp4);\r
+\r
}\r
\r
return DhcpSb->IoStatus;\r
**/\r
EFI_STATUS\r
Dhcp4InstanceConfigUdpIo (\r
- IN UDP_IO_PORT *UdpIo,\r
+ IN UDP_IO *UdpIo,\r
IN VOID *Context\r
)\r
{\r
UdpConfigData.StationPort = Token->ListenPoints[0].ListenPort;\r
}\r
\r
- return UdpIo->Udp->Configure (UdpIo->Udp, &UdpConfigData);\r
+ return UdpIo->Protocol.Udp4->Configure (UdpIo->Protocol.Udp4, &UdpConfigData);\r
}\r
\r
/**\r
ASSERT (Instance->Token != NULL);\r
\r
DhcpSb = Instance->Service;\r
- Instance->UdpIo = UdpIoCreatePort (DhcpSb->Controller, DhcpSb->Image, Dhcp4InstanceConfigUdpIo, Instance);\r
+ Instance->UdpIo = UdpIoCreateIo (\r
+ DhcpSb->Controller,\r
+ DhcpSb->Image,\r
+ Dhcp4InstanceConfigUdpIo,\r
+ UDP_IO_UDP4_VERSION,\r
+ Instance\r
+ );\r
if (Instance->UdpIo == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
} else {\r
sent out. The packet will be queued to the response queue.\r
\r
@param UdpPacket The Dhcp4 packet.\r
- @param Points Udp4 address pair.\r
+ @param EndPoint Udp4 address pair.\r
@param IoStatus Status of the input.\r
@param Context Extra info for the input.\r
\r
VOID\r
PxeDhcpInput (\r
NET_BUF *UdpPacket,\r
- UDP_POINTS *Points,\r
+ UDP_END_POINT *EndPoint,\r
EFI_STATUS IoStatus,\r
VOID *Context\r
)\r
// Clean up the resources dedicated for this transmit receive transaction.\r
//\r
NetbufQueFlush (&Instance->ResponseQueue);\r
- UdpIoCleanPort (Instance->UdpIo);\r
- UdpIoFreePort (Instance->UdpIo);\r
+ UdpIoCleanIo (Instance->UdpIo);\r
+ UdpIoFreeIo (Instance->UdpIo);\r
Instance->UdpIo = NULL;\r
Instance->Token = NULL;\r
\r
EFI_STATUS Status;\r
NET_FRAGMENT Frag;\r
NET_BUF *Wrap;\r
- UDP_POINTS EndPoint;\r
+ UDP_END_POINT EndPoint;\r
IP4_ADDR Ip;\r
DHCP_SERVICE *DhcpSb;\r
- IP4_ADDR Gateway;\r
+ EFI_IP_ADDRESS Gateway;\r
IP4_ADDR SubnetMask;\r
\r
if ((This == NULL) || (Token == NULL) || (Token->Packet == NULL)) {\r
}\r
\r
//\r
- // Set the local address and local port.\r
+ // Set the local address and local port to ZERO.\r
//\r
- EndPoint.LocalAddr = 0;\r
- EndPoint.LocalPort = 0;\r
+ ZeroMem (&EndPoint, sizeof (UDP_END_POINT));\r
\r
//\r
// Set the destination address and destination port.\r
//\r
CopyMem (&Ip, &Token->RemoteAddress, sizeof (EFI_IPv4_ADDRESS));\r
- EndPoint.RemoteAddr = NTOHL (Ip);\r
+ EndPoint.RemoteAddr.Addr[0] = NTOHL (Ip);\r
\r
if (Token->RemotePort == 0) {\r
EndPoint.RemotePort = DHCP_SERVER_PORT;\r
// Get the gateway.\r
//\r
SubnetMask = DhcpSb->Netmask;\r
- Gateway = 0;\r
- if (!IP4_NET_EQUAL (DhcpSb->ClientAddr, EndPoint.RemoteAddr, SubnetMask)) {\r
- CopyMem (&Gateway, &Token->GatewayAddress, sizeof (EFI_IPv4_ADDRESS));\r
- Gateway = NTOHL (Gateway);\r
+ ZeroMem (&Gateway, sizeof (Gateway));\r
+ if (!IP4_NET_EQUAL (DhcpSb->ClientAddr, EndPoint.RemoteAddr.Addr[0], SubnetMask)) {\r
+ CopyMem (&Gateway.v4, &Token->GatewayAddress, sizeof (EFI_IPv4_ADDRESS));\r
+ Gateway.Addr[0] = NTOHL (Gateway.Addr[0]);\r
}\r
\r
//\r
// Transmit the DHCP packet.\r
//\r
- Status = UdpIoSendDatagram (Instance->UdpIo, Wrap, &EndPoint, Gateway, DhcpOnPacketSent, NULL);\r
+ Status = UdpIoSendDatagram (Instance->UdpIo, Wrap, &EndPoint, &Gateway, DhcpOnPacketSent, NULL);\r
if (EFI_ERROR (Status)) {\r
NetbufFree (Wrap);\r
goto ON_ERROR;\r
ON_ERROR:\r
\r
if (EFI_ERROR (Status) && (Instance->UdpIo != NULL)) {\r
- UdpIoCleanPort (Instance->UdpIo);\r
- UdpIoFreePort (Instance->UdpIo);\r
+ UdpIoCleanIo (Instance->UdpIo);\r
+ UdpIoFreeIo (Instance->UdpIo);\r
Instance->UdpIo = NULL;\r
Instance->Token = NULL;\r
}\r
// free it when timeout.\r
//\r
if (Instance->Timeout > 0) {\r
- Instance->UdpIo->Udp->Poll (Instance->UdpIo->Udp);\r
+ Instance->UdpIo->Protocol.Udp4->Poll (Instance->UdpIo->Protocol.Udp4);\r
gBS->RestoreTPL (OldTpl);\r
} else {\r
gBS->RestoreTPL (OldTpl);\r