Support for PxeBc dhcp functions.\r
\r
Copyright (c) 2013, Red Hat, Inc.\r
-Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
Private->NumOffers++;\r
}\r
\r
+/**\r
+ Switch the Ip4 policy to static.\r
+\r
+ @param[in] Private The pointer to PXEBC_PRIVATE_DATA.\r
+\r
+ @retval EFI_SUCCESS The policy is already configured to static.\r
+ @retval Others Other error as indicated..\r
+\r
+**/\r
+EFI_STATUS\r
+PxeBcSetIp4Policy ( \r
+ IN PXEBC_PRIVATE_DATA *Private\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2;\r
+ EFI_IP4_CONFIG2_POLICY Policy;\r
+ UINTN DataSize;\r
+\r
+ Ip4Config2 = Private->Ip4Config2;\r
+ DataSize = sizeof (EFI_IP4_CONFIG2_POLICY);\r
+ Status = Ip4Config2->GetData (\r
+ Ip4Config2,\r
+ Ip4Config2DataTypePolicy,\r
+ &DataSize,\r
+ &Policy\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+ \r
+ if (Policy != Ip4Config2PolicyStatic) {\r
+ Policy = Ip4Config2PolicyStatic;\r
+ Status= Ip4Config2->SetData (\r
+ Ip4Config2,\r
+ Ip4Config2DataTypePolicy,\r
+ sizeof (EFI_IP4_CONFIG2_POLICY),\r
+ &Policy\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ } \r
+ }\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
\r
/**\r
Select the specified proxy offer, such as BINL, DHCP_ONLY and so on.\r