Next:
3.1.7.8 Safe Raw Sockets
Up:
3.1.7 Safe Raw Sockets
Previous:
3.1.7.6 Safe Raw Sockets
3.1.7.7 Safe Raw Sockets - Sniffer Sockets
#include < planetlab.h >
int tmp, sock;
struct sockaddr_in sin;
sock = socket(PF_INET, SOCK_RAW, IPPROTO_TCP);
tmp = 1;
setsockopt(sock, 0, SO_RAW_SNIFF, & tmp, sizeof(tmp));
sin.sin_port = htons(1234);
bind(sock, (struct sockaddr *)& sin, sizeof(sin));
Next:
3.1.7.8 Safe Raw Sockets
Up:
3.1.7 Safe Raw Sockets
Previous:
3.1.7.6 Safe Raw Sockets
Ian Wakeman 2005-04-22