/* Open the network interface. The number of the interface to be opened is set by the configNETWORK_INTERFACE_TO_USE constant in FreeRTOSConfig.h.  */
static void prvOpenSelectedNetworkInterface(pcap_if_t *pxAllNetworkInterfaces)
/* Open the network interface. The number of the interface to be opened is set by the configNETWORK_INTERFACE_TO_USE constant in FreeRTOSConfig.h.  */
static void prvOpenSelectedNetworkInterface(pcap_if_t *pxAllNetworkInterfaces)
{
pcap_if_t *xInterface;
long x;
	xInterface = pxAllNetworkInterfaces;
    for( x = 0L; x < ( configNETWORK_INTERFACE_TO_USE - 1L ); x++ )
	{
		xInterface = xInterface->next;
	}
	pxOpenedInterfaceHandle = pcap_open(	xInterface->name,
											UIP_CONF_BUFFER_SIZE,
											PCAP_OPENFLAG_PROMISCUOUS,
											0xfffffffL,
											NULL,
											cErrorBuffer            
									   );
    if ( pxOpenedInterfaceHandle == NULL )
    {
        printf( "\r\n%s is not supported by WinPcap and cannot be opened\r\n", xInterface->name );
    }
	else
	{
		prvConfigureCaptureBehaviour();
	}
	pcap_freealldevs( pxAllNetworkInterfaces );
}