int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
//几个结构sk_buff套接字缓存,net_device网络设备结构,是所有网络结构的基础数据结构
,packet_type原型
struct packet_type
{
unsigned short type; /* This is really htons(ether_type). */
struct net_device *dev; /* NULL is wildcarded here */
int (*func) (struct sk_buff *, struct net_device *,
struct packet_type *);
void *data; /* Private to the packet type */
struct packet_type *next;
};
{
struct iphdr *iph;
//指向IP协议头的结构指针
/* When the interface is in promisc. mode, drop all the crap
* that it receives, do not try to analyse it.
*/
if (skb->pkt_type == PACKET_OTHERHOST)
goto drop;
//pkt_type表示报文类型 。PACKET_OTHERHOST表示非去往本机但是在特定模式下被接受的报文
//此处的作用是根据包类型,