sys-socket - linux 内核 socket 结构关系
2021-07-16 12:18:41 1 举报
linux 内核 socket 结构的文件部分和网络部分的结构关系。
作者其他创作
大纲/内容
sk_init_common
./net/ipv4/af_inet.c
socket
+ state : socket_state+ type : short+ flags : unsigned long+ wq : struct socket_wq+ file :struct file*+ sk : struct sock*+ ops : const struct proto_ops *
kern_mount
tcp_v4_init_sock
Linux 5.0.1 sys-socket
./net/socket.c
proto_ops
static const struct net_proto_family __rcu *net_families[NPROTO] __read_mostly;
fd: current fd array
./fs/inode.c
new_inode_pseudo
sock_register
1
vfsmount
+ mnt_root : struct dentry *+ mnt_sb : struct super_block+ mnt_flags : int
kernel_init
4.1
./include/linux/fs.h
4.2
1.2
./net/ipv4/tcp.c
./include/linux/fdtable.h
sock_map_fd
sock
+ sk_wq : struct socket_wq*+ sk_protocol : unsigned int+ sk_type : unsigned int+ sk_rcvbuf : int+ sk_sndbuf : int+ sk_receive_queue : struct sk_buff_head+ sk_write_queue : struct sk_buff_head+ sk_state : __sk_common.skc_state+ sk_family : __sk_common.skc_family+ sk_prot : __sk_common.skc_prot+ sk_prot_creator : struct proto\t\t*
socket_alloc
+ socket : struct socket+ vfs_inode : struct inode
sock_alloc_file
inet_init
sk_alloc
./init/main.c
wenfh2020.com
./include/linux/mount.h
static struct file_system_type sock_fs_type = { .name = \"sockfs\
sock_alloc_inode
inode
+ i_op : const struct inode_operations
files_struct
+ count : atomic_t+ fdt : struct fdtable __rcu*+ next_fd : unsigned long
span style=\"font-size: inherit;\
./net/ipv4/tcp_ipv4.c
f_op = socket_file_ops
sock_init_data
file
+ f_path : struct path+ f_inode : struct inode *+ f_op : const struct file_operations *+ private_data : void *
1.1
net_proto_family
./include/linux/sched.h
./include/net/sock.h
sockfs_mount
4
./include/linux/net.h
3
fdtable
+ max_fds : unsigend int+ fd: struct file __rcu**
inet_protosw
+ list : struct list_head+ type : unsigned short+ protocol : unsigned short+ prot : struct proto+ ops : const struct proto_ops+ flags : unsigned char
proto
i_op = &sockfs_inode_ops
path
+ mnt : struct vfsmount*+ dentry : struct dentry
./net/core/sock.c
./include/linux/path.h
./include/linux/protocol.h
struct proto tcp_prot = { .name = \"TCP\
fd_install
./include/sock.h
./include/linux/dcache.h
dentry
+ d_inode : struct inode
task_struct
+ files : struct files_struct *
file_system_type
+ name : const char*+ fs_flags : int+ (*kill_sb) (struct super_block *) : void
2
super_operations
tcp_init_sock
inet_create
sock_alloc
static struct vfsmount *sock_mnt __read_mostly;
0 条评论
下一页