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:
committed by
mergify[bot]
parent
2f88bd3a12
commit
d1050b9dff
@@ -21,17 +21,17 @@
|
||||
**/
|
||||
UINT32
|
||||
Ip6RouteCacheHash (
|
||||
IN EFI_IPv6_ADDRESS *Ip1,
|
||||
IN EFI_IPv6_ADDRESS *Ip2
|
||||
IN EFI_IPv6_ADDRESS *Ip1,
|
||||
IN EFI_IPv6_ADDRESS *Ip2
|
||||
)
|
||||
{
|
||||
UINT32 Prefix1;
|
||||
UINT32 Prefix2;
|
||||
UINT32 Prefix1;
|
||||
UINT32 Prefix2;
|
||||
|
||||
Prefix1 = *((UINT32 *) ((UINTN *) (Ip1)));
|
||||
Prefix2 = *((UINT32 *) ((UINTN *) (Ip2)));
|
||||
Prefix1 = *((UINT32 *)((UINTN *)(Ip1)));
|
||||
Prefix2 = *((UINT32 *)((UINTN *)(Ip2)));
|
||||
|
||||
return ((UINT32) (Prefix1 ^ Prefix2) % IP6_ROUTE_CACHE_HASH_SIZE);
|
||||
return ((UINT32)(Prefix1 ^ Prefix2) % IP6_ROUTE_CACHE_HASH_SIZE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,12 +49,12 @@ Ip6RouteCacheHash (
|
||||
**/
|
||||
IP6_ROUTE_ENTRY *
|
||||
Ip6CreateRouteEntry (
|
||||
IN EFI_IPv6_ADDRESS *Destination OPTIONAL,
|
||||
IN UINT8 PrefixLength,
|
||||
IN EFI_IPv6_ADDRESS *GatewayAddress OPTIONAL
|
||||
IN EFI_IPv6_ADDRESS *Destination OPTIONAL,
|
||||
IN UINT8 PrefixLength,
|
||||
IN EFI_IPv6_ADDRESS *GatewayAddress OPTIONAL
|
||||
)
|
||||
{
|
||||
IP6_ROUTE_ENTRY *RtEntry;
|
||||
IP6_ROUTE_ENTRY *RtEntry;
|
||||
|
||||
RtEntry = AllocateZeroPool (sizeof (IP6_ROUTE_ENTRY));
|
||||
|
||||
@@ -85,7 +85,7 @@ Ip6CreateRouteEntry (
|
||||
**/
|
||||
VOID
|
||||
Ip6FreeRouteEntry (
|
||||
IN OUT IP6_ROUTE_ENTRY *RtEntry
|
||||
IN OUT IP6_ROUTE_ENTRY *RtEntry
|
||||
)
|
||||
{
|
||||
ASSERT ((RtEntry != NULL) && (RtEntry->RefCnt > 0));
|
||||
@@ -116,14 +116,14 @@ Ip6FreeRouteEntry (
|
||||
**/
|
||||
IP6_ROUTE_ENTRY *
|
||||
Ip6FindRouteEntry (
|
||||
IN IP6_ROUTE_TABLE *RtTable,
|
||||
IN EFI_IPv6_ADDRESS *Destination OPTIONAL,
|
||||
IN EFI_IPv6_ADDRESS *NextHop OPTIONAL
|
||||
IN IP6_ROUTE_TABLE *RtTable,
|
||||
IN EFI_IPv6_ADDRESS *Destination OPTIONAL,
|
||||
IN EFI_IPv6_ADDRESS *NextHop OPTIONAL
|
||||
)
|
||||
{
|
||||
LIST_ENTRY *Entry;
|
||||
IP6_ROUTE_ENTRY *RtEntry;
|
||||
INTN Index;
|
||||
LIST_ENTRY *Entry;
|
||||
IP6_ROUTE_ENTRY *RtEntry;
|
||||
INTN Index;
|
||||
|
||||
ASSERT (Destination != NULL || NextHop != NULL);
|
||||
|
||||
@@ -144,7 +144,6 @@ Ip6FindRouteEntry (
|
||||
return RtEntry;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,13 +165,13 @@ Ip6FindRouteEntry (
|
||||
**/
|
||||
IP6_ROUTE_CACHE_ENTRY *
|
||||
Ip6CreateRouteCacheEntry (
|
||||
IN EFI_IPv6_ADDRESS *Dst,
|
||||
IN EFI_IPv6_ADDRESS *Src,
|
||||
IN EFI_IPv6_ADDRESS *GateWay,
|
||||
IN UINTN Tag
|
||||
IN EFI_IPv6_ADDRESS *Dst,
|
||||
IN EFI_IPv6_ADDRESS *Src,
|
||||
IN EFI_IPv6_ADDRESS *GateWay,
|
||||
IN UINTN Tag
|
||||
)
|
||||
{
|
||||
IP6_ROUTE_CACHE_ENTRY *RtCacheEntry;
|
||||
IP6_ROUTE_CACHE_ENTRY *RtCacheEntry;
|
||||
|
||||
RtCacheEntry = AllocatePool (sizeof (IP6_ROUTE_CACHE_ENTRY));
|
||||
|
||||
@@ -222,21 +221,21 @@ Ip6FreeRouteCacheEntry (
|
||||
**/
|
||||
IP6_ROUTE_CACHE_ENTRY *
|
||||
Ip6FindRouteCache (
|
||||
IN IP6_ROUTE_TABLE *RtTable,
|
||||
IN EFI_IPv6_ADDRESS *Dest,
|
||||
IN EFI_IPv6_ADDRESS *Src
|
||||
IN IP6_ROUTE_TABLE *RtTable,
|
||||
IN EFI_IPv6_ADDRESS *Dest,
|
||||
IN EFI_IPv6_ADDRESS *Src
|
||||
)
|
||||
{
|
||||
LIST_ENTRY *Entry;
|
||||
IP6_ROUTE_CACHE_ENTRY *RtCacheEntry;
|
||||
UINT32 Index;
|
||||
LIST_ENTRY *Entry;
|
||||
IP6_ROUTE_CACHE_ENTRY *RtCacheEntry;
|
||||
UINT32 Index;
|
||||
|
||||
Index = IP6_ROUTE_CACHE_HASH (Dest, Src);
|
||||
|
||||
NET_LIST_FOR_EACH (Entry, &RtTable->Cache.CacheBucket[Index]) {
|
||||
RtCacheEntry = NET_LIST_USER_STRUCT (Entry, IP6_ROUTE_CACHE_ENTRY, Link);
|
||||
|
||||
if (EFI_IP6_EQUAL (Dest, &RtCacheEntry->Destination)&& EFI_IP6_EQUAL (Src, &RtCacheEntry->Source)) {
|
||||
if (EFI_IP6_EQUAL (Dest, &RtCacheEntry->Destination) && EFI_IP6_EQUAL (Src, &RtCacheEntry->Source)) {
|
||||
NET_GET_REF (RtCacheEntry);
|
||||
return RtCacheEntry;
|
||||
}
|
||||
@@ -260,16 +259,16 @@ Ip6FindRouteCache (
|
||||
**/
|
||||
EFI_STATUS
|
||||
Ip6BuildEfiRouteTable (
|
||||
IN IP6_ROUTE_TABLE *RouteTable,
|
||||
OUT UINT32 *EfiRouteCount,
|
||||
OUT EFI_IP6_ROUTE_TABLE **EfiRouteTable OPTIONAL
|
||||
IN IP6_ROUTE_TABLE *RouteTable,
|
||||
OUT UINT32 *EfiRouteCount,
|
||||
OUT EFI_IP6_ROUTE_TABLE **EfiRouteTable OPTIONAL
|
||||
)
|
||||
{
|
||||
LIST_ENTRY *Entry;
|
||||
IP6_ROUTE_ENTRY *RtEntry;
|
||||
EFI_IP6_ROUTE_TABLE *EfiTable;
|
||||
UINT32 Count;
|
||||
INT32 Index;
|
||||
LIST_ENTRY *Entry;
|
||||
IP6_ROUTE_ENTRY *RtEntry;
|
||||
EFI_IP6_ROUTE_TABLE *EfiTable;
|
||||
UINT32 Count;
|
||||
INT32 Index;
|
||||
|
||||
ASSERT (EfiRouteCount != NULL);
|
||||
|
||||
@@ -295,7 +294,6 @@ Ip6BuildEfiRouteTable (
|
||||
Count = 0;
|
||||
|
||||
for (Index = IP6_PREFIX_MAX; Index >= 0; Index--) {
|
||||
|
||||
NET_LIST_FOR_EACH (Entry, &(RouteTable->RouteArea[Index])) {
|
||||
RtEntry = NET_LIST_USER_STRUCT (Entry, IP6_ROUTE_ENTRY, Link);
|
||||
|
||||
@@ -329,8 +327,8 @@ Ip6CreateRouteTable (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
IP6_ROUTE_TABLE *RtTable;
|
||||
UINT32 Index;
|
||||
IP6_ROUTE_TABLE *RtTable;
|
||||
UINT32 Index;
|
||||
|
||||
RtTable = AllocatePool (sizeof (IP6_ROUTE_TABLE));
|
||||
if (RtTable == NULL) {
|
||||
@@ -361,19 +359,19 @@ Ip6CreateRouteTable (
|
||||
**/
|
||||
VOID
|
||||
Ip6CleanRouteTable (
|
||||
IN OUT IP6_ROUTE_TABLE *RtTable
|
||||
IN OUT IP6_ROUTE_TABLE *RtTable
|
||||
)
|
||||
{
|
||||
LIST_ENTRY *Entry;
|
||||
LIST_ENTRY *Next;
|
||||
IP6_ROUTE_ENTRY *RtEntry;
|
||||
IP6_ROUTE_CACHE_ENTRY *RtCacheEntry;
|
||||
UINT32 Index;
|
||||
LIST_ENTRY *Entry;
|
||||
LIST_ENTRY *Next;
|
||||
IP6_ROUTE_ENTRY *RtEntry;
|
||||
IP6_ROUTE_CACHE_ENTRY *RtCacheEntry;
|
||||
UINT32 Index;
|
||||
|
||||
ASSERT (RtTable->RefCnt > 0);
|
||||
|
||||
if (--RtTable->RefCnt > 0) {
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -410,18 +408,17 @@ Ip6CleanRouteTable (
|
||||
**/
|
||||
VOID
|
||||
Ip6PurgeRouteCache (
|
||||
IN IP6_ROUTE_CACHE *RtCache,
|
||||
IN UINTN Tag
|
||||
IN IP6_ROUTE_CACHE *RtCache,
|
||||
IN UINTN Tag
|
||||
)
|
||||
{
|
||||
LIST_ENTRY *Entry;
|
||||
LIST_ENTRY *Next;
|
||||
IP6_ROUTE_CACHE_ENTRY *RtCacheEntry;
|
||||
UINT32 Index;
|
||||
LIST_ENTRY *Entry;
|
||||
LIST_ENTRY *Next;
|
||||
IP6_ROUTE_CACHE_ENTRY *RtCacheEntry;
|
||||
UINT32 Index;
|
||||
|
||||
for (Index = 0; Index < IP6_ROUTE_CACHE_HASH_SIZE; Index++) {
|
||||
NET_LIST_FOR_EACH_SAFE (Entry, Next, &RtCache->CacheBucket[Index]) {
|
||||
|
||||
RtCacheEntry = NET_LIST_USER_STRUCT (Entry, IP6_ROUTE_CACHE_ENTRY, Link);
|
||||
|
||||
if (RtCacheEntry->Tag == Tag) {
|
||||
@@ -447,15 +444,15 @@ Ip6PurgeRouteCache (
|
||||
**/
|
||||
EFI_STATUS
|
||||
Ip6AddRoute (
|
||||
IN OUT IP6_ROUTE_TABLE *RtTable,
|
||||
IN EFI_IPv6_ADDRESS *Destination,
|
||||
IN UINT8 PrefixLength,
|
||||
IN EFI_IPv6_ADDRESS *GatewayAddress
|
||||
IN OUT IP6_ROUTE_TABLE *RtTable,
|
||||
IN EFI_IPv6_ADDRESS *Destination,
|
||||
IN UINT8 PrefixLength,
|
||||
IN EFI_IPv6_ADDRESS *GatewayAddress
|
||||
)
|
||||
{
|
||||
LIST_ENTRY *ListHead;
|
||||
LIST_ENTRY *Entry;
|
||||
IP6_ROUTE_ENTRY *Route;
|
||||
LIST_ENTRY *ListHead;
|
||||
LIST_ENTRY *Entry;
|
||||
IP6_ROUTE_ENTRY *Route;
|
||||
|
||||
ListHead = &RtTable->RouteArea[PrefixLength];
|
||||
|
||||
@@ -466,7 +463,8 @@ Ip6AddRoute (
|
||||
Route = NET_LIST_USER_STRUCT (Entry, IP6_ROUTE_ENTRY, Link);
|
||||
|
||||
if (NetIp6IsNetEqual (Destination, &Route->Destination, PrefixLength) &&
|
||||
EFI_IP6_EQUAL (GatewayAddress, &Route->NextHop)) {
|
||||
EFI_IP6_EQUAL (GatewayAddress, &Route->NextHop))
|
||||
{
|
||||
return EFI_ACCESS_DENIED;
|
||||
}
|
||||
}
|
||||
@@ -506,17 +504,17 @@ Ip6AddRoute (
|
||||
**/
|
||||
EFI_STATUS
|
||||
Ip6DelRoute (
|
||||
IN OUT IP6_ROUTE_TABLE *RtTable,
|
||||
IN EFI_IPv6_ADDRESS *Destination,
|
||||
IN UINT8 PrefixLength,
|
||||
IN EFI_IPv6_ADDRESS *GatewayAddress
|
||||
IN OUT IP6_ROUTE_TABLE *RtTable,
|
||||
IN EFI_IPv6_ADDRESS *Destination,
|
||||
IN UINT8 PrefixLength,
|
||||
IN EFI_IPv6_ADDRESS *GatewayAddress
|
||||
)
|
||||
{
|
||||
LIST_ENTRY *ListHead;
|
||||
LIST_ENTRY *Entry;
|
||||
LIST_ENTRY *Next;
|
||||
IP6_ROUTE_ENTRY *Route;
|
||||
UINT32 TotalNum;
|
||||
LIST_ENTRY *ListHead;
|
||||
LIST_ENTRY *Entry;
|
||||
LIST_ENTRY *Next;
|
||||
IP6_ROUTE_ENTRY *Route;
|
||||
UINT32 TotalNum;
|
||||
|
||||
ListHead = &RtTable->RouteArea[PrefixLength];
|
||||
TotalNum = RtTable->TotalNum;
|
||||
@@ -524,14 +522,15 @@ Ip6DelRoute (
|
||||
NET_LIST_FOR_EACH_SAFE (Entry, Next, ListHead) {
|
||||
Route = NET_LIST_USER_STRUCT (Entry, IP6_ROUTE_ENTRY, Link);
|
||||
|
||||
if (Destination != NULL && !NetIp6IsNetEqual (Destination, &Route->Destination, PrefixLength)) {
|
||||
continue;
|
||||
}
|
||||
if (GatewayAddress != NULL && !EFI_IP6_EQUAL (GatewayAddress, &Route->NextHop)) {
|
||||
if ((Destination != NULL) && !NetIp6IsNetEqual (Destination, &Route->Destination, PrefixLength)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Ip6PurgeRouteCache (&RtTable->Cache, (UINTN) Route);
|
||||
if ((GatewayAddress != NULL) && !EFI_IP6_EQUAL (GatewayAddress, &Route->NextHop)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Ip6PurgeRouteCache (&RtTable->Cache, (UINTN)Route);
|
||||
RemoveEntryList (Entry);
|
||||
Ip6FreeRouteEntry (Route);
|
||||
|
||||
@@ -556,17 +555,17 @@ Ip6DelRoute (
|
||||
**/
|
||||
IP6_ROUTE_CACHE_ENTRY *
|
||||
Ip6Route (
|
||||
IN IP6_SERVICE *IpSb,
|
||||
IN EFI_IPv6_ADDRESS *Dest,
|
||||
IN EFI_IPv6_ADDRESS *Src
|
||||
IN IP6_SERVICE *IpSb,
|
||||
IN EFI_IPv6_ADDRESS *Dest,
|
||||
IN EFI_IPv6_ADDRESS *Src
|
||||
)
|
||||
{
|
||||
IP6_ROUTE_TABLE *RtTable;
|
||||
LIST_ENTRY *ListHead;
|
||||
IP6_ROUTE_CACHE_ENTRY *RtCacheEntry;
|
||||
IP6_ROUTE_ENTRY *RtEntry;
|
||||
EFI_IPv6_ADDRESS NextHop;
|
||||
UINT32 Index;
|
||||
IP6_ROUTE_TABLE *RtTable;
|
||||
LIST_ENTRY *ListHead;
|
||||
IP6_ROUTE_CACHE_ENTRY *RtCacheEntry;
|
||||
IP6_ROUTE_ENTRY *RtEntry;
|
||||
EFI_IPv6_ADDRESS NextHop;
|
||||
UINT32 Index;
|
||||
|
||||
RtTable = IpSb->RouteTable;
|
||||
|
||||
@@ -614,7 +613,7 @@ Ip6Route (
|
||||
//
|
||||
// Create a route cache entry, and tag it as spawned from this route entry
|
||||
//
|
||||
RtCacheEntry = Ip6CreateRouteCacheEntry (Dest, Src, &NextHop, (UINTN) RtEntry);
|
||||
RtCacheEntry = Ip6CreateRouteCacheEntry (Dest, Src, &NextHop, (UINTN)RtEntry);
|
||||
|
||||
if (RtCacheEntry == NULL) {
|
||||
return NULL;
|
||||
@@ -626,4 +625,3 @@ Ip6Route (
|
||||
|
||||
return RtCacheEntry;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user