2 Routines used to operate the Ip4 configure variable.
4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at<BR>
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _NIC_IP4_VARIABLE_H_
16 #define _NIC_IP4_VARIABLE_H_
19 // Return the size of NIC_IP4_CONFIG_INFO and EFI_IP4_IPCONFIG_DATA.
20 // They are of variable size
22 #define SIZEOF_IP4_CONFIG_INFO(Ip4Config) \
23 (sizeof (EFI_IP4_IPCONFIG_DATA) + \
24 sizeof (EFI_IP4_ROUTE_TABLE) * (Ip4Config)->RouteTableSize)
26 #define SIZEOF_NIC_IP4_CONFIG_INFO(NicConfig) \
27 (sizeof (NIC_IP4_CONFIG_INFO) + \
28 sizeof (EFI_IP4_ROUTE_TABLE) * (NicConfig)->Ip4Info.RouteTableSize)
31 // Compare whether two NIC address are equal includes their type and length.
33 #define NIC_ADDR_EQUAL(Nic1, Nic2) \
34 (((Nic1)->Type == (Nic2)->Type) && ((Nic1)->Len == (Nic2)->Len) && \
35 NET_MAC_EQUAL (&(Nic1)->MacAddr, &(Nic2)->MacAddr, (Nic1)->Len))
38 Check whether the configure parameter is valid.
40 @param NicConfig The configure parameter to check
42 @return TRUE if the parameter is valid for the interface, otherwise FALSE.
47 IN NIC_IP4_CONFIG_INFO
*NicConfig
51 Read the ip4 configure variable from the EFI variable.
53 @param Instance The IP4 CONFIG instance.
55 @return The IP4 configure read if it is there and is valid, otherwise NULL.
59 Ip4ConfigReadVariable (
60 IN IP4_CONFIG_INSTANCE
*Instance
64 Write the IP4 configure variable to the NVRAM. If Config
65 is NULL, remove the variable.
67 @param Instance The IP4 CONFIG instance.
68 @param NicConfig The IP4 configure data to write.
70 @retval EFI_SUCCESS The variable is written to the NVRam.
71 @retval Others Failed to write the variable.
75 Ip4ConfigWriteVariable (
76 IN IP4_CONFIG_INSTANCE
*Instance
,
77 IN NIC_IP4_CONFIG_INFO
*NicConfig OPTIONAL
81 Reclaim Ip4Config Variables for NIC which has been removed from the platform.
85 Ip4ConfigReclaimVariable (
90 Fix the RouteTable pointer in an EFI_IP4_IPCONFIG_DATA structure.
92 The pointer is set to be immediately follow the ConfigData if there're entries
93 in the RouteTable. Otherwise it is set to NULL.
95 @param ConfigData The IP4 IP configure data.
99 Ip4ConfigFixRouteTablePointer (
100 IN OUT EFI_IP4_IPCONFIG_DATA
*ConfigData