NetworkPkg: Apply uncrustify changes

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the NetworkPkg package

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
This commit is contained in:
Michael Kubacki
2021-12-05 14:54:07 -08:00
committed by mergify[bot]
parent 2f88bd3a12
commit d1050b9dff
294 changed files with 29888 additions and 30440 deletions

View File

@@ -7,7 +7,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include "Ip4Impl.h"
/**
Return the cast type (Unicast/Broadcast) specific to an
interface. All the addresses are host byte ordered.
@@ -25,25 +24,21 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
INTN
Ip4GetNetCast (
IN IP4_ADDR IpAddr,
IN IP4_INTERFACE *IpIf
IN IP4_ADDR IpAddr,
IN IP4_INTERFACE *IpIf
)
{
if (IpAddr == IpIf->Ip) {
return IP4_LOCAL_HOST;
} else if (IpAddr == IpIf->SubnetBrdcast) {
return IP4_SUBNET_BROADCAST;
} else if (IpAddr == IpIf->NetBrdcast) {
return IP4_NET_BROADCAST;
}
return 0;
}
/**
Find the cast type of the packet related to the local host.
This isn't the same as link layer cast type. For example, DHCP
@@ -62,15 +57,15 @@ Ip4GetNetCast (
**/
INTN
Ip4GetHostCast (
IN IP4_SERVICE *IpSb,
IN IP4_ADDR Dst,
IN IP4_ADDR Src
IN IP4_SERVICE *IpSb,
IN IP4_ADDR Dst,
IN IP4_ADDR Src
)
{
LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
INTN Type;
INTN Class;
LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
INTN Type;
INTN Class;
Type = 0;
@@ -106,18 +101,16 @@ Ip4GetHostCast (
if (Dst == IP4_ALLONE_ADDRESS) {
IpIf = Ip4FindNet (IpSb, Src);
if (IpIf != NULL && !IP4_IS_BROADCAST (Ip4GetNetCast (Src, IpIf))) {
if ((IpIf != NULL) && !IP4_IS_BROADCAST (Ip4GetNetCast (Src, IpIf))) {
return IP4_LOCAL_BROADCAST;
}
} else if (IP4_IS_MULTICAST (Dst) && Ip4FindGroup (&IpSb->IgmpCtrl, Dst) != NULL) {
} else if (IP4_IS_MULTICAST (Dst) && (Ip4FindGroup (&IpSb->IgmpCtrl, Dst) != NULL)) {
return IP4_MULTICAST;
}
return Type;
}
/**
Find an interface whose configured IP address is Ip.
@@ -129,12 +122,12 @@ Ip4GetHostCast (
**/
IP4_INTERFACE *
Ip4FindInterface (
IN IP4_SERVICE *IpSb,
IN IP4_ADDR Ip
IN IP4_SERVICE *IpSb,
IN IP4_ADDR Ip
)
{
LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
IpIf = NET_LIST_USER_STRUCT (Entry, IP4_INTERFACE, Link);
@@ -147,7 +140,6 @@ Ip4FindInterface (
return NULL;
}
/**
Find an interface that Ip is on that connected network.
@@ -159,12 +151,12 @@ Ip4FindInterface (
**/
IP4_INTERFACE *
Ip4FindNet (
IN IP4_SERVICE *IpSb,
IN IP4_ADDR Ip
IN IP4_SERVICE *IpSb,
IN IP4_ADDR Ip
)
{
LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
IpIf = NET_LIST_USER_STRUCT (Entry, IP4_INTERFACE, Link);
@@ -177,7 +169,6 @@ Ip4FindNet (
return NULL;
}
/**
Find an interface of the service with the same Ip/Netmask pair.
@@ -190,13 +181,13 @@ Ip4FindNet (
**/
IP4_INTERFACE *
Ip4FindStationAddress (
IN IP4_SERVICE *IpSb,
IN IP4_ADDR Ip,
IN IP4_ADDR Netmask
IN IP4_SERVICE *IpSb,
IN IP4_ADDR Ip,
IN IP4_ADDR Netmask
)
{
LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
IpIf = NET_LIST_USER_STRUCT (Entry, IP4_INTERFACE, Link);
@@ -209,7 +200,6 @@ Ip4FindStationAddress (
return NULL;
}
/**
Get the MAC address for a multicast IP address. Call
Mnp's McastIpToMac to find the MAC address in stead of
@@ -226,18 +216,17 @@ Ip4FindStationAddress (
**/
EFI_STATUS
Ip4GetMulticastMac (
IN EFI_MANAGED_NETWORK_PROTOCOL *Mnp,
IN IP4_ADDR Multicast,
OUT EFI_MAC_ADDRESS *Mac
IN EFI_MANAGED_NETWORK_PROTOCOL *Mnp,
IN IP4_ADDR Multicast,
OUT EFI_MAC_ADDRESS *Mac
)
{
EFI_IP_ADDRESS EfiIp;
EFI_IP_ADDRESS EfiIp;
EFI_IP4 (EfiIp.v4) = HTONL (Multicast);
return Mnp->McastIpToMac (Mnp, FALSE, &EfiIp, Mac);
}
/**
Convert the multibyte field in IP header's byter order.
In spite of its name, it can also be used to convert from
@@ -250,19 +239,18 @@ Ip4GetMulticastMac (
**/
IP4_HEAD *
Ip4NtohHead (
IN IP4_HEAD *Head
IN IP4_HEAD *Head
)
{
Head->TotalLen = NTOHS (Head->TotalLen);
Head->Id = NTOHS (Head->Id);
Head->Fragment = NTOHS (Head->Fragment);
Head->Src = NTOHL (Head->Src);
Head->Dst = NTOHL (Head->Dst);
Head->TotalLen = NTOHS (Head->TotalLen);
Head->Id = NTOHS (Head->Id);
Head->Fragment = NTOHS (Head->Fragment);
Head->Src = NTOHL (Head->Src);
Head->Dst = NTOHL (Head->Dst);
return Head;
}
/**
Validate that Ip/Netmask pair is OK to be used as station
address. Only continuous netmasks are supported. and check
@@ -277,15 +265,15 @@ Ip4NtohHead (
**/
BOOLEAN
Ip4StationAddressValid (
IN IP4_ADDR Ip,
IN IP4_ADDR Netmask
IN IP4_ADDR Ip,
IN IP4_ADDR Netmask
)
{
//
// Only support the station address with 0.0.0.0/0 to enable DHCP client.
//
if (Netmask == IP4_ALLZERO_ADDRESS) {
return (BOOLEAN) (Ip == IP4_ALLZERO_ADDRESS);
return (BOOLEAN)(Ip == IP4_ALLZERO_ADDRESS);
}
//