]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.h
SourceLevelDebugPkg/SecPeiDebugAgentLib: Restore CPU interrupt state
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4ConfigDxe / NicIp4Variable.h
CommitLineData
83cbd279 1/** @file\r
3e8c18da 2 Routines used to operate the Ip4 configure variable.\r
83cbd279 3\r
74df5026 4Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
e5eed7d3 5This program and the accompanying materials\r
83cbd279 6are licensed and made available under the terms and conditions of the BSD License\r
402fa70f 7which accompanies this distribution. The full text of the license may be found at<BR>\r
83cbd279 8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
83cbd279 13**/\r
14\r
15#ifndef _NIC_IP4_VARIABLE_H_\r
16#define _NIC_IP4_VARIABLE_H_\r
17\r
83cbd279 18//\r
19// Return the size of NIC_IP4_CONFIG_INFO and EFI_IP4_IPCONFIG_DATA.\r
20// They are of variable size\r
21//\r
22#define SIZEOF_IP4_CONFIG_INFO(Ip4Config) \\r
23 (sizeof (EFI_IP4_IPCONFIG_DATA) + \\r
7659d0c9 24 sizeof (EFI_IP4_ROUTE_TABLE) * (Ip4Config)->RouteTableSize)\r
83cbd279 25\r
26#define SIZEOF_NIC_IP4_CONFIG_INFO(NicConfig) \\r
27 (sizeof (NIC_IP4_CONFIG_INFO) + \\r
7659d0c9 28 sizeof (EFI_IP4_ROUTE_TABLE) * (NicConfig)->Ip4Info.RouteTableSize)\r
83cbd279 29\r
30//\r
31// Compare whether two NIC address are equal includes their type and length.\r
32//\r
33#define NIC_ADDR_EQUAL(Nic1, Nic2) \\r
34 (((Nic1)->Type == (Nic2)->Type) && ((Nic1)->Len == (Nic2)->Len) && \\r
35 NET_MAC_EQUAL (&(Nic1)->MacAddr, &(Nic2)->MacAddr, (Nic1)->Len))\r
36\r
7bce0c5a 37/**\r
38 Check whether the configure parameter is valid.\r
39\r
40 @param NicConfig The configure parameter to check\r
41\r
42 @return TRUE if the parameter is valid for the interface, otherwise FALSE.\r
43\r
44**/\r
83cbd279 45BOOLEAN\r
46Ip4ConfigIsValid (\r
47 IN NIC_IP4_CONFIG_INFO *NicConfig\r
48 );\r
49\r
7bce0c5a 50/**\r
51 Read the ip4 configure variable from the EFI variable.\r
52\r
74df5026 53 @param Instance The IP4 CONFIG instance.\r
7bce0c5a 54\r
74df5026 55 @return The IP4 configure read if it is there and is valid, otherwise NULL.\r
7bce0c5a 56\r
57**/\r
74df5026 58NIC_IP4_CONFIG_INFO *\r
83cbd279 59Ip4ConfigReadVariable (\r
74df5026 60 IN IP4_CONFIG_INSTANCE *Instance\r
83cbd279 61 );\r
62\r
7bce0c5a 63/**\r
64 Write the IP4 configure variable to the NVRAM. If Config\r
65 is NULL, remove the variable.\r
66\r
74df5026 67 @param Instance The IP4 CONFIG instance.\r
68 @param NicConfig The IP4 configure data to write.\r
7bce0c5a 69\r
74df5026 70 @retval EFI_SUCCESS The variable is written to the NVRam.\r
7bce0c5a 71 @retval Others Failed to write the variable.\r
72\r
73**/\r
83cbd279 74EFI_STATUS\r
75Ip4ConfigWriteVariable (\r
74df5026 76 IN IP4_CONFIG_INSTANCE *Instance,\r
77 IN NIC_IP4_CONFIG_INFO *NicConfig OPTIONAL\r
83cbd279 78 );\r
79\r
7bce0c5a 80/**\r
74df5026 81 Reclaim Ip4Config Variables for NIC which has been removed from the platform.\r
7bce0c5a 82\r
83**/\r
74df5026 84VOID\r
85Ip4ConfigReclaimVariable (\r
86 VOID\r
83cbd279 87 );\r
88\r
7bce0c5a 89/**\r
74df5026 90 Fix the RouteTable pointer in an EFI_IP4_IPCONFIG_DATA structure.\r
7bce0c5a 91\r
402fa70f 92 The pointer is set to be immediately follow the ConfigData if there're entries\r
93 in the RouteTable. Otherwise it is set to NULL.\r
74df5026 94\r
402fa70f 95 @param ConfigData The IP4 IP configure data.\r
96\r
97**/\r
7659d0c9 98VOID\r
99Ip4ConfigFixRouteTablePointer (\r
c8d8f1e3 100 IN OUT EFI_IP4_IPCONFIG_DATA *ConfigData\r
7659d0c9 101 );\r
102\r
83cbd279 103#endif\r
63886849 104\r