-
Couldn't load subscription status.
- Fork 203
Update Portable Folder for End Point changes #602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Portable Folder for End Point changes #602
Conversation
Added changes in WinpCap Port for IPV4 Endpoint changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR. I will check it later in a real project.
Please make the change suggested below.
| break; | ||
| } | ||
|
|
||
| return xResult; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very important: the return statement should be placed at the end of the function, not within the for-loop.
Can you please change that?
| static BaseType_t xHasWarned = pdFALSE; | ||
| EthernetHeader_t * pxEtherHeader; | ||
| NetworkEndPoint_t * pxEndPoint; | ||
| BaseType_t xResult; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking more closely, I also see that xResult was not initialised, which is entirely my fault.
I suggest this change:
static BaseType_t xPacketBouncedBack( const uint8_t * pucBuffer )
{
- BaseType_t xResult;
+ BaseType_t xResult = pdFALSE;
for( pxEndPoint = FreeRTOS_FirstEndPoint( NULL );
pxEndPoint != NULL;
pxEndPoint = FreeRTOS_NextEndPoint( NULL, pxEndPoint ) )
{
if( memcmp( pxEndPoint->xMACAddress.ucBytes, pxEtherHeader->xSourceAddress.ucBytes, ipMAC_ADDRESS_LENGTH_BYTES ) == 0 )
{
xResult = pdTRUE;
break;
}
- return xResult;
}
+ return xResult;
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @kar-rahul-aws , I compiled WinPCap/NetworkInterface.c in a demo project. It had a few warnings which can be solved as follows:
NetworkInterface.c :
- BaseType_t xNetworkInterfaceInitialise( NetworkInterface_t * pxInterface )
+ static BaseType_t xNetworkInterfaceInitialise( NetworkInterface_t * pxInterface )and please add a formal declaration as well at the top of the file.
- BaseType_t xGetPhyLinkStatus( NetworkInterface_t * pxInterface )
+ static BaseType_t xGetPhyLinkStatus( NetworkInterface_t * pxInterface )and please add a formal declaration as well at the top of the file.
NetworkInterface.h :
The following declarations can be removed:
- /* INTERNAL API FUNCTIONS. */
- BaseType_t xNetworkInterfaceInitialise( void );
- BaseType_t xNetworkInterfaceOutput( NetworkBufferDescriptor_t * const pxNetworkBuffer,
- BaseType_t xReleaseAfterSend );xGetPhyLinkStatus() will also become a static function:
- /* The following function is defined only when BufferAllocation_1.c is linked in the project. */
- BaseType_t xGetPhyLinkStatus( void );Thank you,
Hein
|
At this moment, Eventually this function will also be coupled to an interface: and the code will call That is also why the above functions must be declared |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/bot run uncrustify
|
/bot run uncrustify |
Added changes in WinPCap Port for IPV4 Endpoint changes
Network Interface changes for WinPCap Port
Description
Added Endpoint changes and Network Interface structure changes
Test Steps
Related Issue
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.