]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.h
Add compiler hint of "GLOBAL_REMOVE_IF_UNREFERENCED" to prevent static unicode string...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4ConfigDxe / NicIp4Variable.h
CommitLineData
83cbd279 1/** @file\r
2\r
3Copyright (c) 2006, Intel Corporation\r
4All rights reserved. This program and the accompanying materials\r
5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12Module Name:\r
13\r
14 NicIp4Variable.h\r
15\r
16Abstract:\r
17\r
18 Routines used to operate the Ip4 configure variable\r
19\r
20\r
21**/\r
22\r
23#ifndef _NIC_IP4_VARIABLE_H_\r
24#define _NIC_IP4_VARIABLE_H_\r
25\r
26\r
27#include <Protocol/NicIp4Config.h>\r
28\r
29//\r
30// Return the size of NIC_IP4_CONFIG_INFO and EFI_IP4_IPCONFIG_DATA.\r
31// They are of variable size\r
32//\r
33#define SIZEOF_IP4_CONFIG_INFO(Ip4Config) \\r
34 (sizeof (EFI_IP4_IPCONFIG_DATA) + \\r
35 sizeof (EFI_IP4_ROUTE_TABLE) * (NET_MAX (1, (Ip4Config)->RouteTableSize) - 1))\r
36\r
37#define SIZEOF_NIC_IP4_CONFIG_INFO(NicConfig) \\r
38 (sizeof (NIC_IP4_CONFIG_INFO) + \\r
39 sizeof (EFI_IP4_ROUTE_TABLE) * (NET_MAX (1, (NicConfig)->Ip4Info.RouteTableSize) - 1))\r
40\r
41//\r
42// Compare whether two NIC address are equal includes their type and length.\r
43//\r
44#define NIC_ADDR_EQUAL(Nic1, Nic2) \\r
45 (((Nic1)->Type == (Nic2)->Type) && ((Nic1)->Len == (Nic2)->Len) && \\r
46 NET_MAC_EQUAL (&(Nic1)->MacAddr, &(Nic2)->MacAddr, (Nic1)->Len))\r
47\r
48BOOLEAN\r
49Ip4ConfigIsValid (\r
50 IN NIC_IP4_CONFIG_INFO *NicConfig\r
51 );\r
52\r
53IP4_CONFIG_VARIABLE *\r
54Ip4ConfigReadVariable (\r
55 VOID\r
56 );\r
57\r
58EFI_STATUS\r
59Ip4ConfigWriteVariable (\r
60 IN IP4_CONFIG_VARIABLE *Config OPTIONAL\r
61 );\r
62\r
63NIC_IP4_CONFIG_INFO *\r
64Ip4ConfigFindNicVariable (\r
65 IN IP4_CONFIG_VARIABLE *Variable,\r
66 IN NIC_ADDR *NicAddr\r
67 );\r
68\r
69IP4_CONFIG_VARIABLE *\r
70Ip4ConfigModifyVariable (\r
71 IN IP4_CONFIG_VARIABLE *Variable, OPTIONAL\r
72 IN NIC_ADDR *NicAddr,\r
73 IN NIC_IP4_CONFIG_INFO *Config OPTIONAL\r
74 );\r
75#endif\r