This is an example to dump NIC information via UNDI.
This example code uses EFI_IP4_CONFIG2_PROTOCOL for example, only.
Here is the complete source code.
Samples code dumps these informations:
#
# Pseudo code
#
# IfInfo = Ip4Cfg2.EFI_IP4_CONFIG2_INTERFACE_INFO ()
# EFI_IP4_CONFIG2_PROTOCOL.GetData (
# Ip4Cfg2P,
# Ip4Cfg2.Ip4Config2DataTypeInterfaceInfo,
# e.byref (DataSize),
# e.cast (e.byref (IfInfo), e.PVOID)
# )#
# Dumpped information
#
EFI_IP4_CONFIG2_INTERFACE_INFO.Name
EFI_IP4_CONFIG2_INTERFACE_INFO.IfType
EFI_IP4_CONFIG2_INTERFACE_INFO.HwAddressSize
EFI_IP4_CONFIG2_INTERFACE_INFO.HwAddress EFI_IP4_CONFIG2_INTERFACE_INFO.StationAddress
EFI_IP4_CONFIG2_INTERFACE_INFO.SubnetMask
EFI_IP4_CONFIG2_INTERFACE_INFO.RouteTableSize
And DNS informations:
#
# Pseudo code
#
# DnsAddr = (e.EFI_IPv4_ADDRESS * \
# (DataSize.value / e.sizeof (e.EFI_IPv4_ADDRESS))) ()
# Status = Ip4Cfg2P[0].GetData (
# Ip4Cfg2P,
# Ip4Cfg2.Ip4Config2DataTypeDnsServer,
# e.byref (DataSize),
# e.cast (e.byref (DnsAddr), e.PVOID)
# )
#
# Dumpped information
#
# for Dns in DnsAddr:
# print " DnsAddr:"
# for Addr in Dns.Addr:
# print "%02X " % Addr,
# print
No comments:
Post a Comment