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