Chinaunix首页 | 论坛 | 博客
  • 博客访问: 61507
  • 博文数量: 12
  • 博客积分: 1586
  • 博客等级: 上尉
  • 技术积分: 90
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-17 13:25
文章分类
文章存档

2012年(1)

2011年(1)

2010年(10)

分类: LINUX

2010-11-03 17:41:04

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

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

chinaunix网友2010-11-05 08:31:55

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com