NetworkPkg/Application/VConfig/VConfig.c File Reference


Defines

#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_PROTOCOL * OpenVlanConfigProtocol (IN EFI_HANDLE Handle)
VOID CloseVlanConfigProtocol (IN EFI_HANDLE Handle)
VOID ShowNicVlanInfo (IN EFI_HANDLE Handle, IN UINTN NicIndex)
VOID DisplayVlan (IN CHAR16 *Name)
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

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 - 2013, 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 IMPLIED.


Define Documentation

#define INVALID_NIC_INDEX   0xffff

Referenced by NicNameToIndex().

#define INVALID_VLAN_ID   0xffff

Referenced by StrToVlanId().


Function Documentation

VOID AddVlan ( IN CHAR16 *  ParamStr  ) 

Add a VLAN device.

Parameters:
[in] ParamStr Parameter string from user input.

References CloseVlanConfigProtocol(), mHiiHandle, NicNameToHandle(), OpenVlanConfigProtocol(), and StrToVlanId().

Referenced by VlanConfigMain().

VOID CloseVlanConfigProtocol ( IN EFI_HANDLE  Handle  ) 

Close VlanConfig protocol of a handle.

Parameters:
[in] Handle The handle to close the VlanConfig protocol.

References mImageHandle.

Referenced by AddVlan(), DeleteVlan(), and ShowNicVlanInfo().

VOID DeleteVlan ( IN CHAR16 *  ParamStr  ) 

Remove a VLAN device.

Parameters:
[in] ParamStr Parameter string from user input.

References CloseVlanConfigProtocol(), mHiiHandle, NicNameToHandle(), OpenVlanConfigProtocol(), and StrToVlanId().

Referenced by VlanConfigMain().

VOID DisplayVlan ( IN CHAR16 *  Name  ) 

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

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

References LocateNicHandleBuffer(), NicNameToHandle(), and ShowNicVlanInfo().

Referenced by VlanConfigMain().

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

Locate the network interface handle buffer.

Parameters:
[out] NumberOfHandles Pointer to the number of handles.
[out] HandleBuffer Pointer to the buffer to store the returned handles.

References mHiiHandle.

Referenced by DisplayVlan(), and NicNameToHandle().

EFI_HANDLE NicNameToHandle ( IN CHAR16 *  Name  ) 

Find network interface device handle by its name.

Parameters:
[in] Name Name of the network interface.
Return values:
NULL Cannot find the network interface.
Returns:
others Handle of the network interface.

References LocateNicHandleBuffer(), mHiiHandle, and NicNameToIndex().

Referenced by AddVlan(), DeleteVlan(), and DisplayVlan().

UINTN NicNameToIndex ( IN CHAR16 *  Name  ) 

Extract the decimal index from the network interface name.

Parameters:
[in] Name Name of the network interface.
Return values:
INVALID_NIC_INDEX Failed to extract the network interface index.
Returns:
others The network interface index.

References INVALID_NIC_INDEX.

Referenced by NicNameToHandle().

EFI_VLAN_CONFIG_PROTOCOL* OpenVlanConfigProtocol ( IN EFI_HANDLE  Handle  ) 

Open VlanConfig protocol from a handle.

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

References mImageHandle.

Referenced by AddVlan(), DeleteVlan(), and ShowNicVlanInfo().

VOID ShowNicVlanInfo ( IN EFI_HANDLE  Handle,
IN UINTN  NicIndex 
)

Display VLAN configuration of a network interface.

Parameters:
[in] Handle Handle of the network interface.
[in] NicIndex Index of the network interface.

References CloseVlanConfigProtocol(), mHiiHandle, mImageHandle, and OpenVlanConfigProtocol().

Referenced by DisplayVlan().

UINT16 StrToVlanId ( IN CHAR16 *  String  ) 

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

Parameters:
[in] String Pointer to VLAN ID string from user input.
Return values:
Value translated from String, or INVALID_VLAN_ID is string is invalid.

References INVALID_VLAN_ID.

Referenced by AddVlan(), and DeleteVlan().

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

The actual entry point for the application.

Parameters:
[in] ImageHandle The firmware allocated handle for the EFI image.
[in] SystemTable A pointer to the EFI System Table.
Return values:
EFI_SUCCESS The entry point executed successfully.
other Some error occur when executing this entry point.

References AddVlan(), DeleteVlan(), DisplayVlan(), mHiiHandle, mImageHandle, mParamList, and VConfigStrings.


Variable Documentation

EFI_HII_HANDLE mHiiHandle = NULL

EFI_HANDLE mImageHandle = NULL

SHELL_PARAM_ITEM mParamList[]

Initial value:

 {
  {
    L"-l",
    TypeValue
  },
  {
    L"-a",
    TypeMaxValue
  },
  {
    L"-d",
    TypeValue
  },
  {
    NULL,
    TypeMax
  }
}

Referenced by VlanConfigMain().

UINT8 VConfigStrings[]

Referenced by VlanConfigMain().


Generated on Mon Sep 28 08:49:05 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1