MdeModulePkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at<BR>
|
||||
@@ -237,10 +237,10 @@ Ip4ComponentNameGetDriverName (
|
||||
|
||||
@param Ip4[in] A pointer to the EFI_IP4_PROTOCOL.
|
||||
|
||||
|
||||
|
||||
@retval EFI_SUCCESS Update the ControllerNameTable of this instance successfully.
|
||||
@retval EFI_INVALID_PARAMETER The input parameter is invalid.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
UpdateName (
|
||||
@@ -290,7 +290,7 @@ UpdateName (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
return AddUnicodeString2 (
|
||||
"en",
|
||||
gIp4ComponentName2.SupportedLanguages,
|
||||
@@ -378,9 +378,9 @@ Ip4ComponentNameGetControllerName (
|
||||
OUT CHAR16 **ControllerName
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
EFI_IP4_PROTOCOL *Ip4;
|
||||
|
||||
|
||||
//
|
||||
// Only provide names for child handles.
|
||||
//
|
||||
@@ -388,9 +388,9 @@ Ip4ComponentNameGetControllerName (
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Make sure this driver produced ChildHandle
|
||||
//
|
||||
//
|
||||
// Make sure this driver produced ChildHandle
|
||||
//
|
||||
Status = EfiTestChildHandle (
|
||||
ControllerHandle,
|
||||
ChildHandle,
|
||||
@@ -400,9 +400,9 @@ Ip4ComponentNameGetControllerName (
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve an instance of a produced protocol from ChildHandle
|
||||
//
|
||||
//
|
||||
// Retrieve an instance of a produced protocol from ChildHandle
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ChildHandle,
|
||||
&gEfiIp4ProtocolGuid,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Common definition for IP4.
|
||||
|
||||
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Vfr file for IP4Dxe.
|
||||
|
||||
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -87,13 +87,13 @@ formset
|
||||
endif;
|
||||
|
||||
subtitle text = STRING_TOKEN(STR_NULL);
|
||||
|
||||
|
||||
text
|
||||
help = STRING_TOKEN(STR_SAVE_CHANGES),
|
||||
text = STRING_TOKEN(STR_SAVE_CHANGES),
|
||||
flags = INTERACTIVE,
|
||||
key = KEY_SAVE_CHANGES;
|
||||
|
||||
|
||||
endform;
|
||||
|
||||
endformset;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The implementation of EFI IPv4 Configuration II Protocol.
|
||||
|
||||
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
@@ -82,7 +82,7 @@ Ip4Config2DestroyDhcp4 (
|
||||
|
||||
Instance->Dhcp4Handle = NULL;
|
||||
|
||||
return Status;
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,7 +112,7 @@ Ip4Config2OnPolicyChanged (
|
||||
if (IpSb->DefaultInterface != NULL) {
|
||||
if (IpSb->DefaultRouteTable != NULL) {
|
||||
Ip4FreeRouteTable (IpSb->DefaultRouteTable);
|
||||
IpSb->DefaultRouteTable = NULL;
|
||||
IpSb->DefaultRouteTable = NULL;
|
||||
}
|
||||
|
||||
Ip4CancelReceive (IpSb->DefaultInterface);
|
||||
@@ -125,7 +125,7 @@ Ip4Config2OnPolicyChanged (
|
||||
|
||||
//
|
||||
// Create new default interface and route table.
|
||||
//
|
||||
//
|
||||
IpIf = Ip4CreateInterface (IpSb->Mnp, IpSb->Controller, IpSb->Image);
|
||||
if (IpIf == NULL) {
|
||||
return ;
|
||||
@@ -136,7 +136,7 @@ Ip4Config2OnPolicyChanged (
|
||||
Ip4FreeInterface (IpIf, NULL);
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
IpSb->DefaultInterface = IpIf;
|
||||
InsertHeadList (&IpSb->Interfaces, &IpIf->Link);
|
||||
IpSb->DefaultRouteTable = RouteTable;
|
||||
@@ -255,7 +255,7 @@ Ip4Config2ReadConfigData (
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for (Index = 0; Index < Variable->DataRecordCount; Index++) {
|
||||
|
||||
CopyMem (&DataRecord, &Variable->DataRecord[Index], sizeof (DataRecord));
|
||||
@@ -375,8 +375,8 @@ Ip4Config2WriteConfigData (
|
||||
|
||||
|
||||
/**
|
||||
Build a EFI_IP4_ROUTE_TABLE to be returned to the caller of GetModeData.
|
||||
The EFI_IP4_ROUTE_TABLE is clumsy to use in the internal operation of the
|
||||
Build a EFI_IP4_ROUTE_TABLE to be returned to the caller of GetModeData.
|
||||
The EFI_IP4_ROUTE_TABLE is clumsy to use in the internal operation of the
|
||||
IP4 driver.
|
||||
|
||||
@param[in] IpSb The IP4 service binding instance.
|
||||
@@ -392,7 +392,7 @@ Ip4Config2BuildDefaultRouteTable (
|
||||
OUT EFI_IP4_ROUTE_TABLE *Table
|
||||
)
|
||||
{
|
||||
LIST_ENTRY *Entry;
|
||||
LIST_ENTRY *Entry;
|
||||
IP4_ROUTE_ENTRY *RtEntry;
|
||||
UINT32 Count;
|
||||
INT32 Index;
|
||||
@@ -468,8 +468,8 @@ Ip4Config2OnDhcp4SbInstalled (
|
||||
@param[in] StationAddress Ip address to be set.
|
||||
@param[in] SubnetMask Subnet to be set.
|
||||
|
||||
@retval EFI_SUCCESS Set default address successful.
|
||||
@retval Others Some errors occur in setting.
|
||||
@retval EFI_SUCCESS Set default address successful.
|
||||
@retval Others Some errors occur in setting.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -501,7 +501,7 @@ Ip4Config2SetDefaultAddr (
|
||||
//
|
||||
if (IpSb->DefaultRouteTable != NULL) {
|
||||
Ip4FreeRouteTable (IpSb->DefaultRouteTable);
|
||||
IpSb->DefaultRouteTable = NULL;
|
||||
IpSb->DefaultRouteTable = NULL;
|
||||
}
|
||||
|
||||
Ip4CancelReceive (IpSb->DefaultInterface);
|
||||
@@ -509,7 +509,7 @@ Ip4Config2SetDefaultAddr (
|
||||
IpSb->DefaultInterface = NULL;
|
||||
//
|
||||
// Create new default interface and route table.
|
||||
//
|
||||
//
|
||||
IpIf = Ip4CreateInterface (IpSb->Mnp, IpSb->Controller, IpSb->Image);
|
||||
if (IpIf == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
@@ -520,7 +520,7 @@ Ip4Config2SetDefaultAddr (
|
||||
Ip4FreeInterface (IpIf, NULL);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
|
||||
IpSb->DefaultInterface = IpIf;
|
||||
InsertHeadList (&IpSb->Interfaces, &IpIf->Link);
|
||||
IpSb->DefaultRouteTable = RouteTable;
|
||||
@@ -537,8 +537,8 @@ Ip4Config2SetDefaultAddr (
|
||||
}
|
||||
|
||||
if (IpIf->Arp != NULL) {
|
||||
//
|
||||
// A non-NULL IpIf->Arp here means a new ARP child is created when setting default address,
|
||||
//
|
||||
// A non-NULL IpIf->Arp here means a new ARP child is created when setting default address,
|
||||
// but some IP children may have referenced the default interface before it is configured,
|
||||
// these IP instances also consume this ARP protocol so they need to open it BY_CHILD_CONTROLLER.
|
||||
//
|
||||
@@ -580,20 +580,20 @@ Ip4Config2SetDefaultAddr (
|
||||
|
||||
IpSb->State = IP4_SERVICE_CONFIGED;
|
||||
IpSb->Reconfig = FALSE;
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Set the station address, subnetmask and gateway address for the default interface.
|
||||
|
||||
@param[in] Instance The pointer to the IP4 config2 instance data.
|
||||
@param[in] Instance The pointer to the IP4 config2 instance data.
|
||||
@param[in] StationAddress Ip address to be set.
|
||||
@param[in] SubnetMask Subnet to be set.
|
||||
@param[in] GatewayAddress Gateway to be set.
|
||||
|
||||
@retval EFI_SUCCESS Set default If successful.
|
||||
@retval Others Errors occur as indicated.
|
||||
@retval EFI_SUCCESS Set default If successful.
|
||||
@retval Others Errors occur as indicated.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -630,7 +630,7 @@ Ip4Config2SetDefaultIf (
|
||||
IP4_ALLZERO_ADDRESS,
|
||||
IP4_ALLZERO_ADDRESS,
|
||||
GatewayAddress
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
@@ -687,7 +687,7 @@ Ip4Config2CleanDhcp4 (
|
||||
/**
|
||||
This worker function sets the DNS server list for the EFI IPv4 network
|
||||
stack running on the communication device that this EFI_IP4_CONFIG2_PROTOCOL
|
||||
manages. The DNS server addresses must be unicast IPv4 addresses.
|
||||
manages. The DNS server addresses must be unicast IPv4 addresses.
|
||||
|
||||
@param[in] Instance The pointer to the IP4 config2 instance data.
|
||||
@param[in] DataSize The size of the buffer pointed to by Data in bytes.
|
||||
@@ -728,7 +728,7 @@ Ip4Config2SetDnsServerWorker (
|
||||
Item = &Instance->DataItem[Ip4Config2DataTypeDnsServer];
|
||||
NewDns = (EFI_IPv4_ADDRESS *) Data;
|
||||
OldDns = Item->Data.DnsServers;
|
||||
NewDnsCount = DataSize / sizeof (EFI_IPv4_ADDRESS);
|
||||
NewDnsCount = DataSize / sizeof (EFI_IPv4_ADDRESS);
|
||||
OldDnsCount = Item->DataSize / sizeof (EFI_IPv4_ADDRESS);
|
||||
OneAdded = FALSE;
|
||||
|
||||
@@ -785,7 +785,7 @@ Ip4Config2SetDnsServerWorker (
|
||||
if (Tmp != NULL) {
|
||||
if (Item->Data.Ptr != NULL) {
|
||||
FreePool (Item->Data.Ptr);
|
||||
}
|
||||
}
|
||||
Item->Data.Ptr = Tmp;
|
||||
}
|
||||
|
||||
@@ -846,7 +846,7 @@ Ip4Config2OnDhcp4Complete (
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Parse the ACK to get required DNS server information.
|
||||
//
|
||||
@@ -916,7 +916,7 @@ Ip4StartAutoConfig (
|
||||
EFI_DHCP4_PACKET_OPTION *OptionList[1];
|
||||
IP4_CONFIG2_DHCP4_OPTION ParaList;
|
||||
EFI_STATUS Status;
|
||||
|
||||
|
||||
IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
|
||||
|
||||
if (IpSb->State > IP4_SERVICE_UNSTARTED) {
|
||||
@@ -978,7 +978,7 @@ Ip4StartAutoConfig (
|
||||
);
|
||||
|
||||
Instance->Dhcp4Handle = NULL;
|
||||
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -990,7 +990,7 @@ Ip4StartAutoConfig (
|
||||
Status = Dhcp4->GetModeData (Dhcp4, &Dhcp4Mode);
|
||||
if (Dhcp4Mode.State == Dhcp4Bound) {
|
||||
Ip4Config2OnDhcp4Complete (NULL, Instance);
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1023,14 +1023,14 @@ Ip4StartAutoConfig (
|
||||
&gEfiDhcp4ServiceBindingProtocolGuid,
|
||||
Instance->Dhcp4Handle
|
||||
);
|
||||
|
||||
|
||||
Instance->Dhcp4 = NULL;
|
||||
|
||||
|
||||
Instance->Dhcp4Handle = NULL;
|
||||
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Start the DHCP process
|
||||
//
|
||||
@@ -1051,20 +1051,20 @@ Ip4StartAutoConfig (
|
||||
Ip4Config2DestroyDhcp4 (Instance);
|
||||
gBS->CloseEvent (Instance->Dhcp4Event);
|
||||
Instance->Dhcp4Event = NULL;
|
||||
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
IpSb->State = IP4_SERVICE_STARTED;
|
||||
DispatchDpc ();
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
The work function is to get the interface information of the communication
|
||||
The work function is to get the interface information of the communication
|
||||
device this IP4_CONFIG2_INSTANCE manages.
|
||||
|
||||
@param[in] Instance Pointer to the IP4 config2 instance data.
|
||||
@@ -1099,7 +1099,7 @@ Ip4Config2GetIfInfo (
|
||||
if (IpSb->DefaultRouteTable != NULL) {
|
||||
Length += IpSb->DefaultRouteTable->TotalNum * sizeof (EFI_IP4_ROUTE_TABLE);
|
||||
}
|
||||
|
||||
|
||||
if (*DataSize < Length) {
|
||||
*DataSize = Length;
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
@@ -1126,14 +1126,14 @@ Ip4Config2GetIfInfo (
|
||||
IfInfo->RouteTableSize = IpSb->DefaultRouteTable->TotalNum;
|
||||
IfInfo->RouteTable = (EFI_IP4_ROUTE_TABLE *) ((UINT8 *) Data + sizeof (EFI_IP4_CONFIG2_INTERFACE_INFO));
|
||||
|
||||
Ip4Config2BuildDefaultRouteTable (IpSb, IfInfo->RouteTable);
|
||||
Ip4Config2BuildDefaultRouteTable (IpSb, IfInfo->RouteTable);
|
||||
}
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
The work function is to set the general configuration policy for the EFI IPv4 network
|
||||
The work function is to set the general configuration policy for the EFI IPv4 network
|
||||
stack that is running on the communication device managed by this IP4_CONFIG2_INSTANCE.
|
||||
The policy will affect other configuration settings.
|
||||
|
||||
@@ -1175,7 +1175,7 @@ Ip4Config2SetPolicy (
|
||||
}
|
||||
} else {
|
||||
//
|
||||
// The policy is changed. Clean the ManualAddress, Gateway and DnsServers,
|
||||
// The policy is changed. Clean the ManualAddress, Gateway and DnsServers,
|
||||
// shrink the variable data size, and fire up all the related events.
|
||||
//
|
||||
DataItem = &Instance->DataItem[Ip4Config2DataTypeManualAddress];
|
||||
@@ -1204,7 +1204,7 @@ Ip4Config2SetPolicy (
|
||||
DataItem->DataSize = 0;
|
||||
DataItem->Status = EFI_NOT_FOUND;
|
||||
NetMapIterate (&DataItem->EventMap, Ip4Config2SignalEvent, NULL);
|
||||
|
||||
|
||||
if (NewPolicy == Ip4Config2PolicyDhcp) {
|
||||
SET_DATA_ATTRIB (DataItem->Attribute, DATA_ATTRIB_VOLATILE);
|
||||
} else {
|
||||
@@ -1215,7 +1215,7 @@ Ip4Config2SetPolicy (
|
||||
if (Instance->Dhcp4Handle != NULL) {
|
||||
Ip4Config2DestroyDhcp4 (Instance);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Close the event.
|
||||
//
|
||||
@@ -1235,7 +1235,7 @@ Ip4Config2SetPolicy (
|
||||
}
|
||||
|
||||
/**
|
||||
The work function is to set the station addresses manually for the EFI IPv4
|
||||
The work function is to set the station addresses manually for the EFI IPv4
|
||||
network stack. It is only configurable when the policy is Ip4Config2PolicyStatic.
|
||||
|
||||
@param[in] Instance Pointer to the IP4 config2 instance data.
|
||||
@@ -1317,7 +1317,7 @@ Ip4Config2SetManualAddress (
|
||||
if (DataItem->Data.Ptr != NULL) {
|
||||
FreePool (DataItem->Data.Ptr);
|
||||
}
|
||||
|
||||
|
||||
DataItem->Data.Ptr = Ptr;
|
||||
DataItem->DataSize = DataSize;
|
||||
DataItem->Status = EFI_NOT_READY;
|
||||
@@ -1331,7 +1331,7 @@ Ip4Config2SetManualAddress (
|
||||
if (Ptr != NULL) {
|
||||
FreePool (Ptr);
|
||||
}
|
||||
DataItem->Data.Ptr = NULL;
|
||||
DataItem->Data.Ptr = NULL;
|
||||
}
|
||||
} else {
|
||||
//
|
||||
@@ -1350,7 +1350,7 @@ Ip4Config2SetManualAddress (
|
||||
if (IpSb->DefaultInterface != NULL) {
|
||||
if (IpSb->DefaultRouteTable != NULL) {
|
||||
Ip4FreeRouteTable (IpSb->DefaultRouteTable);
|
||||
IpSb->DefaultRouteTable = NULL;
|
||||
IpSb->DefaultRouteTable = NULL;
|
||||
}
|
||||
|
||||
Ip4CancelReceive (IpSb->DefaultInterface);
|
||||
@@ -1363,7 +1363,7 @@ Ip4Config2SetManualAddress (
|
||||
|
||||
//
|
||||
// Create new default interface and route table.
|
||||
//
|
||||
//
|
||||
IpIf = Ip4CreateInterface (IpSb->Mnp, IpSb->Controller, IpSb->Image);
|
||||
if (IpIf == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
@@ -1374,14 +1374,14 @@ Ip4Config2SetManualAddress (
|
||||
Ip4FreeInterface (IpIf, NULL);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
|
||||
IpSb->DefaultInterface = IpIf;
|
||||
InsertHeadList (&IpSb->Interfaces, &IpIf->Link);
|
||||
IpSb->DefaultRouteTable = RouteTable;
|
||||
Ip4ReceiveFrame (IpIf, NULL, Ip4AccpetFrame, IpSb);
|
||||
|
||||
//
|
||||
// Reset the State to unstarted.
|
||||
// Reset the State to unstarted.
|
||||
//
|
||||
if (IpSb->State == IP4_SERVICE_CONFIGED || IpSb->State == IP4_SERVICE_STARTED) {
|
||||
IpSb->State = IP4_SERVICE_UNSTARTED;
|
||||
@@ -1392,8 +1392,8 @@ Ip4Config2SetManualAddress (
|
||||
}
|
||||
|
||||
/**
|
||||
The work function is to set the gateway addresses manually for the EFI IPv4
|
||||
network stack that is running on the communication device that this EFI IPv4
|
||||
The work function is to set the gateway addresses manually for the EFI IPv4
|
||||
network stack that is running on the communication device that this EFI IPv4
|
||||
Configuration Protocol manages. It is not configurable when the policy is
|
||||
Ip4Config2PolicyDhcp. The gateway addresses must be unicast IPv4 addresses.
|
||||
|
||||
@@ -1474,7 +1474,7 @@ Ip4Config2SetGateway (
|
||||
for (Index1 = 0; Index1 < NewGatewayCount; Index1++) {
|
||||
CopyMem (&Gateway, NewGateway + Index1, sizeof (IP4_ADDR));
|
||||
|
||||
if ((IpSb->DefaultInterface->SubnetMask != 0) &&
|
||||
if ((IpSb->DefaultInterface->SubnetMask != 0) &&
|
||||
!NetIp4IsUnicast (NTOHL (Gateway), IpSb->DefaultInterface->SubnetMask)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
@@ -1505,7 +1505,7 @@ Ip4Config2SetGateway (
|
||||
IP4_ALLZERO_ADDRESS,
|
||||
IP4_ALLZERO_ADDRESS,
|
||||
NTOHL (Gateway)
|
||||
);
|
||||
);
|
||||
|
||||
OneAdded = TRUE;
|
||||
}
|
||||
@@ -1541,9 +1541,9 @@ Ip4Config2SetGateway (
|
||||
}
|
||||
|
||||
/**
|
||||
The work function is to set the DNS server list for the EFI IPv4 network
|
||||
stack running on the communication device that this EFI_IP4_CONFIG2_PROTOCOL
|
||||
manages. It is not configurable when the policy is Ip4Config2PolicyDhcp.
|
||||
The work function is to set the DNS server list for the EFI IPv4 network
|
||||
stack running on the communication device that this EFI_IP4_CONFIG2_PROTOCOL
|
||||
manages. It is not configurable when the policy is Ip4Config2PolicyDhcp.
|
||||
The DNS server addresses must be unicast IPv4 addresses.
|
||||
|
||||
@param[in] Instance The pointer to the IP4 config2 instance data.
|
||||
@@ -1589,7 +1589,7 @@ Ip4Config2SetDnsServer (
|
||||
Status = Ip4Config2SetDnsServerWorker (Instance, DataSize, Data);
|
||||
} else {
|
||||
//
|
||||
// DataSize is 0 and Data is NULL, clean up the DnsServer address.
|
||||
// DataSize is 0 and Data is NULL, clean up the DnsServer address.
|
||||
//
|
||||
if (Item->Data.Ptr != NULL) {
|
||||
FreePool (Item->Data.Ptr);
|
||||
@@ -1598,7 +1598,7 @@ Ip4Config2SetDnsServer (
|
||||
Item->DataSize = 0;
|
||||
Item->Status = EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -1678,7 +1678,7 @@ Ip4Config2OnDhcp4Event (
|
||||
network stack was set successfully.
|
||||
@retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
|
||||
- This is NULL.
|
||||
- One or more fields in Data and DataSize do not match the
|
||||
- One or more fields in Data and DataSize do not match the
|
||||
requirement of the data type indicated by DataType.
|
||||
@retval EFI_WRITE_PROTECTED The specified configuration data is read-only or the specified
|
||||
configuration data cannot be set under the current policy.
|
||||
@@ -2031,7 +2031,7 @@ Ip4Config2InitInstance (
|
||||
NetMapInit (&Instance->DataItem[Index].EventMap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Initialize each data type: associate storage and set data size for the
|
||||
// fixed size data types, hook the SetData function, set the data attribute.
|
||||
@@ -2066,7 +2066,7 @@ Ip4Config2InitInstance (
|
||||
|
||||
//
|
||||
// Try to read the config data from NV variable.
|
||||
// If not found, write initialized config data into NV variable
|
||||
// If not found, write initialized config data into NV variable
|
||||
// as a default config data.
|
||||
//
|
||||
Status = Ip4Config2ReadConfigData (IpSb->MacString, Instance);
|
||||
@@ -2077,7 +2077,7 @@ Ip4Config2InitInstance (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
Instance->Ip4Config2.SetData = EfiIp4Config2SetData;
|
||||
Instance->Ip4Config2.GetData = EfiIp4Config2GetData;
|
||||
Instance->Ip4Config2.RegisterDataNotify = EfiIp4Config2RegisterDataNotify;
|
||||
@@ -2166,7 +2166,7 @@ Ip4AutoReconfigCallBackDpc (
|
||||
if (IpSb->State > IP4_SERVICE_UNSTARTED) {
|
||||
IpSb->State = IP4_SERVICE_UNSTARTED;
|
||||
}
|
||||
|
||||
|
||||
IpSb->Reconfig = TRUE;
|
||||
|
||||
Ip4StartAutoConfig (&IpSb->Ip4Config2Instance);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Definitions for EFI IPv4 Configuration II Protocol implementation.
|
||||
|
||||
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
@@ -70,7 +70,7 @@ typedef struct _IP4_CONFIG2_INSTANCE IP4_CONFIG2_INSTANCE;
|
||||
8 bytes.
|
||||
@retval EFI_SUCCESS The specified configuration data for the EFI IPv4
|
||||
network stack was set successfully.
|
||||
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
@@ -87,14 +87,14 @@ EFI_STATUS
|
||||
@param[in, out] DataSize On input, in bytes, the size of Data. On output, in
|
||||
bytes, the size of buffer required to store the specified
|
||||
configuration data.
|
||||
@param[in] Data The data buffer in which the configuration data is returned.
|
||||
@param[in] Data The data buffer in which the configuration data is returned.
|
||||
Ignored if DataSize is ZERO.
|
||||
|
||||
@retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified
|
||||
configuration data, and the required size is
|
||||
configuration data, and the required size is
|
||||
returned in DataSize.
|
||||
@retval EFI_SUCCESS The specified configuration data was obtained successfully.
|
||||
|
||||
@retval EFI_SUCCESS The specified configuration data was obtained successfully.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
@@ -151,7 +151,7 @@ typedef struct {
|
||||
#pragma pack()
|
||||
|
||||
typedef struct {
|
||||
EFI_IP4_CONFIG2_POLICY Policy; ///< manual or automatic
|
||||
EFI_IP4_CONFIG2_POLICY Policy; ///< manual or automatic
|
||||
EFI_IP4_CONFIG2_MANUAL_ADDRESS *ManualAddress; ///< IP addresses
|
||||
UINT32 ManualAddressCount; ///< IP addresses count
|
||||
EFI_IPv4_ADDRESS *GatewayAddress; ///< Gateway address
|
||||
@@ -177,7 +177,7 @@ struct _IP4_CONFIG2_INSTANCE {
|
||||
EFI_IP4_CONFIG2_PROTOCOL Ip4Config2;
|
||||
|
||||
EFI_IP4_CONFIG2_INTERFACE_INFO InterfaceInfo;
|
||||
EFI_IP4_CONFIG2_POLICY Policy;
|
||||
EFI_IP4_CONFIG2_POLICY Policy;
|
||||
IP4_CONFIG2_DATA_ITEM DataItem[Ip4Config2DataTypeMaximum];
|
||||
|
||||
EFI_EVENT Dhcp4SbNotifyEvent;
|
||||
@@ -190,7 +190,7 @@ struct _IP4_CONFIG2_INSTANCE {
|
||||
UINT32 FailedIaAddressCount;
|
||||
EFI_IPv4_ADDRESS *DeclineAddress;
|
||||
UINT32 DeclineAddressCount;
|
||||
|
||||
|
||||
IP4_FORM_CALLBACK_INFO CallbackInfo;
|
||||
|
||||
IP4_CONFIG2_NVDATA Ip4NvData;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Helper functions for configuring or getting the parameters relating to Ip4.
|
||||
|
||||
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -23,7 +23,7 @@ CHAR16 mIp4Config2StorageName[] = L"IP4_CONFIG2_IFR_NVDATA";
|
||||
|
||||
@return The prefix length of the subnet mask.
|
||||
@retval 0 Other errors as indicated.
|
||||
|
||||
|
||||
**/
|
||||
UINT8
|
||||
GetSubnetMaskPrefixLength (
|
||||
@@ -65,7 +65,7 @@ GetSubnetMaskPrefixLength (
|
||||
|
||||
@retval EFI_SUCCESS The binary IP address is returned in Ip.
|
||||
@retval EFI_INVALID_PARAMETER The IP string is malformatted.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
Ip4Config2StrToIp (
|
||||
@@ -131,7 +131,7 @@ Ip4Config2StrToIp (
|
||||
@retval EFI_SUCCESS The binary IP address list is returned in PtrIpList.
|
||||
@retval EFI_OUT_OF_RESOURCES Error occurs in allocating memory.
|
||||
@retval EFI_INVALID_PARAMETER The IP string is malformatted.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
Ip4Config2StrToIpList (
|
||||
@@ -141,19 +141,19 @@ Ip4Config2StrToIpList (
|
||||
)
|
||||
{
|
||||
UINTN BeginIndex;
|
||||
UINTN EndIndex;
|
||||
UINTN EndIndex;
|
||||
UINTN Index;
|
||||
UINTN IpIndex;
|
||||
CHAR16 *StrTemp;
|
||||
BOOLEAN SpaceTag;
|
||||
|
||||
|
||||
BeginIndex = 0;
|
||||
EndIndex = BeginIndex;
|
||||
Index = 0;
|
||||
IpIndex = 0;
|
||||
StrTemp = NULL;
|
||||
SpaceTag = TRUE;
|
||||
|
||||
|
||||
*PtrIpList = NULL;
|
||||
*IpCount = 0;
|
||||
|
||||
@@ -173,14 +173,14 @@ Ip4Config2StrToIpList (
|
||||
SpaceTag = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Index++;
|
||||
}
|
||||
|
||||
if (*IpCount == 0) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Allocate buffer for IpList.
|
||||
//
|
||||
@@ -203,10 +203,10 @@ Ip4Config2StrToIpList (
|
||||
*IpCount = 0;
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
|
||||
CopyMem (StrTemp, Str + BeginIndex, (EndIndex - BeginIndex) * sizeof(CHAR16));
|
||||
*(StrTemp + (EndIndex - BeginIndex)) = L'\0';
|
||||
|
||||
|
||||
if (Ip4Config2StrToIp (StrTemp, &((*PtrIpList)[IpIndex])) != EFI_SUCCESS) {
|
||||
FreePool(StrTemp);
|
||||
FreePool(*PtrIpList);
|
||||
@@ -214,7 +214,7 @@ Ip4Config2StrToIpList (
|
||||
*IpCount = 0;
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
BeginIndex = EndIndex;
|
||||
IpIndex++;
|
||||
|
||||
@@ -228,9 +228,9 @@ Ip4Config2StrToIpList (
|
||||
EndIndex++;
|
||||
SpaceTag = FALSE;
|
||||
}
|
||||
|
||||
|
||||
Index++;
|
||||
|
||||
|
||||
if (*(Str + Index) == L'\0') {
|
||||
if (!SpaceTag) {
|
||||
StrTemp = AllocateZeroPool((EndIndex - BeginIndex + 1) * sizeof(CHAR16));
|
||||
@@ -240,10 +240,10 @@ Ip4Config2StrToIpList (
|
||||
*IpCount = 0;
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
|
||||
CopyMem (StrTemp, Str + BeginIndex, (EndIndex - BeginIndex) * sizeof(CHAR16));
|
||||
*(StrTemp + (EndIndex - BeginIndex)) = L'\0';
|
||||
|
||||
|
||||
if (Ip4Config2StrToIp (StrTemp, &((*PtrIpList)[IpIndex])) != EFI_SUCCESS) {
|
||||
FreePool(StrTemp);
|
||||
FreePool(*PtrIpList);
|
||||
@@ -255,7 +255,7 @@ Ip4Config2StrToIpList (
|
||||
FreePool(StrTemp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
@@ -265,7 +265,7 @@ Ip4Config2StrToIpList (
|
||||
|
||||
@param[in] Ip The IPv4 address.
|
||||
@param[out] Str The dotted IP string.
|
||||
|
||||
|
||||
**/
|
||||
VOID
|
||||
Ip4Config2IpToStr (
|
||||
@@ -275,8 +275,8 @@ Ip4Config2IpToStr (
|
||||
{
|
||||
UnicodeSPrint (
|
||||
Str,
|
||||
2 * IP4_STR_MAX_SIZE,
|
||||
L"%d.%d.%d.%d",
|
||||
2 * IP4_STR_MAX_SIZE,
|
||||
L"%d.%d.%d.%d",
|
||||
Ip->Addr[0],
|
||||
Ip->Addr[1],
|
||||
Ip->Addr[2],
|
||||
@@ -286,13 +286,13 @@ Ip4Config2IpToStr (
|
||||
|
||||
|
||||
/**
|
||||
Convert the IPv4 address list into string consists of several decimal
|
||||
Convert the IPv4 address list into string consists of several decimal
|
||||
dotted IPv4 addresses separated by space.
|
||||
|
||||
@param[in] Ip The IPv4 address list.
|
||||
@param[in] IpCount The size of IPv4 address list.
|
||||
@param[out] Str The string contains several decimal dotted
|
||||
IPv4 addresses separated by space.
|
||||
IPv4 addresses separated by space.
|
||||
|
||||
@retval EFI_SUCCESS Operation is success.
|
||||
@retval EFI_OUT_OF_RESOURCES Error occurs in allocating memory.
|
||||
@@ -310,7 +310,7 @@ Ip4Config2IpListToStr (
|
||||
UINTN StrIndex;
|
||||
CHAR16 *TempStr;
|
||||
EFI_IPv4_ADDRESS *TempIp;
|
||||
|
||||
|
||||
Index = 0;
|
||||
TemIndex = 0;
|
||||
StrIndex = 0;
|
||||
@@ -327,9 +327,9 @@ Ip4Config2IpListToStr (
|
||||
}
|
||||
|
||||
UnicodeSPrint (
|
||||
TempStr,
|
||||
2 * IP4_STR_MAX_SIZE,
|
||||
L"%d.%d.%d.%d",
|
||||
TempStr,
|
||||
2 * IP4_STR_MAX_SIZE,
|
||||
L"%d.%d.%d.%d",
|
||||
TempIp->Addr[0],
|
||||
TempIp->Addr[1],
|
||||
TempIp->Addr[2],
|
||||
@@ -342,7 +342,7 @@ Ip4Config2IpListToStr (
|
||||
Str[StrIndex++] = L'\0';
|
||||
} else {
|
||||
Str[StrIndex++] = L' ';
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
Str[StrIndex++] = *(TempStr + TemIndex);
|
||||
@@ -362,7 +362,7 @@ Ip4Config2IpListToStr (
|
||||
|
||||
@param[in] Event The pointer of Event.
|
||||
@param[in] Context The pointer of Context.
|
||||
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
@@ -384,7 +384,7 @@ Ip4Config2ManualAddressNotify (
|
||||
set successfully.
|
||||
@retval EFI_INVALID_PARAMETER Source instance or target IFR data is not available.
|
||||
@retval Others Other errors as indicated.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
Ip4Config2ConvertConfigNvDataToIfrNvData (
|
||||
@@ -409,11 +409,11 @@ Ip4Config2ConvertConfigNvDataToIfrNvData (
|
||||
Ip4Info = NULL;
|
||||
DnsAddress = NULL;
|
||||
GatewaySize = sizeof (EFI_IPv4_ADDRESS);
|
||||
|
||||
|
||||
if ((IfrNvData == NULL) || (Instance == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
NET_CHECK_SIGNATURE (Instance, IP4_CONFIG2_INSTANCE_SIGNATURE);
|
||||
|
||||
IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
|
||||
@@ -427,7 +427,7 @@ Ip4Config2ConvertConfigNvDataToIfrNvData (
|
||||
|
||||
//
|
||||
// Get the Policy info.
|
||||
//
|
||||
//
|
||||
DataSize = sizeof (EFI_IP4_CONFIG2_POLICY);
|
||||
Status = Ip4Config2->GetData (
|
||||
Ip4Config2,
|
||||
@@ -438,14 +438,14 @@ Ip4Config2ConvertConfigNvDataToIfrNvData (
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
if (Policy == Ip4Config2PolicyStatic) {
|
||||
IfrNvData->DhcpEnable = FALSE;
|
||||
} else if (Policy == Ip4Config2PolicyDhcp) {
|
||||
IfrNvData->DhcpEnable = TRUE;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Get the interface info.
|
||||
//
|
||||
@@ -459,7 +459,7 @@ Ip4Config2ConvertConfigNvDataToIfrNvData (
|
||||
if (Status != EFI_BUFFER_TOO_SMALL) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
Ip4Info = AllocateZeroPool (DataSize);
|
||||
if (Ip4Info == NULL) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
@@ -475,7 +475,7 @@ Ip4Config2ConvertConfigNvDataToIfrNvData (
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Get the Gateway info.
|
||||
//
|
||||
@@ -502,7 +502,7 @@ Ip4Config2ConvertConfigNvDataToIfrNvData (
|
||||
if ((Status != EFI_BUFFER_TOO_SMALL) && (Status != EFI_NOT_FOUND)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
DnsCount = (UINT32) (DnsSize / sizeof (EFI_IPv4_ADDRESS));
|
||||
|
||||
if (DnsSize > 0) {
|
||||
@@ -511,7 +511,7 @@ Ip4Config2ConvertConfigNvDataToIfrNvData (
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
Status = Ip4Config2->GetData (
|
||||
Ip4Config2,
|
||||
Ip4Config2DataTypeDnsServer,
|
||||
@@ -537,7 +537,7 @@ Exit:
|
||||
if (Ip4Info != NULL) {
|
||||
FreePool(Ip4Info);
|
||||
}
|
||||
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -552,7 +552,7 @@ Exit:
|
||||
set successfully.
|
||||
@retval EFI_INVALID_PARAMETER The address information for setting is invalid.
|
||||
@retval Others Other errors as indicated.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
Ip4Config2ConvertIfrNvDataToConfigNvData (
|
||||
@@ -560,9 +560,9 @@ Ip4Config2ConvertIfrNvDataToConfigNvData (
|
||||
IN OUT IP4_CONFIG2_INSTANCE *Instance
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
EFI_IP4_CONFIG2_PROTOCOL *Ip4Cfg2;
|
||||
IP4_CONFIG2_NVDATA *Ip4NvData;
|
||||
IP4_CONFIG2_NVDATA *Ip4NvData;
|
||||
|
||||
EFI_IP_ADDRESS StationAddress;
|
||||
EFI_IP_ADDRESS SubnetMask;
|
||||
@@ -581,15 +581,15 @@ Ip4Config2ConvertIfrNvDataToConfigNvData (
|
||||
Status = EFI_SUCCESS;
|
||||
Ip4Cfg2 = &Instance->Ip4Config2;
|
||||
Ip4NvData = &Instance->Ip4NvData;
|
||||
|
||||
|
||||
DnsCount = 0;
|
||||
DnsAddress = NULL;
|
||||
|
||||
DnsAddress = NULL;
|
||||
|
||||
TimeoutEvent = NULL;
|
||||
SetAddressEvent = NULL;
|
||||
|
||||
|
||||
|
||||
|
||||
if (Instance == NULL || IfrFormNvData == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
@@ -597,10 +597,10 @@ Ip4Config2ConvertIfrNvDataToConfigNvData (
|
||||
if (IfrFormNvData->Configure != TRUE) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
if (IfrFormNvData->DhcpEnable == TRUE) {
|
||||
Ip4NvData->Policy = Ip4Config2PolicyDhcp;
|
||||
|
||||
|
||||
Status = Ip4Cfg2->SetData (
|
||||
Ip4Cfg2,
|
||||
Ip4Config2DataTypePolicy,
|
||||
@@ -623,15 +623,15 @@ Ip4Config2ConvertIfrNvDataToConfigNvData (
|
||||
}
|
||||
|
||||
Status = Ip4Config2StrToIp (IfrFormNvData->StationAddress, &StationAddress.v4);
|
||||
if (EFI_ERROR (Status) ||
|
||||
(SubnetMask.Addr[0] != 0 && !NetIp4IsUnicast (NTOHL (StationAddress.Addr[0]), NTOHL (SubnetMask.Addr[0]))) ||
|
||||
if (EFI_ERROR (Status) ||
|
||||
(SubnetMask.Addr[0] != 0 && !NetIp4IsUnicast (NTOHL (StationAddress.Addr[0]), NTOHL (SubnetMask.Addr[0]))) ||
|
||||
!Ip4StationAddressValid (NTOHL (StationAddress.Addr[0]), NTOHL (SubnetMask.Addr[0]))) {
|
||||
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid IP address!", NULL);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
Status = Ip4Config2StrToIp (IfrFormNvData->GatewayAddress, &Gateway.v4);
|
||||
if (EFI_ERROR (Status) ||
|
||||
if (EFI_ERROR (Status) ||
|
||||
(Gateway.Addr[0] != 0 && SubnetMask.Addr[0] != 0 && !NetIp4IsUnicast (NTOHL (Gateway.Addr[0]), NTOHL (SubnetMask.Addr[0])))) {
|
||||
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid Gateway!", NULL);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
@@ -645,16 +645,16 @@ Ip4Config2ConvertIfrNvDataToConfigNvData (
|
||||
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid Dns Server!", NULL);
|
||||
FreePool(DnsAddress);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (EFI_ERROR (Status)) {
|
||||
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid Dns Server!", NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Ip4NvData->ManualAddress != NULL) {
|
||||
FreePool(Ip4NvData->ManualAddress);
|
||||
FreePool(Ip4NvData->ManualAddress);
|
||||
}
|
||||
Ip4NvData->ManualAddressCount = 1;
|
||||
Ip4NvData->ManualAddress = AllocateZeroPool(sizeof(EFI_IP4_CONFIG2_MANUAL_ADDRESS));
|
||||
@@ -662,14 +662,14 @@ Ip4Config2ConvertIfrNvDataToConfigNvData (
|
||||
if (DnsAddress != NULL) {
|
||||
FreePool(DnsAddress);
|
||||
}
|
||||
|
||||
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
CopyMem(&Ip4NvData->ManualAddress->Address, &StationAddress.v4, sizeof(EFI_IPv4_ADDRESS));
|
||||
CopyMem(&Ip4NvData->ManualAddress->SubnetMask, &SubnetMask.v4, sizeof(EFI_IPv4_ADDRESS));
|
||||
|
||||
|
||||
if (Ip4NvData->GatewayAddress != NULL) {
|
||||
FreePool(Ip4NvData->GatewayAddress);
|
||||
FreePool(Ip4NvData->GatewayAddress);
|
||||
}
|
||||
Ip4NvData->GatewayAddressCount = 1;
|
||||
Ip4NvData->GatewayAddress = AllocateZeroPool(sizeof(EFI_IPv4_ADDRESS));
|
||||
@@ -680,9 +680,9 @@ Ip4Config2ConvertIfrNvDataToConfigNvData (
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
CopyMem(Ip4NvData->GatewayAddress, &Gateway.v4, sizeof(EFI_IPv4_ADDRESS));
|
||||
|
||||
|
||||
if (Ip4NvData->DnsAddress != NULL) {
|
||||
FreePool(Ip4NvData->DnsAddress);
|
||||
FreePool(Ip4NvData->DnsAddress);
|
||||
}
|
||||
Ip4NvData->DnsAddressCount = (UINT32) DnsCount;
|
||||
Ip4NvData->DnsAddress = DnsAddress;
|
||||
@@ -726,7 +726,7 @@ Ip4Config2ConvertIfrNvDataToConfigNvData (
|
||||
}
|
||||
|
||||
IsAddressOk = FALSE;
|
||||
|
||||
|
||||
Status = Ip4Cfg2->RegisterDataNotify (
|
||||
Ip4Cfg2,
|
||||
Ip4Config2DataTypeManualAddress,
|
||||
@@ -791,12 +791,12 @@ Ip4Config2ConvertIfrNvDataToConfigNvData (
|
||||
DataSize,
|
||||
Ip4NvData->DnsAddress
|
||||
);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Exit:
|
||||
if (SetAddressEvent != NULL) {
|
||||
@@ -875,12 +875,12 @@ Ip4FormExtractConfig (
|
||||
OUT EFI_STRING *Results
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
IP4_CONFIG2_INSTANCE *Ip4Config2Instance;
|
||||
IP4_FORM_CALLBACK_INFO *Private;
|
||||
IP4_FORM_CALLBACK_INFO *Private;
|
||||
IP4_CONFIG2_IFR_NVDATA *IfrFormNvData;
|
||||
EFI_STRING ConfigRequestHdr;
|
||||
EFI_STRING ConfigRequest;
|
||||
EFI_STRING ConfigRequest;
|
||||
BOOLEAN AllocatedRequest;
|
||||
EFI_STRING FormResult;
|
||||
UINTN Size;
|
||||
@@ -889,19 +889,19 @@ Ip4FormExtractConfig (
|
||||
if (Progress == NULL || Results == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
IfrFormNvData = NULL;
|
||||
ConfigRequest = NULL;
|
||||
FormResult = NULL;
|
||||
FormResult = NULL;
|
||||
Size = 0;
|
||||
AllocatedRequest = FALSE;
|
||||
ConfigRequest = Request;
|
||||
AllocatedRequest = FALSE;
|
||||
ConfigRequest = Request;
|
||||
Private = IP4_FORM_CALLBACK_INFO_FROM_CONFIG_ACCESS(This);
|
||||
Ip4Config2Instance = IP4_CONFIG2_INSTANCE_FROM_FORM_CALLBACK(Private);
|
||||
BufferSize = sizeof (IP4_CONFIG2_IFR_NVDATA);
|
||||
*Progress = Request;
|
||||
|
||||
|
||||
//
|
||||
// Check Request data in <ConfigHdr>.
|
||||
//
|
||||
@@ -910,9 +910,9 @@ Ip4FormExtractConfig (
|
||||
if (IfrFormNvData == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
|
||||
Ip4Config2ConvertConfigNvDataToIfrNvData (Ip4Config2Instance, IfrFormNvData);
|
||||
|
||||
|
||||
if ((Request == NULL) || (StrStr (Request, L"OFFSET") == NULL)) {
|
||||
//
|
||||
// Request has no request element, construct full request string.
|
||||
@@ -927,7 +927,7 @@ Ip4FormExtractConfig (
|
||||
goto Failure;
|
||||
}
|
||||
AllocatedRequest = TRUE;
|
||||
|
||||
|
||||
UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize);
|
||||
FreePool (ConfigRequestHdr);
|
||||
}
|
||||
@@ -945,7 +945,7 @@ Ip4FormExtractConfig (
|
||||
);
|
||||
|
||||
FreePool (IfrFormNvData);
|
||||
|
||||
|
||||
//
|
||||
// Free the allocated config request string.
|
||||
//
|
||||
@@ -958,7 +958,7 @@ Ip4FormExtractConfig (
|
||||
goto Failure;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Request == NULL || HiiIsConfigHdrMatch (Request, &gIp4Config2NvDataGuid, mIp4Config2StorageName)) {
|
||||
*Results = FormResult;
|
||||
} else {
|
||||
@@ -1107,7 +1107,7 @@ Ip4FormRouteConfig (
|
||||
callback.Currently not implemented.
|
||||
@retval EFI_INVALID_PARAMETERS Passing in wrong parameter.
|
||||
@retval Others Other errors as indicated.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
@@ -1124,7 +1124,7 @@ Ip4FormCallback (
|
||||
IP4_CONFIG2_INSTANCE *Instance;
|
||||
IP4_CONFIG2_IFR_NVDATA *IfrFormNvData;
|
||||
IP4_FORM_CALLBACK_INFO *Private;
|
||||
|
||||
|
||||
EFI_IP_ADDRESS StationAddress;
|
||||
EFI_IP_ADDRESS SubnetMask;
|
||||
EFI_IP_ADDRESS Gateway;
|
||||
@@ -1133,15 +1133,15 @@ Ip4FormCallback (
|
||||
UINTN DnsCount;
|
||||
UINTN Index;
|
||||
EFI_INPUT_KEY Key;
|
||||
|
||||
|
||||
IfrFormNvData = NULL;
|
||||
DnsCount = 0;
|
||||
DnsAddress = NULL;
|
||||
DnsAddress = NULL;
|
||||
|
||||
if (Action == EFI_BROWSER_ACTION_CHANGED) {
|
||||
Private = IP4_FORM_CALLBACK_INFO_FROM_CONFIG_ACCESS(This);
|
||||
Instance = IP4_CONFIG2_INSTANCE_FROM_FORM_CALLBACK(Private);
|
||||
|
||||
|
||||
IfrFormNvData = AllocateZeroPool (sizeof (IP4_CONFIG2_IFR_NVDATA));
|
||||
if (IfrFormNvData == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
@@ -1181,7 +1181,7 @@ Ip4FormCallback (
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case KEY_DNS:
|
||||
Status = Ip4Config2StrToIpList (IfrFormNvData->DnsAddress, &DnsAddress, &DnsCount);
|
||||
if (!EFI_ERROR (Status) && DnsCount > 0) {
|
||||
@@ -1191,19 +1191,19 @@ Ip4FormCallback (
|
||||
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid Dns Server!", NULL);
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (EFI_ERROR (Status)) {
|
||||
CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid Dns Server!", NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if(DnsAddress != NULL) {
|
||||
|
||||
if(DnsAddress != NULL) {
|
||||
FreePool(DnsAddress);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case KEY_SAVE_CHANGES:
|
||||
Status = Ip4Config2ConvertIfrNvDataToConfigNvData (IfrFormNvData, Instance);
|
||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
|
||||
@@ -1232,7 +1232,7 @@ Ip4FormCallback (
|
||||
@retval EFI_SUCCESS The HII Config Access protocol is installed.
|
||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
|
||||
@retval Others Other errors as indicated.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
Ip4Config2FormInit (
|
||||
@@ -1253,9 +1253,9 @@ Ip4Config2FormInit (
|
||||
|
||||
IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
|
||||
ASSERT (IpSb != NULL);
|
||||
|
||||
|
||||
CallbackInfo = &Instance->CallbackInfo;
|
||||
|
||||
|
||||
CallbackInfo->Signature = IP4_FORM_CALLBACK_INFO_SIGNATURE;
|
||||
|
||||
Status = gBS->HandleProtocol (
|
||||
@@ -1344,26 +1344,26 @@ Ip4Config2FormInit (
|
||||
Status = NetLibGetMacString (IpSb->Controller, IpSb->Image, &MacString);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
OldMenuString = HiiGetString (
|
||||
CallbackInfo->RegisteredHandle,
|
||||
STRING_TOKEN (STR_IP4_CONFIG2_FORM_HELP),
|
||||
CallbackInfo->RegisteredHandle,
|
||||
STRING_TOKEN (STR_IP4_CONFIG2_FORM_HELP),
|
||||
NULL
|
||||
);
|
||||
UnicodeSPrint (MenuString, 128, L"%s (MAC:%s)", OldMenuString, MacString);
|
||||
HiiSetString (
|
||||
CallbackInfo->RegisteredHandle,
|
||||
STRING_TOKEN (STR_IP4_CONFIG2_FORM_HELP),
|
||||
MenuString,
|
||||
CallbackInfo->RegisteredHandle,
|
||||
STRING_TOKEN (STR_IP4_CONFIG2_FORM_HELP),
|
||||
MenuString,
|
||||
NULL
|
||||
);
|
||||
|
||||
UnicodeSPrint (PortString, 128, L"MAC:%s", MacString);
|
||||
HiiSetString (
|
||||
CallbackInfo->RegisteredHandle,
|
||||
STRING_TOKEN (STR_IP4_DEVICE_FORM_HELP),
|
||||
PortString,
|
||||
CallbackInfo->RegisteredHandle,
|
||||
STRING_TOKEN (STR_IP4_DEVICE_FORM_HELP),
|
||||
PortString,
|
||||
NULL
|
||||
);
|
||||
|
||||
|
||||
FreePool (MacString);
|
||||
FreePool (OldMenuString);
|
||||
|
||||
@@ -1405,7 +1405,7 @@ Ip4Config2FormUnload (
|
||||
IpSb->Image,
|
||||
CallbackInfo->ChildHandle
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// Uninstall EFI_HII_CONFIG_ACCESS_PROTOCOL
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
The header file of IP4Config2Nv.c
|
||||
|
||||
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -30,7 +30,7 @@ extern UINT8 Ip4DxeStrings[];
|
||||
@retval EFI_SUCCESS The HII Config Access protocol is installed.
|
||||
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
|
||||
@retval Others Other errors as indicated.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
Ip4Config2FormInit (
|
||||
|
@@ -258,7 +258,7 @@ Ip4CreateService (
|
||||
IpSb->ReconfigEvent = NULL;
|
||||
|
||||
IpSb->Reconfig = FALSE;
|
||||
|
||||
|
||||
IpSb->MediaPresent = TRUE;
|
||||
|
||||
//
|
||||
@@ -352,7 +352,7 @@ Ip4CreateService (
|
||||
|
||||
IpSb->MacString = NULL;
|
||||
Status = NetLibGetMacString (IpSb->Controller, IpSb->Image, &IpSb->MacString);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
@@ -367,7 +367,7 @@ Ip4CreateService (
|
||||
InsertHeadList (&IpSb->Interfaces, &IpSb->DefaultInterface->Link);
|
||||
|
||||
ZeroMem (&IpSb->Ip4Config2Instance, sizeof (IP4_CONFIG2_INSTANCE));
|
||||
|
||||
|
||||
Status = Ip4Config2InitInstance (&IpSb->Ip4Config2Instance);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -488,7 +488,7 @@ Ip4CleanService (
|
||||
|
||||
/**
|
||||
Callback function which provided by user to remove one node in NetDestroyLinkList process.
|
||||
|
||||
|
||||
@param[in] Entry The entry to be removed.
|
||||
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
|
||||
|
||||
@@ -549,7 +549,7 @@ Ip4DriverBindingStart (
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||
)
|
||||
{
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
IP4_SERVICE *IpSb;
|
||||
EFI_IP4_CONFIG2_PROTOCOL *Ip4Cfg2;
|
||||
@@ -575,13 +575,13 @@ Ip4DriverBindingStart (
|
||||
if (Status == EFI_SUCCESS) {
|
||||
return EFI_ALREADY_STARTED;
|
||||
}
|
||||
|
||||
|
||||
Status = Ip4CreateService (ControllerHandle, This->DriverBindingHandle, &IpSb);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
ASSERT (IpSb != NULL);
|
||||
|
||||
Ip4Cfg2 = &IpSb->Ip4Config2Instance.Ip4Config2;
|
||||
@@ -603,16 +603,16 @@ Ip4DriverBindingStart (
|
||||
}
|
||||
|
||||
//
|
||||
// Read the config data from NV variable again.
|
||||
// Read the config data from NV variable again.
|
||||
// The default data can be changed by other drivers.
|
||||
//
|
||||
Status = Ip4Config2ReadConfigData (IpSb->MacString, &IpSb->Ip4Config2Instance);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto UNINSTALL_PROTOCOL;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Consume the installed EFI_IP4_CONFIG2_PROTOCOL to set the default data items.
|
||||
// Consume the installed EFI_IP4_CONFIG2_PROTOCOL to set the default data items.
|
||||
//
|
||||
for (Index = Ip4Config2DataTypePolicy; Index < Ip4Config2DataTypeMaximum; Index++) {
|
||||
DataItem = &IpSb->Ip4Config2Instance.DataItem[Index];
|
||||
@@ -626,13 +626,13 @@ Ip4DriverBindingStart (
|
||||
if (EFI_ERROR(Status)) {
|
||||
goto UNINSTALL_PROTOCOL;
|
||||
}
|
||||
|
||||
|
||||
if (Index == Ip4Config2DataTypePolicy && (*(DataItem->Data.Policy) == Ip4Config2PolicyDhcp)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Ready to go: start the receiving and timer.
|
||||
// Ip4Config2SetPolicy maybe call Ip4ReceiveFrame() to set the default interface's RecvRequest first after
|
||||
@@ -705,9 +705,9 @@ Ip4DriverBindingStop (
|
||||
)
|
||||
{
|
||||
EFI_SERVICE_BINDING_PROTOCOL *ServiceBinding;
|
||||
IP4_SERVICE *IpSb;
|
||||
IP4_SERVICE *IpSb;
|
||||
EFI_HANDLE NicHandle;
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
INTN State;
|
||||
LIST_ENTRY *List;
|
||||
IP4_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT Context;
|
||||
@@ -717,20 +717,20 @@ Ip4DriverBindingStop (
|
||||
BOOLEAN IsDhcp4;
|
||||
|
||||
IsDhcp4 = FALSE;
|
||||
|
||||
|
||||
NicHandle = NetLibGetNicHandle (ControllerHandle, &gEfiManagedNetworkProtocolGuid);
|
||||
if (NicHandle == NULL) {
|
||||
NicHandle = NetLibGetNicHandle (ControllerHandle, &gEfiArpProtocolGuid);
|
||||
if (NicHandle == NULL) {
|
||||
NicHandle = NetLibGetNicHandle (ControllerHandle, &gEfiDhcp4ProtocolGuid);
|
||||
if (NicHandle != NULL) {
|
||||
IsDhcp4 = TRUE;
|
||||
IsDhcp4 = TRUE;
|
||||
} else {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
NicHandle,
|
||||
&gEfiIp4ServiceBindingProtocolGuid,
|
||||
@@ -742,7 +742,7 @@ Ip4DriverBindingStop (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
|
||||
IpSb = IP4_SERVICE_FROM_PROTOCOL (ServiceBinding);
|
||||
|
||||
if (IsDhcp4) {
|
||||
@@ -761,7 +761,7 @@ Ip4DriverBindingStop (
|
||||
NULL
|
||||
);
|
||||
} else if (IpSb->DefaultInterface->ArpHandle == ControllerHandle) {
|
||||
|
||||
|
||||
//
|
||||
// The ARP protocol for the default interface is being uninstalled and all
|
||||
// its IP child handles should have been destroyed before. So, release the
|
||||
@@ -770,7 +770,7 @@ Ip4DriverBindingStop (
|
||||
Ip4CancelReceive (IpSb->DefaultInterface);
|
||||
Ip4FreeInterface (IpSb->DefaultInterface, NULL);
|
||||
Ip4FreeRouteTable (IpSb->DefaultRouteTable);
|
||||
|
||||
|
||||
IpIf = Ip4CreateInterface (IpSb->Mnp, IpSb->Controller, IpSb->Image);
|
||||
if (IpIf == NULL) {
|
||||
goto ON_ERROR;
|
||||
@@ -780,7 +780,7 @@ Ip4DriverBindingStop (
|
||||
Ip4FreeInterface (IpIf, NULL);
|
||||
goto ON_ERROR;;
|
||||
}
|
||||
|
||||
|
||||
IpSb->DefaultInterface = IpIf;
|
||||
InsertHeadList (&IpSb->Interfaces, &IpIf->Link);
|
||||
IpSb->DefaultRouteTable = RouteTable;
|
||||
@@ -807,7 +807,7 @@ Ip4DriverBindingStop (
|
||||
&IpSb->Ip4Config2Instance.Ip4Config2,
|
||||
NULL
|
||||
);
|
||||
|
||||
|
||||
if (gIp4ControllerNameTable != NULL) {
|
||||
FreeUnicodeStringTable (gIp4ControllerNameTable);
|
||||
gIp4ControllerNameTable = NULL;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -34,7 +34,7 @@ typedef struct {
|
||||
This is the declaration of an EFI image entry point. This entry point is
|
||||
the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
|
||||
both device drivers and bus drivers.
|
||||
|
||||
|
||||
The entry point for IP4 driver which install the driver
|
||||
binding and component name protocol on its image.
|
||||
|
||||
@@ -114,7 +114,7 @@ Ip4DriverBindingStart (
|
||||
restrictions for this service. DisconnectController()
|
||||
must follow these calling restrictions. If any other agent wishes
|
||||
to call Stop() it must also follow these calling restrictions.
|
||||
|
||||
|
||||
@param[in] This Protocol instance pointer.
|
||||
@param[in] ControllerHandle Handle of device to stop driver on
|
||||
@param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number
|
||||
@@ -139,14 +139,14 @@ Ip4DriverBindingStop (
|
||||
//
|
||||
/**
|
||||
Creates a child handle and installs a protocol.
|
||||
|
||||
The CreateChild() function installs a protocol on ChildHandle.
|
||||
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
|
||||
|
||||
The CreateChild() function installs a protocol on ChildHandle.
|
||||
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
|
||||
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
|
||||
|
||||
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
|
||||
@param ChildHandle Pointer to the handle of the child to create. If it is NULL,
|
||||
then a new handle is created. If it is a pointer to an existing UEFI handle,
|
||||
then a new handle is created. If it is a pointer to an existing UEFI handle,
|
||||
then the protocol is added to the existing UEFI handle.
|
||||
|
||||
@retval EFI_SUCCES The protocol was added to ChildHandle.
|
||||
@@ -165,9 +165,9 @@ Ip4ServiceBindingCreateChild (
|
||||
|
||||
/**
|
||||
Destroys a child handle with a protocol installed on it.
|
||||
|
||||
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
|
||||
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
|
||||
|
||||
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
|
||||
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
|
||||
last protocol on ChildHandle, then ChildHandle is destroyed.
|
||||
|
||||
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
|
||||
|
@@ -6,7 +6,7 @@
|
||||
# subset of the Internet Control Message Protocol (ICMP) and may include support for
|
||||
# the Internet Group Management Protocol (IGMP).
|
||||
#
|
||||
# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -24,7 +24,7 @@
|
||||
MODULE_UNI_FILE = Ip4Dxe.uni
|
||||
FILE_GUID = 9FB1A1F3-3B71-4324-B39A-745CBB015FFF
|
||||
MODULE_TYPE = UEFI_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
VERSION_STRING = 1.0
|
||||
ENTRY_POINT = Ip4DriverEntryPoint
|
||||
UNLOAD_IMAGE = NetLibDefaultUnload
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
# DRIVER_BINDING = gIp4DriverBinding
|
||||
# DRIVER_BINDING = gIp4DriverBinding
|
||||
# COMPONENT_NAME = gIp4ComponentName
|
||||
# COMPONENT_NAME2 = gIp4ComponentName2
|
||||
#
|
||||
@@ -102,7 +102,7 @@
|
||||
gEfiIpSec2ProtocolGuid ## SOMETIMES_CONSUMES
|
||||
gEfiHiiConfigAccessProtocolGuid ## BY_START
|
||||
gEfiDevicePathProtocolGuid ## TO_START
|
||||
|
||||
|
||||
[Guids]
|
||||
## SOMETIMES_CONSUMES ## GUID # HiiIsConfigHdrMatch EFI_NIC_IP4_CONFIG_VARIABLE
|
||||
## SOMETIMES_PRODUCES ## GUID # HiiConstructConfigHdr EFI_NIC_IP4_CONFIG_VARIABLE
|
||||
|
@@ -6,13 +6,13 @@
|
||||
// subset of the Internet Control Message Protocol (ICMP) and may include support for
|
||||
// the Internet Group Management Protocol (IGMP).
|
||||
//
|
||||
// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
//
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
// which accompanies this distribution. The full text of the license may be found at
|
||||
// http://opensource.org/licenses/bsd-license.php
|
||||
//
|
||||
//
|
||||
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
//
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// /** @file
|
||||
// Ip4Dxe Localized Strings and Content
|
||||
//
|
||||
// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
//
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
@@ -13,8 +13,8 @@
|
||||
//
|
||||
// **/
|
||||
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
#string STR_PROPERTIES_MODULE_NAME
|
||||
#language en-US
|
||||
"IP v4 DXE Driver"
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// /** @file
|
||||
// String definitions for Ip4Config2 formset
|
||||
|
||||
// Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
// Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
// This program and the accompanying materials
|
||||
// are licensed and made available under the terms and conditions of the BSD License
|
||||
// which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -30,7 +30,7 @@
|
||||
#string STR_IP4_MASK_HELP #language en-US "Enter NetMask in dotted-decimal notation. Example: 255.255.255.0\r\n"
|
||||
#string STR_IP4_LOCAL_GATEWAY #language en-US "Local Gateway"
|
||||
#string STR_IP4_GATEWAY_HELP #language en-US "Enter Gateway in dotted-decimal notation. Example: 192.168.10.1\r\n"
|
||||
#string STR_IP4_LOCAL_DNS #language en-US "Local DNS Servers"
|
||||
#string STR_IP4_LOCAL_DNS #language en-US "Local DNS Servers"
|
||||
#string STR_IP4_DNS_HELP #language en-US "Enter DNS Servers in dotted-decimal notation. Example: 192.168.10.8 192.168.10.9\r\n"
|
||||
#string STR_SAVE_CHANGES #language en-US "Save Changes and Exit"
|
||||
#string STR_NULL #language en-US ""
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -72,7 +72,7 @@ mIp4SupportedIcmp[23] = {
|
||||
/**
|
||||
Process the ICMP redirect. Find the instance then update
|
||||
its route cache.
|
||||
|
||||
|
||||
All kinds of redirect is treated as host redirect as
|
||||
specified by RFC1122 3.3.1.2:
|
||||
"Since the subnet mask appropriate to the destination
|
||||
@@ -80,7 +80,7 @@ mIp4SupportedIcmp[23] = {
|
||||
message SHOULD be treated identically to a Host Redirect
|
||||
message;"
|
||||
|
||||
@param[in] IpSb The IP4 service binding instance that received
|
||||
@param[in] IpSb The IP4 service binding instance that received
|
||||
the packet.
|
||||
@param[in] Head The IP head of the received ICMPpacket.
|
||||
@param[in] Packet The content of the ICMP redirect packet with IP
|
||||
@@ -166,7 +166,7 @@ Ip4ProcessIcmpRedirect (
|
||||
@retval EFI_SUCCESS The ICMP error is processed successfully.
|
||||
@retval EFI_INVALID_PARAMETER The packet is invalid
|
||||
@retval Others Failed to process the packet.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
Ip4ProcessIcmpError (
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Header file for ICMP protocol.
|
||||
|
||||
Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Implement IP4 pesudo interface.
|
||||
|
||||
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -68,7 +68,7 @@ Ip4OnArpResolvedDpc (
|
||||
@param Event The Arp request event.
|
||||
@param Context The context of the callback, a point to the ARP
|
||||
queue.
|
||||
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
@@ -139,7 +139,7 @@ Ip4CancelFrameArp (
|
||||
finished.
|
||||
@param[in] Context Opaque parameter to the call back.
|
||||
|
||||
@retval Token The wrapped token if succeed
|
||||
@retval Token The wrapped token if succeed
|
||||
@retval NULL The wrapped token if NULL
|
||||
|
||||
**/
|
||||
@@ -587,10 +587,10 @@ Ip4SetAddress (
|
||||
Interface->Image,
|
||||
Interface->Controller
|
||||
);
|
||||
|
||||
|
||||
Interface->Arp = NULL;
|
||||
}
|
||||
|
||||
|
||||
NetLibDestroyServiceChild (
|
||||
Interface->Controller,
|
||||
Interface->Image,
|
||||
@@ -872,7 +872,7 @@ Ip4OnArpResolvedDpc (
|
||||
@param Event The Arp request event.
|
||||
@param Context The context of the callback, a point to the ARP
|
||||
queue.
|
||||
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Definition for IP4 pesudo interface structure.
|
||||
|
||||
Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
This file implements the RFC2236: IGMP v2.
|
||||
|
||||
Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@@ -682,7 +682,7 @@ Ip4ConfigProtocol (
|
||||
//
|
||||
if (IpSb->State == IP4_SERVICE_UNSTARTED) {
|
||||
//
|
||||
// Trigger the EFI_IP4_CONFIG2_PROTOCOL to retrieve the
|
||||
// Trigger the EFI_IP4_CONFIG2_PROTOCOL to retrieve the
|
||||
// default IPv4 address if it is not available yet.
|
||||
//
|
||||
Policy = IpSb->Ip4Config2Instance.Policy;
|
||||
@@ -1048,11 +1048,11 @@ Ip4Groups (
|
||||
// is decreamented each time an address is removed..
|
||||
//
|
||||
for (Index = IpInstance->GroupCount; Index > 0 ; Index--) {
|
||||
Group = 0;
|
||||
Group = 0;
|
||||
if(IpInstance->Groups != NULL) {
|
||||
Group = IpInstance->Groups[Index - 1];
|
||||
}
|
||||
|
||||
Group = IpInstance->Groups[Index - 1];
|
||||
}
|
||||
|
||||
if ((GroupAddress == NULL) || EFI_IP4_EQUAL (&Group, GroupAddress)) {
|
||||
if (EFI_ERROR (Ip4LeaveGroup (IpInstance, NTOHL (Group)))) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
@@ -1663,7 +1663,7 @@ EfiIp4Transmit (
|
||||
}
|
||||
|
||||
RawHdrLen = (UINT8) (RawHdrLen << 2);
|
||||
|
||||
|
||||
CopyMem (&Head, FirstFragment, IP4_MIN_HEADLEN);
|
||||
|
||||
Ip4NtohHead (&Head);
|
||||
@@ -2253,8 +2253,8 @@ Ip4SentPacketTicking (
|
||||
}
|
||||
|
||||
/**
|
||||
This heart beat timer of IP4 service instance times out all of its IP4 children's
|
||||
received-but-not-delivered and transmitted-but-not-recycle packets, and provides
|
||||
This heart beat timer of IP4 service instance times out all of its IP4 children's
|
||||
received-but-not-delivered and transmitted-but-not-recycle packets, and provides
|
||||
time input for its IGMP protocol.
|
||||
|
||||
@param[in] Event The IP4 service instance's heart beat timer.
|
||||
@@ -2272,17 +2272,17 @@ Ip4TimerTicking (
|
||||
|
||||
IpSb = (IP4_SERVICE *) Context;
|
||||
NET_CHECK_SIGNATURE (IpSb, IP4_SERVICE_SIGNATURE);
|
||||
|
||||
|
||||
Ip4PacketTimerTicking (IpSb);
|
||||
Ip4IgmpTicking (IpSb);
|
||||
}
|
||||
|
||||
/**
|
||||
This dedicated timer is used to poll underlying network media status. In case
|
||||
of cable swap or wireless network switch, a new round auto configuration will
|
||||
be initiated. The timer will signal the IP4 to run DHCP configuration again.
|
||||
IP4 driver will free old IP address related resource, such as route table and
|
||||
Interface, then initiate a DHCP process to acquire new IP, eventually create
|
||||
This dedicated timer is used to poll underlying network media status. In case
|
||||
of cable swap or wireless network switch, a new round auto configuration will
|
||||
be initiated. The timer will signal the IP4 to run DHCP configuration again.
|
||||
IP4 driver will free old IP address related resource, such as route table and
|
||||
Interface, then initiate a DHCP process to acquire new IP, eventually create
|
||||
route table for new IP address.
|
||||
|
||||
@param[in] Event The IP4 service instance's heart beat timer.
|
||||
@@ -2303,12 +2303,12 @@ Ip4TimerReconfigChecking (
|
||||
|
||||
IpSb = (IP4_SERVICE *) Context;
|
||||
NET_CHECK_SIGNATURE (IpSb, IP4_SERVICE_SIGNATURE);
|
||||
|
||||
|
||||
OldMediaPresent = IpSb->MediaPresent;
|
||||
|
||||
//
|
||||
// Get fresh mode data from MNP, since underlying media status may change.
|
||||
// Here, it needs to mention that the MediaPresent can also be checked even if
|
||||
// Get fresh mode data from MNP, since underlying media status may change.
|
||||
// Here, it needs to mention that the MediaPresent can also be checked even if
|
||||
// EFI_NOT_STARTED returned while this MNP child driver instance isn't configured.
|
||||
//
|
||||
Status = IpSb->Mnp->GetModeData (IpSb->Mnp, NULL, &SnpModeData);
|
||||
@@ -2323,8 +2323,8 @@ Ip4TimerReconfigChecking (
|
||||
if (!OldMediaPresent && IpSb->MediaPresent && (IpSb->Ip4Config2Instance.Policy == Ip4Config2PolicyDhcp)) {
|
||||
//
|
||||
// Signal the IP4 to run the dhcp configuration again. IP4 driver will free
|
||||
// old IP address related resource, such as route table and Interface, then
|
||||
// initiate a DHCP round to acquire new IP, eventually
|
||||
// old IP address related resource, such as route table and Interface, then
|
||||
// initiate a DHCP round to acquire new IP, eventually
|
||||
// create route table for new IP address.
|
||||
//
|
||||
if (IpSb->ReconfigEvent != NULL) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
Ip4 internal functions and type defintions.
|
||||
|
||||
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
|
||||
|
||||
@@ -134,7 +134,7 @@ struct _IP4_PROTOCOL {
|
||||
EFI_HANDLE Handle;
|
||||
INTN State;
|
||||
|
||||
BOOLEAN InDestroy;
|
||||
BOOLEAN InDestroy;
|
||||
|
||||
IP4_SERVICE *Service;
|
||||
LIST_ENTRY Link; // Link to all the IP protocol from the service
|
||||
@@ -212,7 +212,7 @@ struct _IP4_SERVICE {
|
||||
BOOLEAN Reconfig;
|
||||
|
||||
//
|
||||
// Underlying media present status.
|
||||
// Underlying media present status.
|
||||
//
|
||||
BOOLEAN MediaPresent;
|
||||
|
||||
@@ -334,8 +334,8 @@ Ip4Groups (
|
||||
);
|
||||
|
||||
/**
|
||||
This heart beat timer of IP4 service instance times out all of its IP4 children's
|
||||
received-but-not-delivered and transmitted-but-not-recycle packets, and provides
|
||||
This heart beat timer of IP4 service instance times out all of its IP4 children's
|
||||
received-but-not-delivered and transmitted-but-not-recycle packets, and provides
|
||||
time input for its IGMP protocol.
|
||||
|
||||
@param[in] Event The IP4 service instance's heart beat timer.
|
||||
@@ -350,11 +350,11 @@ Ip4TimerTicking (
|
||||
);
|
||||
|
||||
/**
|
||||
This dedicated timer is used to poll underlying network media status. In case
|
||||
of cable swap or wireless network switch, a new round auto configuration will
|
||||
be initiated. The timer will signal the IP4 to run DHCP configuration again.
|
||||
IP4 driver will free old IP address related resource, such as route table and
|
||||
Interface, then initiate a DHCP process to acquire new IP, eventually create
|
||||
This dedicated timer is used to poll underlying network media status. In case
|
||||
of cable swap or wireless network switch, a new round auto configuration will
|
||||
be initiated. The timer will signal the IP4 to run DHCP configuration again.
|
||||
IP4 driver will free old IP address related resource, such as route table and
|
||||
Interface, then initiate a DHCP process to acquire new IP, eventually create
|
||||
route table for new IP address.
|
||||
|
||||
@param[in] Event The IP4 service instance's heart beat timer.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
IP4 input process.
|
||||
|
||||
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
|
||||
|
||||
This program and the accompanying materials
|
||||
@@ -441,8 +441,8 @@ DROP:
|
||||
}
|
||||
|
||||
/**
|
||||
The callback function for the net buffer which wraps the packet processed by
|
||||
IPsec. It releases the wrap packet and also signals IPsec to free the resources.
|
||||
The callback function for the net buffer which wraps the packet processed by
|
||||
IPsec. It releases the wrap packet and also signals IPsec to free the resources.
|
||||
|
||||
@param[in] Arg The wrap context
|
||||
|
||||
@@ -469,25 +469,25 @@ Ip4IpSecFree (
|
||||
}
|
||||
|
||||
/**
|
||||
The work function to locate IPsec protocol to process the inbound or
|
||||
The work function to locate IPsec protocol to process the inbound or
|
||||
outbound IP packets. The process routine handls the packet with following
|
||||
actions: bypass the packet, discard the packet, or protect the packet.
|
||||
actions: bypass the packet, discard the packet, or protect the packet.
|
||||
|
||||
@param[in] IpSb The IP4 service instance.
|
||||
@param[in, out] Head The The caller supplied IP4 header.
|
||||
@param[in, out] Netbuf The IP4 packet to be processed by IPsec.
|
||||
@param[in, out] Options The caller supplied options.
|
||||
@param[in, out] OptionsLen The length of the option.
|
||||
@param[in] Direction The directionality in an SPD entry,
|
||||
@param[in] Direction The directionality in an SPD entry,
|
||||
EfiIPsecInBound or EfiIPsecOutBound.
|
||||
@param[in] Context The token's wrap.
|
||||
|
||||
@retval EFI_SUCCESS The IPsec protocol is not available or disabled.
|
||||
@retval EFI_SUCCESS The packet was bypassed and all buffers remain the same.
|
||||
@retval EFI_SUCCESS The packet was protected.
|
||||
@retval EFI_ACCESS_DENIED The packet was discarded.
|
||||
@retval EFI_ACCESS_DENIED The packet was discarded.
|
||||
@retval EFI_OUT_OF_RESOURCES There is no suffcient resource to complete the operation.
|
||||
@retval EFI_BUFFER_TOO_SMALL The number of non-empty block is bigger than the
|
||||
@retval EFI_BUFFER_TOO_SMALL The number of non-empty block is bigger than the
|
||||
number of input data blocks when build a fragment table.
|
||||
|
||||
**/
|
||||
@@ -519,12 +519,12 @@ Ip4IpSecProcessPacket (
|
||||
goto ON_EXIT;
|
||||
}
|
||||
ASSERT (mIpSec != NULL);
|
||||
|
||||
|
||||
Packet = *Netbuf;
|
||||
RecycleEvent = NULL;
|
||||
IpSecWrap = NULL;
|
||||
FragmentTable = NULL;
|
||||
TxWrap = (IP4_TXTOKEN_WRAP *) Context;
|
||||
TxWrap = (IP4_TXTOKEN_WRAP *) Context;
|
||||
FragmentCount = Packet->BlockOpNum;
|
||||
|
||||
ZeroMem (&ZeroHead, sizeof (IP4_HEAD));
|
||||
@@ -535,14 +535,14 @@ Ip4IpSecProcessPacket (
|
||||
if (mIpSec->DisabledFlag) {
|
||||
//
|
||||
// If IPsec is disabled, restore the original MTU
|
||||
//
|
||||
//
|
||||
IpSb->MaxPacketSize = IpSb->OldMaxPacketSize;
|
||||
goto ON_EXIT;
|
||||
} else {
|
||||
//
|
||||
// If IPsec is enabled, use the MTU which reduce the IPsec header length.
|
||||
// If IPsec is enabled, use the MTU which reduce the IPsec header length.
|
||||
//
|
||||
IpSb->MaxPacketSize = IpSb->OldMaxPacketSize - IP4_MAX_IPSEC_HEADLEN;
|
||||
IpSb->MaxPacketSize = IpSb->OldMaxPacketSize - IP4_MAX_IPSEC_HEADLEN;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -554,9 +554,9 @@ Ip4IpSecProcessPacket (
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto ON_EXIT;
|
||||
}
|
||||
|
||||
|
||||
Status = NetbufBuildExt (Packet, FragmentTable, &FragmentCount);
|
||||
|
||||
|
||||
//
|
||||
// Record the original FragmentTable and count.
|
||||
//
|
||||
@@ -572,7 +572,7 @@ Ip4IpSecProcessPacket (
|
||||
// Convert host byte order to network byte order
|
||||
//
|
||||
Ip4NtohHead (*Head);
|
||||
|
||||
|
||||
Status = mIpSec->ProcessExt (
|
||||
mIpSec,
|
||||
IpSb->Controller,
|
||||
@@ -590,7 +590,7 @@ Ip4IpSecProcessPacket (
|
||||
// Convert back to host byte order
|
||||
//
|
||||
Ip4NtohHead (*Head);
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
FreePool (OriginalFragmentTable);
|
||||
goto ON_EXIT;
|
||||
@@ -610,7 +610,7 @@ Ip4IpSecProcessPacket (
|
||||
}
|
||||
|
||||
if (Direction == EfiIPsecOutBound && TxWrap != NULL) {
|
||||
|
||||
|
||||
TxWrap->IpSecRecycleSignal = RecycleEvent;
|
||||
TxWrap->Packet = NetbufFromExt (
|
||||
FragmentTable,
|
||||
@@ -635,28 +635,28 @@ Ip4IpSecProcessPacket (
|
||||
//
|
||||
NetIpSecNetbufFree (*Netbuf);
|
||||
*Netbuf = TxWrap->Packet;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
IpSecWrap = AllocateZeroPool (sizeof (IP4_IPSEC_WRAP));
|
||||
|
||||
|
||||
if (IpSecWrap == NULL) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
gBS->SignalEvent (RecycleEvent);
|
||||
goto ON_EXIT;
|
||||
}
|
||||
|
||||
|
||||
IpSecWrap->IpSecRecycleSignal = RecycleEvent;
|
||||
IpSecWrap->Packet = Packet;
|
||||
Packet = NetbufFromExt (
|
||||
FragmentTable,
|
||||
FragmentCount,
|
||||
IP4_MAX_HEADLEN,
|
||||
0,
|
||||
Ip4IpSecFree,
|
||||
FragmentTable,
|
||||
FragmentCount,
|
||||
IP4_MAX_HEADLEN,
|
||||
0,
|
||||
Ip4IpSecFree,
|
||||
IpSecWrap
|
||||
);
|
||||
|
||||
|
||||
if (Packet == NULL) {
|
||||
Packet = IpSecWrap->Packet;
|
||||
gBS->SignalEvent (RecycleEvent);
|
||||
@@ -686,7 +686,7 @@ ON_EXIT:
|
||||
/**
|
||||
Pre-process the IPv4 packet. First validates the IPv4 packet, and
|
||||
then reassembles packet if it is necessary.
|
||||
|
||||
|
||||
@param[in] IpSb Pointer to IP4_SERVICE.
|
||||
@param[in, out] Packet Pointer to the Packet to be processed.
|
||||
@param[in] Head Pointer to the IP4_HEAD.
|
||||
@@ -696,7 +696,7 @@ ON_EXIT:
|
||||
as multicast.
|
||||
|
||||
@retval EFI_SEUCCESS The recieved packet is in well form.
|
||||
@retval EFI_INVAILD_PARAMETER The recieved packet is malformed.
|
||||
@retval EFI_INVAILD_PARAMETER The recieved packet is malformed.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -705,9 +705,9 @@ Ip4PreProcessPacket (
|
||||
IN OUT NET_BUF **Packet,
|
||||
IN IP4_HEAD *Head,
|
||||
IN UINT8 *Option,
|
||||
IN UINT32 OptionLen,
|
||||
IN UINT32 OptionLen,
|
||||
IN UINT32 Flag
|
||||
)
|
||||
)
|
||||
{
|
||||
IP4_CLIP_INFO *Info;
|
||||
UINT32 HeadLen;
|
||||
@@ -720,7 +720,7 @@ Ip4PreProcessPacket (
|
||||
if ((*Packet)->TotalSize < IP4_MIN_HEADLEN) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
HeadLen = (Head->HeadLen << 2);
|
||||
TotalLen = NTOHS (Head->TotalLen);
|
||||
|
||||
@@ -769,7 +769,7 @@ Ip4PreProcessPacket (
|
||||
// Validate the options. Don't call the Ip4OptionIsValid if
|
||||
// there is no option to save some CPU process.
|
||||
//
|
||||
|
||||
|
||||
if ((OptionLen > 0) && !Ip4OptionIsValid (Option, OptionLen, TRUE)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
@@ -810,7 +810,7 @@ Ip4PreProcessPacket (
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -842,7 +842,7 @@ Ip4AccpetFrame (
|
||||
IP4_HEAD ZeroHead;
|
||||
UINT8 *Option;
|
||||
UINT32 OptionLen;
|
||||
|
||||
|
||||
IpSb = (IP4_SERVICE *) Context;
|
||||
Option = NULL;
|
||||
|
||||
@@ -861,11 +861,11 @@ Ip4AccpetFrame (
|
||||
// Validate packet format and reassemble packet if it is necessary.
|
||||
//
|
||||
Status = Ip4PreProcessPacket (
|
||||
IpSb,
|
||||
&Packet,
|
||||
Head,
|
||||
IpSb,
|
||||
&Packet,
|
||||
Head,
|
||||
Option,
|
||||
OptionLen,
|
||||
OptionLen,
|
||||
Flag
|
||||
);
|
||||
|
||||
@@ -890,7 +890,7 @@ Ip4AccpetFrame (
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto RESTART;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// If the packet is protected by tunnel mode, parse the inner Ip Packet.
|
||||
//
|
||||
@@ -914,7 +914,7 @@ Ip4AccpetFrame (
|
||||
goto RESTART;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ASSERT (Packet != NULL);
|
||||
Head = Packet->Ip.Ip4;
|
||||
IP4_GET_CLIP_INFO (Packet)->Status = EFI_SUCCESS;
|
||||
@@ -1298,7 +1298,7 @@ Ip4InstanceDeliverPacket (
|
||||
//
|
||||
Head = NetbufAllocSpace (Dup, IP4_MAX_HEADLEN, NET_BUF_HEAD);
|
||||
ASSERT (Head != NULL);
|
||||
|
||||
|
||||
Dup->Ip.Ip4 = (IP4_HEAD *) Head;
|
||||
|
||||
CopyMem (Head, Packet->Ip.Ip4, Packet->Ip.Ip4->HeadLen << 2);
|
||||
@@ -1345,7 +1345,7 @@ Ip4InstanceDeliverPacket (
|
||||
@param[in] Head The header of the received packet.
|
||||
@param[in] Packet The data of the received packet.
|
||||
@param[in] Option Point to the IP4 packet header options.
|
||||
@param[in] OptionLen Length of the IP4 packet header options.
|
||||
@param[in] OptionLen Length of the IP4 packet header options.
|
||||
@param[in] IpIf The interface to enqueue the packet to.
|
||||
|
||||
@return The number of the IP4 children that accepts the packet
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#define IP4_MIN_HEADLEN 20
|
||||
#define IP4_MAX_HEADLEN 60
|
||||
///
|
||||
/// 8(ESP header) + 16(max IV) + 16(max padding) + 2(ESP tail) + 12(max ICV) = 54
|
||||
/// 8(ESP header) + 16(max IV) + 16(max padding) + 2(ESP tail) + 12(max ICV) = 54
|
||||
///
|
||||
#define IP4_MAX_IPSEC_HEADLEN 54
|
||||
|
||||
@@ -169,7 +169,7 @@ Ip4Demultiplex (
|
||||
@param[in] Head The header of the received packet.
|
||||
@param[in] Packet The data of the received packet.
|
||||
@param[in] Option Point to the IP4 packet header options.
|
||||
@param[in] OptionLen Length of the IP4 packet header options.
|
||||
@param[in] OptionLen Length of the IP4 packet header options.
|
||||
@param[in] IpIf The interface to enqueue the packet to.
|
||||
|
||||
@return The number of the IP4 children that accepts the packet
|
||||
@@ -216,25 +216,25 @@ Ip4PacketTimerTicking (
|
||||
);
|
||||
|
||||
/**
|
||||
The work function to locate IPsec protocol to process the inbound or
|
||||
The work function to locate IPsec protocol to process the inbound or
|
||||
outbound IP packets. The process routine handls the packet with following
|
||||
actions: bypass the packet, discard the packet, or protect the packet.
|
||||
actions: bypass the packet, discard the packet, or protect the packet.
|
||||
|
||||
@param[in] IpSb The IP4 service instance.
|
||||
@param[in, out] Head The The caller supplied IP4 header.
|
||||
@param[in, out] Netbuf The IP4 packet to be processed by IPsec.
|
||||
@param[in, out] Options The caller supplied options.
|
||||
@param[in, out] OptionsLen The length of the option.
|
||||
@param[in] Direction The directionality in an SPD entry,
|
||||
@param[in] Direction The directionality in an SPD entry,
|
||||
EfiIPsecInBound or EfiIPsecOutBound.
|
||||
@param[in] Context The token's wrap.
|
||||
|
||||
@retval EFI_SUCCESS The IPsec protocol is not available or disabled.
|
||||
@retval EFI_SUCCESS The packet was bypassed and all buffers remain the same.
|
||||
@retval EFI_SUCCESS The packet was protected.
|
||||
@retval EFI_ACCESS_DENIED The packet was discarded.
|
||||
@retval EFI_ACCESS_DENIED The packet was discarded.
|
||||
@retval EFI_OUT_OF_RESOURCES There is no suffcient resource to complete the operation.
|
||||
@retval EFI_BUFFER_TOO_SMALL The number of non-empty block is bigger than the
|
||||
@retval EFI_BUFFER_TOO_SMALL The number of non-empty block is bigger than the
|
||||
number of input data blocks when build a fragment table.
|
||||
|
||||
**/
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
IP4 option support functions.
|
||||
|
||||
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -109,7 +109,7 @@ Ip4OptionIsValid (
|
||||
@param[in] Option The original option to copy from
|
||||
@param[in] OptionLen The length of the original option
|
||||
@param[in] FirstFragment Whether it is the first fragment
|
||||
@param[in, out] Buf The buffer to copy options to. NULL
|
||||
@param[in, out] Buf The buffer to copy options to. NULL
|
||||
@param[in, out] BufLen The length of the buffer
|
||||
|
||||
@retval EFI_SUCCESS The options are copied over
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
IP4 option support routines.
|
||||
|
||||
Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -54,7 +54,7 @@ Ip4OptionIsValid (
|
||||
@param[in] Option The original option to copy from
|
||||
@param[in] OptionLen The length of the original option
|
||||
@param[in] FirstFragment Whether it is the first fragment
|
||||
@param[in, out] Buf The buffer to copy options to. NULL
|
||||
@param[in, out] Buf The buffer to copy options to. NULL
|
||||
@param[in, out] BufLen The length of the buffer
|
||||
|
||||
@retval EFI_SUCCESS The options are copied over
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
Transmit the IP4 packet.
|
||||
|
||||
Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -269,16 +269,16 @@ Ip4Output (
|
||||
Head->Ver = 4;
|
||||
RawData = FALSE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Call IPsec process.
|
||||
//
|
||||
Status = Ip4IpSecProcessPacket (
|
||||
IpSb,
|
||||
&Head,
|
||||
&Packet,
|
||||
&Option,
|
||||
&OptLen,
|
||||
IpSb,
|
||||
&Head,
|
||||
&Packet,
|
||||
&Option,
|
||||
&OptLen,
|
||||
EfiIPsecOutBound,
|
||||
Context
|
||||
);
|
||||
@@ -286,7 +286,7 @@ Ip4Output (
|
||||
if (EFI_ERROR(Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
Dest = Head->Dst;
|
||||
if (IP4_IS_BROADCAST (Ip4GetNetCast (Dest, IpIf)) || (Dest == IP4_ALLONE_ADDRESS)) {
|
||||
//
|
||||
@@ -333,7 +333,7 @@ Ip4Output (
|
||||
// OK, selected the source and route, fragment the packet then send
|
||||
// them. Tag each fragment other than the first one as spawn from it.
|
||||
//
|
||||
Mtu = IpSb->MaxPacketSize + sizeof (IP4_HEAD);
|
||||
Mtu = IpSb->MaxPacketSize + sizeof (IP4_HEAD);
|
||||
|
||||
if (Packet->TotalSize + HeadLen > Mtu) {
|
||||
//
|
||||
@@ -342,7 +342,7 @@ Ip4Output (
|
||||
if (RawData) {
|
||||
return EFI_BAD_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Packet is fragmented from the tail to the head, that is, the
|
||||
// first frame sent is the last fragment of the packet. The first
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
EFI IP4 route table and route cache table defintions.
|
||||
|
||||
Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
Reference in New Issue
Block a user