raw socket in Windows XP
-
I created a row socket in order to send raw TCP data using following code: SOCKET sRaw = socket(AF_INET,SOCK_RAW,IPPROTO_IP); int flag = 1; setsockopt(sRaw, IPPROTO_IP, IP_HDRINCL, (char*)&flag, sizeo(flag)); after i intialized buffer and dest address, i call sendto function send it: int nRet = ::sendto(sRaw, buff, sizeof(ipHeader) + sizeof(tcpHeader), 0, (sockaddr*)&in, sizeof(in)); if(nRet == SOCKET_ERROR) { printf(" sendto failed () %d \n", ::GetLastError()); return; } the result is sendto failed with error code : 10004. Why? help me, tell me why, how can i send raw TCP data using raw socket. my OS is Windows xp sp2.
-
I created a row socket in order to send raw TCP data using following code: SOCKET sRaw = socket(AF_INET,SOCK_RAW,IPPROTO_IP); int flag = 1; setsockopt(sRaw, IPPROTO_IP, IP_HDRINCL, (char*)&flag, sizeo(flag)); after i intialized buffer and dest address, i call sendto function send it: int nRet = ::sendto(sRaw, buff, sizeof(ipHeader) + sizeof(tcpHeader), 0, (sockaddr*)&in, sizeof(in)); if(nRet == SOCKET_ERROR) { printf(" sendto failed () %d \n", ::GetLastError()); return; } the result is sendto failed with error code : 10004. Why? help me, tell me why, how can i send raw TCP data using raw socket. my OS is Windows xp sp2.
-
Microsoft have crippled the TCP implementation in SP2. Google groups is your friend. Aaron.
thank you very much. does TCP implementation exist in SP1?