socket PF_PACKET sock_raw:->packet_create->dev_add_pack Modify ptype_base|ptype_all:二层协议
接收过程:netif_rx->process_backlog->netif_receive_skb:ptype_base|ptype_all
socket AF_INET sock_raw:->inet_create (list_for_each_entry_rcu(answer, &inetsw[sock->type], list) find SOCK_RAW )->hash(raw_hash_sk) Modify raw_v4_hashinfo:IP上层协议
接收过程: ip_rcv->ip_rcv_finish->ip_route_input->ip_local_deliver->ip_local_deliver_finish
->raw_local_deliver:raw_v4_hashinfo
inet_init->inet_register_protosw:注册inetsw_array
inetsw_array[]包含
{
.type = SOCK_RAW,
.protocol = IPPROTO_IP, /* wild card */
.prot = &raw_prot,
.ops = &inet_sockraw_ops,
.no_check = UDP_CSUM_DEFAULT,
.flags = INET_PROTOSW_REUSE,
}
AF_INET RAW socket 接口 一直存在
阅读(1954) | 评论(0) | 转发(0) |