Код (Text): int bOpt = 1; WSADATA asd; WSAStartup(MAKEWORD(2,2),&asd); SOCKET s = socket(PF_INET, SOCK_RAW, IPPROTO_RAW); setsockopt(s, IPPROTO_IP, IP_HDRINCL, (char *)&bOpt, sizeof(bOpt)); struct sockaddr_in sin; sin.sin_family = AF_INET; sin.sin_port = htons(80); sin.sin_addr.s_addr = inet_addr("192.168.0.101"); char datagram[40]; ipheader *iph = (ipheader *)datagram; tcpheader *tcph = (tcpheader *)(datagram + sizeof(ipheader)); PS_HDR pseudo_header; memset(datagram, 0, sizeof(datagram)); iph->ip_hl = 5; iph->ip_v = 4; iph->ip_tos = 0; iph->ip_len = sizeof(ipheader) + sizeof(tcpheader); iph->ip_id = rand(); iph->ip_off = 0; iph->ip_ttl = 255; iph->ip_p = IPPROTO_TCP; iph->ip_sum = 0; iph->ip_src = inet_addr("192.168.0.100"); iph->ip_dst = sin.sin_addr.s_addr; tcph->th_sport = htons(getrandom(0, 1500)); tcph->th_dport = sin.sin_port; tcph->th_seq = rand(); tcph->th_ack = 0; tcph->th_x2 = 0; tcph->th_off = 5; tcph->th_flags = TH_SYN; tcph->th_win = htons(512); tcph->th_sum = 0; tcph->th_urp = 0; pseudo_header.source_address = iph->ip_src; pseudo_header.dest_address = sin.sin_addr.s_addr; pseudo_header.placeholder = 0; pseudo_header.protocol = IPPROTO_TCP; pseudo_header.tcp_length = htons(sizeof(tcpheader)); memcpy((char*)&pseudo_header.tcp, (char*)tcph, sizeof(tcpheader)); iph->ip_sum = checksum((unsigned short *)&iph, sizeof(ipheader)); tcph->th_sum = checksum((unsigned short *)&pseudo_header, sizeof(pseudo_header)); if (sendto(s, datagram, sizeof(datagram), 0, (SOCKADDR *)&sin, sizeof(sin)) == SOCKET_ERROR) return -1; Собственно пытаюсь отправить сырой СИН, но не выходит никак. Это у меня ошибка или действует ограничение Windows?