Date: Thu, 25 Mar 1999 18:15:20 +0300 From: "Anton Kondakov" <slayer@rpts.donpac.ru> To: <freebsd-questions@freebsd.org> Subject: Raw sockets Message-ID: <01be76d2$4c6d6500$446897c3@ws.rpts.donpac.ru>
next in thread | raw e-mail | index | archive | help
May I receive TCP packets from raw socket? This code don't work :( if ((rs = socket(AF_INET,SOCK_RAW,IPPROTO_TCP))==-1) exit(1); soc.sin_family = AF_INET; soc.sin_addr.s_addr = INADDR_ANY; soc.sin_port = SRC_PORT; if (!bind(rs,(struct sockaddr *)&soc,sizeof(soc))) exit(1); buf = malloc(PKT_SIZE); sz = sizeof(psoc); p = recvfrom(rs,buf,PKT_SIZE,0,(struct sockaddr *)&psoc,&sz); P.S. code running under root account (FreeBSD 2.2.8) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01be76d2$4c6d6500$446897c3>