<div class="dp-highlighter bg_cpp">
<div class="bar">
<div class="tools">
[cpp]?<a class="ViewSource" title="view plain" href="http://blog.csdn.net/geekcome/article/details/7488828">view plain<a class="CopyToClipboard" title="copy" href="http://blog.csdn.net/geekcome/article/details/7488828">copy
?
- {??
-
- ?????net_proto?*pro;??
-
- ??????
-
- ?????(pro->name?!=?NULL)???
-
- ????????(*pro->init_func)(pro);??
-
- ????}??
-
- }??
全局的protocols定义如下:
<div class="dp-highlighter bg_cpp">
<div class="bar">
<div class="tools">
[cpp]?<a class="ViewSource" title="view plain" href="http://blog.csdn.net/geekcome/article/details/7488828">view plain<a class="CopyToClipboard" title="copy" href="http://blog.csdn.net/geekcome/article/details/7488828">copy
?
- ??
-
- ??
-
- ??{?,????p8022_proto_init?},??
-
- ??
-
- ??{?,????ax25_proto_init?},??
-
- ??
-
- ??
-
- ??{?,??ipx_proto_init?},??
-
- ??
-
- ??
-
- };??
而结构体net_proto的定义net.h中为
<div class="dp-highlighter bg_cpp">
<div class="bar">
<div class="tools">
[cpp]?<a class="ViewSource" title="view plain" href="http://blog.csdn.net/geekcome/article/details/7488828">view plain<a class="CopyToClipboard" title="copy" href="http://blog.csdn.net/geekcome/article/details/7488828">copy
?
- ?????*name;???????
-
- };??
以后注重讨论标准的INET域让我们回到proto_init()函数
接下来会执行inet_proto_init()函数,进行INET域协议的初始化。该函数的实现在net/inet/af_inet.c中
其中的
(void) sock_register(inet_proto_ops.family,&inet_proto_ops); (编辑:应用网_丽江站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|