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
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.
20 #ifndef _NIC_IP4_CONFIG_H_
21 #define _NIC_IP4_CONFIG_H_
23 #include EFI_PROTOCOL_DEFINITION (Ip4Config)
25 #define EFI_NIC_IP4_CONFIG_PROTOCOL_GUID \
26 {0xdca3d4d, 0x12da, 0x4728, {0xbf, 0x7e, 0x86, 0xce, 0xb9, 0x28, 0xd0, 0x67}}
28 #define EFI_NIC_IP4_CONFIG_VARIABLE_GUID \
29 {0xd8944553, 0xc4dd, 0x41f4, {0x9b, 0x30, 0xe1, 0x39, 0x7c, 0xfb, 0x26, 0x7b}}
31 #define EFI_NIC_IP4_CONFIG_VARIABLE L"EfiNicIp4ConfigVariable"
34 typedef struct _EFI_NIC_IP4_CONFIG_PROTOCOL EFI_NIC_IP4_CONFIG_PROTOCOL
;
38 // Config source: dhcp or static
40 IP4_CONFIG_SOURCE_DHCP
= 0,
41 IP4_CONFIG_SOURCE_STATIC
,
42 IP4_CONFIG_SOURCE_MAX
,
44 IP4_NIC_NAME_LENGTH
= 64,
45 MAX_IP4_CONFIG_IN_VARIABLE
= 16,
49 // The following structures are used by drivers/applications other
50 // than EFI_IP4_PROTOCOL, such as ifconfig shell application, to
51 // communicate the IP configuration information to EFI_IP4_CONFIG_PROTOCOL.
52 // EFI_IP4_CONFIG_PROTOCOL in turn is used by EFI_IP4_PROTOCOL to get
53 // the default IP4 configuration. ifconfig can't use the EFI_IP4_PROTOCOL
54 // because it don't know how to configure the default IP address even
55 // it has got the address.
57 // NIC_ADDR contains the interface's type and MAC address to identify
58 // a specific NIC. NIC_IP4_CONFIG_INFO contains the IP4 configure
59 // parameters for that NIC. IP4_CONFIG_VARIABLE is the EFI variable to
60 // save the configuration. NIC_IP4_CONFIG_INFO and IP4_CONFIG_VARIABLE
61 // is of variable length.
63 // EFI_NIC_IP4_CONFIG_PROTOCOL is a priority protocol, not defined by UEFI2.0
68 EFI_MAC_ADDRESS MacAddr
;
72 NIC_ADDR NicAddr
; // Link layer address to identify the NIC
73 UINT32 Source
; // Static or DHCP
74 BOOLEAN Perment
; // Survive the reboot or not
75 EFI_IP4_IPCONFIG_DATA Ip4Info
; // IP addresses
76 } NIC_IP4_CONFIG_INFO
;
79 UINT32 Len
; // Total length of the variable
80 UINT16 CheckSum
; // CheckSum, the same as IP4 head checksum
81 UINT32 Count
; // Number of NIC_IP4_CONFIG_INFO follows
82 NIC_IP4_CONFIG_INFO ConfigInfo
;
83 } IP4_CONFIG_VARIABLE
;
87 (EFIAPI
*EFI_NIC_IP4_CONFIG_GET_INFO
) (
88 IN EFI_NIC_IP4_CONFIG_PROTOCOL
*This
,
90 OUT NIC_IP4_CONFIG_INFO
*NicConfig OPTIONAL
95 (EFIAPI
*EFI_NIC_IP4_CONFIG_SET_INFO
) (
96 IN EFI_NIC_IP4_CONFIG_PROTOCOL
*This
,
97 IN NIC_IP4_CONFIG_INFO
*NicConfig
, OPTIONAL
103 (EFIAPI
*EFI_NIC_IP4_CONFIG_GET_NAME
) (
104 IN EFI_NIC_IP4_CONFIG_PROTOCOL
*This
,
105 IN UINT16
*Name
, OPTIONAL
106 IN NIC_ADDR
*NicAddr OPTIONAL
109 struct _EFI_NIC_IP4_CONFIG_PROTOCOL
{
110 EFI_NIC_IP4_CONFIG_GET_NAME GetName
;
111 EFI_NIC_IP4_CONFIG_GET_INFO GetInfo
;
112 EFI_NIC_IP4_CONFIG_SET_INFO SetInfo
;
115 extern EFI_GUID gEfiNicIp4ConfigVariableGuid
;
116 extern EFI_GUID gEfiNicIp4ConfigProtocolGuid
;