2.6.9 Dev. c Netif_receive_skb () SKB-> H. Raw = SKB-> NH. Raw = SKB-> data; ========================================================== = Comments: After the NIC receives the data, it allocates a SKB space in the receiving Letter to copy the data from the buffer on the NIC chip to the memory where SKB-> data is the starting address, in this case, SKB-> data is the MAC frame starting from the source MAC address. In this case, the other variables in the SKB structure are 0. However, the value assignment statement above sets the pointer position in H and NH to be the same as SKB-> data, that is In this case, (Link Layer) SKB-> data points to the MAC header, IP layer header, and TCP layer header. This means that if you want to access the variable in the H (TCP Header) at this time, you must: Struct tcphdr * temp; Temp = (struct tcphdr *) (char *) SKB-> Data + sizeof (struct iphdr )); At this time, the temp Pointer Points to the TCP Header structure in the datagram-struct tcphdr. If you want to access the IP address header information, struct iphdr * IPH = SKB-> NH. iph In this case, IPH points to the IP header structure-struct iphdr. After removing the MAC header from eth_trans_type, upload it to the IP layer. The function that the IP layer receives is Ip_rcv (). |