I am trying to send the ping pkt. by writting a kernel module. when i checked whats being sent through tcpdump i saw somthing but it was not an icmp header.so decided to check whats in the headers transport_header and network_header(member of skb).how could i use printk command to do it(or any other).please see the follwing code
icmp.type = ICMP_ECHO;
icmp.code = 0;
icmp.un.echo.sequence = i++;
icmp.un.echo.id = current->pid & 0xFFFF;
skb->transport_header =skb_push(skb,sizeof(icmp));
memset(skb->transport_header,0,sizeof(struct icmphdr));
memcpy(skb->transport_header,&icmp,sizeof(struct icmphdr));
This would be quite ugly, but readable: