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