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

@@ -9,7 +9,7 @@
#include "Mtftp6Impl.h"
CHAR8 *mMtftp6SupportedOptions[MTFTP6_SUPPORTED_OPTIONS_NUM] = {
CHAR8 *mMtftp6SupportedOptions[MTFTP6_SUPPORTED_OPTIONS_NUM] = {
"blksize",
"windowsize",
"timeout",
@@ -17,7 +17,6 @@ CHAR8 *mMtftp6SupportedOptions[MTFTP6_SUPPORTED_OPTIONS_NUM] = {
"multicast"
};
/**
Parse the NULL terminated ASCII string of multicast option.
@@ -32,25 +31,23 @@ CHAR8 *mMtftp6SupportedOptions[MTFTP6_SUPPORTED_OPTIONS_NUM] = {
**/
EFI_STATUS
Mtftp6ParseMcastOption (
IN UINT8 *Str,
IN MTFTP6_EXT_OPTION_INFO *ExtInfo
IN UINT8 *Str,
IN MTFTP6_EXT_OPTION_INFO *ExtInfo
)
{
EFI_STATUS Status;
UINT32 Num;
CHAR8 *Ip6Str;
CHAR8 *TempStr;
EFI_STATUS Status;
UINT32 Num;
CHAR8 *Ip6Str;
CHAR8 *TempStr;
//
// The multicast option is formatted like "addr,port,mc"
// The server can also omit the ip and port, use ",,1"
//
if (*Str == ',') {
ZeroMem (&ExtInfo->McastIp, sizeof (EFI_IPv6_ADDRESS));
} else {
Ip6Str = (CHAR8 *) AllocateCopyPool (AsciiStrSize ((CHAR8 *) Str), Str);
Ip6Str = (CHAR8 *)AllocateCopyPool (AsciiStrSize ((CHAR8 *)Str), Str);
if (Ip6Str == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -88,17 +85,15 @@ Mtftp6ParseMcastOption (
// empty string. such as the port in ",,1"
//
if (*Str == ',') {
ExtInfo->McastPort = 0;
} else {
Num = (UINT32) AsciiStrDecimalToUintn ((CHAR8 *) Str);
Num = (UINT32)AsciiStrDecimalToUintn ((CHAR8 *)Str);
if (Num > 65535) {
return EFI_INVALID_PARAMETER;
}
ExtInfo->McastPort = (UINT16) Num;
ExtInfo->McastPort = (UINT16)Num;
while (NET_IS_DIGIT (*Str)) {
Str++;
@@ -114,13 +109,13 @@ Mtftp6ParseMcastOption (
//
// Check the master/slave setting, 1 for master, 0 for slave.
//
Num = (UINT32) AsciiStrDecimalToUintn ((CHAR8 *) Str);
Num = (UINT32)AsciiStrDecimalToUintn ((CHAR8 *)Str);
if (Num != 0 && Num != 1) {
if ((Num != 0) && (Num != 1)) {
return EFI_INVALID_PARAMETER;
}
ExtInfo->IsMaster = (BOOLEAN) (Num == 1);
ExtInfo->IsMaster = (BOOLEAN)(Num == 1);
while (NET_IS_DIGIT (*Str)) {
Str++;
@@ -133,7 +128,6 @@ Mtftp6ParseMcastOption (
return EFI_SUCCESS;
}
/**
Parse the MTFTP6 extension options.
@@ -151,81 +145,74 @@ Mtftp6ParseMcastOption (
**/
EFI_STATUS
Mtftp6ParseExtensionOption (
IN EFI_MTFTP6_OPTION *Options,
IN UINT32 Count,
IN BOOLEAN IsRequest,
IN UINT16 Operation,
IN MTFTP6_EXT_OPTION_INFO *ExtInfo
IN EFI_MTFTP6_OPTION *Options,
IN UINT32 Count,
IN BOOLEAN IsRequest,
IN UINT16 Operation,
IN MTFTP6_EXT_OPTION_INFO *ExtInfo
)
{
EFI_STATUS Status;
EFI_MTFTP6_OPTION *Opt;
UINT32 Index;
UINT32 Value;
EFI_STATUS Status;
EFI_MTFTP6_OPTION *Opt;
UINT32 Index;
UINT32 Value;
ExtInfo->BitMap = 0;
for (Index = 0; Index < Count; Index++) {
Opt = Options + Index;
if (Opt->OptionStr == NULL || Opt->ValueStr == NULL) {
if ((Opt->OptionStr == NULL) || (Opt->ValueStr == NULL)) {
return EFI_INVALID_PARAMETER;
}
if (AsciiStriCmp ((CHAR8 *) Opt->OptionStr, "blksize") == 0) {
if (AsciiStriCmp ((CHAR8 *)Opt->OptionStr, "blksize") == 0) {
//
// block size option, valid value is between [8, 65464]
//
Value = (UINT32) AsciiStrDecimalToUintn ((CHAR8 *) Opt->ValueStr);
Value = (UINT32)AsciiStrDecimalToUintn ((CHAR8 *)Opt->ValueStr);
if ((Value < 8) || (Value > 65464)) {
return EFI_INVALID_PARAMETER;
}
ExtInfo->BlkSize = (UINT16) Value;
ExtInfo->BlkSize = (UINT16)Value;
ExtInfo->BitMap |= MTFTP6_OPT_BLKSIZE_BIT;
} else if (AsciiStriCmp ((CHAR8 *) Opt->OptionStr, "timeout") == 0) {
} else if (AsciiStriCmp ((CHAR8 *)Opt->OptionStr, "timeout") == 0) {
//
// timeout option, valid value is between [1, 255]
//
Value = (UINT32) AsciiStrDecimalToUintn ((CHAR8 *) Opt->ValueStr);
Value = (UINT32)AsciiStrDecimalToUintn ((CHAR8 *)Opt->ValueStr);
if (Value < 1 || Value > 255) {
if ((Value < 1) || (Value > 255)) {
return EFI_INVALID_PARAMETER;
}
ExtInfo->Timeout = (UINT8) Value;
ExtInfo->Timeout = (UINT8)Value;
ExtInfo->BitMap |= MTFTP6_OPT_TIMEOUT_BIT;
} else if (AsciiStriCmp ((CHAR8 *) Opt->OptionStr, "tsize") == 0) {
} else if (AsciiStriCmp ((CHAR8 *)Opt->OptionStr, "tsize") == 0) {
//
// tsize option, the biggest transfer supported is 4GB with block size option
//
ExtInfo->Tsize = (UINT32) AsciiStrDecimalToUintn ((CHAR8 *) Opt->ValueStr);
ExtInfo->Tsize = (UINT32)AsciiStrDecimalToUintn ((CHAR8 *)Opt->ValueStr);
ExtInfo->BitMap |= MTFTP6_OPT_TSIZE_BIT;
} else if (AsciiStriCmp ((CHAR8 *) Opt->OptionStr, "multicast") == 0) {
} else if (AsciiStriCmp ((CHAR8 *)Opt->OptionStr, "multicast") == 0) {
//
// Multicast option, if it is a request, the value must be a zero string,
// otherwise, it must be like "addr,port,mc" string, mc indicates master.
//
if (!IsRequest) {
Status = Mtftp6ParseMcastOption (Opt->ValueStr, ExtInfo);
if (EFI_ERROR (Status)) {
return Status;
}
} else if (*(Opt->ValueStr) != '\0') {
return EFI_INVALID_PARAMETER;
}
ExtInfo->BitMap |= MTFTP6_OPT_MCAST_BIT;
} else if (AsciiStriCmp ((CHAR8 *) Opt->OptionStr, "windowsize") == 0) {
} else if (AsciiStriCmp ((CHAR8 *)Opt->OptionStr, "windowsize") == 0) {
if (Operation == EFI_MTFTP6_OPCODE_WRQ) {
//
// Currently, windowsize is not supported in the write operation.
@@ -233,15 +220,14 @@ Mtftp6ParseExtensionOption (
return EFI_UNSUPPORTED;
}
Value = (UINT32) AsciiStrDecimalToUintn ((CHAR8 *) Opt->ValueStr);
Value = (UINT32)AsciiStrDecimalToUintn ((CHAR8 *)Opt->ValueStr);
if ((Value < 1)) {
return EFI_INVALID_PARAMETER;
}
ExtInfo->WindowSize = (UINT16) Value;
ExtInfo->BitMap |= MTFTP6_OPT_WINDOWSIZE_BIT;
ExtInfo->WindowSize = (UINT16)Value;
ExtInfo->BitMap |= MTFTP6_OPT_WINDOWSIZE_BIT;
} else if (IsRequest) {
//
// If it's a request, unsupported; else if it's a reply, ignore.
@@ -253,7 +239,6 @@ Mtftp6ParseExtensionOption (
return EFI_SUCCESS;
}
/**
Go through the packet to fill the options array with the start
addresses of each MTFTP option name/value pair.
@@ -273,21 +258,21 @@ Mtftp6ParseExtensionOption (
**/
EFI_STATUS
Mtftp6ParsePacketOption (
IN EFI_MTFTP6_PACKET *Packet,
IN UINT32 PacketLen,
IN OUT UINT32 *Count,
IN EFI_MTFTP6_OPTION *Options OPTIONAL
IN EFI_MTFTP6_PACKET *Packet,
IN UINT32 PacketLen,
IN OUT UINT32 *Count,
IN EFI_MTFTP6_OPTION *Options OPTIONAL
)
{
UINT8 *Cur;
UINT8 *Last;
UINT8 Num;
UINT8 *Name;
UINT8 *Value;
UINT8 *Cur;
UINT8 *Last;
UINT8 Num;
UINT8 *Name;
UINT8 *Value;
Num = 0;
Cur = (UINT8 *) Packet + MTFTP6_OPCODE_LEN;
Last = (UINT8 *) Packet + PacketLen - 1;
Num = 0;
Cur = (UINT8 *)Packet + MTFTP6_OPCODE_LEN;
Last = (UINT8 *)Packet + PacketLen - 1;
//
// process option name and value pairs.
@@ -312,9 +297,9 @@ Mtftp6ParsePacketOption (
Num++;
if (Options != NULL && Num <= *Count) {
Options[Num - 1].OptionStr = Name;
Options[Num - 1].ValueStr = Value;
if ((Options != NULL) && (Num <= *Count)) {
Options[Num - 1].OptionStr = Name;
Options[Num - 1].ValueStr = Value;
}
Cur++;
@@ -323,7 +308,7 @@ Mtftp6ParsePacketOption (
//
// Return buffer too small if the buffer passed-in isn't enough.
//
if (*Count < Num || Options == NULL) {
if ((*Count < Num) || (Options == NULL)) {
*Count = Num;
return EFI_BUFFER_TOO_SMALL;
}
@@ -332,7 +317,6 @@ Mtftp6ParsePacketOption (
return EFI_SUCCESS;
}
/**
Go through the packet, generate option list array and fill it
by the result of parse options.
@@ -354,15 +338,15 @@ Mtftp6ParsePacketOption (
**/
EFI_STATUS
Mtftp6ParseStart (
IN EFI_MTFTP6_PACKET *Packet,
IN UINT32 PacketLen,
IN OUT UINT32 *OptionCount,
OUT EFI_MTFTP6_OPTION **OptionList OPTIONAL
IN EFI_MTFTP6_PACKET *Packet,
IN UINT32 PacketLen,
IN OUT UINT32 *OptionCount,
OUT EFI_MTFTP6_OPTION **OptionList OPTIONAL
)
{
EFI_STATUS Status;
EFI_STATUS Status;
if (PacketLen == 0 || Packet == NULL || OptionCount == NULL) {
if ((PacketLen == 0) || (Packet == NULL) || (OptionCount == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -379,7 +363,7 @@ Mtftp6ParseStart (
//
// The last byte must be zero to terminate the options.
//
if (*((UINT8 *) Packet + PacketLen - 1) != 0) {
if (*((UINT8 *)Packet + PacketLen - 1) != 0) {
return EFI_PROTOCOL_ERROR;
}