I am building on top of PassThru and it seems like I am parsing the ip header incorrectly. can anyone help?
here is the code:
if(ntohs(pEthHeader->h_proto) == ETH_P_IP){
pIPHeader = (iphdr*)PacketBuffer.m_IBuffer+14;
printf(“tInternet Protocol (IP) packetn”);
printf(“Source:%u.%u.%u.%un”,pIPHeader->ip_src.S_un.S_un_b.s_b1,pIPHeader->ip_src.S_un.S_un_b.s_b2,
pIPHeader->ip_src.S_un.S_un_b.s_b4,pIPHeader->ip_src.S_un.S_un_b.s_b4);
printf(“Destin:%u.%u.%u.%un”,pIPHeader->ip_dst.S_un.S_un_b.s_b1,pIPHeader->ip_dst.S_un.S_un_b.s_b2,
pIPHeader->ip_dst.S_un.S_un_b.s_b4,pIPHeader->ip_dst.S_un.S_un_b.s_b4);
}
When I generate traffic, neither source nor dest ip is my machines ip address. [/quote]