我正在研究tcp/ip实现,特别是套接字层,并且我对某些结构并不太了解。理解内核中的'struct proto'和'struct proto_ops'
我知道'struct proto_ops'用于定义操作,例如, bind/connect/accept,每个套接字都有一个指定的proto_ops。
另一方面,'struct proto'定义了新的协议,并且结构还为accept/bind/setsockopt/getsockopt/etc定义了函数指针。方法。
我在$ linux/net /中读了很多代码,我没有看到它在哪里使用通过'struct proto'定义的操作,所以我不确定这些方法在代码中如何使用?
有人能为我澄清这一点吗? 谢谢。