]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Protocol/NicIp4Config/NicIp4Config.h
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Protocol / NicIp4Config / NicIp4Config.h
CommitLineData
3eb9473e 1/*++\r
2\r
3e99020d 3Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
f57387d5 4This program and the accompanying materials \r
3eb9473e 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 NicIp4Config.h\r
15\r
16Abstract:\r
17\r
18--*/\r
19\r
20#ifndef _NIC_IP4_CONFIG_H_\r
21#define _NIC_IP4_CONFIG_H_\r
22\r
23#include EFI_PROTOCOL_DEFINITION (Ip4Config)\r
24\r
25#define EFI_NIC_IP4_CONFIG_PROTOCOL_GUID \\r
7ccf38a3 26 {0xdca3d4d, 0x12da, 0x4728, {0xbf, 0x7e, 0x86, 0xce, 0xb9, 0x28, 0xd0, 0x67}}\r
3eb9473e 27\r
28#define EFI_NIC_IP4_CONFIG_VARIABLE_GUID \\r
7ccf38a3 29 {0xd8944553, 0xc4dd, 0x41f4, {0x9b, 0x30, 0xe1, 0x39, 0x7c, 0xfb, 0x26, 0x7b}}\r
3eb9473e 30\r
31#define EFI_NIC_IP4_CONFIG_VARIABLE L"EfiNicIp4ConfigVariable"\r
32\r
33\r
34typedef struct _EFI_NIC_IP4_CONFIG_PROTOCOL EFI_NIC_IP4_CONFIG_PROTOCOL;\r
35\r
02d99367 36enum {\r
3eb9473e 37 //\r
38 // Config source: dhcp or static\r
39 //\r
40 IP4_CONFIG_SOURCE_DHCP = 0,\r
41 IP4_CONFIG_SOURCE_STATIC,\r
42 IP4_CONFIG_SOURCE_MAX,\r
43 \r
44 IP4_NIC_NAME_LENGTH = 64,\r
3e99020d 45 MAX_IP4_CONFIG_IN_VARIABLE = 128\r
3eb9473e 46};\r
47\r
48//\r
49// The following structures are used by drivers/applications other\r
50// than EFI_IP4_PROTOCOL, such as ifconfig shell application, to \r
51// communicate the IP configuration information to EFI_IP4_CONFIG_PROTOCOL. \r
52// EFI_IP4_CONFIG_PROTOCOL in turn is used by EFI_IP4_PROTOCOL to get \r
53// the default IP4 configuration. ifconfig can't use the EFI_IP4_PROTOCOL\r
54// because it don't know how to configure the default IP address even\r
55// it has got the address. \r
56//\r
57// NIC_ADDR contains the interface's type and MAC address to identify\r
58// a specific NIC. NIC_IP4_CONFIG_INFO contains the IP4 configure \r
59// parameters for that NIC. IP4_CONFIG_VARIABLE is the EFI variable to \r
60// save the configuration. NIC_IP4_CONFIG_INFO and IP4_CONFIG_VARIABLE \r
61// is of variable length.\r
62//\r
63// EFI_NIC_IP4_CONFIG_PROTOCOL is a priority protocol, not defined by UEFI2.0\r
64//\r
65typedef struct {\r
66 UINT16 Type;\r
67 UINT8 Len;\r
68 EFI_MAC_ADDRESS MacAddr;\r
69} NIC_ADDR;\r
70\r
71typedef struct {\r
72 NIC_ADDR NicAddr; // Link layer address to identify the NIC\r
73 UINT32 Source; // Static or DHCP\r
74 BOOLEAN Perment; // Survive the reboot or not\r
75 EFI_IP4_IPCONFIG_DATA Ip4Info; // IP addresses\r
76} NIC_IP4_CONFIG_INFO;\r
77\r
78typedef struct {\r
79 UINT32 Len; // Total length of the variable\r
80 UINT16 CheckSum; // CheckSum, the same as IP4 head checksum\r
81 UINT32 Count; // Number of NIC_IP4_CONFIG_INFO follows\r
82 NIC_IP4_CONFIG_INFO ConfigInfo;\r
83} IP4_CONFIG_VARIABLE;\r
84\r
85typedef\r
86EFI_STATUS\r
87(EFIAPI *EFI_NIC_IP4_CONFIG_GET_INFO) (\r
88 IN EFI_NIC_IP4_CONFIG_PROTOCOL *This,\r
89 IN OUT UINTN *Len,\r
90 OUT NIC_IP4_CONFIG_INFO *NicConfig OPTIONAL \r
91 );\r
92\r
93typedef\r
94EFI_STATUS\r
95(EFIAPI *EFI_NIC_IP4_CONFIG_SET_INFO) (\r
96 IN EFI_NIC_IP4_CONFIG_PROTOCOL *This,\r
97 IN NIC_IP4_CONFIG_INFO *NicConfig, OPTIONAL\r
98 IN BOOLEAN ReConfig \r
99 );\r
100\r
101typedef\r
102EFI_STATUS\r
103(EFIAPI *EFI_NIC_IP4_CONFIG_GET_NAME) (\r
104 IN EFI_NIC_IP4_CONFIG_PROTOCOL *This,\r
105 IN UINT16 *Name, OPTIONAL\r
106 IN NIC_ADDR *NicAddr OPTIONAL \r
107 );\r
108\r
3eb9473e 109struct _EFI_NIC_IP4_CONFIG_PROTOCOL {\r
110 EFI_NIC_IP4_CONFIG_GET_NAME GetName;\r
111 EFI_NIC_IP4_CONFIG_GET_INFO GetInfo;\r
112 EFI_NIC_IP4_CONFIG_SET_INFO SetInfo;\r
113};\r
114\r
115extern EFI_GUID gEfiNicIp4ConfigVariableGuid;\r
116extern EFI_GUID gEfiNicIp4ConfigProtocolGuid;\r
117#endif\r