OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
Ip4Utils.c File Reference

Go to the source code of this file.

Functions

BOOLEAN Ip4StationAddressValid (IN IP4_ADDR Ip, IN IP4_ADDR Netmask)
 
UINT8 GetSubnetMaskPrefixLength (IN EFI_IPv4_ADDRESS *SubnetMask)
 
EFI_STATUS Ip4Config2StrToIp (IN CHAR16 *Str, OUT EFI_IPv4_ADDRESS *Ip)
 
EFI_STATUS Ip4Config2StrToIpList (IN CHAR16 *Str, OUT EFI_IPv4_ADDRESS **PtrIpList, OUT UINTN *IpCount)
 

Detailed Description

IPv4 utilities.

Methods from:

  • NetworkPkg/Ip4Dxe/Ip4Common.c
  • NetworkPkg/Ip4Dxe/Ip4Config2Nv.c

Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Ip4Utils.c.

Function Documentation

◆ GetSubnetMaskPrefixLength()

UINT8 GetSubnetMaskPrefixLength ( IN EFI_IPv4_ADDRESS * SubnetMask)

Calculate the prefix length of the IPv4 subnet mask.

Parameters
[in]SubnetMaskThe IPv4 subnet mask.
Returns
The prefix length of the subnet mask.
Return values
0Other errors as indicated.

Definition at line 66 of file Ip4Utils.c.

◆ Ip4Config2StrToIp()

EFI_STATUS Ip4Config2StrToIp ( IN CHAR16 * Str,
OUT EFI_IPv4_ADDRESS * Ip )

Convert the decimal dotted IPv4 address into the binary IPv4 address.

Parameters
[in]StrThe UNICODE string.
[out]IpThe storage to return the IPv4 address.
Return values
EFI_SUCCESSThe binary IP address is returned in Ip.
EFI_INVALID_PARAMETERThe IP string is malformatted.

Definition at line 108 of file Ip4Utils.c.

◆ Ip4Config2StrToIpList()

EFI_STATUS Ip4Config2StrToIpList ( IN CHAR16 * Str,
OUT EFI_IPv4_ADDRESS ** PtrIpList,
OUT UINTN * IpCount )

Convert the decimal dotted IPv4 addresses separated by space into the binary IPv4 address list.

Parameters
[in]StrThe UNICODE string contains IPv4 addresses.
[out]PtrIpListThe storage to return the IPv4 address list.
[out]IpCountThe size of the IPv4 address list.
Return values
EFI_SUCCESSThe binary IP address list is returned in PtrIpList.
EFI_OUT_OF_RESOURCESError occurs in allocating memory.
EFI_INVALID_PARAMETERThe IP string is malformatted.

Definition at line 173 of file Ip4Utils.c.

◆ Ip4StationAddressValid()

BOOLEAN Ip4StationAddressValid ( IN IP4_ADDR Ip,
IN IP4_ADDR Netmask )

Validate that Ip/Netmask pair is OK to be used as station address. Only continuous netmasks are supported. and check that StationAddress is a unicast address on the network.

Parameters
[in]IpThe IP address to validate.
[in]NetmaskThe netmask of the IP.
Return values
TRUEThe Ip/Netmask pair is valid.
FALSEThe Ip/Netmask pair is invalid.

Definition at line 27 of file Ip4Utils.c.