{"id":208401,"date":"2025-09-11T16:21:44","date_gmt":"2025-09-11T08:21:44","guid":{"rendered":"https:\/\/www.server.hk\/blog\/?p=208401"},"modified":"2025-09-11T16:21:44","modified_gmt":"2025-09-11T08:21:44","slug":"linux-%e7%bd%91%e7%bb%9c%e6%a0%88%e5%89%96%e6%9e%90%ef%bc%9a%e5%85%a8%e9%9d%a2%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/208401\/","title":{"rendered":"Linux \u7f51\u7edc\u6808\u5256\u6790\uff1a\u5168\u9762\u6307\u5357"},"content":{"rendered":"<h2 dir=\"auto\">Linux \u7f51\u7edc\u6808\u7b80\u4ecb<\/h2>\n<p dir=\"auto\">Linux \u7f51\u7edc\u6808\u662f Linux \u64cd\u4f5c\u7cfb\u7edf\u4e2d\u4e00\u4e2a\u5f3a\u5927\u800c\u6a21\u5757\u5316\u7684\u6846\u67b6\uff0c\u5b83\u662f\u9ad8\u6548\u7f51\u7edc\u901a\u4fe1\u7684\u6838\u5fc3\u7ec4\u6210\u90e8\u5206\u3002\u4ece BSD \u7f51\u7edc\u6808\u6f14\u5316\u800c\u6765\uff0c\u5b83\u63d0\u4f9b\u4e86\u6e05\u6670\u5b9a\u4e49\u7684\u63a5\u53e3\uff0c\u4ece\u534f\u8bae\u65e0\u5173\u5c42\u5230\u7279\u5b9a\u534f\u8bae\u5b9e\u73b0\uff0c\u5e94\u6709\u5c3d\u6709\u3002\u672c\u6587\u6df1\u5165\u63a2\u8ba8 Linux \u7f51\u7edc\u6808\u7684\u67b6\u6784\u3001\u5173\u952e\u7ec4\u4ef6\u548c\u8fd0\u884c\u6d41\u7a0b\uff0c\u4e13\u4e3a IT \u4e13\u4e1a\u4eba\u58eb\u548c\u5f00\u53d1\u8005\u91cf\u8eab\u6253\u9020\uff0c\u5e2e\u52a9\u4ed6\u4eec\u5168\u9762\u7406\u89e3\u8fd9\u4e00\u7cfb\u7edf\u3002<\/p>\n<h3 dir=\"auto\">\u4e92\u8054\u7f51\u6a21\u578b\uff1a\u56db\u5c42\u7ed3\u6784<\/h3>\n<p dir=\"auto\">Linux \u7f51\u7edc\u6808\u4e0d\u50cf\u4f20\u7edf\u7684\u4e03\u5c42 OSI \u6a21\u578b\u90a3\u6837\u590d\u6742\uff0c\u5b83\u91c7\u7528\u7b80\u6d01\u7684\u56db\u5c42\u4e92\u8054\u7f51\u6a21\u578b\uff1a<\/p>\n<ul dir=\"auto\">\n<li><strong>\u94fe\u8def\u5c42<\/strong>\uff1a\u901a\u8fc7\u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f\u4e0e\u7269\u7406\u4ecb\u8d28\uff08\u5982\u4ee5\u592a\u7f51\u6216\u4e32\u884c\u8fde\u63a5\uff09\u4ea4\u4e92\uff0c\u8d1f\u8d23\u5e27\u7684\u53d1\u9001\u548c\u63a5\u6536\u3002<\/li>\n<li><strong>\u7f51\u7edc\u5c42<\/strong>\uff1a\u7ba1\u7406\u4e3b\u673a\u95f4\u7684\u6570\u636e\u5305\u8def\u7531\uff0c\u4e3b\u8981\u4f9d\u8d56\u4e92\u8054\u7f51\u534f\u8bae\uff08IP\uff09\u3002<\/li>\n<li><strong>\u4f20\u8f93\u5c42<\/strong>\uff1a\u4f7f\u7528 TCP \u548c UDP \u7b49\u534f\u8bae\u5b9e\u73b0\u7aef\u5230\u7aef\u901a\u4fe1\uff0c\u5904\u7406\u4e3b\u673a\u5185\u7684\u8fde\u63a5\u3002<\/li>\n<li><strong>\u5e94\u7528\u5c42<\/strong>\uff1a\u89e3\u91ca\u6570\u636e\u8bed\u4e49\uff0c\u8ba9\u5e94\u7528\u7a0b\u5e8f\u80fd\u591f\u6709\u610f\u4e49\u5730\u5904\u7406\u7f51\u7edc\u6570\u636e\u3002<\/li>\n<\/ul>\n<p dir=\"auto\">\u8fd9\u79cd\u7ed3\u6784\u786e\u4fdd\u4e86\u6a21\u5757\u5316\u548c\u7075\u6d3b\u6027\uff0c\u80fd\u591f\u9002\u5e94\u5404\u79cd\u7f51\u7edc\u534f\u8bae\u548c\u786c\u4ef6\u3002<\/p>\n<h2 dir=\"auto\">Linux \u7f51\u7edc\u6808\u7684\u6838\u5fc3\u67b6\u6784<\/h2>\n<p dir=\"auto\">Linux \u7f51\u7edc\u6808\u5728\u7528\u6237\u7a7a\u95f4\u3001\u5185\u6838\u7a7a\u95f4\u548c\u7269\u7406\u786c\u4ef6\u4e4b\u95f4\u8fd0\u884c\uff0c\u6570\u636e\u901a\u8fc7\u5957\u63a5\u5b57\u7f13\u51b2\u533a\uff08sk_buff\uff09\u6d41\u52a8\u3002\u4e0b\u9762\u662f\u5176\u67b6\u6784\u6982\u8ff0\uff1a<\/p>\n<h3 dir=\"auto\">\u7cfb\u7edf\u8c03\u7528\u63a5\u53e3<\/h3>\n<p dir=\"auto\">\u7cfb\u7edf\u8c03\u7528\u63a5\u53e3\u662f\u7528\u6237\u7a7a\u95f4\u5e94\u7528\u7a0b\u5e8f\u4e0e\u5185\u6838\u7f51\u7edc\u5b50\u7cfb\u7edf\u4e4b\u95f4\u7684\u6865\u6881\uff0c\u63d0\u4f9b\u6807\u51c6\u5316\u65b9\u5f0f\u6765\u8bbf\u95ee\u7f51\u7edc\u8d44\u6e90\u3002<\/p>\n<ul dir=\"auto\">\n<li><strong>\u5173\u952e\u7cfb\u7edf\u8c03\u7528<\/strong>\uff1a\n<ul dir=\"auto\">\n<li>socket()\uff1a\u521b\u5efa\u7528\u4e8e\u7f51\u7edc\u901a\u4fe1\u7684\u5957\u63a5\u5b57\uff0c\u6307\u5b9a\u5730\u5740\u65cf\uff08\u5982 AF_INET\uff09\u3001\u7c7b\u578b\uff08\u5982 SOCK_STREAM\uff09\u548c\u534f\u8bae\u3002<\/li>\n<li>bind()\uff1a\u5c06\u5957\u63a5\u5b57\u7ed1\u5b9a\u5230\u672c\u5730\u5730\u5740\u3002<\/li>\n<li>listen()\uff1a\u51c6\u5907\u5957\u63a5\u5b57\u63a5\u53d7\u4f20\u5165\u8fde\u63a5\u3002<\/li>\n<li>accept()\uff1a\u63a5\u53d7\u4f20\u5165\u8fde\u63a5\uff0c\u521b\u5efa\u65b0\u5957\u63a5\u5b57\u3002<\/li>\n<li>connect()\uff1a\u5411\u8fdc\u7a0b\u5730\u5740\u53d1\u8d77\u8fde\u63a5\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p dir=\"auto\">\u7f51\u7edc\u5957\u63a5\u5b57\u8fd8\u652f\u6301\u6807\u51c6\u6587\u4ef6\u64cd\u4f5c\uff08\u5982 read \u548c write\uff09\uff0c\u5c06\u5957\u63a5\u5b57\u89c6\u4e3a\u6587\u4ef6\u63cf\u8ff0\u7b26\uff0c\u4e0e Linux \u7684\u57fa\u4e8e\u6587\u4ef6\u7684 I\/O \u6a21\u578b\u65e0\u7f1d\u96c6\u6210\u3002socket_file_ops \u7ed3\u6784\u5b9a\u4e49\u4e86\u8fd9\u4e9b\u64cd\u4f5c\uff0c\u786e\u4fdd\u4e0e\u6587\u4ef6\u8bed\u4e49\u517c\u5bb9\u3002<\/p>\n<h3 dir=\"auto\">\u534f\u8bae\u65e0\u5173\u63a5\u53e3<\/h3>\n<p dir=\"auto\">\u5957\u63a5\u5b57\u5c42\u63d0\u4f9b\u534f\u8bae\u65e0\u5173\u63a5\u53e3\uff0c\u62bd\u8c61\u5e95\u5c42\u534f\u8bae\u7ec6\u8282\uff0c\u652f\u6301 TCP\u3001UDP\u3001SCTP \u548c\u539f\u59cb\u4ee5\u592a\u7f51\u7b49\u591a\u79cd\u534f\u8bae\u3002<\/p>\n<ul dir=\"auto\">\n<li><strong>\u5957\u63a5\u5b57\u7ed3\u6784\uff08struct sock\uff09<\/strong>\uff1a \u5b9a\u4e49\u5728 linux\/include\/net\/sock.h \u4e2d\uff0c\u8be5\u7ed3\u6784\u5c01\u88c5\u5957\u63a5\u5b57\u72b6\u6001\uff0c\u5305\u62ec\u534f\u8bae\u7279\u5b9a\u6570\u636e\u548c\u64cd\u4f5c\u3002\u5b83\u5305\u542b\u5982 __sk_common \u7528\u4e8e\u5171\u4eab\u5c5e\u6027\uff0c\u4ee5\u53ca sk_prot \u7528\u4e8e\u534f\u8bae\u7279\u5b9a\u51fd\u6570\u7684\u5b57\u6bb5\u3002<\/li>\n<li><strong>\u534f\u8bae\u64cd\u4f5c\uff08struct proto\uff09<\/strong>\uff1a \u6bcf\u4e2a\u534f\u8bae\u5b9a\u4e49\u4e00\u4e2a proto \u7ed3\u6784\uff0c\u6307\u5b9a\u64cd\u4f5c\u5982\u5957\u63a5\u5b57\u521b\u5efa\u3001\u8fde\u63a5\u5efa\u7acb\u548c\u5173\u95ed\u3002\u4f8b\u5982\uff1a\n<div dir=\"auto\">\n<div data-testid=\"code-block\">\n<div>c<\/div>\n<div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<div>\n<pre tabindex=\"0\"><code>struct proto tcp_prot = {\r\n    .name = \"TCP\",\r\n    .close = tcp_close,\r\n    .connect = tcp_v4_connect,\r\n    .accept = inet_csk_accept,\r\n    ...\r\n};<\/code><\/pre>\n<\/div>\n<div><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<p>\u8be5\u7ed3\u6784\u786e\u4fdd\u534f\u8bae\u7279\u5b9a\u903b\u8f91\u88ab\u5c01\u88c5\uff0c\u540c\u65f6\u4fdd\u6301\u7edf\u4e00\u63a5\u53e3\u3002<\/li>\n<\/ul>\n<h3 dir=\"auto\">\u7f51\u7edc\u534f\u8bae<\/h3>\n<p dir=\"auto\">Linux \u652f\u6301\u6838\u5fc3\u534f\u8bae\u5982 TCP\u3001UDP \u548c IP\uff0c\u8fd9\u4e9b\u534f\u8bae\u5728 inet_init \u51fd\u6570\uff08linux\/net\/ipv4\/af_inet.c\uff09\u4e2d\u521d\u59cb\u5316\u3002\u4e3b\u8981\u65b9\u9762\u5305\u62ec\uff1a<\/p>\n<ul dir=\"auto\">\n<li><strong>\u534f\u8bae\u6ce8\u518c<\/strong>\uff1a \u4f7f\u7528 proto_register \u6ce8\u518c\u534f\u8bae\uff0c\u5c06\u5176\u6dfb\u52a0\u5230\u6d3b\u52a8\u534f\u8bae\u5217\u8868\uff0c\u5e76\u53ef\u9009\u5206\u914d slab \u7f13\u5b58\u4ee5\u63d0\u9ad8\u6548\u7387\u3002<\/li>\n<li><strong>\u534f\u8bae\u5f00\u5173\uff08inetsw_array\uff09<\/strong>\uff1a inetsw_array \u5c06\u534f\u8bae\u6620\u5c04\u5230\u5176\u64cd\u4f5c\uff0c\u5b9a\u4e49\u5982\u4e0b\uff1a\n<div dir=\"auto\">\n<div data-testid=\"code-block\">\n<div>c<\/div>\n<div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<div>\n<pre tabindex=\"0\"><code>static struct inet_protosw inetsw_array[] = {\r\n    {\r\n        .type = SOCK_STREAM,\r\n        .protocol = IPPROTO_TCP,\r\n        .prot = &amp;tcp_prot,\r\n        .ops = &amp;inet_stream_ops,\r\n        .flags = INET_PROTOSW_PERMANENT | INET_PROTOSW_ICSK,\r\n    },\r\n    ...\r\n};<\/code><\/pre>\n<\/div>\n<div><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<p>\u8be5\u6570\u7ec4\u5728\u5957\u63a5\u5b57\u521b\u5efa\u65f6\uff08\u5982 socket(AF_INET, SOCK_STREAM, 0) \u7528\u4e8e TCP\uff09\u542f\u7528\u52a8\u6001\u534f\u8bae\u6620\u5c04\u3002<\/li>\n<li><strong>\u534f\u8bae\u521d\u59cb\u5316<\/strong>\uff1a inet_init \u51fd\u6570\u521d\u59cb\u5316 ARP\u3001ICMP\u3001IP\u3001TCP \u548c UDP \u7b49\u6a21\u5757\uff0c\u786e\u4fdd\u6240\u6709\u7ec4\u4ef6\u5c31\u7eea\u3002<\/li>\n<\/ul>\n<h3 dir=\"auto\">\u5957\u63a5\u5b57\u7f13\u51b2\u533a\uff08sk_buff\uff09<\/h3>\n<p dir=\"auto\">sk_buff \u7ed3\u6784\u5b9a\u4e49\u5728 linux\/include\/linux\/skbuff.h \u4e2d\uff0c\u662f\u7f51\u7edc\u6808\u6570\u636e\u79fb\u52a8\u7684\u6838\u5fc3\u3002\u5b83\u5c01\u88c5\u8de8\u5c42\u7684\u5305\u6570\u636e\u548c\u5143\u6570\u636e\u3002<\/p>\n<ul dir=\"auto\">\n<li><strong>\u5173\u952e\u7279\u6027<\/strong>\uff1a\n<ul dir=\"auto\">\n<li><strong>\u5305\u6570\u636e<\/strong>\uff1a\u5b58\u50a8\u5b9e\u9645\u6570\u636e\u548c\u534f\u8bae\u5934\uff08\u5982 th \u7528\u4e8e\u4f20\u8f93\u5c42\u3001iph \u7528\u4e8e IP\u3001mac \u7528\u4e8e MAC \u5934\uff09\u3002<\/li>\n<li><strong>\u94fe\u5f0f\u8fde\u63a5<\/strong>\uff1a\u5355\u4e2a\u8fde\u63a5\u53ef\u94fe\u63a5\u591a\u4e2a sk_buff \u5b9e\u4f8b\u3002<\/li>\n<li><strong>\u8bbe\u5907\u5173\u8054<\/strong>\uff1a\u5f15\u7528\u7f51\u7edc\u8bbe\u5907\uff08net_device *dev\uff09\u7528\u4e8e\u53d1\u9001\u6216\u63a5\u6536\u3002<\/li>\n<li><strong>\u5185\u5b58\u7ba1\u7406<\/strong>\uff1a\u786e\u4fdd\u5934\u90e8\u7684\u8fde\u7eed\u5185\u5b58\uff0c\u5e76\u63d0\u4f9b\u5185\u6838\u51fd\u6570\u7528\u4e8e\u521b\u5efa\u3001\u514b\u9686\u548c\u961f\u5217\u7ba1\u7406\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 dir=\"auto\">\u8bbe\u5907\u65e0\u5173\u63a5\u53e3<\/h3>\n<p dir=\"auto\">\u8bbe\u5907\u65e0\u5173\u5c42\u62bd\u8c61\u786c\u4ef6\u7279\u5b9a\u7ec6\u8282\uff0c\u8ba9\u534f\u8bae\u901a\u8fc7\u7edf\u4e00\u63a5\u53e3\u4e0e\u5404\u79cd\u7f51\u7edc\u8bbe\u5907\u4ea4\u4e92\u3002<\/p>\n<ul dir=\"auto\">\n<li><strong>\u8bbe\u5907\u6ce8\u518c<\/strong>\uff1a \u9a71\u52a8\u7a0b\u5e8f\u4f7f\u7528 register_netdevice \u6ce8\u518c\uff0c\u586b\u5145 net_device \u7ed3\u6784\uff0c\u5305\u62ec\u8bbe\u5907\u7279\u5b9a\u4f8b\u7a0b\uff08\u5982 hard_start_xmit \u7528\u4e8e\u4f20\u8f93\uff09\u3002<\/li>\n<li><strong>\u6570\u636e\u4f20\u8f93<\/strong>\uff1a dev_queue_xmit \u51fd\u6570\u5c06 sk_buff \u5305\u6392\u961f\u53d1\u9001\u5230\u786c\u4ef6\uff0c\u4f7f\u7528\u8bbe\u5907\u7684 hard_start_xmit \u65b9\u6cd5\u3002<\/li>\n<li><strong>\u6570\u636e\u63a5\u6536<\/strong>\uff1a netif_rx \u51fd\u6570\u5904\u7406\u4f20\u5165\u5305\uff0c\u5c06\u5176\u6392\u961f\u5230\u4e0a\u5c42\u5904\u7406\u3002\u65b0 API\uff08NAPI\uff09\u901a\u8fc7\u51cf\u5c11\u4e2d\u65ad\u63d0\u5347\u9ad8\u8d1f\u8f7d\u6027\u80fd\uff0c\u5c3d\u7ba1\u5927\u591a\u6570\u9a71\u52a8\u4ecd\u4f7f\u7528\u4f20\u7edf netif_rx \u63a5\u53e3\u3002<\/li>\n<\/ul>\n<h3 dir=\"auto\">\u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f<\/h3>\n<p dir=\"auto\">\u7f51\u7edc\u6808\u5e95\u90e8\u662f\u7ba1\u7406\u7269\u7406\u7f51\u7edc\u786c\u4ef6\u7684\u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f\uff08\u5982\u4ee5\u592a\u7f51\u6216 SLIP \u63a5\u53e3\uff09\u3002<\/p>\n<ul dir=\"auto\">\n<li><strong>\u521d\u59cb\u5316<\/strong>\uff1a \u9a71\u52a8\u5206\u914d net_device \u7ed3\u6784\uff0c\u5b9a\u4e49\u4f8b\u7a0b\u5982 hard_start_xmit \u7528\u4e8e\u5305\u4f20\u8f93\u3002<\/li>\n<li><strong>\u5305\u5904\u7406<\/strong>\uff1a\n<ul dir=\"auto\">\n<li><strong>\u4f20\u8f93<\/strong>\uff1a\u9a71\u52a8\u5c06 sk_buff \u6570\u636e\u79fb\u52a8\u5230\u786c\u4ef6\u961f\u5217\u6216\u73af\u3002<\/li>\n<li><strong>\u63a5\u6536<\/strong>\uff1a\u4f20\u5165\u5305\u5c01\u88c5\u5728 sk_buff \u4e2d\uff0c\u5e76\u4f20\u9012\u7ed9 netif_rx \u6216 NAPI \u7684 netif_receive_skb\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u9a71\u52a8\u4f4d\u7f6e<\/strong>\uff1a \u7f51\u7edc\u7279\u5b9a\u9a71\u52a8\u4f4d\u4e8e linux\/drivers\/net \u4e2d\uff0c\u9488\u5bf9\u7279\u5b9a\u786c\u4ef6\u9700\u6c42\u5b9a\u5236\u3002<\/li>\n<\/ul>\n<h2 dir=\"auto\">\u8fd0\u884c\u6d41\u7a0b\uff1a\u4ece\u5957\u63a5\u5b57\u5230\u786c\u4ef6<\/h2>\n<p dir=\"auto\">\u7f51\u7edc\u6808\u7684\u64cd\u4f5c\u53ef\u603b\u7ed3\u5982\u4e0b\uff1a<\/p>\n<ol dir=\"auto\">\n<li><strong>\u5957\u63a5\u5b57\u521b\u5efa<\/strong>\uff1a \u7528\u6237\u7a7a\u95f4\u5e94\u7528\u7a0b\u5e8f\u521b\u5efa\u5957\u63a5\u5b57\uff08\u5982 socket(AF_INET, SOCK_STREAM, 0)\uff09\uff0c\u901a\u8fc7 inetsw_array \u6620\u5c04\u5230 TCP\u3002<\/li>\n<li><strong>\u534f\u8bae\u4ea4\u4e92<\/strong>\uff1a \u7cfb\u7edf\u8c03\u7528\u5982 connect \u8c03\u7528 proto_ops\uff08\u5982 inet_stream_ops\uff09\uff0c\u59d4\u6258\u7ed9\u534f\u8bae\u7279\u5b9a\u51fd\u6570\uff08\u5982 tcp_v4_connect\uff09\u3002<\/li>\n<li><strong>\u6570\u636e\u79fb\u52a8<\/strong>\uff1a \u6570\u636e\u5c01\u88c5\u5728 sk_buff \u4e2d\uff0c\u4ece\u5e94\u7528\u5c42\u5230\u8bbe\u5907\u5c42\u904d\u5386\u6808\uff0c\u5728\u5404\u5c42\u6dfb\u52a0\u6216\u79fb\u9664\u5934\u3002<\/li>\n<li><strong>\u4f20\u8f93\/\u63a5\u6536<\/strong>\uff1a \u5305\u901a\u8fc7 dev_queue_xmit \u6392\u961f\u4f20\u8f93\uff0c\u6216\u901a\u8fc7 netif_rx \u5904\u7406\u63a5\u6536\uff0c\u4e0e\u786c\u4ef6\u901a\u8fc7\u9a71\u52a8\u4ea4\u4e92\u3002<\/li>\n<\/ol>\n<h2 dir=\"auto\">\u5173\u952e\u7ed3\u6784\u603b\u7ed3<\/h2>\n<div dir=\"auto\">\n<div>\n<div><\/div>\n<\/div>\n<table dir=\"auto\" data-wide=\"false\">\n<thead>\n<tr>\n<th data-col-size=\"md\">\u7ed3\u6784<\/th>\n<th data-col-size=\"lg\">\u4f4d\u7f6e<\/th>\n<th data-col-size=\"md\">\u7528\u9014<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td data-col-size=\"md\">struct sock<\/td>\n<td data-col-size=\"lg\">linux\/include\/net\/sock.h<\/td>\n<td data-col-size=\"md\">\u7ba1\u7406\u5957\u63a5\u5b57\u72b6\u6001\u548c\u534f\u8bae\u7279\u5b9a\u64cd\u4f5c\u3002<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"md\">struct proto<\/td>\n<td data-col-size=\"lg\">linux\/include\/net\/sock.h<\/td>\n<td data-col-size=\"md\">\u5b9a\u4e49\u534f\u8bae\u7279\u5b9a\u64cd\u4f5c\uff08\u5982 TCP\u3001UDP\uff09\u3002<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"md\">struct sk_buff<\/td>\n<td data-col-size=\"lg\">linux\/include\/linux\/skbuff.h<\/td>\n<td data-col-size=\"md\">\u5c01\u88c5\u7f51\u7edc\u901a\u4fe1\u7684\u5305\u6570\u636e\u548c\u5143\u6570\u636e\u3002<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"md\">struct net_device<\/td>\n<td data-col-size=\"lg\">linux\/include\/linux\/netdevice.h<\/td>\n<td data-col-size=\"md\">\u8868\u793a\u7f51\u7edc\u8bbe\u5907\uff0c\u5b9a\u4e49\u9a71\u52a8\u7279\u5b9a\u4f8b\u7a0b\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2 dir=\"auto\">\u7ed3\u8bed<\/h2>\n<p dir=\"auto\">Linux \u7f51\u7edc\u6808\u662f\u4e00\u4e2a\u7cbe\u5fc3\u8bbe\u8ba1\u7684\u7cfb\u7edf\uff0c\u5e73\u8861\u4e86\u6a21\u5757\u5316\u3001\u6027\u80fd\u548c\u7075\u6d3b\u6027\u3002\u4ece\u7cfb\u7edf\u8c03\u7528\u5230\u8bbe\u5907\u9a71\u52a8\u7684\u5c42\u7ea7\u67b6\u6784\uff0c\u786e\u4fdd\u4e86\u8de8\u591a\u79cd\u534f\u8bae\u548c\u786c\u4ef6\u7684\u7a33\u5065\u7f51\u7edc\u901a\u4fe1\u3002\u901a\u8fc7\u5229\u7528 sk_buff \u548c proto \u7b49\u7ed3\u6784\uff0cLinux \u4e3a\u73b0\u4ee3\u7f51\u7edc\u9700\u6c42\u63d0\u4f9b\u4e86\u53ef\u6269\u5c55\u6846\u67b6\uff0c\u6210\u4e3a\u5f00\u53d1\u8005\u548c\u7cfb\u7edf\u7ba1\u7406\u5458\u7684\u57fa\u77f3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux \u7f51\u7edc\u6808\u7b80\u4ecb Linu&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-208401","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/208401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=208401"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/208401\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=208401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=208401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=208401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}