TianoCore EDK2 master
Loading...
Searching...
No Matches
Ifconfig6.c File Reference

Go to the source code of this file.

Data Structures

struct  _IFCONFIG6_INTERFACE_CB
 
struct  _ARG_LIST
 
struct  _IFCONFIG6_PRIVATE_DATA
 
struct  _VAR_CHECK_ITEM
 

Macros

#define MACADDRMAXSIZE   32
 
#define PREFIXMAXLEN   16
 

Typedefs

typedef struct _IFCONFIG6_INTERFACE_CB IFCONFIG6_INTERFACE_CB
 
typedef struct _ARG_LIST ARG_LIST
 
typedef struct _IFCONFIG6_PRIVATE_DATA IFCONFIG6_PRIVATE_DATA
 
typedef struct _VAR_CHECK_ITEM VAR_CHECK_ITEM
 

Enumerations

enum  { IfConfig6OpList = 1 , IfConfig6OpSet = 2 , IfConfig6OpClear = 3 }
 
enum  VAR_CHECK_CODE {
  VarCheckReserved = -1 , VarCheckOk = 0 , VarCheckDuplicate , VarCheckConflict ,
  VarCheckUnknown , VarCheckLackValue , VarCheckOutOfMem , VarCheckReserved = -1 ,
  VarCheckOk = 0 , VarCheckDuplicate , VarCheckConflict , VarCheckUnknown ,
  VarCheckLackValue , VarCheckOutOfMem
}
 
enum  VAR_CHECK_FLAG_TYPE {
  FlagTypeSingle = 0 , FlagTypeNeedVar , FlagTypeNeedSet , FlagTypeSkipUnknown ,
  FlagTypeSingle = 0 , FlagTypeNeedVar , FlagTypeNeedSet , FlagTypeSkipUnknown
}
 

Functions

VOID IfConfig6FreeArgList (ARG_LIST *List)
 
ARG_LISTIfConfig6SplitStrToList (IN CONST CHAR16 *String, IN CHAR16 Separator)
 
VAR_CHECK_CODE IfConfig6RetriveCheckListByName (IN VAR_CHECK_ITEM *CheckList, IN CHAR16 *Name, IN BOOLEAN Init)
 
VOID EFIAPI IfConfig6ManualAddressNotify (IN EFI_EVENT Event, IN VOID *Context)
 
VOID IfConfig6PrintMacAddr (IN UINT8 *Node, IN UINT32 Size)
 
VOID IfConfig6PrintIpAddr (IN EFI_IPv6_ADDRESS *Ip, IN UINT8 *PrefixLen)
 
EFI_STATUS IfConfig6ParseManualAddressList (IN OUT ARG_LIST **Arg, OUT EFI_IP6_CONFIG_MANUAL_ADDRESS **Buf, OUT UINTN *BufSize)
 
EFI_STATUS IfConfig6ParseGwDnsAddressList (IN OUT ARG_LIST **Arg, OUT EFI_IPv6_ADDRESS **Buf, OUT UINTN *BufSize)
 
EFI_STATUS IfConfig6ParseInterfaceId (IN OUT ARG_LIST **Arg, OUT EFI_IP6_CONFIG_INTERFACE_ID **IfId)
 
EFI_STATUS IfConfig6ParseDadXmits (IN OUT ARG_LIST **Arg, OUT UINT32 *Xmits)
 
EFI_STATUS IfConfig6GetInterfaceInfo (IN EFI_HANDLE ImageHandle, IN CHAR16 *IfName, IN LIST_ENTRY *IfList)
 
SHELL_STATUS IfConfig6ShowInterfaceInfo (IN LIST_ENTRY *IfList)
 
SHELL_STATUS IfConfig6ClearInterfaceInfo (IN LIST_ENTRY *IfList, IN CHAR16 *IfName)
 
SHELL_STATUS IfConfig6SetInterfaceInfo (IN LIST_ENTRY *IfList, IN ARG_LIST *VarArg)
 
SHELL_STATUS IfConfig6 (IN IFCONFIG6_PRIVATE_DATA *Private)
 
VOID IfConfig6Cleanup (IN IFCONFIG6_PRIVATE_DATA *Private)
 
SHELL_STATUS EFIAPI ShellCommandRunIfconfig6 (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

SHELL_PARAM_ITEM mIfConfig6CheckList []
 
VAR_CHECK_ITEM mIfConfig6SetCheckList []
 

Detailed Description

The implementation for Shell command IfConfig6.

Copyright (c) 2016, Intel Corporation. All rights reserved.
(C) Copyright 2017 Hewlett Packard Enterprise Development LP

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Ifconfig6.c.

Macro Definition Documentation

◆ MACADDRMAXSIZE

#define MACADDRMAXSIZE   32

Definition at line 35 of file Ifconfig6.c.

◆ PREFIXMAXLEN

#define PREFIXMAXLEN   16

Definition at line 36 of file Ifconfig6.c.

Typedef Documentation

◆ ARG_LIST

typedef struct _ARG_LIST ARG_LIST

Definition at line 50 of file Ifconfig6.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Definition at line 12 of file Ifconfig6.c.

◆ VAR_CHECK_CODE

enum VAR_CHECK_CODE

Definition at line 18 of file Ifconfig6.c.

◆ VAR_CHECK_FLAG_TYPE

enum VAR_CHECK_FLAG_TYPE

Definition at line 28 of file Ifconfig6.c.

Function Documentation

◆ IfConfig6()

SHELL_STATUS IfConfig6 ( IN IFCONFIG6_PRIVATE_DATA Private)

The IfConfig6 main process.

Parameters
[in]PrivateThe pointer of IFCONFIG6_PRIVATE_DATA.
Return values
SHELL_SUCCESSIfConfig6 processed successfully.
othersThe IfConfig6 process failed.

Definition at line 1661 of file Ifconfig6.c.

◆ IfConfig6Cleanup()

VOID IfConfig6Cleanup ( IN IFCONFIG6_PRIVATE_DATA Private)

The IfConfig6 cleanup process, free the allocated memory.

Parameters
[in]PrivateThe pointer of IFCONFIG6_PRIVATE_DATA.

Definition at line 1713 of file Ifconfig6.c.

◆ IfConfig6ClearInterfaceInfo()

SHELL_STATUS IfConfig6ClearInterfaceInfo ( IN LIST_ENTRY IfList,
IN CHAR16 *  IfName 
)

The clean process of the IfConfig6 application.

Parameters
[in]IfListThe pointer of IfList(interface list).
[in]IfNameThe pointer of interface name.
Return values
SHELL_SUCCESSThe IfConfig6 clean processed successfully.
othersThe IfConfig6 clean process failed.

Definition at line 1106 of file Ifconfig6.c.

◆ IfConfig6FreeArgList()

VOID IfConfig6FreeArgList ( ARG_LIST List)

Free the ARG_LIST.

Parameters
ListPointer to ARG_LIST to free.

Definition at line 157 of file Ifconfig6.c.

◆ IfConfig6GetInterfaceInfo()

EFI_STATUS IfConfig6GetInterfaceInfo ( IN EFI_HANDLE  ImageHandle,
IN CHAR16 *  IfName,
IN LIST_ENTRY IfList 
)

The get current status of all handles.

Parameters
[in]ImageHandleThe handle of ImageHandle.
[in]IfNameThe pointer of IfName(interface name).
[in]IfListThe pointer of IfList(interface list).
Return values
EFI_SUCCESSThe get status processed successfully.
othersThe get status process failed.

Definition at line 726 of file Ifconfig6.c.

◆ IfConfig6ManualAddressNotify()

VOID EFIAPI IfConfig6ManualAddressNotify ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

The notify function of create event when performing a manual config.

Parameters
[in]EventThe event this notify function registered to.
[in]ContextPointer to the context data registered to the event.

Definition at line 318 of file Ifconfig6.c.

◆ IfConfig6ParseDadXmits()

EFI_STATUS IfConfig6ParseDadXmits ( IN OUT ARG_LIST **  Arg,
OUT UINT32 *  Xmits 
)

Parse dad in string format from Args with the "-s" option and convert it to UINT32 format.

Parameters
[in,out]ArgThe pointer of the address of ARG_LIST that saves Args with the "-s" option.
[out]XmitsThe pointer of Xmits.
Return values
EFI_SUCCESSThe get status processed successfully.
othersThe get status process failed.

Definition at line 686 of file Ifconfig6.c.

◆ IfConfig6ParseGwDnsAddressList()

EFI_STATUS IfConfig6ParseGwDnsAddressList ( IN OUT ARG_LIST **  Arg,
OUT EFI_IPv6_ADDRESS **  Buf,
OUT UINTN BufSize 
)

Pick up gw/dns IPv6 address in string format from Args with "-s" option and convert it to EFI_IPv6_ADDRESS format.

Parameters
[in,out]ArgThe pointer of the address of ARG_LIST that save Args with the "-s" option.
[out]BufThe pointer of the address of EFI_IPv6_ADDRESS.
[out]BufSizeThe pointer of BufSize that describes the size of Buf in bytes.
Return values
EFI_SUCCESSThe conversion is successful.
OthersDoesn't find the host address, or it is an invalid IPv6 address in string format.

Definition at line 534 of file Ifconfig6.c.

◆ IfConfig6ParseInterfaceId()

EFI_STATUS IfConfig6ParseInterfaceId ( IN OUT ARG_LIST **  Arg,
OUT EFI_IP6_CONFIG_INTERFACE_ID **  IfId 
)

Parse InterfaceId in string format from Args with the "-s" option and convert it to EFI_IP6_CONFIG_INTERFACE_ID format.

Parameters
[in,out]ArgThe pointer of the address of ARG_LIST that saves Args with the "-s" option.
[out]IfIdThe pointer of EFI_IP6_CONFIG_INTERFACE_ID.
Return values
EFI_SUCCESSThe get status processed successfullly.
EFI_INVALID_PARAMETERThe get status process failed.

Definition at line 628 of file Ifconfig6.c.

◆ IfConfig6ParseManualAddressList()

EFI_STATUS IfConfig6ParseManualAddressList ( IN OUT ARG_LIST **  Arg,
OUT EFI_IP6_CONFIG_MANUAL_ADDRESS **  Buf,
OUT UINTN BufSize 
)

Pick up host IPv6 address in string format from Args with "-s" option and convert it to EFI_IP6_CONFIG_MANUAL_ADDRESS format.

Parameters
[in,out]ArgThe pointer of the address of ARG_LIST which save Args with the "-s" option.
[out]BufThe pointer of the address of EFI_IP6_CONFIG_MANUAL_ADDRESS.
[out]BufSizeThe pointer of BufSize that describes the size of Buf in bytes.
Return values
EFI_SUCCESSThe convertion is successful.
OthersDoes't find the host address, or it is an invalid IPv6 address in string format.

Definition at line 429 of file Ifconfig6.c.

◆ IfConfig6PrintIpAddr()

VOID IfConfig6PrintIpAddr ( IN EFI_IPv6_ADDRESS Ip,
IN UINT8 *  PrefixLen 
)

Print IPv6 address.

Parameters
[in]IpThe pointer of Ip bufffer in EFI_IPv6_ADDRESS format.
[in]PrefixLenThe pointer of PrefixLen that describes the size Prefix.

Definition at line 361 of file Ifconfig6.c.

◆ IfConfig6PrintMacAddr()

VOID IfConfig6PrintMacAddr ( IN UINT8 *  Node,
IN UINT32  Size 
)

Print MAC address.

Parameters
[in]NodeThe pointer of MAC address buffer.
[in]SizeThe size of MAC address buffer.

Definition at line 334 of file Ifconfig6.c.

◆ IfConfig6RetriveCheckListByName()

VAR_CHECK_CODE IfConfig6RetriveCheckListByName ( IN VAR_CHECK_ITEM CheckList,
IN CHAR16 *  Name,
IN BOOLEAN  Init 
)

Check the correctness of input Args with '-s' option.

Parameters
[in]CheckListThe pointer of VAR_CHECK_ITEM array.
[in]NameThe pointer of input arg.
[in]InitThe switch to execute the check.
Returns
The value of VAR_CHECK_CODE.

Definition at line 257 of file Ifconfig6.c.

◆ IfConfig6SetInterfaceInfo()

SHELL_STATUS IfConfig6SetInterfaceInfo ( IN LIST_ENTRY IfList,
IN ARG_LIST VarArg 
)

The set process of the IfConfig6 application.

Parameters
[in]IfListThe pointer of IfList(interface list).
[in]VarArgThe pointer of ARG_LIST(Args with "-s" option).
Return values
SHELL_SUCCESSThe IfConfig6 set processed successfully.
othersThe IfConfig6 set process failed.

Definition at line 1180 of file Ifconfig6.c.

◆ IfConfig6ShowInterfaceInfo()

SHELL_STATUS IfConfig6ShowInterfaceInfo ( IN LIST_ENTRY IfList)

The list process of the IfConfig6 application.

Parameters
[in]IfListThe pointer of IfList(interface list).
Return values
SHELL_SUCCESSThe IfConfig6 list processed successfully.
othersThe IfConfig6 list process failed.

Definition at line 978 of file Ifconfig6.c.

◆ IfConfig6SplitStrToList()

ARG_LIST * IfConfig6SplitStrToList ( IN CONST CHAR16 *  String,
IN CHAR16  Separator 
)

Split a string with specified separator and save the substring to a list.

Parameters
[in]StringThe pointer of the input string.
[in]SeparatorThe specified separator.
Returns
The pointer of headnode of ARG_LIST.

Definition at line 182 of file Ifconfig6.c.

◆ ShellCommandRunIfconfig6()

SHELL_STATUS EFIAPI ShellCommandRunIfconfig6 ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Function for 'ifconfig6' command.

Parameters
[in]ImageHandleHandle to the Image (NULL if Internal).
[in]SystemTablePointer to the System Table (NULL if Internal).
Return values
SHELL_SUCCESSifconfig6 command processed successfully.
othersThe ifconfig6 command process failed.

Definition at line 1774 of file Ifconfig6.c.

Variable Documentation

◆ mIfConfig6CheckList

SHELL_PARAM_ITEM mIfConfig6CheckList[]
Initial value:
= {
{
L"-b",
},
{
L"-s",
},
{
L"-l",
},
{
L"-r",
},
{
L"-?",
},
{
TypeMax
},
}
#define NULL
Definition: Base.h:319
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
Definition: ShellLib.h:700
@ TypeMaxValue
A flag followed by all the command line data before the next flag.
Definition: ShellLib.h:704
@ TypeFlag
A flag that is present or not present only (IE "-a").
Definition: ShellLib.h:699

Definition at line 73 of file Ifconfig6.c.

◆ mIfConfig6SetCheckList

VAR_CHECK_ITEM mIfConfig6SetCheckList[]

Definition at line 100 of file Ifconfig6.c.