/** @file\r
Functions implementation related with DHCPv4 for HTTP boot driver.\r
\r
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available under \r
the terms and conditions of the BSD License that accompanies this distribution. \r
The full text of the license may be found at\r
EFI_DHCP4_PACKET_OPTION *MaxMsgSize;\r
UINT16 Value;\r
EFI_STATUS Status;\r
+ BOOLEAN Received;\r
\r
- if ((Dhcp4Event != Dhcp4RcvdOffer) && (Dhcp4Event != Dhcp4SelectOffer)) {\r
+ if ((Dhcp4Event != Dhcp4SendDiscover) && \r
+ (Dhcp4Event != Dhcp4RcvdOffer) && \r
+ (Dhcp4Event != Dhcp4SendRequest) && \r
+ (Dhcp4Event != Dhcp4RcvdAck) && \r
+ (Dhcp4Event != Dhcp4SelectOffer)) {\r
return EFI_SUCCESS;\r
}\r
\r
Value = HTONS (HTTP_BOOT_DHCP4_PACKET_MAX_SIZE);\r
CopyMem (MaxMsgSize->Data, &Value, sizeof (Value));\r
}\r
+ \r
+ //\r
+ // Callback to user if any packets sent or received.\r
+ //\r
+ if (Private->HttpBootCallback != NULL && Dhcp4Event != Dhcp4SelectOffer) {\r
+ Received = (BOOLEAN) (Dhcp4Event == Dhcp4RcvdOffer || Dhcp4Event == Dhcp4RcvdAck);\r
+ Status = Private->HttpBootCallback->Callback (\r
+ Private->HttpBootCallback, \r
+ HttpBootDhcp4,\r
+ Received,\r
+ Packet->Length,\r
+ &Packet->Dhcp4\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return EFI_ABORTED;\r
+ }\r
+ }\r
\r
Status = EFI_SUCCESS;\r
switch (Dhcp4Event) {\r