tcp listen on raw socket

Does anyone know how to listen for tcp packets using a raw socket. I have
set one up that should work and send packets to it but it doesn’t get any
data and blocks until i kill it. I’ve set the protocol to 0 and can pick up
stuff like IGMPs but when i set it to 6 I get nothing. Thanks.

code I used…

int sock=socket(AF_INET,SOCK_RAW,6);
if(sock==-1)
{printf(“socket error”,strerror(errno));}
recv(sock,(char*)data,1024);

It can’t currently be done. tcp packets aren’t passed to the raw
ip processing routines.

-seanb

foo bar <ben@paybycheck.com> wrote:
: Does anyone know how to listen for tcp packets using a raw socket. I have
: set one up that should work and send packets to it but it doesn’t get any
: data and blocks until i kill it. I’ve set the protocol to 0 and can pick up
: stuff like IGMPs but when i set it to 6 I get nothing. Thanks.

: code I used…

: int sock=socket(AF_INET,SOCK_RAW,6);
: if(sock==-1)
: {printf(“socket error”,strerror(errno));}
: recv(sock,(char*)data,1024);