Hi
I am using S32K3 Design studio with FreeRTOS, LWIP component.
Question) By raw socket , can I make promiscuous mode like below?
PF_PACKET, SIOCGIFFLAGS, IFF_PROMISC is not defined.
But SW32K3_TCPIP_STACK_1_0_4 / 1_0_3 doesn't support it.
Is there any other method?
~~~~
/* Open PF_PACKET socket, listening for EtherType ETHER_TYPE */
if ((sockfd = socket(PF_PACKET, SOCK_RAW, htons(ETHER_TYPE))) == -1)
{
perror("listener: socket");
return -1;
}
/* Set interface to promiscuous mode - do we need to do this every time? */
strncpy(ifopts.ifr_name, ifName, IFNAMSIZ - 1);
ioctl(sockfd, SIOCGIFFLAGS, &ifopts);
ifopts.ifr_flags |= IFF_PROMISC;
ioctl(sockfd, SIOCSIFFLAGS, &ifopts);
/* Allow the socket to be reused - incase connection is closed prematurely */
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &sockopt, sizeof sockopt) == -1)
~~~