From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=ting.ye@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D67DB2095BB78 for ; Wed, 18 Oct 2017 00:32:16 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Oct 2017 00:35:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,395,1503385200"; d="scan'208";a="911018445" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 18 Oct 2017 00:35:53 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 18 Oct 2017 00:35:52 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 18 Oct 2017 00:35:51 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by shsmsx102.ccr.corp.intel.com ([169.254.2.175]) with mapi id 14.03.0319.002; Wed, 18 Oct 2017 15:35:49 +0800 From: "Ye, Ting" To: "Fu, Siyuan" , "edk2-devel@lists.01.org" CC: "Wu, Jiaxin" Thread-Topic: [Patch] NetworkPkg: Remove ping6 and ifconfig shell application. Thread-Index: AQHTR0j+LGva8hqt10GOLPFLWbPa+KLpOMig Date: Wed, 18 Oct 2017 07:35:49 +0000 Message-ID: References: <20171017130751.30192-1-siyuan.fu@intel.com> In-Reply-To: <20171017130751.30192-1-siyuan.fu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] NetworkPkg: Remove ping6 and ifconfig shell application. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 07:32:17 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ye Ting =20 -----Original Message----- From: Fu, Siyuan=20 Sent: Tuesday, October 17, 2017 9:08 PM To: edk2-devel@lists.01.org Cc: Wu, Jiaxin; Ye, Ting Subject: [Patch] NetworkPkg: Remove ping6 and ifconfig shell application. Edk2 has duplicated ping6/ifconfig6 implementation in NetworkPkg and ShellP= kg. The usage and parameter format of these 2 versions are exactly same. These = two commands have been added to Shell specification so the copy under ShellPkg\Library\UefiShellNetwork2CommandsLib\ will be actively maintained in future. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Cc: Wu Jiaxin Cc: Ye Ting --- NetworkPkg/Application/IfConfig6/IfConfig6.c | 1793 ----------------= ---- NetworkPkg/Application/IfConfig6/IfConfig6.h | 79 - NetworkPkg/Application/IfConfig6/IfConfig6.inf | 67 - NetworkPkg/Application/IfConfig6/IfConfig6.uni | 23 - .../Application/IfConfig6/IfConfig6Extra.uni | 20 - .../Application/IfConfig6/IfConfig6Strings.uni | 92 - NetworkPkg/Application/Ping6/Ia32/Tsc.c | 28 - NetworkPkg/Application/Ping6/Ipf/Itc.c | 28 - NetworkPkg/Application/Ping6/Ping6.c | 1200 ------------- NetworkPkg/Application/Ping6/Ping6.h | 87 - NetworkPkg/Application/Ping6/Ping6.inf | 78 - NetworkPkg/Application/Ping6/Ping6.uni | 22 - NetworkPkg/Application/Ping6/Ping6Extra.uni | 20 - NetworkPkg/Application/Ping6/Ping6Strings.uni | 53 - NetworkPkg/Application/Ping6/X64/Tsc.c | 28 - NetworkPkg/NetworkPkg.dsc | 3 - 16 files changed, 3621 deletions(-) delete mode 100644 NetworkPkg/Application/IfConfig6/IfConfig6.c delete mode 100644 NetworkPkg/Application/IfConfig6/IfConfig6.h delete mode 100644 NetworkPkg/Application/IfConfig6/IfConfig6.inf delete mode 100644 NetworkPkg/Application/IfConfig6/IfConfig6.uni delete mode 100644 NetworkPkg/Application/IfConfig6/IfConfig6Extra.uni delete mode 100644 NetworkPkg/Application/IfConfig6/IfConfig6Strings.uni delete mode 100644 NetworkPkg/Application/Ping6/Ia32/Tsc.c delete mode 100644 NetworkPkg/Application/Ping6/Ipf/Itc.c delete mode 100644 NetworkPkg/Application/Ping6/Ping6.c delete mode 100644 NetworkPkg/Application/Ping6/Ping6.h delete mode 100644 NetworkPkg/Application/Ping6/Ping6.inf delete mode 100644 NetworkPkg/Application/Ping6/Ping6.uni delete mode 100644 NetworkPkg/Application/Ping6/Ping6Extra.uni delete mode 100644 NetworkPkg/Application/Ping6/Ping6Strings.uni delete mode 100644 NetworkPkg/Application/Ping6/X64/Tsc.c diff --git a/NetworkPkg/Application/IfConfig6/IfConfig6.c b/NetworkPkg/Appl= ication/IfConfig6/IfConfig6.c deleted file mode 100644 index 48c3be3552..0000000000 --- a/NetworkPkg/Application/IfConfig6/IfConfig6.c +++ /dev/null @@ -1,1793 +0,0 @@ -/** @file - The implementation for Shell application IfConfig6. - - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "IfConfig6.h" - -// -// String token ID of ifconfig6 command help message text. -// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringIfconfig6HelpTokenId = =3D STRING_TOKEN (STR_IFCONFIG6_HELP); - -EFI_HII_HANDLE mHiiHandle; - -SHELL_PARAM_ITEM mIfConfig6CheckList[] =3D { - { - L"-b", - TypeFlag - }, - { - L"-s", - TypeMaxValue - }, - { - L"-l", - TypeValue - }, - { - L"-r", - TypeValue - }, - { - NULL, - TypeMax - }, -}; - -VAR_CHECK_ITEM mSetCheckList[] =3D { - { - L"auto", - 0x00000001, - 0x00000001, - FlagTypeSingle - }, - { - L"man", - 0x00000002, - 0x00000001, - FlagTypeSingle - }, - { - L"host", - 0x00000004, - 0x00000002, - FlagTypeSingle - }, - { - L"dad", - 0x00000008, - 0x00000004, - FlagTypeSingle - }, - { - L"gw", - 0x00000010, - 0x00000008, - FlagTypeSingle - }, - { - L"dns", - 0x00000020, - 0x00000010, - FlagTypeSingle - }, - { - L"id", - 0x00000040, - 0x00000020, - FlagTypeSingle - }, - { - NULL, - 0x0, - 0x0, - FlagTypeSkipUnknown - }, -}; - -/** - Split a string with specified separator and save the substring to a list= . - - @param[in] String The pointer of the input string. - @param[in] Separator The specified separator. - - @return The pointer of headnode of ARG_LIST. - -**/ -ARG_LIST * -SplitStrToList ( - IN CONST CHAR16 *String, - IN CHAR16 Separator - ) -{ - CHAR16 *Str; - CHAR16 *ArgStr; - ARG_LIST *ArgList; - ARG_LIST *ArgNode; - - if (String =3D=3D NULL || *String =3D=3D L'\0') { - return NULL; - } - - // - // Copy the CONST string to a local copy. - // - Str =3D AllocateCopyPool (StrSize (String), String); - ASSERT (Str !=3D NULL); - ArgStr =3D Str; - - // - // init a node for the list head. - // - ArgNode =3D (ARG_LIST *) AllocateZeroPool (sizeof (ARG_LIST)); - ASSERT (ArgNode !=3D NULL); - ArgList =3D ArgNode; - - // - // Split the local copy and save in the list node. - // - while (*Str !=3D L'\0') { - if (*Str =3D=3D Separator) { - *Str =3D L'\0'; - ArgNode->Arg =3D ArgStr; - ArgStr =3D Str + 1; - ArgNode->Next =3D (ARG_LIST *) AllocateZeroPool (sizeof (ARG_LIST)); - ASSERT (ArgNode->Next !=3D NULL); - ArgNode =3D ArgNode->Next; - } - - Str++; - } - - ArgNode->Arg =3D ArgStr; - ArgNode->Next =3D NULL; - - return ArgList; -} - -/** - Check the correctness of input Args with '-s' option. - - @param[in] CheckList The pointer of VAR_CHECK_ITEM array. - @param[in] Name The pointer of input arg. - @param[in] Init The switch to execute the check. - - @return The value of VAR_CHECK_CODE. - -**/ -VAR_CHECK_CODE -IfConfig6RetriveCheckListByName( - IN VAR_CHECK_ITEM *CheckList, - IN CHAR16 *Name, - IN BOOLEAN Init -) -{ - STATIC UINT32 CheckDuplicate; - STATIC UINT32 CheckConflict; - VAR_CHECK_CODE RtCode; - UINT32 Index; - VAR_CHECK_ITEM Arg; - - if (Init) { - CheckDuplicate =3D 0; - CheckConflict =3D 0; - return VarCheckOk; - } - - RtCode =3D VarCheckOk; - Index =3D 0; - Arg =3D CheckList[Index]; - - // - // Check the Duplicated/Conflicted/Unknown input Args. - // - while (Arg.FlagStr !=3D NULL) { - if (StrCmp (Arg.FlagStr, Name) =3D=3D 0) { - - if (CheckDuplicate & Arg.FlagID) { - RtCode =3D VarCheckDuplicate; - break; - } - - if (CheckConflict & Arg.ConflictMask) { - RtCode =3D VarCheckConflict; - break; - } - - CheckDuplicate |=3D Arg.FlagID; - CheckConflict |=3D Arg.ConflictMask; - break; - } - - Arg =3D CheckList[++Index]; - } - - if (Arg.FlagStr =3D=3D NULL) { - RtCode =3D VarCheckUnknown; - } - - return RtCode; -} - -/** - The notify function of create event when performing a manual config. - - @param[in] Event The event this notify function registered to. - @param[in] Context Pointer to the context data registered to the= event. - -**/ -VOID -EFIAPI -IfConfig6ManualAddressNotify ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - *((BOOLEAN *) Context) =3D TRUE; -} - -/** - Print MAC address. - - @param[in] Node The pointer of MAC address buffer. - @param[in] Size The size of MAC address buffer. - -**/ -VOID -IfConfig6PrintMacAddr ( - IN UINT8 *Node, - IN UINT32 Size - ) -{ - UINTN Index; - - ASSERT (Size <=3D MACADDRMAXSIZE); - - for (Index =3D 0; Index < Size; Index++) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_MAC_AD= DR_BODY), mHiiHandle, Node[Index]); - if (Index + 1 < Size) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_COLO= N), mHiiHandle); - } - } - - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_NEWLINE)= , mHiiHandle); -} - -/** - Print IPv6 address. - - @param[in] Ip The pointer of Ip bufffer in EFI_IPv6_ADDRESS= format. - @param[in] PrefixLen The pointer of PrefixLen that describes the s= ize Prefix. - -**/ -VOID -IfConfig6PrintIpAddr ( - IN EFI_IPv6_ADDRESS *Ip, - IN UINT8 *PrefixLen - ) -{ - UINTN Index; - BOOLEAN Short; - - Short =3D FALSE; - - for (Index =3D 0; Index < PREFIXMAXLEN; Index =3D Index + 2) { - - if (!Short && (Index + 1 < PREFIXMAXLEN) && (Index % 2 =3D=3D 0) && (I= p->Addr[Index] =3D=3D 0) && (Ip->Addr[Index + 1] =3D=3D 0)) { - // - // Deal with the case of ::. - // - if (Index =3D=3D 0) { - // - // :: is at the beginning of the address. - // - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_CO= LON), mHiiHandle); - } - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_COLO= N), mHiiHandle); - - while ((Ip->Addr[Index] =3D=3D 0) && (Ip->Addr[Index + 1] =3D=3D 0) = && (Index < PREFIXMAXLEN)) { - Index =3D Index + 2; - if (Index > PREFIXMAXLEN - 2) { - break; - } - } - - Short =3D TRUE; - - if (Index =3D=3D PREFIXMAXLEN) { - // - // :: is at the end of the address. - // - break; - } - } - - if (Index < PREFIXMAXLEN - 1) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_IP_A= DDR_BODY), mHiiHandle, Ip->Addr[Index]); - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_IP_A= DDR_BODY), mHiiHandle, Ip->Addr[Index + 1]); - } - - if (Index + 2 < PREFIXMAXLEN) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_COLO= N), mHiiHandle); - } - } - - if (PrefixLen !=3D NULL) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_PREFIX= _LEN), mHiiHandle, *PrefixLen); - } -} - -/** - Pick up host IPv6 address in string format from Args with "-s" option an= d convert it to EFI_IP6_CONFIG_MANUAL_ADDRESS format. - - @param[in, out] Arg The pointer of the address of ARG_LIST whi= ch save Args with the "-s" option. - @param[out] Buf The pointer of the address of EFI_IP6_CONF= IG_MANUAL_ADDRESS. - @param[out] BufSize The pointer of BufSize that describes the = size of Buf in bytes. - - @retval EFI_SUCCESS The convertion is successful. - @retval Others Does't find the host address, or it is an invalid= IPv6 address in string format. - -**/ -EFI_STATUS -IfConfig6ParseManualAddressList ( - IN OUT ARG_LIST **Arg, - OUT EFI_IP6_CONFIG_MANUAL_ADDRESS **Buf, - OUT UINTN *BufSize - ) -{ - EFI_STATUS Status; - EFI_IP6_CONFIG_MANUAL_ADDRESS *AddrBuf; - ARG_LIST *VarArg; - EFI_IPv6_ADDRESS Address; - UINT8 Prefix; - UINT8 AddrCnt; - - Prefix =3D 0; - AddrCnt =3D 0; - *BufSize =3D 0; - *Buf =3D NULL; - VarArg =3D *Arg; - Status =3D EFI_SUCCESS; - - // - // Go through the list to check the correctness of input host ip6 addres= s. - // - while ((!EFI_ERROR (Status)) && (VarArg !=3D NULL)) { - - Status =3D NetLibStrToIp6andPrefix (VarArg->Arg, &Address, &Prefix); - - if (EFI_ERROR (Status)) { - // - // host ip ip ... gw - // - break; - } - - VarArg =3D VarArg->Next; - AddrCnt++; - } - - if (AddrCnt =3D=3D 0) { - return EFI_INVALID_PARAMETER; - } - - AddrBuf =3D AllocateZeroPool (AddrCnt * sizeof (EFI_IP6_CONFIG_MANUAL_AD= DRESS)); - ASSERT (AddrBuf !=3D NULL); - - AddrCnt =3D 0; - VarArg =3D *Arg; - Status =3D EFI_SUCCESS; - - // - // Go through the list to fill in the EFI_IP6_CONFIG_MANUAL_ADDRESS stru= cture. - // - while ((!EFI_ERROR (Status)) && (VarArg !=3D NULL)) { - - Status =3D NetLibStrToIp6andPrefix (VarArg->Arg, &Address, &Prefix); - - if (EFI_ERROR (Status)) { - break; - } - - // - // If prefix length is not set, set it as Zero here. In the IfConfigSe= tInterfaceInfo() - // Zero prefix, length will be transfered to default prefix length. - // - if (Prefix =3D=3D 0xFF) { - Prefix =3D 0; - } - AddrBuf[AddrCnt].IsAnycast =3D FALSE; - AddrBuf[AddrCnt].PrefixLength =3D Prefix; - IP6_COPY_ADDRESS (&AddrBuf[AddrCnt].Address, &Address); - VarArg =3D VarArg->Next; - AddrCnt++; - } - - *Arg =3D VarArg; - - if (EFI_ERROR (Status) && (Status !=3D EFI_INVALID_PARAMETER)) { - goto ON_ERROR; - } - - *Buf =3D AddrBuf; - *BufSize =3D AddrCnt * sizeof (EFI_IP6_CONFIG_MANUAL_ADDRESS); - - return EFI_SUCCESS; - -ON_ERROR: - - FreePool (AddrBuf); - return Status; -} - -/** - Pick up gw/dns IPv6 address in string format from Args with "-s" option = and convert it to EFI_IPv6_ADDRESS format. - - @param[in, out] Arg The pointer of the address of ARG_LIST tha= t save Args with the "-s" option. - @param[out] Buf The pointer of the address of EFI_IPv6_ADD= RESS. - @param[out] BufSize The pointer of BufSize that describes the = size of Buf in bytes. - - @retval EFI_SUCCESS The conversion is successful. - @retval Others Doesn't find the host address, or it is an invali= d IPv6 address in string format. - -**/ -EFI_STATUS -IfConfig6ParseGwDnsAddressList ( - IN OUT ARG_LIST **Arg, - OUT EFI_IPv6_ADDRESS **Buf, - OUT UINTN *BufSize - ) -{ - EFI_STATUS Status; - EFI_IPv6_ADDRESS *AddrBuf; - ARG_LIST *VarArg; - EFI_IPv6_ADDRESS Address; - UINT8 Prefix; - UINT8 AddrCnt; - - AddrCnt =3D 0; - *BufSize =3D 0; - *Buf =3D NULL; - VarArg =3D *Arg; - Status =3D EFI_SUCCESS; - - // - // Go through the list to check the correctness of input gw/dns address. - // - while ((!EFI_ERROR (Status)) && (VarArg !=3D NULL)) { - - Status =3D NetLibStrToIp6andPrefix (VarArg->Arg, &Address, &Prefix); - - if (EFI_ERROR (Status)) { - // - // gw ip ip ... host - // - break; - } - - VarArg =3D VarArg->Next; - AddrCnt++; - } - - if (AddrCnt =3D=3D 0) { - return EFI_INVALID_PARAMETER; - } - - AddrBuf =3D AllocateZeroPool (AddrCnt * sizeof (EFI_IPv6_ADDRESS)); - ASSERT (AddrBuf !=3D NULL); - - AddrCnt =3D 0; - VarArg =3D *Arg; - Status =3D EFI_SUCCESS; - - // - // Go through the list to fill in the EFI_IPv6_ADDRESS structure. - // - while ((!EFI_ERROR (Status)) && (VarArg !=3D NULL)) { - - Status =3D NetLibStrToIp6andPrefix (VarArg->Arg, &Address, &Prefix); - - if (EFI_ERROR (Status)) { - break; - } - - IP6_COPY_ADDRESS (&AddrBuf[AddrCnt], &Address); - - VarArg =3D VarArg->Next; - AddrCnt++; - } - - *Arg =3D VarArg; - - if (EFI_ERROR (Status) && (Status !=3D EFI_INVALID_PARAMETER)) { - goto ON_ERROR; - } - - *Buf =3D AddrBuf; - *BufSize =3D AddrCnt * sizeof (EFI_IPv6_ADDRESS); - - return EFI_SUCCESS; - -ON_ERROR: - - FreePool (AddrBuf); - return Status; -} - -/** - Parse InterfaceId in string format from Args with the "-s" option and co= nvert it to EFI_IP6_CONFIG_INTERFACE_ID format. - - @param[in, out] Arg The pointer of the address of ARG_LIST that sa= ves Args with the "-s" option. - @param[out] IfId The pointer of EFI_IP6_CONFIG_INTERFACE_ID. - - @retval EFI_SUCCESS The get status processed successfullly. - @retval EFI_INVALID_PARAMETER The get status process failed. - -**/ -EFI_STATUS -IfConfig6ParseInterfaceId ( - IN OUT ARG_LIST **Arg, - OUT EFI_IP6_CONFIG_INTERFACE_ID **IfId - ) -{ - UINT8 Index; - UINT8 NodeVal; - CHAR16 *IdStr; - - if (*Arg =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - Index =3D 0; - IdStr =3D (*Arg)->Arg; - ASSERT (IfId !=3D NULL); - *IfId =3D AllocateZeroPool (sizeof (EFI_IP6_CONFIG_INTERFACE_ID)); - ASSERT (*IfId !=3D NULL); - - while ((*IdStr !=3D L'\0') && (Index < 8)) { - - NodeVal =3D 0; - while ((*IdStr !=3D L':') && (*IdStr !=3D L'\0')) { - - if ((*IdStr <=3D L'F') && (*IdStr >=3D L'A')) { - NodeVal =3D (UINT8)((NodeVal << 4) + *IdStr - L'A' + 10); - } else if ((*IdStr <=3D L'f') && (*IdStr >=3D L'a')) { - NodeVal =3D (UINT8)((NodeVal << 4) + *IdStr - L'a' + 10); - } else if ((*IdStr <=3D L'9') && (*IdStr >=3D L'0')) { - NodeVal =3D (UINT8)((NodeVal << 4) + *IdStr - L'0'); - } else { - FreePool (*IfId); - return EFI_INVALID_PARAMETER; - } - - IdStr++; - } - - (*IfId)->Id[Index++] =3D NodeVal; - - if (*IdStr =3D=3D L':') { - IdStr++; - } - } - - *Arg =3D (*Arg)->Next; - return EFI_SUCCESS; -} - -/** - Parse dad in string format from Args with the "-s" option and convert it= to UINT32 format. - - @param[in, out] Arg The pointer of the address of ARG_LIST that s= aves Args with the "-s" option. - @param[out] Xmits The pointer of Xmits. - - @retval EFI_SUCCESS The get status processed successfully. - @retval others The get status process failed. - -**/ -EFI_STATUS -IfConfig6ParseDadXmits ( - IN OUT ARG_LIST **Arg, - OUT UINT32 *Xmits - ) -{ - CHAR16 *ValStr; - - if (*Arg =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - ValStr =3D (*Arg)->Arg; - *Xmits =3D 0; - - while (*ValStr !=3D L'\0') { - - if ((*ValStr <=3D L'9') && (*ValStr >=3D L'0')) { - - *Xmits =3D (*Xmits * 10) + (*ValStr - L'0'); - - } else { - - return EFI_INVALID_PARAMETER; - } - - ValStr++; - } - - *Arg =3D (*Arg)->Next; - return EFI_SUCCESS; -} - -/** - The get current status of all handles. - - @param[in] ImageHandle The handle of ImageHandle. - @param[in] IfName The pointer of IfName(interface name). - @param[in] IfList The pointer of IfList(interface list). - - @retval EFI_SUCCESS The get status processed successfully. - @retval others The get status process failed. - -**/ -EFI_STATUS -IfConfig6GetInterfaceInfo ( - IN EFI_HANDLE ImageHandle, - IN CHAR16 *IfName, - IN LIST_ENTRY *IfList - ) -{ - EFI_STATUS Status; - UINTN HandleIndex; - UINTN HandleNum; - EFI_HANDLE *HandleBuffer; - EFI_IP6_CONFIG_PROTOCOL *Ip6Cfg; - EFI_IP6_CONFIG_INTERFACE_INFO *IfInfo; - IFCONFIG6_INTERFACE_CB *IfCb; - UINTN DataSize; - - HandleBuffer =3D NULL; - HandleNum =3D 0; - - IfInfo =3D NULL; - IfCb =3D NULL; - - // - // Locate all the handles with ip6 service binding protocol. - // - Status =3D gBS->LocateHandleBuffer ( - ByProtocol, - &gEfiIp6ServiceBindingProtocolGuid, - NULL, - &HandleNum, - &HandleBuffer - ); - if (EFI_ERROR (Status) || (HandleNum =3D=3D 0)) { - return EFI_ABORTED; - } - - // - // Enumerate all handles that installed with ip6 service binding protoco= l. - // - for (HandleIndex =3D 0; HandleIndex < HandleNum; HandleIndex++) { - IfCb =3D NULL; - IfInfo =3D NULL; - DataSize =3D 0; - - // - // Ip6config protocol and ip6 service binding protocol are installed - // on the same handle. - // - ASSERT (HandleBuffer !=3D NULL); - Status =3D gBS->HandleProtocol ( - HandleBuffer[HandleIndex], - &gEfiIp6ConfigProtocolGuid, - (VOID **) &Ip6Cfg - ); - - if (EFI_ERROR (Status)) { - goto ON_ERROR; - } - // - // Get the interface information size. - // - Status =3D Ip6Cfg->GetData ( - Ip6Cfg, - Ip6ConfigDataTypeInterfaceInfo, - &DataSize, - NULL - ); - - if (Status !=3D EFI_BUFFER_TOO_SMALL) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_IP6CF= G_GETDATA), mHiiHandle, Status); - goto ON_ERROR; - } - - IfInfo =3D AllocateZeroPool (DataSize); - - if (IfInfo =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto ON_ERROR; - } - // - // Get the interface info. - // - Status =3D Ip6Cfg->GetData ( - Ip6Cfg, - Ip6ConfigDataTypeInterfaceInfo, - &DataSize, - IfInfo - ); - - if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_IP6CF= G_GETDATA), mHiiHandle, Status); - goto ON_ERROR; - } - // - // Check the interface name if required. - // - if ((IfName !=3D NULL) && (StrCmp (IfName, IfInfo->Name) !=3D 0)) { - FreePool (IfInfo); - continue; - } - - DataSize =3D 0; - // - // Get the size of dns server list. - // - Status =3D Ip6Cfg->GetData ( - Ip6Cfg, - Ip6ConfigDataTypeDnsServer, - &DataSize, - NULL - ); - - if ((Status !=3D EFI_BUFFER_TOO_SMALL) && (Status !=3D EFI_NOT_FOUND))= { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_IP6CF= G_GETDATA), mHiiHandle, Status); - goto ON_ERROR; - } - - IfCb =3D AllocateZeroPool (sizeof (IFCONFIG6_INTERFACE_CB) + DataSize)= ; - - if (IfCb =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto ON_ERROR; - } - - IfCb->NicHandle =3D HandleBuffer[HandleIndex]; - IfCb->IfInfo =3D IfInfo; - IfCb->IfCfg =3D Ip6Cfg; - IfCb->DnsCnt =3D (UINT32) (DataSize / sizeof (EFI_IPv6_ADDRESS)); - - // - // Get the dns server list if has. - // - if (DataSize > 0) { - - Status =3D Ip6Cfg->GetData ( - Ip6Cfg, - Ip6ConfigDataTypeDnsServer, - &DataSize, - IfCb->DnsAddr - ); - - if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_IP6= CFG_GETDATA), mHiiHandle, Status); - goto ON_ERROR; - } - } - // - // Get the interface id if has. - // - DataSize =3D sizeof (EFI_IP6_CONFIG_INTERFACE_ID); - IfCb->IfId =3D AllocateZeroPool (DataSize); - - if (IfCb->IfId =3D=3D NULL) { - goto ON_ERROR; - } - - Status =3D Ip6Cfg->GetData ( - Ip6Cfg, - Ip6ConfigDataTypeAltInterfaceId, - &DataSize, - IfCb->IfId - ); - - if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_IP6CF= G_GETDATA), mHiiHandle, Status); - goto ON_ERROR; - } - - if (Status =3D=3D EFI_NOT_FOUND) { - FreePool (IfCb->IfId); - IfCb->IfId =3D NULL; - } - // - // Get the config policy. - // - DataSize =3D sizeof (EFI_IP6_CONFIG_POLICY); - Status =3D Ip6Cfg->GetData ( - Ip6Cfg, - Ip6ConfigDataTypePolicy, - &DataSize, - &IfCb->Policy - ); - - if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_IP6CF= G_GETDATA), mHiiHandle, Status); - goto ON_ERROR; - } - // - // Get the dad transmits. - // - DataSize =3D sizeof (EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS); - Status =3D Ip6Cfg->GetData ( - Ip6Cfg, - Ip6ConfigDataTypeDupAddrDetectTransmits, - &DataSize, - &IfCb->Xmits - ); - - if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_IP6CF= G_GETDATA), mHiiHandle, Status); - goto ON_ERROR; - } - - InsertTailList (IfList, &IfCb->Link); - - if ((IfName !=3D NULL) && (StrCmp (IfName, IfInfo->Name) =3D=3D 0)) { - // - // Only need the appointed interface, keep the allocated buffer. - // - IfCb =3D NULL; - IfInfo =3D NULL; - break; - } - } - - if (HandleBuffer !=3D NULL) { - FreePool (HandleBuffer); - } - - return EFI_SUCCESS; - -ON_ERROR: - - if (IfInfo !=3D NULL) { - FreePool (IfInfo); - } - - if (IfCb !=3D NULL) { - if (IfCb->IfId !=3D NULL) { - FreePool (IfCb->IfId); - } - - FreePool (IfCb); - } - - return Status; -} - -/** - The list process of the IfConfig6 application. - - @param[in] IfList The pointer of IfList(interface list). - - @retval EFI_SUCCESS The IfConfig6 list processed successfully. - @retval others The IfConfig6 list process failed. - -**/ -EFI_STATUS -IfConfig6ShowInterfaceInfo ( - IN LIST_ENTRY *IfList - ) -{ - EFI_STATUS Status; - LIST_ENTRY *Entry; - IFCONFIG6_INTERFACE_CB *IfCb; - UINTN Index; - - Entry =3D IfList->ForwardLink; - Status =3D EFI_SUCCESS; - - if (IsListEmpty (IfList)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_INVALID= _INTERFACE), mHiiHandle); - } - - // - // Go through the interface list. - // - while (Entry !=3D IfList) { - - IfCb =3D BASE_CR (Entry, IFCONFIG6_INTERFACE_CB, Link); - - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_BREAK)= , mHiiHandle); - - // - // Print interface name. - // - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_IF_NAM= E), mHiiHandle, IfCb->IfInfo->Name); - - // - // Print interface config policy. - // - if (IfCb->Policy =3D=3D Ip6ConfigPolicyAutomatic) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_POLI= CY_AUTO), mHiiHandle); - } else { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_POLI= CY_MAN), mHiiHandle); - } - - // - // Print dad transmit. - // - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_DAD_TR= ANSMITS), mHiiHandle, IfCb->Xmits); - - // - // Print interface id if has. - // - if (IfCb->IfId !=3D NULL) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_INTE= RFACE_ID_HEAD), mHiiHandle); - - IfConfig6PrintMacAddr ( - IfCb->IfId->Id, - 8 - ); - } - // - // Print mac address of the interface. - // - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_MAC_AD= DR_HEAD), mHiiHandle); - - IfConfig6PrintMacAddr ( - IfCb->IfInfo->HwAddress.Addr, - IfCb->IfInfo->HwAddressSize - ); - - // - // Print ip addresses list of the interface. - // - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_IP_ADD= R_HEAD), mHiiHandle); - - for (Index =3D 0; Index < IfCb->IfInfo->AddressInfoCount; Index++) { - IfConfig6PrintIpAddr ( - &IfCb->IfInfo->AddressInfo[Index].Address, - &IfCb->IfInfo->AddressInfo[Index].PrefixLength - ); - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_NEWL= INE), mHiiHandle); - } - - // - // Print dns server addresses list of the interface if has. - // - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_DNS_AD= DR_HEAD), mHiiHandle); - - for (Index =3D 0; Index < IfCb->DnsCnt; Index++) { - IfConfig6PrintIpAddr ( - &IfCb->DnsAddr[Index], - NULL - ); - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_NEWL= INE), mHiiHandle); - } - - // - // Print route table of the interface if has. - // - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_ROUTE_= HEAD), mHiiHandle); - - for (Index =3D 0; Index < IfCb->IfInfo->RouteCount; Index++) { - IfConfig6PrintIpAddr ( - &IfCb->IfInfo->RouteTable[Index].Destination, - &IfCb->IfInfo->RouteTable[Index].PrefixLength - ); - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_JOIN= T), mHiiHandle); - - IfConfig6PrintIpAddr ( - &IfCb->IfInfo->RouteTable[Index].Gateway, - NULL - ); - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_NEWL= INE), mHiiHandle); - } - - Entry =3D Entry->ForwardLink; - } - - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_INFO_BREAK), = mHiiHandle); - - return Status; -} - -/** - The clean process of the IfConfig6 application. - - @param[in] IfList The pointer of IfList(interface list). - - @retval EFI_SUCCESS The IfConfig6 clean processed successfully. - @retval others The IfConfig6 clean process failed. - -**/ -EFI_STATUS -IfConfig6ClearInterfaceInfo ( - IN LIST_ENTRY *IfList - ) -{ - EFI_STATUS Status; - LIST_ENTRY *Entry; - IFCONFIG6_INTERFACE_CB *IfCb; - EFI_IP6_CONFIG_POLICY Policy; - - Policy =3D Ip6ConfigPolicyAutomatic; - Entry =3D IfList->ForwardLink; - Status =3D EFI_SUCCESS; - - if (IsListEmpty (IfList)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_INVALID= _INTERFACE), mHiiHandle); - } - - // - // Go through the interface list. - // - while (Entry !=3D IfList) { - - IfCb =3D BASE_CR (Entry, IFCONFIG6_INTERFACE_CB, Link); - - Status =3D IfCb->IfCfg->SetData ( - IfCb->IfCfg, - Ip6ConfigDataTypePolicy, - sizeof (EFI_IP6_CONFIG_POLICY), - &Policy - ); - - if (EFI_ERROR (Status)) { - break; - } - - Entry =3D Entry->ForwardLink; - } - - return Status; -} - -/** - The set process of the IfConfig6 application. - - @param[in] IfList The pointer of IfList(interface list). - @param[in] VarArg The pointer of ARG_LIST(Args with "-s" option). - - @retval EFI_SUCCESS The IfConfig6 set processed successfully. - @retval others The IfConfig6 set process failed. - -**/ -EFI_STATUS -IfConfig6SetInterfaceInfo ( - IN LIST_ENTRY *IfList, - IN ARG_LIST *VarArg - ) -{ - EFI_STATUS Status; - IFCONFIG6_INTERFACE_CB *IfCb; - EFI_IP6_CONFIG_MANUAL_ADDRESS *CfgManAddr; - EFI_IPv6_ADDRESS *CfgAddr; - UINTN AddrSize; - EFI_IP6_CONFIG_INTERFACE_ID *InterfaceId; - UINT32 DadXmits; - UINT32 CurDadXmits; - UINTN CurDadXmitsLen; - EFI_IP6_CONFIG_POLICY Policy; - - VAR_CHECK_CODE CheckCode; - EFI_EVENT TimeOutEvt; - EFI_EVENT MappedEvt; - BOOLEAN IsAddressOk; - - UINTN DataSize; - UINT32 Index; - UINT32 Index2; - BOOLEAN IsAddressSet; - EFI_IP6_CONFIG_INTERFACE_INFO *IfInfo; - - CfgManAddr =3D NULL; - CfgAddr =3D NULL; - TimeOutEvt =3D NULL; - MappedEvt =3D NULL; - IfInfo =3D NULL; - InterfaceId =3D NULL; - CurDadXmits =3D 0; - - if (IsListEmpty (IfList)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_INVALID= _INTERFACE), mHiiHandle); - return EFI_INVALID_PARAMETER; - } - // - // Make sure to set only one interface each time. - // - IfCb =3D BASE_CR (IfList->ForwardLink, IFCONFIG6_INTERFACE_CB, Link); - Status =3D EFI_SUCCESS; - - // - // Initialize check list mechanism. - // - CheckCode =3D IfConfig6RetriveCheckListByName( - NULL, - NULL, - TRUE - ); - - // - // Create events & timers for asynchronous settings. - // - Status =3D gBS->CreateEvent ( - EVT_TIMER, - TPL_CALLBACK, - NULL, - NULL, - &TimeOutEvt - ); - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - - Status =3D gBS->CreateEvent ( - EVT_NOTIFY_SIGNAL, - TPL_NOTIFY, - IfConfig6ManualAddressNotify, - &IsAddressOk, - &MappedEvt - ); - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - // - // Parse the setting variables. - // - while (VarArg !=3D NULL) { - // - // Check invalid parameters (duplication & unknown & conflict). - // - CheckCode =3D IfConfig6RetriveCheckListByName( - mSetCheckList, - VarArg->Arg, - FALSE - ); - - if (VarCheckOk !=3D CheckCode) { - switch (CheckCode) { - case VarCheckDuplicate: - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_D= UPLICATE_COMMAND), mHiiHandle, VarArg->Arg); - break; - - case VarCheckConflict: - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_C= ONFLICT_COMMAND), mHiiHandle, VarArg->Arg); - break; - - case VarCheckUnknown: - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_U= NKNOWN_COMMAND), mHiiHandle, VarArg->Arg); - break; - - default: - break; - } - - VarArg =3D VarArg->Next; - continue; - } - // - // Process valid variables. - // - if (StrCmp(VarArg->Arg, L"auto") =3D=3D 0) { - // - // Set automaic config policy - // - Policy =3D Ip6ConfigPolicyAutomatic; - Status =3D IfCb->IfCfg->SetData ( - IfCb->IfCfg, - Ip6ConfigDataTypePolicy, - sizeof (EFI_IP6_CONFIG_POLICY), - &Policy - ); - - if (EFI_ERROR(Status)) { - goto ON_EXIT; - } - - VarArg=3D VarArg->Next; - - } else if (StrCmp (VarArg->Arg, L"man") =3D=3D 0) { - // - // Set manual config policy. - // - Policy =3D Ip6ConfigPolicyManual; - Status =3D IfCb->IfCfg->SetData ( - IfCb->IfCfg, - Ip6ConfigDataTypePolicy, - sizeof (EFI_IP6_CONFIG_POLICY), - &Policy - ); - - if (EFI_ERROR(Status)) { - goto ON_EXIT; - } - - VarArg=3D VarArg->Next; - - } else if (StrCmp (VarArg->Arg, L"host") =3D=3D 0) { - // - // Parse till the next tag or the end of command line. - // - VarArg =3D VarArg->Next; - Status =3D IfConfig6ParseManualAddressList ( - &VarArg, - &CfgManAddr, - &AddrSize - ); - - if (EFI_ERROR (Status)) { - if (Status =3D=3D EFI_INVALID_PARAMETER) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_L= ACK_ARGUMENTS), mHiiHandle, L"host"); - continue; - } else { - goto ON_EXIT; - } - } - // - // Set static host ip6 address list. - // This is a asynchronous process. - // - IsAddressOk =3D FALSE; - - Status =3D IfCb->IfCfg->RegisterDataNotify ( - IfCb->IfCfg, - Ip6ConfigDataTypeManualAddress, - MappedEvt - ); - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - - Status =3D IfCb->IfCfg->SetData ( - IfCb->IfCfg, - Ip6ConfigDataTypeManualAddress, - AddrSize, - CfgManAddr - ); - - if (Status =3D=3D EFI_NOT_READY) { - // - // Get current dad transmits count. - // - CurDadXmitsLen =3D sizeof (EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMIT= S); - IfCb->IfCfg->GetData ( - IfCb->IfCfg, - Ip6ConfigDataTypeDupAddrDetectTransmits, - &CurDadXmitsLen, - &CurDadXmits - ); - - gBS->SetTimer (TimeOutEvt, TimerRelative, 50000000 + 10000000 * Cu= rDadXmits); - - while (EFI_ERROR (gBS->CheckEvent (TimeOutEvt))) { - if (IsAddressOk) { - Status =3D EFI_SUCCESS; - break; - } - } - } - - IfCb->IfCfg->UnregisterDataNotify ( - IfCb->IfCfg, - Ip6ConfigDataTypeManualAddress, - MappedEvt - ); - - if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_MAN= _HOST), mHiiHandle, Status); - goto ON_EXIT; - } - - // - // Check whether the address is set successfully. - // - DataSize =3D 0; - - Status =3D IfCb->IfCfg->GetData ( - IfCb->IfCfg, - Ip6ConfigDataTypeInterfaceInfo, - &DataSize, - NULL - ); - - if (Status !=3D EFI_BUFFER_TOO_SMALL) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_IP6= CFG_GETDATA), mHiiHandle, Status); - goto ON_EXIT; - } - - IfInfo =3D AllocateZeroPool (DataSize); - - if (IfInfo =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto ON_EXIT; - } - - Status =3D IfCb->IfCfg->GetData ( - IfCb->IfCfg, - Ip6ConfigDataTypeInterfaceInfo, - &DataSize, - IfInfo - ); - - if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_IP6= CFG_GETDATA), mHiiHandle, Status); - goto ON_EXIT; - } - - for ( Index =3D 0; Index < (UINTN) (AddrSize / sizeof (EFI_IP6_CONFI= G_MANUAL_ADDRESS)); Index++) { - IsAddressSet =3D FALSE; - // - // By default, the prefix length 0 is regarded as 64. - // - if (CfgManAddr[Index].PrefixLength =3D=3D 0) { - CfgManAddr[Index].PrefixLength =3D 64; - } - - for (Index2 =3D 0; Index2 < IfInfo->AddressInfoCount; Index2++) { - if (EFI_IP6_EQUAL (&IfInfo->AddressInfo[Index2].Address, &CfgMan= Addr[Index].Address) && - (IfInfo->AddressInfo[Index2].PrefixLength =3D=3D CfgManAddr[= Index].PrefixLength)) { - IsAddressSet =3D TRUE; - break; - } - } - - if (!IsAddressSet) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_A= DDRESS_FAILED), mHiiHandle); - IfConfig6PrintIpAddr ( - &CfgManAddr[Index].Address, - &CfgManAddr[Index].PrefixLength - ); - } - } - - } else if (StrCmp (VarArg->Arg, L"gw") =3D=3D 0) { - // - // Parse till the next tag or the end of command line. - // - VarArg =3D VarArg->Next; - Status =3D IfConfig6ParseGwDnsAddressList ( - &VarArg, - &CfgAddr, - &AddrSize - ); - - if (EFI_ERROR (Status)) { - if (Status =3D=3D EFI_INVALID_PARAMETER) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_L= ACK_ARGUMENTS), mHiiHandle, L"gw"); - continue; - } else { - goto ON_EXIT; - } - } - // - // Set static gateway ip6 address list. - // - Status =3D IfCb->IfCfg->SetData ( - IfCb->IfCfg, - Ip6ConfigDataTypeGateway, - AddrSize, - CfgAddr - ); - - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - - } else if (StrCmp (VarArg->Arg, L"dns") =3D=3D 0) { - // - // Parse till the next tag or the end of command line. - // - VarArg =3D VarArg->Next; - Status =3D IfConfig6ParseGwDnsAddressList ( - &VarArg, - &CfgAddr, - &AddrSize - ); - - if (EFI_ERROR (Status)) { - if (Status =3D=3D EFI_INVALID_PARAMETER) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_L= ACK_ARGUMENTS), mHiiHandle, L"dns"); - continue; - } else { - goto ON_EXIT; - } - } - // - // Set static dhs server ip6 address list. - // - Status =3D IfCb->IfCfg->SetData ( - IfCb->IfCfg, - Ip6ConfigDataTypeDnsServer, - AddrSize, - CfgAddr - ); - - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - - } else if (StrCmp (VarArg->Arg, L"id") =3D=3D 0) { - // - // Parse till the next tag or the end of command line. - // - VarArg =3D VarArg->Next; - Status =3D IfConfig6ParseInterfaceId (&VarArg, &InterfaceId); - - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - // - // Set alternative interface id. - // - Status =3D IfCb->IfCfg->SetData ( - IfCb->IfCfg, - Ip6ConfigDataTypeAltInterfaceId, - sizeof (EFI_IP6_CONFIG_INTERFACE_ID), - InterfaceId - ); - - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - - } else if (StrCmp (VarArg->Arg, L"dad") =3D=3D 0) { - // - // Parse till the next tag or the end of command line. - // - VarArg =3D VarArg->Next; - Status =3D IfConfig6ParseDadXmits (&VarArg, &DadXmits); - - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - // - // Set dad transmits count. - // - Status =3D IfCb->IfCfg->SetData ( - IfCb->IfCfg, - Ip6ConfigDataTypeDupAddrDetectTransmits, - sizeof (EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANS= MITS), - &DadXmits - ); - - if (EFI_ERROR(Status)) { - goto ON_EXIT; - } - } - } - -ON_EXIT: - - if (CfgManAddr !=3D NULL) { - FreePool (CfgManAddr); - } - - if (CfgAddr !=3D NULL) { - FreePool (CfgAddr); - } - - if (MappedEvt !=3D NULL) { - gBS->CloseEvent (MappedEvt); - } - - if (TimeOutEvt !=3D NULL) { - gBS->CloseEvent (TimeOutEvt); - } - - if (IfInfo !=3D NULL) { - FreePool (IfInfo); - } - - return Status; - -} - -/** - The IfConfig6 main process. - - @param[in] Private The pointer of IFCONFIG6_PRIVATE_DATA. - - @retval EFI_SUCCESS IfConfig6 processed successfully. - @retval others The IfConfig6 process failed. - -**/ -EFI_STATUS -IfConfig6 ( - IN IFCONFIG6_PRIVATE_DATA *Private - ) -{ - EFI_STATUS Status; - - // - // Get configure information of all interfaces. - // - Status =3D IfConfig6GetInterfaceInfo ( - Private->ImageHandle, - Private->IfName, - &Private->IfList - ); - - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - - switch (Private->OpCode) { - case IfConfig6OpList: - Status =3D IfConfig6ShowInterfaceInfo (&Private->IfList); - break; - - case IfConfig6OpClear: - Status =3D IfConfig6ClearInterfaceInfo (&Private->IfList); - break; - - case IfConfig6OpSet: - Status =3D IfConfig6SetInterfaceInfo (&Private->IfList, Private->VarAr= g); - break; - - default: - Status =3D EFI_ABORTED; - } - -ON_EXIT: - - return Status; -} - -/** - The IfConfig6 cleanup process, free the allocated memory. - - @param[in] Private The pointer of IFCONFIG6_PRIVATE_DATA. - -**/ -VOID -IfConfig6Cleanup ( - IN IFCONFIG6_PRIVATE_DATA *Private - ) -{ - LIST_ENTRY *Entry; - LIST_ENTRY *NextEntry; - IFCONFIG6_INTERFACE_CB *IfCb; - ARG_LIST *ArgNode; - ARG_LIST *ArgHead; - - ASSERT (Private !=3D NULL); - - // - // Clean the list which save the set config Args. - // - if (Private->VarArg !=3D NULL) { - ArgHead =3D Private->VarArg; - - while (ArgHead->Next !=3D NULL) { - ArgNode =3D ArgHead->Next; - FreePool (ArgHead); - ArgHead =3D ArgNode; - } - - FreePool (ArgHead); - } - - if (Private->IfName !=3D NULL) - FreePool (Private->IfName); - - - // - // Clean the IFCONFIG6_INTERFACE_CB list. - // - Entry =3D Private->IfList.ForwardLink; - NextEntry =3D Entry->ForwardLink; - - while (Entry !=3D &Private->IfList) { - - IfCb =3D BASE_CR (Entry, IFCONFIG6_INTERFACE_CB, Link); - - RemoveEntryList (&IfCb->Link); - - if (IfCb->IfId !=3D NULL) { - - FreePool (IfCb->IfId); - } - - if (IfCb->IfInfo !=3D NULL) { - - FreePool (IfCb->IfInfo); - } - - FreePool (IfCb); - - Entry =3D NextEntry; - NextEntry =3D Entry->ForwardLink; - } - - FreePool (Private); -} - -/** - 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, inclu= ding - both device drivers and bus drivers. - - The entry point for the IfConfig6 application which parses the command l= ine input and calls the IfConfig6 process. - - @param[in] ImageHandle The image handle of this application. - @param[in] SystemTable The pointer to the EFI System Table. - - @retval EFI_SUCCESS The operation completed successfully. - @retval Others Some errors occur. - -**/ -EFI_STATUS -EFIAPI -IfConfig6Initialize ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - IFCONFIG6_PRIVATE_DATA *Private; - EFI_HII_PACKAGE_LIST_HEADER *PackageList; - LIST_ENTRY *ParamPackage; - CONST CHAR16 *ValueStr; - ARG_LIST *ArgList; - CHAR16 *ProblemParam; - CHAR16 *Str; - - Private =3D NULL; - - // - // Retrieve HII package list from ImageHandle - // - Status =3D gBS->OpenProtocol ( - ImageHandle, - &gEfiHiiPackageListProtocolGuid, - (VOID **) &PackageList, - ImageHandle, - NULL, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - if (EFI_ERROR (Status)) { - return Status; - } - - // - // Publish HII package list to HII Database. - // - Status =3D gHiiDatabase->NewPackageList ( - gHiiDatabase, - PackageList, - NULL, - &mHiiHandle - ); - if (EFI_ERROR (Status)) { - return Status; - } - =20 - ASSERT (mHiiHandle !=3D NULL); - - Status =3D ShellCommandLineParseEx (mIfConfig6CheckList, &ParamPackage, = &ProblemParam, TRUE, FALSE); - if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_INVALID= _COMMAND), mHiiHandle, ProblemParam); - goto ON_EXIT; - } - - // - // To handle no option. - // - if (!ShellCommandLineGetFlag (ParamPackage, L"-r") && !ShellCommandLineG= etFlag (ParamPackage, L"-s") && - !ShellCommandLineGetFlag (ParamPackage, L"-l")) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_LACK_OPTION= ), mHiiHandle); - goto ON_EXIT; - } - // - // To handle conflict options. - // - if (((ShellCommandLineGetFlag (ParamPackage, L"-r")) && (ShellCommandLin= eGetFlag (ParamPackage, L"-s"))) || - ((ShellCommandLineGetFlag (ParamPackage, L"-r")) && (ShellCommandLin= eGetFlag (ParamPackage, L"-l"))) || - ((ShellCommandLineGetFlag (ParamPackage, L"-s")) && (ShellCommandLin= eGetFlag (ParamPackage, L"-l")))) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_CONFLICT_OP= TIONS), mHiiHandle); - goto ON_EXIT; - } - - Status =3D EFI_INVALID_PARAMETER; - - Private =3D AllocateZeroPool (sizeof (IFCONFIG6_PRIVATE_DATA)); - - if (Private =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto ON_EXIT; - } - - InitializeListHead (&Private->IfList); - - // - // To get interface name for the list option. - // - if (ShellCommandLineGetFlag (ParamPackage, L"-l")) { - Private->OpCode =3D IfConfig6OpList; - ValueStr =3D ShellCommandLineGetValue (ParamPackage, L"-l"); - if (ValueStr !=3D NULL) { - Str =3D AllocateCopyPool (StrSize (ValueStr), ValueStr); - ASSERT (Str !=3D NULL); - Private->IfName =3D Str; - } - } - // - // To get interface name for the clear option. - // - if (ShellCommandLineGetFlag (ParamPackage, L"-r")) { - Private->OpCode =3D IfConfig6OpClear; - ValueStr =3D ShellCommandLineGetValue (ParamPackage, L"-r"); - if (ValueStr !=3D NULL) { - Str =3D AllocateCopyPool (StrSize (ValueStr), ValueStr); - ASSERT (Str !=3D NULL); - Private->IfName =3D Str; - } - } - // - // To get interface name and corresponding Args for the set option. - // - if (ShellCommandLineGetFlag (ParamPackage, L"-s")) { - - ValueStr =3D ShellCommandLineGetValue (ParamPackage, L"-s"); - if (ValueStr =3D=3D NULL) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_LACK_= INTERFACE), mHiiHandle); - goto ON_EXIT; - } - // - // To split the configuration into multi-section. - // - ArgList =3D SplitStrToList (ValueStr, L' '); - ASSERT (ArgList !=3D NULL); - - Private->OpCode =3D IfConfig6OpSet; - Private->IfName =3D ArgList->Arg; - - Private->VarArg =3D ArgList->Next; - - if (Private->IfName =3D=3D NULL || Private->VarArg =3D=3D NULL) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG6_ERR_LACK_= COMMAND), mHiiHandle); - goto ON_EXIT; - } - } - // - // Main process of ifconfig6. - // - Status =3D IfConfig6 (Private); - -ON_EXIT: - - ShellCommandLineFreeVarList (ParamPackage); - HiiRemovePackages (mHiiHandle); - if (Private !=3D NULL) - IfConfig6Cleanup (Private); - - return Status; -} - diff --git a/NetworkPkg/Application/IfConfig6/IfConfig6.h b/NetworkPkg/Appl= ication/IfConfig6/IfConfig6.h deleted file mode 100644 index f74897108d..0000000000 --- a/NetworkPkg/Application/IfConfig6/IfConfig6.h +++ /dev/null @@ -1,79 +0,0 @@ -/** @file - The interface function declaration of shell application IfConfig6. - - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ - -#ifndef _IFCONFIG6_H_ -#define _IFCONFIG6_H_ - -enum { - IfConfig6OpList =3D 1, - IfConfig6OpSet =3D 2, - IfConfig6OpClear =3D 3 -}; - -typedef enum { - VarCheckReserved =3D -1, - VarCheckOk =3D 0, - VarCheckDuplicate, - VarCheckConflict, - VarCheckUnknown, - VarCheckLackValue, - VarCheckOutOfMem -} VAR_CHECK_CODE; - -typedef enum { - FlagTypeSingle =3D 0, - FlagTypeNeedVar, - FlagTypeNeedSet, - FlagTypeSkipUnknown -} VAR_CHECK_FLAG_TYPE; - -#define MACADDRMAXSIZE 32 -#define PREFIXMAXLEN 16=20 - -typedef struct _IFCONFIG6_INTERFACE_CB { - EFI_HANDLE NicHandle; - LIST_ENTRY Link; - EFI_IP6_CONFIG_PROTOCOL *IfCfg; - EFI_IP6_CONFIG_INTERFACE_INFO *IfInfo;=20 - EFI_IP6_CONFIG_INTERFACE_ID *IfId; - EFI_IP6_CONFIG_POLICY Policy; - EFI_IP6_CONFIG_DUP_ADDR_DETECT_TRANSMITS Xmits; - UINT32 DnsCnt; - EFI_IPv6_ADDRESS DnsAddr[1]; -} IFCONFIG6_INTERFACE_CB; - -typedef struct _ARG_LIST ARG_LIST; - -struct _ARG_LIST { - ARG_LIST *Next; - CHAR16 *Arg; -}; - -typedef struct _IFCONFIG6_PRIVATE_DATA { - EFI_HANDLE ImageHandle; - LIST_ENTRY IfList; - - UINT32 OpCode; - CHAR16 *IfName; - ARG_LIST *VarArg; -} IFCONFIG6_PRIVATE_DATA; - -typedef struct _VAR_CHECK_ITEM{ - CHAR16 *FlagStr; - UINT32 FlagID; - UINT32 ConflictMask; - VAR_CHECK_FLAG_TYPE FlagType; -} VAR_CHECK_ITEM; -#endif diff --git a/NetworkPkg/Application/IfConfig6/IfConfig6.inf b/NetworkPkg/Ap= plication/IfConfig6/IfConfig6.inf deleted file mode 100644 index 519b7c3279..0000000000 --- a/NetworkPkg/Application/IfConfig6/IfConfig6.inf +++ /dev/null @@ -1,67 +0,0 @@ -## @file -# Shell application IfConfig6. -# -# It is shell application which is used to set and get configurations for= the -# EFI IPv6 network stack. -# -# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may b= e 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 IM= PLIED. -# -## - -[Defines] - INF_VERSION =3D 0x00010006 - BASE_NAME =3D IfConfig6 - FILE_GUID =3D 6F71926E-60CE-428d-AA58-A3D9FB879429 - MODULE_TYPE =3D UEFI_APPLICATION - VERSION_STRING =3D 1.0 - ENTRY_POINT =3D IfConfig6Initialize - MODULE_UNI_FILE =3D IfConfig6.uni - -# -# -# This flag specifies whether HII resource section is generated into PE i= mage. -# - UEFI_HII_RESOURCE_SECTION =3D TRUE - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 IPF -# -[Sources] - IfConfig6Strings.uni - IfConfig6.c - IfConfig6.h - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - ShellPkg/ShellPkg.dec - =20 -[LibraryClasses] - BaseLib - UefiBootServicesTableLib - UefiApplicationEntryPoint - UefiHiiServicesLib - BaseMemoryLib - ShellLib - MemoryAllocationLib - DebugLib - HiiLib - NetLib - -[Protocols] - gEfiIp6ServiceBindingProtocolGuid ## CONSUMES - gEfiIp6ConfigProtocolGuid ## CONSUMES - gEfiHiiPackageListProtocolGuid ## CONSUMES - -[UserExtensions.TianoCore."ExtraFiles"] - IfConfig6Extra.uni diff --git a/NetworkPkg/Application/IfConfig6/IfConfig6.uni b/NetworkPkg/Ap= plication/IfConfig6/IfConfig6.uni deleted file mode 100644 index e0ea589771..0000000000 --- a/NetworkPkg/Application/IfConfig6/IfConfig6.uni +++ /dev/null @@ -1,23 +0,0 @@ -// /** @file -// Shell application IfConfig6. -// -// It is shell application which is used to set and get configurations for= the -// EFI IPv6 network stack. -// -// Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the B= SD License -// which accompanies this distribution. The full text of the license may b= e found at -// http://opensource.org/licenses/bsd-license.php. -//=20 -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -// -// **/ - - -#string STR_MODULE_ABSTRACT #language en-US "Shell application= IfConfig6" - -#string STR_MODULE_DESCRIPTION #language en-US "It is shell appli= cation which is used to set and get configurations for the EFI IPv6 network= stack." - diff --git a/NetworkPkg/Application/IfConfig6/IfConfig6Extra.uni b/NetworkP= kg/Application/IfConfig6/IfConfig6Extra.uni deleted file mode 100644 index 7d3f27a073..0000000000 --- a/NetworkPkg/Application/IfConfig6/IfConfig6Extra.uni +++ /dev/null @@ -1,20 +0,0 @@ -// /** @file -// IfConfig6 Localized Strings and Content -// -// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the B= SD License -// which accompanies this distribution. The full text of the license may b= e 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 IM= PLIED. -// -// **/ - -#string STR_PROPERTIES_MODULE_NAME=20 -#language en-US=20 -"IfConfig6 App" - - diff --git a/NetworkPkg/Application/IfConfig6/IfConfig6Strings.uni b/Networ= kPkg/Application/IfConfig6/IfConfig6Strings.uni deleted file mode 100644 index 0c10bbdf78..0000000000 --- a/NetworkPkg/Application/IfConfig6/IfConfig6Strings.uni +++ /dev/null @@ -1,92 +0,0 @@ -/** @file - String definitions for the Shell application IfConfig6. - - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
- - 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 IMP= LIED. - -**/ - -#langdef en-US "English" - -#string STR_IFCONFIG6_ERR_IP6CFG_GETDATA #language en-US "Ip6Conf= ig->GetData return %hr\n" -#string STR_IFCONFIG6_INFO_BREAK #language en-US "-------= ----------------------------------------------------------" -#string STR_IFCONFIG6_INFO_COLON #language en-US ":" -#string STR_IFCONFIG6_INFO_JOINT #language en-US " >> " -#string STR_IFCONFIG6_INFO_NEWLINE #language en-US "\n" -#string STR_IFCONFIG6_INFO_IF_NAME #language en-US "\n%Hnam= e : %s%N\n" -#string STR_IFCONFIG6_INFO_POLICY_AUTO #language en-US "%Hpolic= y : automatic%N\n" -#string STR_IFCONFIG6_INFO_POLICY_MAN #language en-US "%Hpolic= y : manual%N\n" -#string STR_IFCONFIG6_INFO_DAD_TRANSMITS #language en-US "%Hdad x= mits : %d%N\n" -#string STR_IFCONFIG6_INFO_INTERFACE_ID_HEAD #language en-US "%Hinter= face id : %N" -#string STR_IFCONFIG6_INFO_MAC_ADDR_HEAD #language en-US "%Hmac a= ddr : %N" -#string STR_IFCONFIG6_INFO_MAC_ADDR_BODY #language en-US "%02x" -#string STR_IFCONFIG6_INFO_IP_ADDR_HEAD #language en-US "\n%Hhos= t addr : %N\n" -#string STR_IFCONFIG6_INFO_DNS_ADDR_HEAD #language en-US "\n%Hdns= server : %N\n" -#string STR_IFCONFIG6_INFO_IP_ADDR_BODY #language en-US "%02x" -#string STR_IFCONFIG6_INFO_IP_ADDR_BODY4BIT #language en-US "%x" -#string STR_IFCONFIG6_INFO_ROUTE_HEAD #language en-US "\n%Hrou= te table : %N\n" -#string STR_IFCONFIG6_INFO_PREFIX_LEN #language en-US "/%d" - -#string STR_IFCONFIG6_LINE_HELP #language en-US "Display= s or modifies the IPv6 configuration" -#string STR_IFCONFIG6_ERR_LACK_INTERFACE #language en-US "Lack in= terface name.\n" - "Usage: = IfConfig6 -s {ifname} {config options ...}\n" - "Example= : IfConfig6 -s eth0 auto\n" -#string STR_IFCONFIG6_LACK_OPTION #language en-US "Flags l= ack. Please type 'IfConfig6 -?' for help info.\n" -#string STR_IFCONFIG6_CONFLICT_OPTIONS #language en-US "Flags c= onflict. Please type 'IfConfig6 -?' for help info.\n" -#string STR_IFCONFIG6_ERR_LACK_COMMAND #language en-US "Lack in= terface config option.\n" - "Usage: = IfConfig6 -s {ifname} {config options ...}\n" - "Example= : IfConfig6 -s eth0 auto\n" -#string STR_IFCONFIG6_ERR_INVALID_INTERFACE #language en-US "Invalid= interface name.\n" - "Hint: U= se {IfConfig6 -l} to check existing interface names.\n" -#string STR_IFCONFIG6_ERR_INVALID_COMMAND #language en-US "Invalid= command. Bad command %H%s%N is skipped.\n" - "Hint: I= ncorrect option or arguments. Please type 'IfConfig6 -?' for help info.\n" -#string STR_IFCONFIG6_ERR_LACK_ARGUMENTS #language en-US "Lack ar= guments. Bad command %H%s%N is skipped.\n" - "Hint: P= lease type 'IfConfig6 -?' for help info.\n" -#string STR_IFCONFIG6_ERR_LACK_OPTION #language en-US "Lack op= tions.\n" - "Hint: P= lease type 'IfConfig6 -?' for help info.\n" -#string STR_IFCONFIG6_ERR_MAN_HOST #language en-US "Manual = address configuration failed. Please retry.\n" -#string STR_IFCONFIG6_ERR_DUPLICATE_COMMAND #language en-US "Duplica= te commands. Bad command %H%s%N is skipped.\n" - "Hint: P= lease type 'IfConfig6 -?' for help info.\n" -#string STR_IFCONFIG6_ERR_CONFLICT_COMMAND #language en-US "Conflic= t commands. Bad command %H%s%N is skipped.\n" - "Hint: P= lease type 'IfConfig6 -?' for help info.\n" -#string STR_IFCONFIG6_ERR_UNKNOWN_COMMAND #language en-US "Unknown= commands. Bad command %H%s%N is skipped.\n" - "Hint: P= lease type 'IfConfig6 -?' for help info.\n" -#string STR_IFCONFIG6_ERR_ADDRESS_FAILED #language en-US "It fail= ed to set .\n" -#string STR_IFCONFIG6_INVALID_IP #language en-US "%IfConf= ig6: Invalid IP6 address, %s\n" - -#string STR_IFCONFIG6_HELP #language en-US "" -".TH IfConfig6 0 "Displays or modifies IPv6 configuration for network inte= rface."\r\n" -".SH NAME\r\n" -"Displays or modifies IPv6 configuration for network interface.\r\n" -".SH SYNOPSIS\r\n" -" \r\n" -"IfConfig6 [-b] [-r {ifname}] [-l {ifname}] [-s {ifname} {command ...}] [-= ?]\r\n" -".SH OPTIONS\r\n" -" \r\n" -" -b (break) enable page break.\r\n" -" -r (renew) renew configuration of interface and set automatic policy.\r= \n" -" -l (list) list the configuration of interface.\r\n" -" -s (set) set configuration of interface as follows.\r\n" -" |man/auto manual or automatic policy\r\n" -" |id {mac} alternative interface id.\r\n" -" |dad {num} dad transmits count.\r\n" -" |host{ip} static host ip address, must under manual policy.\r\n" -" |gw {ip} gateway ip address, must under manual policy.\r\n" -" |dns {ip} dns server ip address, must under manual policy.\r\n" -".SH EXAMPLES\r\n" -" \r\n" -"Examples:\r\n" -" IfConfig6 -l\r\n" -" IfConfig6 -b -l\r\n" -" IfConfig6 -r eth0\r\n" -" IfConfig6 -s eth0 auto dad 10\r\n" -" IfConfig6 -s eth0 man id ff:dd:aa:88:66:cc\r\n" -" IfConfig6 -s eth1 man host 2002::1/64 2002::2/64 gw 2002::3\r\n" diff --git a/NetworkPkg/Application/Ping6/Ia32/Tsc.c b/NetworkPkg/Applicati= on/Ping6/Ia32/Tsc.c deleted file mode 100644 index e2eae99077..0000000000 --- a/NetworkPkg/Application/Ping6/Ia32/Tsc.c +++ /dev/null @@ -1,28 +0,0 @@ -/** @file - The implement to read TSC in IA32 platform. - - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ - -#include - -/** - Reads and returns the current value of the Time Stamp Counter (TSC). - - @return The current value of TSC. - -**/ -UINT64 -ReadTime () -{ - return AsmReadTsc (); -} diff --git a/NetworkPkg/Application/Ping6/Ipf/Itc.c b/NetworkPkg/Applicatio= n/Ping6/Ipf/Itc.c deleted file mode 100644 index 131e5c0e30..0000000000 --- a/NetworkPkg/Application/Ping6/Ipf/Itc.c +++ /dev/null @@ -1,28 +0,0 @@ -/** @file - The implement to read ITC in IA64 platform. - - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ - -#include - -/** - Reads and returns the current value of the Interval Timer Counter Regist= er (ITC). - - @return The current value of ITC. - -**/ -UINT64 -ReadTime () -{ - return AsmReadItc (); -} diff --git a/NetworkPkg/Application/Ping6/Ping6.c b/NetworkPkg/Application/= Ping6/Ping6.c deleted file mode 100644 index 66daac27be..0000000000 --- a/NetworkPkg/Application/Ping6/Ping6.c +++ /dev/null @@ -1,1200 +0,0 @@ -/** @file - The implementation for Ping6 application. - - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "Ping6.h" - -// -// String token ID of Ping6 command help message text. -// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringPing6HelpToken =3D STRI= NG_TOKEN (STR_PING6_HELP); - -SHELL_PARAM_ITEM Ping6ParamList[] =3D { - { - L"-l", - TypeValue - }, - { - L"-n", - TypeValue - }, - { - L"-s", - TypeValue - }, - { - NULL, - TypeMax - }, -}; - -// -// Global Variables in Ping6 application. -// -EFI_HII_HANDLE mHiiHandle; -CONST CHAR16 *mIp6DstString; -CONST CHAR16 *mIp6SrcString; -UINT64 mFrequency =3D 0; -/** - Get and calculate the frequency in tick/ms. - The result is saved in the globle variable mFrequency - - @retval EFI_SUCCESS Calculated the frequency successfully. - @retval Others Failed to calculate the frequency. - -**/ -EFI_STATUS -Ping6GetFrequency ( - VOID - ) -{ - EFI_STATUS Status; - EFI_CPU_ARCH_PROTOCOL *Cpu; - UINT64 CurrentTick; - UINT64 TimerPeriod; - - Status =3D gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **= ) &Cpu); - - if (EFI_ERROR (Status)) { - return Status; - } - - Status =3D Cpu->GetTimerValue (Cpu, 0, &CurrentTick, &TimerPeriod); - - if (EFI_ERROR (Status)) { - // - // For NT32 Simulator only. 358049 is a similar value to keep timer gr= anularity. - // Set the timer period by ourselves. - // - TimerPeriod =3D (UINT64) NTTIMERPERIOD; - } - // - // The timer period is in femtosecond (1 femtosecond is 1e-15 second). - // So 1e+12 is divided by timer period to produce the freq in tick/ms. - // - mFrequency =3D DivU64x64Remainder (1000000000000ULL, TimerPeriod, NULL); - - return EFI_SUCCESS; -} - -/** - Get and calculate the duration in ms. - - @param[in] Begin The start point of time. - @param[in] End The end point of time. - - @return The duration in ms. - -**/ -UINT64 -Ping6CalculateTick ( - IN UINT64 Begin, - IN UINT64 End - ) -{ - ASSERT (End > Begin); - return DivU64x64Remainder (End - Begin, mFrequency, NULL); -} - -/** - Destroy IPING6_ICMP6_TX_INFO, and recollect the memory. - - @param[in] TxInfo The pointer to PING6_ICMP6_TX_INFO. - -**/ -VOID -Ping6DestroyTxInfo ( - IN PING6_ICMP6_TX_INFO *TxInfo - ) -{ - EFI_IP6_TRANSMIT_DATA *TxData; - EFI_IP6_FRAGMENT_DATA *FragData; - UINTN Index; - - ASSERT (TxInfo !=3D NULL); - - if (TxInfo->Token !=3D NULL) { - - if (TxInfo->Token->Event !=3D NULL) { - gBS->CloseEvent (TxInfo->Token->Event); - } - - TxData =3D TxInfo->Token->Packet.TxData; - if (TxData !=3D NULL) { - - if (TxData->OverrideData !=3D NULL) { - FreePool (TxData->OverrideData); - } - - if (TxData->ExtHdrs !=3D NULL) { - FreePool (TxData->ExtHdrs); - } - - for (Index =3D 0; Index < TxData->FragmentCount; Index++) { - FragData =3D TxData->FragmentTable[Index].FragmentBuffer; - if (FragData !=3D NULL) { - FreePool (FragData); - } - } - } - - FreePool (TxInfo->Token); - } - - FreePool (TxInfo); -} - -/** - Match the request, and reply with SequenceNum/TimeStamp. - - @param[in] Private The pointer to PING6_PRIVATE_DATA. - @param[in] Packet The pointer to ICMP6_ECHO_REQUEST_REPLY. - - @retval EFI_SUCCESS The match is successful. - @retval EFI_NOT_FOUND The reply can't be matched with any request. - -**/ -EFI_STATUS -Ping6MatchEchoReply ( - IN PING6_PRIVATE_DATA *Private, - IN ICMP6_ECHO_REQUEST_REPLY *Packet - ) -{ - PING6_ICMP6_TX_INFO *TxInfo; - LIST_ENTRY *Entry; - LIST_ENTRY *NextEntry; - - NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->TxList) { - TxInfo =3D BASE_CR (Entry, PING6_ICMP6_TX_INFO, Link); - - if ((TxInfo->SequenceNum =3D=3D Packet->SequenceNum) && (TxInfo->TimeS= tamp =3D=3D Packet->TimeStamp)) { - Private->RxCount++; - RemoveEntryList (&TxInfo->Link); - Ping6DestroyTxInfo (TxInfo); - return EFI_SUCCESS; - } - } - - return EFI_NOT_FOUND; -} - -/** - The original intention is to send a request. - Currently, the application retransmits an icmp6 echo request packet - per second in sendnumber times that is specified by the user. - Because nothing can be done here, all things move to the timer rountine. - - @param[in] Event A EFI_EVENT type event. - @param[in] Context The pointer to Context. - -**/ -VOID -EFIAPI -Ping6OnEchoRequestSent ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ -} - -/** - receive reply, match and print reply infomation. - - @param[in] Event A EFI_EVENT type event. - @param[in] Context The pointer to context. - -**/ -VOID -EFIAPI -Ping6OnEchoReplyReceived ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - EFI_STATUS Status; - PING6_PRIVATE_DATA *Private; - EFI_IP6_COMPLETION_TOKEN *RxToken; - EFI_IP6_RECEIVE_DATA *RxData; - ICMP6_ECHO_REQUEST_REPLY *Reply; - UINT32 PayLoad; - UINT64 Rtt; - CHAR8 Near; - - Private =3D (PING6_PRIVATE_DATA *) Context; - - if (Private->Status =3D=3D EFI_ABORTED) { - return; - } - - RxToken =3D &Private->RxToken; - RxData =3D RxToken->Packet.RxData; - Reply =3D RxData->FragmentTable[0].FragmentBuffer; - PayLoad =3D RxData->DataLength; - - if (RxData->Header->NextHeader !=3D IP6_ICMP) { - goto ON_EXIT; - } - - if (!IP6_IS_MULTICAST (&Private->DstAddress) &&=20 - !EFI_IP6_EQUAL (&RxData->Header->SourceAddress, &Private->DstAddress= )) { - goto ON_EXIT; - } - - if ((Reply->Type !=3D ICMP_V6_ECHO_REPLY) || (Reply->Code !=3D 0)) { - goto ON_EXIT; - } - - if (PayLoad !=3D Private->BufferSize) { - goto ON_EXIT; - } - // - // Check whether the reply matches the sent request before. - // - Status =3D Ping6MatchEchoReply (Private, Reply); - if (EFI_ERROR(Status)) { - goto ON_EXIT; - } - // - // Display statistics on this icmp6 echo reply packet. - // - Rtt =3D Ping6CalculateTick (Reply->TimeStamp, ReadTime ()); - if (Rtt !=3D 0) { - Near =3D (CHAR8) '=3D'; - } else { - Near =3D (CHAR8) '<'; - } - - Private->RttSum +=3D Rtt; - Private->RttMin =3D Private->RttMin > Rtt ? Rtt : Private->RttMin; - Private->RttMax =3D Private->RttMax < Rtt ? Rtt : Private->RttMax; - - ShellPrintHiiEx ( - -1, - -1, - NULL, - STRING_TOKEN (STR_PING6_REPLY_INFO), - mHiiHandle, - PayLoad, - mIp6DstString, - Reply->SequenceNum, - RxData->Header->HopLimit, - Near, - Rtt - ); - -ON_EXIT: - - if (Private->RxCount < Private->SendNum) { - // - // Continue to receive icmp6 echo reply packets. - // - RxToken->Status =3D EFI_ABORTED; - - Status =3D Private->Ip6->Receive (Private->Ip6, RxToken); - - if (EFI_ERROR (Status)) { - Private->Status =3D EFI_ABORTED; - } - } else { - // - // All reply have already been received from the dest host. - // - Private->Status =3D EFI_SUCCESS; - } - // - // Singal to recycle the each rxdata here, not at the end of process. - // - gBS->SignalEvent (RxData->RecycleSignal); -} - -/** - Initial EFI_IP6_COMPLETION_TOKEN. - - @param[in] Private The pointer of PING6_PRIVATE_DATA. - @param[in] TimeStamp The TimeStamp of request. - @param[in] SequenceNum The SequenceNum of request. - - @return The pointer of EFI_IP6_COMPLETION_TOKEN. - -**/ -EFI_IP6_COMPLETION_TOKEN * -Ping6GenerateToken ( - IN PING6_PRIVATE_DATA *Private, - IN UINT64 TimeStamp, - IN UINT16 SequenceNum - ) -{ - EFI_STATUS Status; - EFI_IP6_COMPLETION_TOKEN *Token; - EFI_IP6_TRANSMIT_DATA *TxData; - ICMP6_ECHO_REQUEST_REPLY *Request; - - Request =3D AllocateZeroPool (Private->BufferSize); - - if (Request =3D=3D NULL) { - return NULL; - } - // - // Assembly icmp6 echo request packet. - // - Request->Type =3D ICMP_V6_ECHO_REQUEST; - Request->Code =3D 0; - Request->SequenceNum =3D SequenceNum; - Request->TimeStamp =3D TimeStamp; - Request->Identifier =3D 0; - // - // Leave check sum to ip6 layer, since it has no idea of source address - // selection. - // - Request->Checksum =3D 0; - - TxData =3D AllocateZeroPool (sizeof (EFI_IP6_TRANSMIT_DATA)); - - if (TxData =3D=3D NULL) { - FreePool (Request); - return NULL; - } - // - // Assembly ipv6 token for transmit. - // - TxData->OverrideData =3D 0; - TxData->ExtHdrsLength =3D 0; - TxData->ExtHdrs =3D NULL; - TxData->DataLength =3D Private->BufferSize; - TxData->FragmentCount =3D 1; - TxData->FragmentTable[0].FragmentBuffer =3D (VOID *) Request; - TxData->FragmentTable[0].FragmentLength =3D Private->BufferSize; - - Token =3D AllocateZeroPool (sizeof (EFI_IP6_COMPLETION_TOKEN)); - - if (Token =3D=3D NULL) { - FreePool (Request); - FreePool (TxData); - return NULL; - } - - Token->Status =3D EFI_ABORTED; - Token->Packet.TxData =3D TxData; - - Status =3D gBS->CreateEvent ( - EVT_NOTIFY_SIGNAL, - TPL_CALLBACK, - Ping6OnEchoRequestSent, - Private, - &Token->Event - ); - - if (EFI_ERROR (Status)) { - FreePool (Request); - FreePool (TxData); - FreePool (Token); - return NULL; - } - - return Token; -} - -/** - Transmit the EFI_IP6_COMPLETION_TOKEN. - - @param[in] Private The pointer of PING6_PRIVATE_DATA. - - @retval EFI_SUCCESS Transmitted successfully. - @retval EFI_OUT_OF_RESOURCES No memory is available on the platform. - @retval others Transmitted unsuccessfully. - -**/ -EFI_STATUS -Ping6SendEchoRequest ( - IN PING6_PRIVATE_DATA *Private - ) -{ - EFI_STATUS Status; - PING6_ICMP6_TX_INFO *TxInfo; - - TxInfo =3D AllocateZeroPool (sizeof (PING6_ICMP6_TX_INFO)); - - if (TxInfo =3D=3D NULL) { - return EFI_OUT_OF_RESOURCES; - } - - TxInfo->TimeStamp =3D ReadTime (); - TxInfo->SequenceNum =3D (UINT16) (Private->TxCount + 1); - - TxInfo->Token =3D Ping6GenerateToken ( - Private, - TxInfo->TimeStamp, - TxInfo->SequenceNum - ); - - if (TxInfo->Token =3D=3D NULL) { - Ping6DestroyTxInfo (TxInfo); - return EFI_OUT_OF_RESOURCES; - } - - Status =3D Private->Ip6->Transmit (Private->Ip6, TxInfo->Token); - - if (EFI_ERROR (Status)) { - Ping6DestroyTxInfo (TxInfo); - return Status; - } - - InsertTailList (&Private->TxList, &TxInfo->Link); - Private->TxCount++; - - return EFI_SUCCESS; -} - -/** - Place a completion token into the receive packet queue to receive the ec= ho reply. - - @param[in] Private The pointer of PING6_PRIVATE_DATA. - - @retval EFI_SUCCESS Put the token into the receive packet queue suc= cessfully. - @retval others Put the token into the receive packet queue uns= uccessfully. - -**/ -EFI_STATUS -Ping6ReceiveEchoReply ( - IN PING6_PRIVATE_DATA *Private - ) -{ - EFI_STATUS Status; - - ZeroMem (&Private->RxToken, sizeof (EFI_IP6_COMPLETION_TOKEN)); - - Status =3D gBS->CreateEvent ( - EVT_NOTIFY_SIGNAL, - TPL_CALLBACK, - Ping6OnEchoReplyReceived, - Private, - &Private->RxToken.Event - ); - - if (EFI_ERROR (Status)) { - return Status; - } - - Private->RxToken.Status =3D EFI_NOT_READY; - - return Private->Ip6->Receive (Private->Ip6, &Private->RxToken); -} - -/** - Remove the timeout request from the list. - - @param[in] Event A EFI_EVENT type event. - @param[in] Context The pointer to Context. - -**/ -VOID -EFIAPI -Ping6OnTimerRoutine ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - EFI_STATUS Status; - PING6_PRIVATE_DATA *Private; - PING6_ICMP6_TX_INFO *TxInfo; - LIST_ENTRY *Entry; - LIST_ENTRY *NextEntry; - UINT64 Time; - - Private =3D (PING6_PRIVATE_DATA *) Context; - - // - // Retransmit icmp6 echo request packets per second in sendnumber times. - // - if (Private->TxCount < Private->SendNum) { - - Status =3D Ping6SendEchoRequest (Private); - if (Private->TxCount !=3D 0){ - if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_SEND_REQUES= T), mHiiHandle, Private->TxCount + 1); - } - } - } - // - // Check whether any icmp6 echo request in the list timeout. - // - NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->TxList) { - TxInfo =3D BASE_CR (Entry, PING6_ICMP6_TX_INFO, Link); - Time =3D Ping6CalculateTick (TxInfo->TimeStamp, ReadTime ()); - - // - // Remove the timeout echo request from txlist. - // - if (Time > PING6_DEFAULT_TIMEOUT) { - - if (EFI_ERROR (TxInfo->Token->Status)) { - Private->Ip6->Cancel (Private->Ip6, TxInfo->Token); - } - // - // Remove the timeout icmp6 echo request from list. - // - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_TIMEOUT), mHi= iHandle, TxInfo->SequenceNum); - - RemoveEntryList (&TxInfo->Link); - Ping6DestroyTxInfo (TxInfo); - - if (IsListEmpty (&Private->TxList) && (Private->TxCount =3D=3D Priva= te->SendNum)) { - // - // All the left icmp6 echo request in the list timeout. - // - Private->Status =3D EFI_TIMEOUT; - } - } - } -} - -/** - Create a valid IP6 instance. - - @param[in] Private The pointer of PING6_PRIVATE_DATA. - - @retval EFI_SUCCESS Create a valid IP6 instance successfull= y. - @retval EFI_ABORTED Locate handle with ip6 service binding = protocol unsuccessfully. - @retval EFI_INVALID_PARAMETER The source address is unspecified when = the destination address is a link -ocal address. - @retval EFI_OUT_OF_RESOURCES No memory is available on the platform. - @retval EFI_NOT_FOUND The source address is not found. -**/ -EFI_STATUS -Ping6CreateIp6Instance ( - IN PING6_PRIVATE_DATA *Private - ) -{ - EFI_STATUS Status; - UINTN HandleIndex; - UINTN HandleNum; - EFI_HANDLE *HandleBuffer; - EFI_SERVICE_BINDING_PROTOCOL *Ip6Sb; - EFI_IP6_CONFIG_PROTOCOL *Ip6Cfg; - EFI_IP6_CONFIG_DATA Ip6Config; - EFI_IP6_CONFIG_INTERFACE_INFO *IfInfo; - UINTN IfInfoSize; - EFI_IPv6_ADDRESS *Addr; - UINTN AddrIndex; - - HandleBuffer =3D NULL; - Ip6Sb =3D NULL; - IfInfo =3D NULL; - IfInfoSize =3D 0; - - // - // Locate all the handles with ip6 service binding protocol. - // - Status =3D gBS->LocateHandleBuffer ( - ByProtocol, - &gEfiIp6ServiceBindingProtocolGuid, - NULL, - &HandleNum, - &HandleBuffer - ); - if (EFI_ERROR (Status) || (HandleNum =3D=3D 0)) { - return EFI_ABORTED; - } - // - // Source address is required when pinging a link-local address on multi= - - // interfaces host. - // - if (NetIp6IsLinkLocalAddr (&Private->DstAddress) && - NetIp6IsUnspecifiedAddr (&Private->SrcAddress) && - (HandleNum > 1)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_INVALID_SOURCE)= , mHiiHandle); - Status =3D EFI_INVALID_PARAMETER; - goto ON_ERROR; - } - // - // For each ip6 protocol, check interface addresses list. - // - for (HandleIndex =3D 0; HandleIndex < HandleNum; HandleIndex++) { - - Ip6Sb =3D NULL; - IfInfo =3D NULL; - IfInfoSize =3D 0; - - Status =3D gBS->HandleProtocol ( - HandleBuffer[HandleIndex], - &gEfiIp6ServiceBindingProtocolGuid, - (VOID **) &Ip6Sb - ); - if (EFI_ERROR (Status)) { - goto ON_ERROR; - } - - if (NetIp6IsUnspecifiedAddr (&Private->SrcAddress)) { - // - // No need to match interface address. - // - break; - } else { - // - // Ip6config protocol and ip6 service binding protocol are installed - // on the same handle. - // - Status =3D gBS->HandleProtocol ( - HandleBuffer[HandleIndex], - &gEfiIp6ConfigProtocolGuid, - (VOID **) &Ip6Cfg - ); - - if (EFI_ERROR (Status)) { - goto ON_ERROR; - } - // - // Get the interface information size. - // - Status =3D Ip6Cfg->GetData ( - Ip6Cfg, - Ip6ConfigDataTypeInterfaceInfo, - &IfInfoSize, - NULL - ); - - if (Status !=3D EFI_BUFFER_TOO_SMALL) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_IP6CFG_GETD= ATA), mHiiHandle, Status); - goto ON_ERROR; - } - - IfInfo =3D AllocateZeroPool (IfInfoSize); - - if (IfInfo =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto ON_ERROR; - } - // - // Get the interface info. - // - Status =3D Ip6Cfg->GetData ( - Ip6Cfg, - Ip6ConfigDataTypeInterfaceInfo, - &IfInfoSize, - IfInfo - ); - - if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_IP6CFG_GETD= ATA), mHiiHandle, Status); - goto ON_ERROR; - } - // - // Check whether the source address is one of the interface addresse= s. - // - for (AddrIndex =3D 0; AddrIndex < IfInfo->AddressInfoCount; AddrInde= x++) { - - Addr =3D &(IfInfo->AddressInfo[AddrIndex].Address); - if (EFI_IP6_EQUAL (&Private->SrcAddress, Addr)) { - // - // Match a certain interface address. - // - break; - } - } - - if (AddrIndex < IfInfo->AddressInfoCount) { - // - // Found a nic handle with right interface address. - // - break; - } - } - - FreePool (IfInfo); - IfInfo =3D NULL; - } - // - // No exact interface address matched. - // - - if (HandleIndex =3D=3D HandleNum) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_SOURCE_NOT_FOUN= D), mHiiHandle, mIp6SrcString); - Status =3D EFI_NOT_FOUND; - goto ON_ERROR; - } - - Private->NicHandle =3D HandleBuffer[HandleIndex]; - - ASSERT (Ip6Sb !=3D NULL); - Status =3D Ip6Sb->CreateChild (Ip6Sb, &Private->Ip6ChildHandle); - - if (EFI_ERROR (Status)) { - goto ON_ERROR; - } - - Status =3D gBS->OpenProtocol ( - Private->Ip6ChildHandle, - &gEfiIp6ProtocolGuid, - (VOID **) &Private->Ip6, - Private->ImageHandle, - Private->Ip6ChildHandle, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - if (EFI_ERROR (Status)) { - goto ON_ERROR; - } - - ZeroMem (&Ip6Config, sizeof (EFI_IP6_CONFIG_DATA)); - - // - // Configure the ip6 instance for icmp6 packet exchange. - // - Ip6Config.DefaultProtocol =3D 58; - Ip6Config.AcceptAnyProtocol =3D FALSE; - Ip6Config.AcceptIcmpErrors =3D TRUE; - Ip6Config.AcceptPromiscuous =3D FALSE; - Ip6Config.TrafficClass =3D 0; - Ip6Config.HopLimit =3D 128; - Ip6Config.FlowLabel =3D 0; - Ip6Config.ReceiveTimeout =3D 0; - Ip6Config.TransmitTimeout =3D 0; - - IP6_COPY_ADDRESS (&Ip6Config.StationAddress, &Private->SrcAddress); - - IP6_COPY_ADDRESS (&Ip6Config.DestinationAddress, &Private->DstAddress); - - Status =3D Private->Ip6->Configure (Private->Ip6, &Ip6Config); - - if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_IP6_CONFIG), mH= iiHandle, Status); - goto ON_ERROR; - } - - return EFI_SUCCESS; - -ON_ERROR: - if (HandleBuffer !=3D NULL) { - FreePool (HandleBuffer); - } - - if (IfInfo !=3D NULL) { - FreePool (IfInfo); - } - - if ((Ip6Sb !=3D NULL) && (Private->Ip6ChildHandle !=3D NULL)) { - Ip6Sb->DestroyChild (Ip6Sb, Private->Ip6ChildHandle); - } - - return Status; -} - -/** - Destroy the IP6 instance. - - @param[in] Private The pointer of PING6_PRIVATE_DATA. - -**/ -VOID -Ping6DestroyIp6Instance ( - IN PING6_PRIVATE_DATA *Private - ) -{ - EFI_STATUS Status; - EFI_SERVICE_BINDING_PROTOCOL *Ip6Sb; - - gBS->CloseProtocol ( - Private->Ip6ChildHandle, - &gEfiIp6ProtocolGuid, - Private->ImageHandle, - Private->Ip6ChildHandle - ); - - Status =3D gBS->HandleProtocol ( - Private->NicHandle, - &gEfiIp6ServiceBindingProtocolGuid, - (VOID **) &Ip6Sb - ); - - if (!EFI_ERROR(Status)) { - Ip6Sb->DestroyChild (Ip6Sb, Private->Ip6ChildHandle); - } -} - -/** - The Ping6 Process. - - @param[in] ImageHandle The firmware allocated handle for the UEFI i= mage. - @param[in] SendNumber The send request count. - @param[in] BufferSize The send buffer size. - @param[in] SrcAddress The source IPv6 address. - @param[in] DstAddress The destination IPv6 address. - - @retval EFI_SUCCESS The ping6 processed successfullly. - @retval others The ping6 processed unsuccessfully. - -**/ -EFI_STATUS -Ping6 ( - IN EFI_HANDLE ImageHandle, - IN UINT32 SendNumber, - IN UINT32 BufferSize, - IN EFI_IPv6_ADDRESS *SrcAddress, - IN EFI_IPv6_ADDRESS *DstAddress - ) -{ - EFI_STATUS Status; - EFI_INPUT_KEY Key; - PING6_PRIVATE_DATA *Private; - PING6_ICMP6_TX_INFO *TxInfo; - LIST_ENTRY *Entry; - LIST_ENTRY *NextEntry; - - Private =3D AllocateZeroPool (sizeof (PING6_PRIVATE_DATA)); - - ASSERT (Private !=3D NULL); - - Private->ImageHandle =3D ImageHandle; - Private->SendNum =3D SendNumber; - Private->BufferSize =3D BufferSize; - Private->RttMin =3D ~((UINT64 )(0x0)); - Private->Status =3D EFI_NOT_READY; - - InitializeListHead (&Private->TxList); - - IP6_COPY_ADDRESS (&Private->SrcAddress, SrcAddress); - IP6_COPY_ADDRESS (&Private->DstAddress, DstAddress); - - // - // Open and configure a ip6 instance for ping6. - // - Status =3D Ping6CreateIp6Instance (Private); - - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - // - // Print the command line itself. - // - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_START), mHiiHandl= e, mIp6DstString, Private->BufferSize); - // - // Create a ipv6 token to receive the first icmp6 echo reply packet. - // - Status =3D Ping6ReceiveEchoReply (Private); - - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - // - // Create and start timer to send icmp6 echo request packet per second. - // - Status =3D gBS->CreateEvent ( - EVT_TIMER | EVT_NOTIFY_SIGNAL, - TPL_CALLBACK, - Ping6OnTimerRoutine, - Private, - &Private->Timer - ); - - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - // - // Create a ipv6 token to send the first icmp6 echo request packet. - // - Status =3D Ping6SendEchoRequest (Private); - // - // EFI_NOT_READY for IPsec is enable and IKE is not established. - // - if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_READY)) { - if(Status =3D=3D EFI_NOT_FOUND) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_NOSOURCE_INDO= MAIN), mHiiHandle, mIp6DstString); - } - - goto ON_EXIT; - } - - Status =3D gBS->SetTimer ( - Private->Timer, - TimerPeriodic, - PING6_ONE_SECOND - ); - - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - // - // Control the ping6 process by two factors: - // 1. Hot key - // 2. Private->Status - // 2.1. success means all icmp6 echo request packets get reply packets= . - // 2.2. timeout means the last icmp6 echo reply request timeout to get= reply. - // 2.3. noready means ping6 process is on-the-go. - // - while (Private->Status =3D=3D EFI_NOT_READY) { - Private->Ip6->Poll (Private->Ip6); - - // - // Terminate the ping6 process by 'esc' or 'ctl-c'. - // - Status =3D gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); - - if (!EFI_ERROR(Status)) { - if ((Key.UnicodeChar =3D=3D 0x1b) || (Key.UnicodeChar =3D=3D 0x03) |= | - ((Key.UnicodeChar =3D=3D 0) && (Key.ScanCode =3D=3D SCAN_ESC))) { - goto ON_STAT; - } - } - } - -ON_STAT: - // - // Display the statistics in all. - // - gBS->SetTimer (Private->Timer, TimerCancel, 0); - - if (Private->TxCount !=3D 0) { - ShellPrintHiiEx ( - -1, - -1, - NULL, - STRING_TOKEN (STR_PING6_STAT), - mHiiHandle, - Private->TxCount, - Private->RxCount, - (100 * (Private->TxCount - Private->RxCount)) / Private->TxCount, - Private->RttSum - ); - } - - if (Private->RxCount !=3D 0) { - ShellPrintHiiEx ( - -1, - -1, - NULL, - STRING_TOKEN (STR_PING6_RTT), - mHiiHandle, - Private->RttMin, - Private->RttMax, - DivU64x64Remainder (Private->RttSum, Private->RxCount, NULL) - ); - } - -ON_EXIT: - - if (Private !=3D NULL) { - Private->Status =3D EFI_ABORTED; - - NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->TxList) { - TxInfo =3D BASE_CR (Entry, PING6_ICMP6_TX_INFO, Link); - - Status =3D Private->Ip6->Cancel (Private->Ip6, TxInfo->Token); - - RemoveEntryList (&TxInfo->Link); - Ping6DestroyTxInfo (TxInfo); - } - - if (Private->Timer !=3D NULL) { - gBS->CloseEvent (Private->Timer); - } - - if (Private->Ip6 !=3D NULL) { - Status =3D Private->Ip6->Cancel (Private->Ip6, &Private->RxToken); - } - - if (Private->RxToken.Event !=3D NULL) { - gBS->CloseEvent (Private->RxToken.Event); - } - - if (Private->Ip6ChildHandle !=3D NULL) { - Ping6DestroyIp6Instance (Private); - } - - FreePool (Private); - } - - return Status; -} - -/** - 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, inclu= ding - both device drivers and bus drivers. - - The entry point for the Ping6 application that parses the command line i= nput and calls the Ping6 process. - - @param[in] ImageHandle The firmware allocated handle for the UEFI ima= ge. - @param[in] SystemTable A pointer to the EFI System Table. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_INVALID_PARAMETETR Input parameters combination is invali= d. - @retval Others Some errors occur. - -**/ -EFI_STATUS -EFIAPI -InitializePing6 ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - EFI_IPv6_ADDRESS DstAddress; - EFI_IPv6_ADDRESS SrcAddress; - UINT64 BufferSize; - UINTN SendNumber; - LIST_ENTRY *ParamPackage; - CONST CHAR16 *ValueStr; - CONST CHAR16 *ValueStrPtr; - UINTN NonOptionCount; - EFI_HII_PACKAGE_LIST_HEADER *PackageList; - - // - // Retrieve HII package list from ImageHandle - // - Status =3D gBS->OpenProtocol ( - ImageHandle, - &gEfiHiiPackageListProtocolGuid, - (VOID **) &PackageList, - ImageHandle, - NULL, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - if (EFI_ERROR (Status)) { - return Status; - } - - // - // Publish HII package list to HII Database. - // - Status =3D gHiiDatabase->NewPackageList ( - gHiiDatabase, - PackageList, - NULL, - &mHiiHandle - ); - if (EFI_ERROR (Status)) { - return Status; - } - =20 - ASSERT (mHiiHandle !=3D NULL); - - Status =3D ShellCommandLineParseEx (Ping6ParamList, &ParamPackage, NULL,= TRUE, FALSE); - if (EFI_ERROR(Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_INVALID_INPUT),= mHiiHandle); - goto ON_EXIT; - } - - SendNumber =3D 10; - BufferSize =3D 16; - - // - // Parse the parameter of count number. - // - ValueStr =3D ShellCommandLineGetValue (ParamPackage, L"-n"); - ValueStrPtr =3D ValueStr; - if (ValueStr !=3D NULL) { - SendNumber =3D ShellStrToUintn (ValueStrPtr); - - // - // ShellStrToUintn will return 0 when input is 0 or an invalid input s= tring. - // - if ((SendNumber =3D=3D 0) || (SendNumber > PING6_MAX_SEND_NUMBER)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_INVALID_SEND_= NUMBER), mHiiHandle, ValueStr); - Status =3D EFI_INVALID_PARAMETER; - goto ON_EXIT; - } - } - // - // Parse the parameter of buffer size. - // - ValueStr =3D ShellCommandLineGetValue (ParamPackage, L"-l"); - ValueStrPtr =3D ValueStr; - if (ValueStr !=3D NULL) { - BufferSize =3D ShellStrToUintn (ValueStrPtr); - - // - // ShellStrToUintn will return 0 when input is 0 or an invalid input s= tring. - // - if ((BufferSize < 16) || (BufferSize > PING6_MAX_BUFFER_SIZE)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_INVALID_BUFFE= R_SIZE), mHiiHandle, ValueStr); - Status =3D EFI_INVALID_PARAMETER; - goto ON_EXIT; - } - } - - ZeroMem (&SrcAddress, sizeof (EFI_IPv6_ADDRESS)); - ZeroMem (&DstAddress, sizeof (EFI_IPv6_ADDRESS)); - - // - // Parse the parameter of source ip address. - // - ValueStr =3D ShellCommandLineGetValue (ParamPackage, L"-s"); - ValueStrPtr =3D ValueStr; - if (ValueStr !=3D NULL) { - mIp6SrcString =3D ValueStr; - Status =3D NetLibStrToIp6 (ValueStrPtr, &SrcAddress); - if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_INVALID_IP), = mHiiHandle, ValueStr); - Status =3D EFI_INVALID_PARAMETER; - goto ON_EXIT; - } - } - // - // Parse the parameter of destination ip address. - // - NonOptionCount =3D ShellCommandLineGetCount(ParamPackage); - ValueStr =3D ShellCommandLineGetRawValue (ParamPackage, (UINT32)(NonOpti= onCount-1)); - if (NonOptionCount !=3D 2) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_INVALID_INPUT),= mHiiHandle); - Status =3D EFI_INVALID_PARAMETER; - goto ON_EXIT; - } - ValueStrPtr =3D ValueStr; - if (ValueStr !=3D NULL) { - mIp6DstString =3D ValueStr; - Status =3D NetLibStrToIp6 (ValueStrPtr, &DstAddress); - if (EFI_ERROR (Status)) { - ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PING6_INVALID_IP), = mHiiHandle, ValueStr); - Status =3D EFI_INVALID_PARAMETER; - goto ON_EXIT; - } - } - // - // Get frequency to calculate the time from ticks. - // - Status =3D Ping6GetFrequency (); - - if (EFI_ERROR(Status)) { - goto ON_EXIT; - } - // - // Enter into ping6 process. - // - Status =3D Ping6 ( - ImageHandle, - (UINT32)SendNumber, - (UINT32)BufferSize, - &SrcAddress, - &DstAddress - ); - -ON_EXIT: - ShellCommandLineFreeVarList (ParamPackage); - HiiRemovePackages (mHiiHandle); - return Status; -} diff --git a/NetworkPkg/Application/Ping6/Ping6.h b/NetworkPkg/Application/= Ping6/Ping6.h deleted file mode 100644 index 6f590af8c0..0000000000 --- a/NetworkPkg/Application/Ping6/Ping6.h +++ /dev/null @@ -1,87 +0,0 @@ -/** @file - The interface function declaration of shell application Ping6 (Ping for = v6 series). - - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ - -#ifndef _PING6_H_ -#define _PING6_H_ - -#define PING6_DEFAULT_TIMEOUT 5000 -#define PING6_MAX_SEND_NUMBER 10000 -#define PING6_MAX_BUFFER_SIZE 32768 -#define PING6_ONE_SECOND 10000000 - -// -// A similar amount of time that passes in femtoseconds -// for each increment of TimerValue. It is for NT32 only. -// -#define NTTIMERPERIOD 358049 - -#pragma pack(1) - -typedef struct _ICMP6_ECHO_REQUEST_REPLY { - UINT8 Type; - UINT8 Code; - UINT16 Checksum; - UINT16 Identifier; - UINT16 SequenceNum; - UINT64 TimeStamp; - UINT8 Data[1]; -} ICMP6_ECHO_REQUEST_REPLY; - -#pragma pack() - -typedef struct _PING6_ICMP6_TX_INFO { - LIST_ENTRY Link; - UINT16 SequenceNum; - UINT64 TimeStamp; - EFI_IP6_COMPLETION_TOKEN *Token; -} PING6_ICMP6_TX_INFO; - -typedef struct _PING6_PRIVATE_DATA { - EFI_HANDLE ImageHandle; - EFI_HANDLE NicHandle; - EFI_HANDLE Ip6ChildHandle; - EFI_IP6_PROTOCOL *Ip6; - EFI_EVENT Timer; - - EFI_STATUS Status; - LIST_ENTRY TxList; - EFI_IP6_COMPLETION_TOKEN RxToken; - UINT16 RxCount; - UINT16 TxCount; - UINT64 RttSum; - UINT64 RttMin; - UINT64 RttMax; - UINT32 SequenceNum; - - EFI_IPv6_ADDRESS SrcAddress; - EFI_IPv6_ADDRESS DstAddress; - UINT32 SendNum; - UINT32 BufferSize; -} PING6_PRIVATE_DATA; - -/** - Reads and returns the current value of register. - In IA64, the register is the Interval Timer Vector (ITV). - In X86(IA32/X64), the register is the Time Stamp Counter (TSC) - - @return The current value of the register. - -**/ -UINT64 -ReadTime ( - VOID - ); - -#endif diff --git a/NetworkPkg/Application/Ping6/Ping6.inf b/NetworkPkg/Applicatio= n/Ping6/Ping6.inf deleted file mode 100644 index 68b5f2d32f..0000000000 --- a/NetworkPkg/Application/Ping6/Ping6.inf +++ /dev/null @@ -1,78 +0,0 @@ -## @file -# Shell application Ping6. -# -# It is an shell application which is used to Ping the target host with I= Pv6 stack. -# -# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
-# -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the B= SD License -# which accompanies this distribution. The full text of the license may b= e 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 IM= PLIED. -# -## - -[Defines] - INF_VERSION =3D 0x00010006 - BASE_NAME =3D Ping6 - FILE_GUID =3D F35F733F-5235-4d7b-83FA-97780CEBCB20 - MODULE_TYPE =3D UEFI_APPLICATION - VERSION_STRING =3D 1.0 - ENTRY_POINT =3D InitializePing6 - MODULE_UNI_FILE =3D Ping6.uni - -# -# -# This flag specifies whether HII resource section is generated into PE i= mage. -# - UEFI_HII_RESOURCE_SECTION =3D TRUE - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 IPF -# - -[Sources] - Ping6.c - Ping6Strings.uni - Ping6.h - -[Sources.IA32] - Ia32/Tsc.c - -[Sources.X64] - X64/Tsc.c - -[Sources.IPF] - Ipf/Itc.c - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - ShellPkg/ShellPkg.dec - -[LibraryClasses] - BaseLib - UefiBootServicesTableLib - UefiApplicationEntryPoint - UefiHiiServicesLib - BaseMemoryLib - ShellLib - MemoryAllocationLib - DebugLib - HiiLib - NetLib - -[Protocols] - gEfiCpuArchProtocolGuid ## CONSUMES - gEfiIp6ProtocolGuid ## CONSUMES - gEfiIp6ServiceBindingProtocolGuid ## CONSUMES - gEfiIp6ConfigProtocolGuid ## CONSUMES - gEfiHiiPackageListProtocolGuid ## CONSUMES - -[UserExtensions.TianoCore."ExtraFiles"] - Ping6Extra.uni diff --git a/NetworkPkg/Application/Ping6/Ping6.uni b/NetworkPkg/Applicatio= n/Ping6/Ping6.uni deleted file mode 100644 index afd14b796a..0000000000 --- a/NetworkPkg/Application/Ping6/Ping6.uni +++ /dev/null @@ -1,22 +0,0 @@ -// /** @file -// Shell application Ping6. -// -// It is an shell application which is used to Ping the target host with I= Pv6 stack. -// -// Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the B= SD License -// which accompanies this distribution. The full text of the license may b= e found at -// http://opensource.org/licenses/bsd-license.php. -//=20 -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. -// -// **/ - - -#string STR_MODULE_ABSTRACT #language en-US "Shell application= Ping6" - -#string STR_MODULE_DESCRIPTION #language en-US "It is an shell ap= plication which is used to Ping the target host with IPv6 stack." - diff --git a/NetworkPkg/Application/Ping6/Ping6Extra.uni b/NetworkPkg/Appli= cation/Ping6/Ping6Extra.uni deleted file mode 100644 index 097ea5578a..0000000000 --- a/NetworkPkg/Application/Ping6/Ping6Extra.uni +++ /dev/null @@ -1,20 +0,0 @@ -// /** @file -// Ping6 Localized Strings and Content -// -// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.
-// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the B= SD License -// which accompanies this distribution. The full text of the license may b= e 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 IM= PLIED. -// -// **/ - -#string STR_PROPERTIES_MODULE_NAME=20 -#language en-US=20 -"Ping6 App" - - diff --git a/NetworkPkg/Application/Ping6/Ping6Strings.uni b/NetworkPkg/App= lication/Ping6/Ping6Strings.uni deleted file mode 100644 index e4ab19fe63..0000000000 --- a/NetworkPkg/Application/Ping6/Ping6Strings.uni +++ /dev/null @@ -1,53 +0,0 @@ -/** @file - String definitions for the Shell Ping6 application. - - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ - -#langdef en-US "English" - -#string STR_PING6_INVALID_IP #language en-US "%Ping6: Inval= id IP6 address, %s\n" -#string STR_PING6_INVALID_INPUT #language en-US "%Ping6: Inval= id input, please type 'Ping6 -?'for help\n" -#string STR_PING6_INVALID_SEND_NUMBER #language en-US "%Ping6: Inval= id send number, %s\n" -#string STR_PING6_INVALID_BUFFER_SIZE #language en-US "%Ping6: Inval= id buffer size, %s\n" -#string STR_PING6_INVALID_SOURCE #language en-US "%Ping6: Requi= re source interface option\n" -#string STR_PING6_IP6_CONFIG #language en-US "%Ping6: Ip6->= Config %r\n" -#string STR_PING6_IP6_GETMODE #language en-US "%Ping6: Ip6->= GetModeData %r\n" -#string STR_PING6_IP6CFG_GETDATA #language en-US "%Ping6: Ip6Co= nfig->GetData %r\n" -#string STR_PING6_SEND_REQUEST #language en-US "Echo request = sequence %d fails.\n" -#string STR_PING6_SOURCE_NOT_FOUND #language en-US "Source %s not= found.\n" -#string STR_PING6_NOSOURCE_INDOMAIN #language en-US "No sources in= %s's multicast domain.\n" -#string STR_PING6_START #language en-US "Ping %s %d da= ta bytes\n\n" -#string STR_PING6_TIMEOUT #language en-US "Echo request = sequence %d timeout.\n" -#string STR_PING6_REPLY_INFO #language en-US "%d bytes from= %s : icmp_seq=3D%d ttl=3D%d time%c%dms\n" -#string STR_PING6_STAT #language en-US "\n%d packets = transmitted, %d received, %d%% packet loss, time %dms\n" -#string STR_PING6_RTT #language en-US "\nRtt(round t= rip time) min=3D%dms max=3D%dms avg=3D%dms\n" -#string STR_PING6_LINE_HELP #language en-US "Ping a target= machine with UEFI IPv6 network stack" - -#string STR_PING6_HELP #language en-US "" -".TH Ping6 0 "Ping a target machine with UEFI IPv6 network stack."\r\n" -".SH NAME\r\n" -"Ping a target machine with UEFI IPv6 network stack.\r\n" -".SH SYNOPSIS\r\n" -" \r\n" -"Ping6 [-l size] [-n count] [-s SourceIp] TargetIp\r\n" -".SH OPTIONS\r\n" -" \r\n" -" -l size Send buffer size, in bytes(default=3D16, min=3D16, max=3D32= 768).\r\n" -" -n count Send request count, (default=3D10, min=3D1, max=3D10000).\r= \n" -" -s SourceIp Source IPv6 address.\r\n" -" TargetIp Target IPv6 address.\r\n" -".SH EXAMPLES\r\n" -" \r\n" -"Examples:\r\n" -" Ping6 -s 2002::1 2002::2 -l 1000 -n 5\r\n" -" Ping6 2002::2 -l 1000\r\n" diff --git a/NetworkPkg/Application/Ping6/X64/Tsc.c b/NetworkPkg/Applicatio= n/Ping6/X64/Tsc.c deleted file mode 100644 index b3e7bdbb96..0000000000 --- a/NetworkPkg/Application/Ping6/X64/Tsc.c +++ /dev/null @@ -1,28 +0,0 @@ -/** @file - The implement to read TSC in X64 platform. - - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
- - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BS= D License - which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. - -**/ - -#include - -/** - Reads and returns the current value of Time Stamp Counter (TSC). - - @return The current value of TSC - -**/ -UINT64 -ReadTime () -{ - return AsmReadTsc (); -} diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc index 56a1a6b617..b193f5f38b 100644 --- a/NetworkPkg/NetworkPkg.dsc +++ b/NetworkPkg/NetworkPkg.dsc @@ -116,7 +116,6 @@ NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf NetworkPkg/HttpBootDxe/HttpBootDxe.inf =20 - NetworkPkg/Application/IfConfig6/IfConfig6.inf NetworkPkg/Application/IpsecConfig/IpSecConfig.inf NetworkPkg/Application/VConfig/VConfig.inf =20 @@ -126,8 +125,6 @@ NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf NetworkPkg/TlsDxe/TlsDxe.inf NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf - =20 - NetworkPkg/Application/Ping6/Ping6.inf =20 [BuildOptions] *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES --=20 2.13.0.windows.1