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

Go to the source code of this file.

Macros

#define INVALID_NIC_INDEX   0xffff
 
#define INVALID_VLAN_ID   0xffff
 

Functions

VOID LocateNicHandleBuffer (OUT UINTN *NumberOfHandles, OUT EFI_HANDLE **HandleBuffer)
 
UINTN NicNameToIndex (IN CHAR16 *Name)
 
EFI_HANDLE NicNameToHandle (IN CHAR16 *Name)
 
EFI_VLAN_CONFIG_PROTOCOLOpenVlanConfigProtocol (IN EFI_HANDLE Handle)
 
VOID CloseVlanConfigProtocol (IN EFI_HANDLE Handle)
 
VOID ShowNicVlanInfo (IN EFI_HANDLE Handle, IN UINTN NicIndex)
 
VOID DisplayVlan (IN CHAR16 *Name OPTIONAL)
 
UINT16 StrToVlanId (IN CHAR16 *String)
 
VOID AddVlan (IN CHAR16 *ParamStr)
 
VOID DeleteVlan (IN CHAR16 *ParamStr)
 
EFI_STATUS EFIAPI VlanConfigMain (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringVConfigHelpTokenId = STRING_TOKEN (STR_VCONFIG_HELP)
 
UINT8 VConfigStrings []
 
EFI_HANDLE mImageHandle = NULL
 
EFI_HII_HANDLE mHiiHandle = NULL
 
SHELL_PARAM_ITEM mParamList []
 

Detailed Description

Shell application for VLAN configuration.

Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.

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

Definition in file VConfig.c.

Macro Definition Documentation

◆ INVALID_NIC_INDEX

#define INVALID_NIC_INDEX   0xffff

Definition at line 28 of file VConfig.c.

◆ INVALID_VLAN_ID

#define INVALID_VLAN_ID   0xffff

Definition at line 29 of file VConfig.c.

Function Documentation

◆ AddVlan()

VOID AddVlan ( IN CHAR16 *  ParamStr)

Add a VLAN device.

Parameters
[in]ParamStrParameter string from user input.

Definition at line 358 of file VConfig.c.

◆ CloseVlanConfigProtocol()

VOID CloseVlanConfigProtocol ( IN EFI_HANDLE  Handle)

Close VlanConfig protocol of a handle.

Parameters
[in]HandleThe handle to close the VlanConfig protocol.

Definition at line 196 of file VConfig.c.

◆ DeleteVlan()

VOID DeleteVlan ( IN CHAR16 *  ParamStr)

Remove a VLAN device.

Parameters
[in]ParamStrParameter string from user input.

Definition at line 493 of file VConfig.c.

◆ DisplayVlan()

VOID DisplayVlan ( IN CHAR16 *Name  OPTIONAL)

Display the VLAN configuration of all, or a specified network interface.

Parameters
[in]NameName of the network interface. If NULL, the VLAN configuration of all network will be displayed.

Definition at line 283 of file VConfig.c.

◆ LocateNicHandleBuffer()

VOID LocateNicHandleBuffer ( OUT UINTN NumberOfHandles,
OUT EFI_HANDLE **  HandleBuffer 
)

Locate the network interface handle buffer.

Parameters
[out]NumberOfHandlesPointer to the number of handles.
[out]HandleBufferPointer to the buffer to store the returned handles.

Definition at line 68 of file VConfig.c.

◆ NicNameToHandle()

EFI_HANDLE NicNameToHandle ( IN CHAR16 *  Name)

Find network interface device handle by its name.

Parameters
[in]NameName of the network interface.
Return values
NULLCannot find the network interface.
Returns
others Handle of the network interface.

Definition at line 132 of file VConfig.c.

◆ NicNameToIndex()

UINTN NicNameToIndex ( IN CHAR16 *  Name)

Extract the decimal index from the network interface name.

Parameters
[in]NameName of the network interface.
Return values
INVALID_NIC_INDEXFailed to extract the network interface index.
Returns
others The network interface index.

Definition at line 100 of file VConfig.c.

◆ OpenVlanConfigProtocol()

EFI_VLAN_CONFIG_PROTOCOL * OpenVlanConfigProtocol ( IN EFI_HANDLE  Handle)

Open VlanConfig protocol from a handle.

Parameters
[in]HandleThe handle to open the VlanConfig protocol.
Returns
The VlanConfig protocol interface.

Definition at line 170 of file VConfig.c.

◆ ShowNicVlanInfo()

VOID ShowNicVlanInfo ( IN EFI_HANDLE  Handle,
IN UINTN  NicIndex 
)

Display VLAN configuration of a network interface.

Parameters
[in]HandleHandle of the network interface.
[in]NicIndexIndex of the network interface.

Definition at line 216 of file VConfig.c.

◆ StrToVlanId()

UINT16 StrToVlanId ( IN CHAR16 *  String)

Convert a NULL-terminated unicode decimal VLAN ID string to VLAN ID.

Parameters
[in]StringPointer to VLAN ID string from user input.
Return values
Valuetranslated from String, or INVALID_VLAN_ID is string is invalid.

Definition at line 329 of file VConfig.c.

◆ VlanConfigMain()

EFI_STATUS EFIAPI VlanConfigMain ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The actual entry point for the application.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point executed successfully.
otherSome error occur when executing this entry point.

Definition at line 604 of file VConfig.c.

Variable Documentation

◆ mHiiHandle

EFI_HII_HANDLE mHiiHandle = NULL

Definition at line 39 of file VConfig.c.

◆ mImageHandle

EFI_HANDLE mImageHandle = NULL

Definition at line 38 of file VConfig.c.

◆ mParamList

SHELL_PARAM_ITEM mParamList[]
Initial value:
= {
{
L"-l",
},
{
L"-a",
},
{
L"-d",
},
{
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

Definition at line 41 of file VConfig.c.

◆ mStringVConfigHelpTokenId

GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringVConfigHelpTokenId = STRING_TOKEN (STR_VCONFIG_HELP)

Definition at line 26 of file VConfig.c.