Privet Vsem!!!
Sostavlyayu IP header, rasschitivayu CRC, vrode vse OK, no kogda otsilayu, to tcpdump daet sleduyuschee soobschenie (IP + TCP headers):
192.168.1.2.2020 > 192.168.1.1.http: S 0:0(0) win 256 <mss 256> [tos 0x10] (ttl 64, id 0, bad cksum 68f7!) 4510 002c 0000 0000 4006 68f7 c0a8 0102 c0a8 0101 07e4 0050 0000 0000 0000 0000 6002 0100 bea4 0000 0204 0100
Proga rasscheta CRC:
unsigned int CalcChecksum(unsigned char *Start, unsigned int Count, unsigned char IsTCP) { unsigned long Sum = 0;
while (Count > 1) { // sum words Sum += *((unsigned int *)Start)++; Count -= 2; }
if (Count) // add left-over byte, if any Sum += *(unsigned char *)Start; while (Sum >> 16) // fold 32-bit sum to 16 bits Sum = (Sum & 0xFFFF) + (Sum >> 16); return (unsigned int)~Sum; }
Daje ne znayu, za chto potyanut' :( Mojet kto rabotal s podobnim?