Skip to content

Commit 64a4dab

Browse files
committed
Uncrustify: triggered by comment.
1 parent 9ac727e commit 64a4dab

File tree

7 files changed

+140
-134
lines changed

7 files changed

+140
-134
lines changed

source/FreeRTOS_IGMP.c

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@
9494
{
9595
listSET_LIST_ITEM_OWNER( &( pxIRD->xListItem ), ( void * ) pxIRD );
9696
/* Quick and dirty assignment of end-point. This will probably have to be re-designed and re-done. */
97-
/* ToDo: make sure we also join the IPv6 multicast group */
97+
/* ToDo: make sure we also join the IPv6 multicast group */
9898
pxIRD->pxEndPoint = NULL;
99-
pxIRD->xMCastGroupAddress.xIs_IPv6 = pdFALSE_UNSIGNED;
100-
pxIRD->xMCastGroupAddress.xIPAddress.ulIP_IPv4 = ipLLMNR_IP_ADDR;
99+
pxIRD->xMCastGroupAddress.xIs_IPv6 = pdFALSE_UNSIGNED;
100+
pxIRD->xMCastGroupAddress.xIPAddress.ulIP_IPv4 = ipLLMNR_IP_ADDR;
101101
BaseType_t bReportItemConsumed = xAddIGMPReportToList( pxIRD );
102102

103103
if( pdTRUE != bReportItemConsumed )
@@ -259,8 +259,8 @@
259259
const ListItem_t * pxIterator;
260260
const ListItem_t * xEnd = listGET_END_MARKER( &xIGMP_ScheduleList );
261261
MCastReportData_t * pxMRD;
262-
NetworkInterface_t * pxInterface;
263-
NetworkEndPoint_t * pxEndPoint;
262+
NetworkInterface_t * pxInterface;
263+
NetworkEndPoint_t * pxEndPoint;
264264

265265
for( pxIterator = ( const ListItem_t * ) listGET_NEXT( xEnd ); pxIterator != ( const ListItem_t * ) xEnd; pxIterator = ( const ListItem_t * ) listGET_NEXT( pxIterator ) )
266266
{
@@ -280,45 +280,46 @@
280280

281281
if( pxMRD->ucCountDown == 1 )
282282
{
283-
pxEndPoint = pxMRD->pxEndPoint;
284-
/* If the end-point is null, the report is for all interfaces. */
285-
if ( pxEndPoint == NULL)
286-
{
287-
for( pxInterface = FreeRTOS_FirstNetworkInterface();
288-
pxInterface != NULL;
289-
pxInterface = FreeRTOS_NextNetworkInterface( pxInterface ) )
290-
{
291-
for( pxEndPoint = FreeRTOS_FirstEndPoint( pxInterface );
292-
pxEndPoint != NULL;
293-
pxEndPoint = FreeRTOS_NextEndPoint( pxInterface, pxEndPoint ) )
294-
{
295-
if ( pxEndPoint->bits.bIPv6 == pdTRUE_UNSIGNED )
296-
{
297-
/* ToDo: handle ICMPv6 reports*/
298-
continue;
299-
}
300-
301-
/* Make sure the end-point has an IP address */
302-
if ( pxEndPoint->ipv4_settings.ulIPAddress != 0 )
303-
{
304-
pxMRD->ucCountDown = 0;
305-
xSendIGMP( 0, ipIGMP_MEMBERSHIP_REPORT_V2, 0, pxMRD->xMCastGroupAddress.xIPAddress.ulIP_IPv4, pxEndPoint );
306-
}
307-
else
308-
{
309-
}
310-
}
311-
}
312-
}
313-
else
314-
{
315-
/* Make sure the end-point has an IP address */
316-
if ( pxEndPoint->ipv4_settings.ulIPAddress != 0 )
317-
{
318-
pxMRD->ucCountDown = 0;
319-
xSendIGMP( 0, ipIGMP_MEMBERSHIP_REPORT_V2, 0, pxMRD->xMCastGroupAddress.xIPAddress.ulIP_IPv4, pxEndPoint );
320-
}
321-
}
283+
pxEndPoint = pxMRD->pxEndPoint;
284+
285+
/* If the end-point is null, the report is for all interfaces. */
286+
if( pxEndPoint == NULL )
287+
{
288+
for( pxInterface = FreeRTOS_FirstNetworkInterface();
289+
pxInterface != NULL;
290+
pxInterface = FreeRTOS_NextNetworkInterface( pxInterface ) )
291+
{
292+
for( pxEndPoint = FreeRTOS_FirstEndPoint( pxInterface );
293+
pxEndPoint != NULL;
294+
pxEndPoint = FreeRTOS_NextEndPoint( pxInterface, pxEndPoint ) )
295+
{
296+
if( pxEndPoint->bits.bIPv6 == pdTRUE_UNSIGNED )
297+
{
298+
/* ToDo: handle ICMPv6 reports*/
299+
continue;
300+
}
301+
302+
/* Make sure the end-point has an IP address */
303+
if( pxEndPoint->ipv4_settings.ulIPAddress != 0 )
304+
{
305+
pxMRD->ucCountDown = 0;
306+
xSendIGMP( 0, ipIGMP_MEMBERSHIP_REPORT_V2, 0, pxMRD->xMCastGroupAddress.xIPAddress.ulIP_IPv4, pxEndPoint );
307+
}
308+
else
309+
{
310+
}
311+
}
312+
}
313+
}
314+
else
315+
{
316+
/* Make sure the end-point has an IP address */
317+
if( pxEndPoint->ipv4_settings.ulIPAddress != 0 )
318+
{
319+
pxMRD->ucCountDown = 0;
320+
xSendIGMP( 0, ipIGMP_MEMBERSHIP_REPORT_V2, 0, pxMRD->xMCastGroupAddress.xIPAddress.ulIP_IPv4, pxEndPoint );
321+
}
322+
}
322323
}
323324
}
324325

@@ -365,12 +366,12 @@
365366
pxIterator = ( const ListItem_t * ) listGET_NEXT( pxIterator ) )
366367
{
367368
pxIRD = ( MCastReportData_t * ) listGET_LIST_ITEM_OWNER( pxIterator );
368-
369-
if ( pxIRD->xMCastGroupAddress.xIs_IPv6 == pdTRUE_UNSIGNED )
370-
{
371-
/* ToDo: handle IPv6 */
372-
continue;
373-
}
369+
370+
if( pxIRD->xMCastGroupAddress.xIs_IPv6 == pdTRUE_UNSIGNED )
371+
{
372+
/* ToDo: handle IPv6 */
373+
continue;
374+
}
374375

375376
if( pxIRD->xMCastGroupAddress.xIPAddress.ulIP_IPv4 == pMCastGroup->imr_multiaddr.s_addr )
376377
{

source/FreeRTOS_Sockets.c

Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6421,47 +6421,48 @@ void * pvSocketGetSocketID( const ConstSocket_t xSocket )
64216421
{
64226422
case FREERTOS_SO_IP_MULTICAST_TTL:
64236423

6424-
{
6425-
uint8_t ucValue = *( ( uint8_t * ) pvOptionValue );
6426-
6427-
if( ( ( pxSocket->bits.bIsIPv6 == pdTRUE_UNSIGNED ) || pxSocket->ucProtocol != ( uint8_t ) FREERTOS_IPPROTO_UDP ) || ( uxOptionLength != sizeof( ucValue ) ) )
6428-
{
6429-
break; /* will return -pdFREERTOS_ERRNO_EINVAL */
6430-
}
6424+
{
6425+
uint8_t ucValue = *( ( uint8_t * ) pvOptionValue );
64316426

6432-
/* Override the default TTL value with this one. */
6433-
pxSocket->u.xUDP.xMulticastTTL = ( BaseType_t ) ucValue;
6427+
if( ( ( pxSocket->bits.bIsIPv6 == pdTRUE_UNSIGNED ) || ( pxSocket->ucProtocol != ( uint8_t ) FREERTOS_IPPROTO_UDP ) ) || ( uxOptionLength != sizeof( ucValue ) ) )
6428+
{
6429+
break; /* will return -pdFREERTOS_ERRNO_EINVAL */
6430+
}
64346431

6435-
xReturn = 0;
6436-
}
6437-
break;
6432+
/* Override the default TTL value with this one. */
6433+
pxSocket->u.xUDP.xMulticastTTL = ( BaseType_t ) ucValue;
6434+
6435+
xReturn = 0;
6436+
}
6437+
break;
64386438

64396439
case FREERTOS_SO_IPV6_MULTICAST_HOPS:
6440-
{
6441-
BaseType_t xValue = *( ( BaseType_t * ) pvOptionValue );
6442-
6443-
if( ( pxSocket->bits.bIsIPv6 == pdFALSE_UNSIGNED ) || ( pxSocket->ucProtocol != ( uint8_t ) FREERTOS_IPPROTO_UDP ) || ( uxOptionLength != sizeof( BaseType_t ) ) )
6444-
{
6445-
break; /* will return -pdFREERTOS_ERRNO_EINVAL */
6446-
}
6447-
6448-
if ( ( xValue < -1 ) || ( xValue > 255 ) )
6449-
{
6450-
break; /* will return -pdFREERTOS_ERRNO_EINVAL */
6451-
}else if ( xValue == -1 )
6452-
{
6453-
/* Set the default TTL value. */
6454-
pxSocket->u.xUDP.xMulticastTTL = ipconfigUDP_TIME_TO_LIVE;
6455-
}
6456-
else
6457-
{
6458-
/* Override the default TTL value with this one. */
6459-
pxSocket->u.xUDP.xMulticastTTL = xValue;
6460-
}
6461-
6462-
xReturn = 0;
6463-
}
6464-
break;
6440+
{
6441+
BaseType_t xValue = *( ( BaseType_t * ) pvOptionValue );
6442+
6443+
if( ( pxSocket->bits.bIsIPv6 == pdFALSE_UNSIGNED ) || ( pxSocket->ucProtocol != ( uint8_t ) FREERTOS_IPPROTO_UDP ) || ( uxOptionLength != sizeof( BaseType_t ) ) )
6444+
{
6445+
break; /* will return -pdFREERTOS_ERRNO_EINVAL */
6446+
}
6447+
6448+
if( ( xValue < -1 ) || ( xValue > 255 ) )
6449+
{
6450+
break; /* will return -pdFREERTOS_ERRNO_EINVAL */
6451+
}
6452+
else if( xValue == -1 )
6453+
{
6454+
/* Set the default TTL value. */
6455+
pxSocket->u.xUDP.xMulticastTTL = ipconfigUDP_TIME_TO_LIVE;
6456+
}
6457+
else
6458+
{
6459+
/* Override the default TTL value with this one. */
6460+
pxSocket->u.xUDP.xMulticastTTL = xValue;
6461+
}
6462+
6463+
xReturn = 0;
6464+
}
6465+
break;
64656466

64666467
case FREERTOS_SO_IP_ADD_MEMBERSHIP:
64676468
{
@@ -6505,9 +6506,9 @@ void * pvSocketGetSocketID( const ConstSocket_t xSocket )
65056506

65066507
/* Init the IGMP report description. It needs to hold the same membership information
65076508
* and it will eventually be added to the IGMP list. */
6508-
pxMRD->xMCastGroupAddress.xIs_IPv6 = pdFALSE_UNSIGNED;
6509-
pxMRD->xMCastGroupAddress.xIPAddress.ulIP_IPv4 = pMReq->imr_multiaddr.s_addr;
6510-
pxMRD->pxEndPoint = NULL;
6509+
pxMRD->xMCastGroupAddress.xIs_IPv6 = pdFALSE_UNSIGNED;
6510+
pxMRD->xMCastGroupAddress.xIPAddress.ulIP_IPv4 = pMReq->imr_multiaddr.s_addr;
6511+
pxMRD->pxEndPoint = NULL;
65116512
listSET_LIST_ITEM_OWNER( &( pxMRD->xListItem ), ( void * ) pxMRD );
65126513
pxMRD->xNumSockets = 0;
65136514
pxMRD->ucCountDown = 0;

source/include/FreeRTOS_IGMP.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
BaseType_t xSendIGMPEvent( void );
9191
void vHandleIGMP_Event( void );
9292
void vRemoveIGMPReportFromList( struct freertos_ip_mreq * pMCastGroup );
93-
BaseType_t xAddIGMPReportToList( MCastReportData_t * pNewEntry );
93+
BaseType_t xAddIGMPReportToList( MCastReportData_t * pNewEntry );
9494
eFrameProcessingResult_t eProcessIGMPPacket( NetworkBufferDescriptor_t * const pxNetworkBuffer );
9595

9696

source/include/FreeRTOS_IP_Common.h

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,32 @@ typedef struct xxIPv46_Address
5656
} IPv46_Address_t;
5757

5858
#if ( ipconfigSUPPORT_IP_MULTICAST != 0 )
59-
/** @brief The structure represents an IPv4 address. */
60-
typedef struct freertos_in_addr {
61-
uint32_t s_addr; /**< IPv4 address in network byte order */
62-
} In_Addr_t;
59+
/** @brief The structure represents an IPv4 address. */
60+
typedef struct freertos_in_addr
61+
{
62+
uint32_t s_addr; /**< IPv4 address in network byte order */
63+
} In_Addr_t;
6364

64-
/** @brief The structure is used to join/leave an IPv4 multicast group. */
65-
typedef struct freertos_ip_mreq {
66-
In_Addr_t imr_multiaddr; /**< The address of the multicast group */
67-
In_Addr_t imr_interface; /**< The address of the network interface on which the multicast group is to be joined or left */
68-
} IP_MReq_t;
65+
/** @brief The structure is used to join/leave an IPv4 multicast group. */
66+
typedef struct freertos_ip_mreq
67+
{
68+
In_Addr_t imr_multiaddr; /**< The address of the multicast group */
69+
In_Addr_t imr_interface; /**< The address of the network interface on which the multicast group is to be joined or left */
70+
} IP_MReq_t;
6971

70-
/** @brief The structure represents an IPv6 address. */
71-
typedef struct freertos_in6_addr {
72-
IPv6_Address_t s6_addr; /**< IPv6 address */
73-
}In6_Addr_t;
72+
/** @brief The structure represents an IPv6 address. */
73+
typedef struct freertos_in6_addr
74+
{
75+
IPv6_Address_t s6_addr; /**< IPv6 address */
76+
} In6_Addr_t;
7477

75-
/** @brief The structure is used to join/leave an IPv6 multicast group. */
76-
typedef struct freertos_ipv6_mreq {
77-
In6_Addr_t ipv6mr_multiaddr; /**< The address of the multicast group */
78-
uint32_t ipv6mr_interface; /**< The network interface index on which the multicast group is to be joined or left. 0 means use the default multicast interface. */
79-
} IP6_MReq_t;
80-
#endif
78+
/** @brief The structure is used to join/leave an IPv6 multicast group. */
79+
typedef struct freertos_ipv6_mreq
80+
{
81+
In6_Addr_t ipv6mr_multiaddr; /**< The address of the multicast group */
82+
uint32_t ipv6mr_interface; /**< The network interface index on which the multicast group is to be joined or left. 0 means use the default multicast interface. */
83+
} IP6_MReq_t;
84+
#endif /* if ( ipconfigSUPPORT_IP_MULTICAST != 0 ) */
8185

8286
struct xNetworkEndPoint;
8387
struct xNetworkInterface;

source/include/FreeRTOS_IP_Private.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -650,14 +650,14 @@ typedef struct UDPSOCKET
650650
#if ( ipconfigSUPPORT_IP_MULTICAST != 0 )
651651
List_t xMulticastGroupsList;
652652
BaseType_t xMulticastTTL; /**< Allows for multicast sockets to use a different TTL value to limit the scope of the multicast packet. Usually set to 1.
653-
* Note that the options are of different sizes for IPv4 and IPv6.
654-
* Example:
655-
* uint8_t ttl = 1;
656-
* FreeRTOS_setsockopt( MCastSendSock, 0, FREERTOS_SO_IP_MULTICAST_TTL, ( void * ) &ttl, sizeof( ttl ) );
657-
* IPv6 Example:
658-
* BaseType_t hops = 1;
659-
* FreeRTOS_setsockopt( MCastSendSock_v6, 0, FREERTOS_SO_IPV6_MULTICAST_HOPS, ( void * ) &hops, sizeof( hops ) );
660-
*/
653+
* Note that the options are of different sizes for IPv4 and IPv6.
654+
* Example:
655+
* uint8_t ttl = 1;
656+
* FreeRTOS_setsockopt( MCastSendSock, 0, FREERTOS_SO_IP_MULTICAST_TTL, ( void * ) &ttl, sizeof( ttl ) );
657+
* IPv6 Example:
658+
* BaseType_t hops = 1;
659+
* FreeRTOS_setsockopt( MCastSendSock_v6, 0, FREERTOS_SO_IPV6_MULTICAST_HOPS, ( void * ) &hops, sizeof( hops ) );
660+
*/
661661
#endif
662662
} IPUDPSocket_t;
663663

source/include/FreeRTOS_IP_Utils.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,20 @@
6969
/** @brief A structure holding information about a multicast group address. Used during generation of IGMP/ICMPv6 reports. */
7070
typedef struct MCastReportDescription
7171
{
72-
IPv46_Address_t xMCastGroupAddress; /**< Holds the IPv4/IPv6 multicast group address */
73-
ListItem_t xListItem; /**< List item for adding to the global list of reports. */
74-
NetworkEndPoint_t * pxEndPoint; /**< The end-point whose source address will be send for sending this report. NULL to send on the first end-point of every interface. */
75-
BaseType_t xNumSockets; /**< The number of sockets that are subscribed to this multicast group. */
76-
uint8_t ucCountDown;
72+
IPv46_Address_t xMCastGroupAddress; /**< Holds the IPv4/IPv6 multicast group address */
73+
ListItem_t xListItem; /**< List item for adding to the global list of reports. */
74+
NetworkEndPoint_t * pxEndPoint; /**< The end-point whose source address will be send for sending this report. NULL to send on the first end-point of every interface. */
75+
BaseType_t xNumSockets; /**< The number of sockets that are subscribed to this multicast group. */
76+
uint8_t ucCountDown;
7777
} MCastReportData_t;
7878

79-
/** @brief The structure to hold a "descriptor" for a multicast group that a socket has registered to. */
79+
/** @brief The structure to hold a "descriptor" for a multicast group that a socket has registered to. */
8080
typedef struct xMCastGroupDesc
8181
{
82-
struct freertos_ip_mreq mreq; /**< Struct for storing the original mreq structure that was sent to setsockopts() */
83-
struct xLIST_ITEM xListItem; /**< List struct. */
84-
FreeRTOS_Socket_t * pxSocket;
85-
MCastReportData_t * pxIGMPReportDesc; /**< Optional. used to hold the allocated IGMP report descriptor while passing from user code to the IP Task. */
82+
struct freertos_ip_mreq mreq; /**< Struct for storing the original mreq structure that was sent to setsockopts() */
83+
struct xLIST_ITEM xListItem; /**< List struct. */
84+
FreeRTOS_Socket_t * pxSocket;
85+
MCastReportData_t * pxIGMPReportDesc; /**< Optional. used to hold the allocated IGMP report descriptor while passing from user code to the IP Task. */
8686
} MCastGroupDesc_t;
8787
#endif /* ( ipconfigSUPPORT_IP_MULTICAST == 1 ) */
8888

source/portable/NetworkInterface/DriverSAM/NetworkInterface.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ static BaseType_t prvGMACInit( NetworkInterface_t * pxInterface )
719719
#endif /* ipconfigUSE_LLMNR */
720720

721721
#if ( ipconfigUSE_MDNS != 0 )
722-
prvAddMulticastMACAddress( xMDNS_MacAddress.ucBytes );
722+
prvAddMulticastMACAddress( xMDNS_MacAddress.ucBytes );
723723
#endif /* ipconfigUSE_MDNS */
724724

725725
#if ( ipconfigUSE_IPv6 != 0 )
@@ -794,9 +794,9 @@ static BaseType_t prvGMACInit( NetworkInterface_t * pxInterface )
794794
}
795795
/*-----------------------------------------------------------*/
796796

797-
#define GMAC_ADDRESS_HASH_BITS ( 64U )
798-
#define GMAC_ADDRESS_HASH_MASK ( GMAC_ADDRESS_HASH_BITS - 1 )
799-
#define GMAC_ADDRESS_HASH_COUNTERS_MAX_VALUE ( 255U )
797+
#define GMAC_ADDRESS_HASH_BITS ( 64U )
798+
#define GMAC_ADDRESS_HASH_MASK ( GMAC_ADDRESS_HASH_BITS - 1 )
799+
#define GMAC_ADDRESS_HASH_COUNTERS_MAX_VALUE ( 255U )
800800
static uint8_t prvAddressHashCounters[ GMAC_ADDRESS_HASH_BITS ] = { 0 };
801801
static uint64_t prvAddressHashBitMask = ( 0 );
802802

@@ -1153,9 +1153,9 @@ static uint32_t prvEMACRxPoll( void )
11531153
/*-----------------------------------------------------------*/
11541154

11551155
volatile UBaseType_t uxLastMinBufferCount = 0;
1156-
#if ( ipconfigCHECK_IP_QUEUE_SPACE != 0 )
1156+
#if ( ipconfigCHECK_IP_QUEUE_SPACE != 0 )
11571157
volatile UBaseType_t uxLastMinQueueSpace;
1158-
#endif
1158+
#endif
11591159
volatile UBaseType_t uxCurrentSemCount;
11601160
volatile UBaseType_t uxLowestSemCount;
11611161

0 commit comments

Comments
 (0)