Originally Posted by
leetow2003
I create a socket:
socket(AF_INET,SOCK_RAW,IPPROTO_ICMP);
I want to know how to set this socket to promisc?
All right, your asking this again got me curious... I'm afraid I fed you some misinformation.
You _can_, in fact, get the raw data for all protocols (promiscuous mode). A la:
Code:
int fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
More information on this.
On multiplexing: As MK27 as pointed out, select() is one way of doing it, poll() is another. Both are widely supported (though select() is older). Unless performance is a considerable issue for you, which one to use is pretty much about preference.