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 <Protocol/Ip4Config.h>
26 #define EFI_NIC_IP4_CONFIG_PROTOCOL_GUID \
28 0xdca3d4d, 0x12da, 0x4728, { 0xbf, 0x7e, 0x86, 0xce, 0xb9, 0x28, 0xd0, 0x67 } \
31 #define EFI_NIC_IP4_CONFIG_VARIABLE_GUID \
33 0xd8944553, 0xc4dd, 0x41f4, { 0x9b, 0x30, 0xe1, 0x39, 0x7c, 0xfb, 0x26, 0x7b } \
36 #define EFI_NIC_IP4_CONFIG_VARIABLE L"EfiNicIp4ConfigVariable"
39 typedef struct _EFI_NIC_IP4_CONFIG_PROTOCOL EFI_NIC_IP4_CONFIG_PROTOCOL
;
43 // Config source: dhcp or static
45 IP4_CONFIG_SOURCE_DHCP
= 0,
46 IP4_CONFIG_SOURCE_STATIC
,
47 IP4_CONFIG_SOURCE_MAX
,
49 IP4_NIC_NAME_LENGTH
= 64,
50 MAX_IP4_CONFIG_IN_VARIABLE
= 16,
54 // The following structures are used by drivers/applications other
55 // than EFI_IP4_PROTOCOL, such as ifconfig shell application, to
56 // communicate the IP configuration information to EFI_IP4_CONFIG_PROTOCOL.
57 // EFI_IP4_CONFIG_PROTOCOL in turn is used by EFI_IP4_PROTOCOL to get
58 // the default IP4 configuration. ifconfig can't use the EFI_IP4_PROTOCOL
59 // because it don't know how to configure the default IP address even
60 // it has got the address.
62 // NIC_ADDR contains the interface's type and MAC address to identify
63 // a specific NIC. NIC_IP4_CONFIG_INFO contains the IP4 configure
64 // parameters for that NIC. IP4_CONFIG_VARIABLE is the EFI variable to
65 // save the configuration. NIC_IP4_CONFIG_INFO and IP4_CONFIG_VARIABLE
66 // is of variable length.
68 // EFI_NIC_IP4_CONFIG_PROTOCOL is a priority protocol, not defined by UEFI2.0
73 EFI_MAC_ADDRESS MacAddr
;
77 NIC_ADDR NicAddr
; // Link layer address to identify the NIC
78 UINT32 Source
; // Static or DHCP
79 BOOLEAN Perment
; // Survive the reboot or not
80 EFI_IP4_IPCONFIG_DATA Ip4Info
; // IP addresses
81 } NIC_IP4_CONFIG_INFO
;
84 UINT32 Len
; // Total length of the variable
85 UINT16 CheckSum
; // CheckSum, the same as IP4 head checksum
86 UINT32 Count
; // Number of NIC_IP4_CONFIG_INFO follows
87 NIC_IP4_CONFIG_INFO ConfigInfo
;
88 } IP4_CONFIG_VARIABLE
;
92 (EFIAPI
*EFI_NIC_IP4_CONFIG_GET_INFO
) (
93 IN EFI_NIC_IP4_CONFIG_PROTOCOL
*This
,
95 OUT NIC_IP4_CONFIG_INFO
*NicConfig OPTIONAL
100 (EFIAPI
*EFI_NIC_IP4_CONFIG_SET_INFO
) (
101 IN EFI_NIC_IP4_CONFIG_PROTOCOL
*This
,
102 IN NIC_IP4_CONFIG_INFO
*NicConfig
, OPTIONAL
108 (EFIAPI
*EFI_NIC_IP4_CONFIG_GET_NAME
) (
109 IN EFI_NIC_IP4_CONFIG_PROTOCOL
*This
,
110 IN UINT16
*Name
, OPTIONAL
111 IN NIC_ADDR
*NicAddr OPTIONAL
115 struct _EFI_NIC_IP4_CONFIG_PROTOCOL
{
116 EFI_NIC_IP4_CONFIG_GET_NAME GetName
;
117 EFI_NIC_IP4_CONFIG_GET_INFO GetInfo
;
118 EFI_NIC_IP4_CONFIG_SET_INFO SetInfo
;
121 extern EFI_GUID gEfiNicIp4ConfigVariableGuid
;
122 extern EFI_GUID gEfiNicIp4ConfigProtocolGuid
;