linux由于开源就比win好多了 很简单和3环一样
直接看内核源码 (深入了解用户层到内核层 查看linux 源码 tcpip实现 第20章)
分别在:sk->proto与ops
//net.h
struct socket {
socket_state state;
unsigned long flags;
const struct proto_ops *ops;
struct fasync_struct *fasync_list;
struct file *file;
struct sock *sk;
wait_queue_head_t wait;
short type;
};
//sock.h
struct sock {
.....
struct {
struct sk_buff *head;
struct sk_buff *tail;
} sk_backlog;
struct sk_buff_head sk_error_queue;
struct proto *sk_prot_creator;
......
}
转载于:https://blog.51cto.com/haidragon/2329170