Chinaunix首页 | 论坛 | 博客
  • 博客访问: 755302
  • 博文数量: 119
  • 博客积分: 137
  • 博客等级: 少校
  • 技术积分: 1582
  • 用 户 组: 普通用户
  • 注册时间: 2010-04-28 16:39
文章分类

全部博文(119)

文章存档

2017年(3)

2016年(7)

2014年(1)

2013年(8)

2012年(20)

2011年(27)

2010年(53)

分类: LINUX

2010-07-20 09:47:15

 

Bridgecode

linux/net/bridge

Bridge function

netif_receive_skb

br_handle_frame_hook

br_handle_frame()(net/bridge/br_input.c)

Ip/icmp/bridge

Receive/transmit

Rx/tx 相关档案

以下是网路封包从driver一直到socket的流程

netif_rx() (net/core/dev.c)

net_rx_action() (net/core/dev.c)

process_backlog() (net/core/dev.c)

netif_receive_skb() (net/core/dev.c) =呼叫handle_bridge()

deliver_skb() (net/core/dev.c)

ip_rcv() (net/ipv4/ip_input.c)

netfilter prerouting hook

ip_rcv_finish() (net/ipv4/ip_input.c)

call routing code

ip_route_input (net/ipv4/route.c)

ip_local_deliver() (net/ipv4/ip_input.c)

netfilter localin hook

ip_local_deliver [net/ipv4/ip_input.c]
ip_defrag [net/ipv4/ip_fragment.c]
ip_local_deliver_finish() (net/ipv4/ip_input.c)

call ipv4 protocal

如果封包是udp

udp_rcv() (net/ipv4/udp.c)

lookup socket, if any

udp_queue_rcv_skb()

sock_queue_rcv_skb() (include/net/sock.h)

enqueue into socket receiver queue

sock_def_readable() (net/core/sock.c)

wake_sup_interruptible() on socket waitqueue

return from recv() via socketcall

如果封包是tcp

tcp_v4_rcv (net/ipv4/tcp_ipv4.c)

__tcp_v4_lookup

tcp_v4_do_rcv

tcp_rcv_established (net/ipv4/tcp_input.c)

__skb_queue_tail (include/linux/skbuff.)

sock_def_readable (net/core/sock.c)

wake_up_interruptible (include/linux/sched.h)
tcp_v4_hnd_req (net/ipv4/tcp_ipv4.c)
tcp_v4_search_req
tcp_check_req
tcp_v4_syn_recv_sock
__tcp_v4_lookup_established
tcp_rcv_state_process (net/ipv4/tcp_input.c)
tcp_v4_conn_request (net/ipv4/tcp_ipv4.c)
tcp_v4_send_synack
tcp_v4_synq_add
tcp_rcv_synsent_state_process (net/ipv4/tcp_input.c)
tcp_set_state (include/net/tcp.h)
tcp_send_ack (net/ipv4/tcp_output.c]

其他相关

linux/net/ ipv4/ip_output.c

icmp: linux/net/ ipv4/icmp.c

linux/net/bridge/br_device.c


阅读(3684) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~