I have one IP packet, which includes IGMP packet. I want to simulate this using RAW socket programming.
the checksum field of IP packet is e1c9, now how to assign this value in programming. I tried
iphdr->iph_chksum=”e1c9″;
also
iphdr->iph_chksum=57801;
is the above thing right?
it is not working properly, please tell me the exact way?
The C syntax for hexadecimal values is
0xe1c9in this case. you should however ensure that you are using the correct byte order, you will probably need to pass the value throughhtons