]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.h
1. Sync the latest network stack. Add NetLibCreateIPv4DPathNode () in netlib library.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4ConfigDxe / NicIp4Variable.h
CommitLineData
b2570da8 1/** @file
2
3Copyright (c) 2006, Intel Corporation
4All rights reserved. This program and the accompanying materials
5are licensed and made available under the terms and conditions of the BSD License
6which accompanies this distribution. The full text of the license may be found at
7http://opensource.org/licenses/bsd-license.php
8
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12Module Name:
13
14 NicIp4Variable.h
15
16Abstract:
17
18 Routines used to operate the Ip4 configure variable
19
20
21**/
22
23#ifndef _NIC_IP4_VARIABLE_H_
24#define _NIC_IP4_VARIABLE_H_
25
26
27#include <Protocol/NicIp4Config.h>
28
29//
30// Return the size of NIC_IP4_CONFIG_INFO and EFI_IP4_IPCONFIG_DATA.
31// They are of variable size
32//
33#define SIZEOF_IP4_CONFIG_INFO(Ip4Config) \
34 (sizeof (EFI_IP4_IPCONFIG_DATA) + \
35 sizeof (EFI_IP4_ROUTE_TABLE) * (NET_MAX (1, (Ip4Config)->RouteTableSize) - 1))
36
37#define SIZEOF_NIC_IP4_CONFIG_INFO(NicConfig) \
38 (sizeof (NIC_IP4_CONFIG_INFO) + \
39 sizeof (EFI_IP4_ROUTE_TABLE) * (NET_MAX (1, (NicConfig)->Ip4Info.RouteTableSize) - 1))
40
41//
42// Compare whether two NIC address are equal includes their type and length.
43//
44#define NIC_ADDR_EQUAL(Nic1, Nic2) \
45 (((Nic1)->Type == (Nic2)->Type) && ((Nic1)->Len == (Nic2)->Len) && \
46 NET_MAC_EQUAL (&(Nic1)->MacAddr, &(Nic2)->MacAddr, (Nic1)->Len))
47
48BOOLEAN
49Ip4ConfigIsValid (
50 IN NIC_IP4_CONFIG_INFO *NicConfig
51 );
52
53IP4_CONFIG_VARIABLE *
54Ip4ConfigReadVariable (
55 VOID
56 );
57
58EFI_STATUS
59Ip4ConfigWriteVariable (
60 IN IP4_CONFIG_VARIABLE *Config OPTIONAL
61 );
62
63NIC_IP4_CONFIG_INFO *
64Ip4ConfigFindNicVariable (
65 IN IP4_CONFIG_VARIABLE *Variable,
66 IN NIC_ADDR *NicAddr
67 );
68
69IP4_CONFIG_VARIABLE *
70Ip4ConfigModifyVariable (
71 IN IP4_CONFIG_VARIABLE *Variable, OPTIONAL
72 IN NIC_ADDR *NicAddr,
73 IN NIC_IP4_CONFIG_INFO *Config OPTIONAL
74 );
75#endif