]>
Commit | Line | Data |
---|---|---|
5f597758 LG |
1 | /** @file\r |
2 | This file defines NicIp4Config Protocol.\r | |
da89d703 | 3 | \r |
5f597758 | 4 | Copyright (c) 2006 - 2008, Intel Corporation\r |
da89d703 | 5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
5f597758 | 13 | **/\r |
da89d703 | 14 | \r |
15 | #ifndef __NIC_IP4_CONFIG_H__\r | |
16 | #define __NIC_IP4_CONFIG_H__\r | |
17 | \r | |
18 | #include <Protocol/Ip4Config.h>\r | |
19 | \r | |
20 | \r | |
21 | #define EFI_NIC_IP4_CONFIG_PROTOCOL_GUID \\r | |
22 | { \\r | |
23 | 0xdca3d4d, 0x12da, 0x4728, { 0xbf, 0x7e, 0x86, 0xce, 0xb9, 0x28, 0xd0, 0x67 } \\r | |
24 | }\r | |
25 | \r | |
26 | #define EFI_NIC_IP4_CONFIG_VARIABLE_GUID \\r | |
27 | { \\r | |
28 | 0xd8944553, 0xc4dd, 0x41f4, { 0x9b, 0x30, 0xe1, 0x39, 0x7c, 0xfb, 0x26, 0x7b } \\r | |
29 | }\r | |
30 | \r | |
31 | #define EFI_NIC_IP4_CONFIG_VARIABLE L"EfiNicIp4ConfigVariable"\r | |
32 | \r | |
33 | \r | |
34 | typedef struct _EFI_NIC_IP4_CONFIG_PROTOCOL EFI_NIC_IP4_CONFIG_PROTOCOL;\r | |
35 | \r | |
5f597758 | 36 | typedef enum {\r |
da89d703 | 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 | |
552b2523 | 45 | MAX_IP4_CONFIG_IN_VARIABLE = 16\r |
5f597758 | 46 | } IP4_CONFIG_TYPE;\r |
da89d703 | 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 | |
65 | typedef struct {\r | |
66 | UINT16 Type;\r | |
67 | UINT8 Len;\r | |
68 | EFI_MAC_ADDRESS MacAddr;\r | |
69 | } NIC_ADDR;\r | |
70 | \r | |
71 | typedef 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 | |
78 | typedef 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 | |
85 | typedef\r | |
86 | EFI_STATUS\r | |
7d839888 | 87 | (EFIAPI *EFI_NIC_IP4_CONFIG_GET_INFO)(\r |
da89d703 | 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 | |
93 | typedef\r | |
94 | EFI_STATUS\r | |
7d839888 | 95 | (EFIAPI *EFI_NIC_IP4_CONFIG_SET_INFO)(\r |
da89d703 | 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 | |
101 | typedef\r | |
102 | EFI_STATUS\r | |
7d839888 | 103 | (EFIAPI *EFI_NIC_IP4_CONFIG_GET_NAME)(\r |
da89d703 | 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 | |
da89d703 | 109 | struct _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 | |
115 | extern EFI_GUID gEfiNicIp4ConfigVariableGuid;\r | |
116 | extern EFI_GUID gEfiNicIp4ConfigProtocolGuid;\r | |
117 | #endif\r |