Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeIpIoLib
- Timestamp:
- Oct 29, 2015 4:30:44 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 103777
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
- Property svn:mergeinfo changed
/vendor/edk2/current merged: 103769-103776
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.c
r48674 r58466 78 78 {FALSE, TRUE}, // ICMP6_ERR_UNREACH_HOST 79 79 {TRUE, TRUE}, // ICMP6_ERR_UNREACH_PROTOCOL 80 {TRUE, TRUE}, // ICMP6_ERR_UNREACH_PORT 80 {TRUE, TRUE}, // ICMP6_ERR_UNREACH_PORT 81 81 {TRUE, TRUE}, // ICMP6_ERR_PACKAGE_TOOBIG 82 82 {FALSE, TRUE}, // ICMP6_ERR_TIMXCEED_HOPLIMIT 83 83 {FALSE, TRUE}, // ICMP6_ERR_TIMXCEED_REASS 84 {FALSE, TRUE}, // ICMP6_ERR_PARAMPROB_HEADER 84 {FALSE, TRUE}, // ICMP6_ERR_PARAMPROB_HEADER 85 85 {FALSE, TRUE}, // ICMP6_ERR_PARAMPROB_NEXHEADER 86 86 {FALSE, TRUE} // ICMP6_ERR_PARAMPROB_IPV6OPTION … … 255 255 256 256 /** 257 This function handles ICMPv4 packets. It is the worker function of 257 This function handles ICMPv4 packets. It is the worker function of 258 258 IpIoIcmpHandler. 259 259 … … 380 380 IpIo->PktRcvdNotify (EFI_ICMP_ERROR, IcmpErr, Session, Pkt, IpIo->RcvdContext); 381 381 382 return EFI_SUCCESS; 383 } 384 385 /** 386 This function handles ICMPv6 packets. It is the worker function of 382 return EFI_SUCCESS; 383 } 384 385 /** 386 This function handles ICMPv6 packets. It is the worker function of 387 387 IpIoIcmpHandler. 388 388 … … 428 428 // 429 429 // Analyze the ICMPv6 Error in this ICMPv6 packet 430 // 430 // 431 431 switch (Type) { 432 432 case ICMP_V6_DEST_UNREACHABLE: … … 487 487 488 488 return EFI_ABORTED; 489 } 489 } 490 490 491 491 // … … 498 498 PayLoadHdr = (UINT8 *) ((UINT8 *) IcmpHdr + sizeof (IP6_ICMP_ERROR_HEAD)); 499 499 Flag = TRUE; 500 500 501 501 do { 502 502 switch (NextHeader) { … … 536 536 537 537 TrimBytes = (UINT32) (PayLoadHdr - (UINT8 *) IcmpHdr); 538 538 539 539 NetbufTrim (Pkt, TrimBytes, TRUE); 540 540 … … 625 625 { 626 626 IP_IO_SEND_ENTRY *SndEntry; 627 EFI_EVENT Event; 627 EFI_EVENT Event; 628 628 EFI_STATUS Status; 629 629 NET_FRAGMENT *ExtFragment; … … 675 675 676 676 // 677 // Build a fragment table to contain the fragments in the packet. 677 // Build a fragment table to contain the fragments in the packet. 678 678 // 679 679 if (IpIo->IpVersion == IP_VERSION_4) { … … 732 732 Ip6TxData->ExtHdrsLength = 0; 733 733 Ip6TxData->ExtHdrs = NULL; 734 734 735 735 // 736 736 // Set the fields of SndToken … … 779 779 /** 780 780 Destroy the SndEntry. 781 781 782 782 This function pairs with IpIoCreateSndEntry(). 783 783 … … 1064 1064 goto CleanUp; 1065 1065 } 1066 1066 1067 1067 // 1068 1068 // Create a netbuffer representing IPv6 packet … … 1084 1084 // 1085 1085 CopyMem ( 1086 &Session.Source, 1086 &Session.Source, 1087 1087 &RxData->Ip6RxData.Header->SourceAddress, 1088 1088 sizeof(EFI_IPv6_ADDRESS) 1089 1089 ); 1090 1090 CopyMem ( 1091 &Session.Dest, 1092 &RxData->Ip6RxData.Header->DestinationAddress, 1091 &Session.Dest, 1092 &RxData->Ip6RxData.Header->DestinationAddress, 1093 1093 sizeof(EFI_IPv6_ADDRESS) 1094 1094 ); … … 1096 1096 Session.IpHdrLen = RxData->Ip6RxData.HeaderLength; 1097 1097 Session.IpVersion = IP_VERSION_6; 1098 } 1098 } 1099 1099 1100 1100 if (EFI_SUCCESS == Status) { … … 1118 1118 gBS->SignalEvent (RxData->Ip4RxData.RecycleSignal); 1119 1119 } else { 1120 gBS->SignalEvent (RxData->Ip6RxData.RecycleSignal); 1120 gBS->SignalEvent (RxData->Ip6RxData.RecycleSignal); 1121 1121 } 1122 1122 … … 1153 1153 /** 1154 1154 Create a new IP_IO instance. 1155 1155 1156 1156 This function uses IP4/IP6 service binding protocol in Controller to create 1157 1157 an IP4/IP6 child (aka IP4/IP6 instance). … … 1162 1162 binding protocol installed. 1163 1163 @param[in] IpVersion The version of the IP protocol to use, either 1164 IPv4 or IPv6. 1164 IPv4 or IPv6. 1165 1165 1166 1166 @return Pointer to a newly created IP_IO instance, or NULL if failed. … … 1217 1217 Image, 1218 1218 &IpIo->ChildHandle, 1219 IpVersion, 1219 IpVersion, 1220 1220 (VOID **)&(IpIo->Ip) 1221 1221 ); … … 1240 1240 /** 1241 1241 Open an IP_IO instance for use. 1242 1242 1243 1243 This function is called after IpIoCreate(). It is used for configuring the IP 1244 1244 instance and register the callbacks and their context data for sending and … … 1252 1252 @retval EFI_SUCCESS The IP_IO instance opened with OpenData 1253 1253 successfully. 1254 @retval EFI_ACCESS_DENIED The IP_IO instance is configured, avoid to 1254 @retval EFI_ACCESS_DENIED The IP_IO instance is configured, avoid to 1255 1255 reopen it. 1256 1256 @retval Others Error condition occurred. … … 1286 1286 1287 1287 Status = IpIo->Ip.Ip6->Configure ( 1288 IpIo->Ip.Ip6, 1288 IpIo->Ip.Ip6, 1289 1289 &OpenData->IpConfigData.Ip6CfgData 1290 1290 ); … … 1359 1359 /** 1360 1360 Stop an IP_IO instance. 1361 1361 1362 1362 This function is paired with IpIoOpen(). The IP_IO will be unconfigured and all 1363 1363 the pending send/receive tokens will be canceled. … … 1436 1436 /** 1437 1437 Destroy an IP_IO instance. 1438 1438 1439 1439 This function is paired with IpIoCreate(). The IP_IO will be closed first. 1440 1440 Resource will be freed afterwards. See IpIoCloseProtocolDestroyIpChild(). … … 1476 1476 /** 1477 1477 Send out an IP packet. 1478 1478 1479 1479 This function is called after IpIoOpen(). The data to be sent are wrapped in 1480 1480 Pkt. The IP instance wrapped in IpIo is used for sending by default but can be … … 1601 1601 /** 1602 1602 Add a new IP instance for sending data. 1603 1603 1604 1604 The function is used to add the IP_IO to the IP_IO sending list. The caller 1605 1605 can later use IpIoFindSender() to get the IP_IO and call IpIoSend() to send … … 1760 1760 if (((EFI_IP4_CONFIG_DATA *) IpConfigData)->UseDefaultAddress) { 1761 1761 Ip.Ip4->GetModeData ( 1762 Ip.Ip4, 1763 &Ip4ModeData, 1764 NULL, 1762 Ip.Ip4, 1763 &Ip4ModeData, 1764 NULL, 1765 1765 NULL 1766 1766 ); … … 1771 1771 1772 1772 CopyMem ( 1773 &IpInfo->Addr.Addr, 1774 &((EFI_IP4_CONFIG_DATA *) IpConfigData)->StationAddress, 1773 &IpInfo->Addr.Addr, 1774 &((EFI_IP4_CONFIG_DATA *) IpConfigData)->StationAddress, 1775 1775 sizeof (IP4_ADDR) 1776 1776 ); 1777 1777 CopyMem ( 1778 &IpInfo->PreMask.SubnetMask, 1778 &IpInfo->PreMask.SubnetMask, 1779 1779 &((EFI_IP4_CONFIG_DATA *) IpConfigData)->SubnetMask, 1780 1780 sizeof (IP4_ADDR) … … 1830 1830 Status = EFI_NO_MAPPING; 1831 1831 goto OnExit; 1832 } 1832 } 1833 1833 1834 1834 CopyMem ( 1835 &IpInfo->Addr, 1836 &Ip6ModeData.ConfigData.StationAddress, 1835 &IpInfo->Addr, 1836 &Ip6ModeData.ConfigData.StationAddress, 1837 1837 sizeof (EFI_IPv6_ADDRESS) 1838 1838 ); … … 1845 1845 Ip.Ip6->Configure (Ip.Ip6, NULL); 1846 1846 } 1847 } 1847 } 1848 1848 } else { 1849 1849 // … … 1863 1863 Destroy an IP instance maintained in IpIo->IpList for 1864 1864 sending purpose. 1865 1865 1866 1866 This function pairs with IpIoAddIp(). The IpInfo is previously created by 1867 1867 IpIoAddIp(). The IP_IO_IP_INFO::RefCnt is decremented and the IP instance … … 1935 1935 Find the first IP protocol maintained in IpIo whose local 1936 1936 address is the same as Src. 1937 1937 1938 1938 This function is called when the caller needs the IpIo to send data to the 1939 1939 specified Src. The IpIo was added previously by IpIoAddIp(). … … 1961 1961 IP_IO_IP_INFO *IpInfo; 1962 1962 1963 ASSERT ((IpVersion == IP_VERSION_4) || (IpVersion == IP_VERSION_6)); 1963 ASSERT ((IpVersion == IP_VERSION_4) || (IpVersion == IP_VERSION_6)); 1964 1964 1965 1965 NET_LIST_FOR_EACH (IpIoEntry, &mActiveIpIoList) { … … 1983 1983 if (EFI_IP6_EQUAL (&IpInfo->Addr.v6, &Src->v6)) { 1984 1984 *IpIo = IpIoPtr; 1985 return IpInfo; 1985 return IpInfo; 1986 1986 } 1987 } 1987 } 1988 1988 1989 1989 } … … 1999 1999 /** 2000 2000 Get the ICMP error map information. 2001 2001 2002 2002 The ErrorStatus will be returned. The IsHard and Notify are optional. If they 2003 2003 are not NULL, this routine will fill them. … … 2005 2005 @param[in] IcmpError IcmpError Type. 2006 2006 @param[in] IpVersion The version of the IP protocol to use, 2007 either IPv4 or IPv6. 2007 either IPv4 or IPv6. 2008 2008 @param[out] IsHard If TRUE, indicates that it is a hard error. 2009 2009 @param[out] Notify If TRUE, SockError needs to be notified. … … 2076 2076 case ICMP6_ERR_UNREACH_HOST: 2077 2077 case ICMP6_ERR_TIMXCEED_HOPLIMIT: 2078 case ICMP6_ERR_TIMXCEED_REASS: 2078 case ICMP6_ERR_TIMXCEED_REASS: 2079 2079 return EFI_HOST_UNREACHABLE; 2080 2080 2081 2081 case ICMP6_ERR_UNREACH_PROTOCOL: 2082 2082 return EFI_PROTOCOL_UNREACHABLE; 2083 2083 2084 2084 case ICMP6_ERR_UNREACH_PORT: 2085 2085 return EFI_PORT_UNREACHABLE; … … 2110 2110 2111 2111 This function is called when the caller needs the IpIo to refresh the existing 2112 IPv6 neighbor cache entries since the neighbor is considered reachable by the 2113 node has recently received a confirmation that packets sent recently to the 2114 neighbor were received by its IP layer. 2112 IPv6 neighbor cache entries since the neighbor is considered reachable by the 2113 node has recently received a confirmation that packets sent recently to the 2114 neighbor were received by its IP layer. 2115 2115 2116 2116 @param[in] IpIo Pointer to an IP_IO instance 2117 2117 @param[in] Neighbor The IP address of the neighbor 2118 2118 @param[in] Timeout Time in 100-ns units that this entry will 2119 remain in the neighbor cache. A value of 2120 zero means that the entry is permanent. 2121 A value of non-zero means that the entry is 2119 remain in the neighbor cache. A value of 2120 zero means that the entry is permanent. 2121 A value of non-zero means that the entry is 2122 2122 dynamic and will be deleted after Timeout. 2123 2123 … … 2125 2125 @retval EFI_NOT_STARTED The IpIo is not configured. 2126 2126 @retval EFI_INVALID_PARAMETER Neighbor Address is invalid. 2127 @retval EFI_NOT_FOUND The neighbor cache entry is not in the 2128 neighbor table. 2127 @retval EFI_NOT_FOUND The neighbor cache entry is not in the 2128 neighbor table. 2129 2129 @retval EFI_OUT_OF_RESOURCES Failed due to resource limit. 2130 2130 … … 2134 2134 IN IP_IO *IpIo, 2135 2135 IN EFI_IP_ADDRESS *Neighbor, 2136 IN UINT32 Timeout 2136 IN UINT32 Timeout 2137 2137 ) 2138 2138 {
Note:
See TracChangeset
for help on using the changeset viewer.