<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="http://www.opendesktop.net/atom.css" type="text/css"?>

<feed xmlns="http://www.w3.org/2005/Atom"
      xml:base="http://www.opendesktop.net" xml:lang="en">

    <title type="html">Co-Create Developers Portal - 杨红的 Blog</title>

    <updated>2007-02-01T15:41:41-01:00</updated>

    <link href="http://www.opendesktop.net/Members/yanghong/blog"
          rel="alternate" type="text/html" />

    
    <id>tag:www.opendesktop.net,2007:blog</id>

    <generator uri="http://developer.etria.com/projects/quills" version="0.9">Quills</generator>

    <link rel="self"
          href="http://www.opendesktop.net/Members/yanghong/blog/atom.xml" />

    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/yanghong/blog/archive/2007/02/01/plone-shengjidao-2-5.2" />
            <title>Plone 升级到 2.5.2</title>
            <id>tag:www.opendesktop.net,2007-02-01:84a579fa6a6fe8c7bde40e1bdb67d2e8</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;仍然使用 zope 2.8.8，第一次升级由于没有更新 Five (1.2.5)，导至升级后无法访问首页（所有 catalog 中内容丢失？），更新 Five 到 1.2.6 后，重新进行升级过程，没有任何问题就完成了。&lt;/h2&gt;
                
&lt;p&gt;Five 下载址： http://codespeak.net/z3/five/&lt;/p&gt;
&lt;p&gt;呆会儿还要装个投票系统。&lt;/p&gt;
http://plone.org/products/plone-survey&lt;br /&gt;&lt;br /&gt;PloneSurvey is a simple product written to collect data from people&lt;br /&gt;  - feedback on a course, survey, simple data collection etc.&lt;br /&gt;&lt;br /&gt;非常强大！&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;共创开源产品改进与完善客户问卷调查表&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;http://www.opendesktop.net/development/survey/ccoss-products-survey&lt;br /&gt;&lt;/p&gt;

            </content>
            <author>
                <name>yanghong</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2007-02-01T15:41:41+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/yunza80/blog/archive/2006/08/26/kehunabianchishitang" />
            <title>客户那边吃食堂</title>
            <id>tag:www.opendesktop.net,2006-08-26:4e6118ef26ed57b6471694ea0723728a</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;&lt;/h2&gt;
                &lt;p&gt;食堂更好，可是这帮大爷们居然吃那么少，而且吃的奇快，我才还没吃完呢，人家已经要撤退了&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;
            </content>
            <author>
                <name>yunza80</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-08-26T09:08:32+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/yanghong/blog/archive/2006/08/17/wei-blog-tianjiazhongwenming-url-zhichi" />
            <title>为 Blog 添加中文名 URL 支持</title>
            <id>tag:www.opendesktop.net,2006-08-17:e53fc679320f6256053cc1c78a77d8bf</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;中文-&gt; zhongwen&lt;/h2&gt;
                &lt;p&gt;Plone 2.1 + ZopeChinaPack 0.8+ 早已经支持创建的文档自动生成标题对应的 ID（URL 中的部分），当然，中文文字被转换成拼音做为 ID。&lt;/p&gt;&lt;p&gt;我们使用的 Quills 0.9.1 则使用了自己的过滤函数来处理标题并设置为 blogentry 的 ID，从而不支持中文转换为拼音导致如下问题：&lt;/p&gt;&lt;p&gt;输入标题："升级 python doctutils"&lt;br /&gt;&lt;/p&gt;&lt;p&gt;自动生成的 ID: "-python-docutils"&lt;/p&gt;&lt;p&gt;其中的中文没了。&lt;/p&gt;&lt;p&gt;我修改了生成 id 的部分，这样 blogentry 和 topic 都可以自动转换为拼音了。&lt;br /&gt;&lt;/p&gt;&lt;p&gt;补丁如下：&lt;/p&gt;&lt;pre&gt;--- QuillsTool.py.orig  2006-08-17 19:10:03.661645184 +0800&lt;br /&gt;+++ QuillsTool.py       2006-08-17 19:11:06.882034224 +0800&lt;br /&gt;@@ -24,6 +24,7 @@&lt;br /&gt; from Products.CMFCore.utils import UniqueObject&lt;br /&gt; from Products.CMFCore.utils import getToolByName&lt;br /&gt; from AccessControl import ClassSecurityInfo&lt;br /&gt;+from Products.Archetypes.utils import shasattr&lt;br /&gt; from OFS.SimpleItem import SimpleItem&lt;br /&gt; from Globals import InitializeClass&lt;br /&gt; import re&lt;br /&gt;@@ -89,7 +90,13 @@&lt;br /&gt;         """&lt;br /&gt;&lt;br /&gt;         #  could use string.replace for the ''/- thing&lt;br /&gt;-        id = re.sub('[^A-Za-z0-9_-]', '', re.sub(' ', '-', title)).lower()&lt;br /&gt;+        plone_tool = getToolByName(self, 'plone_utils', None)&lt;br /&gt;+        if plone_tool is None or not shasattr(plone_tool, 'normalizeString'):&lt;br /&gt;+            # Plone tool is not available or too old&lt;br /&gt;+            # XXX log?&lt;br /&gt;+            id = re.sub('[^A-Za-z0-9_-]', '', re.sub(' ', '-', title)).lower()&lt;br /&gt;+        else:&lt;br /&gt;+            id = plone_tool.normalizeString(title)&lt;br /&gt;&lt;br /&gt;         if not id:&lt;br /&gt;             # We only do this for thingys in weblogs&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;参考：&lt;br /&gt;&lt;br /&gt;&lt;h3 class="noMargin"&gt;&lt;a href="http://blog.czug.org/panjy/2006/1/zaiplonejiaobenzhongjinxinghanzidaopinyindezhuanhuan"&gt;在Plone脚本中进行汉字到拼音的转换&lt;/a&gt;&lt;/h3&gt;&lt;br /&gt;
            </content>
            <author>
                <name>yanghong</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-08-17T19:14:22+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/yanghong/blog/archive/2006/08/17/upgrade-python-docutils-04" />
            <title>升级 python-docutils 0.4</title>
            <id>tag:www.opendesktop.net,2006-08-17:345a78957f7a648b923021bf08188a92</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;python-docutils 是用于处理 reStructured Text 的工具。&lt;/h2&gt;
                &lt;p&gt;原来服务器上是 0.3.7, 0.4 对中文处理有很大的提高。希望可以解决在 Bug 跟踪系统提交 Bug 时的异常错误问题。&lt;/p&gt;&lt;p&gt;还升级了 &lt;a href="http://www.zope.org/Members/panjunyong/ZopeChinaPak" target="_self"&gt;ZopeChinaPack&lt;/a&gt; 0.8 -&amp;gt; 0.8.1&lt;br /&gt;&lt;/p&gt;&lt;p&gt;参考：&lt;br /&gt;&lt;/p&gt;&lt;h3 class="noMargin"&gt;&lt;a href="http://blog.czug.org/panjy/2006/1/docutils-restructuredtext-0-4banbenfabule"&gt;docutils/reStructuredText 0.4版本发布了&lt;/a&gt;&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;
            </content>
            <author>
                <name>yanghong</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-08-17T18:10:50+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/yanghong/blog/archive/2006/08/15/weblogentry-10" />
            <title>更新“产品”栏的功能</title>
            <id>tag:www.opendesktop.net,2006-08-15:f262a5a5db8241c9d744f05b13a5c59f</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;升级及更新&lt;/h2&gt;
                &lt;ol&gt;&lt;li&gt;升级了 PloneSoftwareCenter，使得“产品“栏更加易用。&lt;br /&gt;1.0 beta7 -&amp;gt; 1.0 beta8, 重新安装并调用 migrate 方法。&lt;/li&gt;&lt;li&gt;更新了共创桌面 Linux 中的问题跟踪系统，按共创桌面 Linux 现有的主要功能添加不用的分类&lt;/li&gt;&lt;li&gt;更新现有 BUG 的分类，问题解释等。&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;为 “&lt;a href="http://www.ccoss.com.cn/newbbs/viewthread.php?tid=4082&amp;amp;extra=page%3D1"&gt;斑竹请进！关于免费帮贵公司测试BUGS问题。&lt;/a&gt; 做好准备&lt;br /&gt;
            </content>
            <author>
                <name>yanghong</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-08-15T10:23:21+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/yunza80/blog/archive/2006/08/06/weblogentry-14" />
            <title>今天挺忙，但是不能闲着，为什么来做这儿的人这么少</title>
            <id>tag:www.opendesktop.net,2006-08-06:3771199ca643dc998abb1ddb7ad97b0b</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;&lt;/h2&gt;
                &lt;p&gt;想用王朔的的、刘一达的京片子口气写点儿什么东西，觉得这风格似乎不用学，学也学不来真谛，于是决定还是用我惯常的贫嘴口气，写点儿什么。&lt;/p&gt;&lt;br /&gt;&lt;p&gt;介个论坛说来开张也好长时间了，我曾经萌发吧自己的blog阵地转到这里边的念头，但是发现因为太过专业，我总是拉家常似的乱贫一气，就和非常serious的it氛围有点儿冲突的意思 。&lt;br /&gt;&lt;/p&gt;&lt;p&gt;再者，这儿人这么少，就不能达到我很soso的博客访问量，没人访问的blog是很郁闷的，虽然大家都说blog不需要别人看。我在ck论坛弄的blog，都没有几个字儿，就100多访问量，已经很受宠若惊了。&lt;/p&gt;&lt;br /&gt;&lt;p&gt; 打住吧，看我这儿拐哪儿了都，管理员同学又该埋怨我瞎说占空间了。言归正传，介尬达的人为啥那么少。按说了，放在网上的东西，而且是免费的技术的东西，总该有人访问的，而且这网站，说实话，也相当不错，管理员同学费了那么大功夫弄。&lt;/p&gt;&lt;br /&gt;&lt;p&gt;   我已经呼吁很多次同学们来这个论坛，看看，说说，但是每人理会，看着这么好的网络资源没被利用，心理很有想法。但是有什么办法呢？&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
            </content>
            <author>
                <name>yunza80</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-08-06T15:59:44+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/yanghong/blog/archive/2006/08/02/opendesktop--plone-25" />
            <title>OpenDesktop 网站升级到 Plone 2.5</title>
            <id>tag:www.opendesktop.net,2006-08-02:11b7f2e4fec81974afdad4e25741cda7</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;升级过程中的主要问题还是基于 LDAP 的用户管理。&lt;/h2&gt;
                &lt;p&gt;&lt;a class="l" href="http://plone.org/documentation/how-to/plone-2-5-and-openldap-integration-for-users-and-groups" target="_blank"&gt;Plone 2.5 and OpenLDAP Integration for Users and Groups&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;


参考了上面的文档。&lt;br /&gt;&lt;br /&gt;&lt;div class="visualIEFloatFix"&gt;
            
            &lt;dl&gt;&lt;dt&gt;
                    &lt;img title="Product" src="http://plone.org/product_icon.gif" height="16" width="16" /&gt;
                    &lt;a href="http://plone.org/products/plone/releases/2.5"&gt;Plone 2.5&lt;/a&gt;
                &lt;/dt&gt;&lt;dd&gt;
                    Integrating with PAS and Zope 3 views.

                    &lt;br /&gt;
                    &lt;img title="Document" src="http://plone.org/document_icon.gif" height="16" width="16" /&gt;
                    &lt;a href="http://plone.org/products/plone/releases/2.5"&gt;Read more…&lt;/a&gt;

                &lt;/dd&gt;&lt;/dl&gt;
        &lt;/div&gt;TODO：&lt;br /&gt;&lt;br /&gt;1。装一个新的 skin&lt;br /&gt;2。全站改版&lt;br /&gt;
            </content>
            <author>
                <name>yanghong</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-08-02T19:11:52+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/yunza80/blog/archive/2006/07/28/weblogentry-13" />
            <title>软件政府采购不应“优先采购”</title>
            <id>tag:www.opendesktop.net,2006-07-28:ef8fb60907727d214f4e1ab4ef651d3c</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;&lt;/h2&gt;
                &lt;br /&gt;&lt;p&gt;出处：http://www.softdriver.org.cn/showNews.jsp?templateID=news&amp;amp;info_stamp=20060727_30480&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;strong&gt;软件政府采购不应“优先采购”&lt;/strong&gt; &lt;/div&gt;&lt;br /&gt;
                          &lt;div align="center" class="newsa"&gt;eNet硅谷动力  &lt;/div&gt;
                        
                      
                    
                    
                       
                        &lt;br /&gt;　　 按照我国的《&lt;a class="article" href="http://www.enet.com.cn/egov" target="_blank"&gt;政府采购&lt;/a&gt;法》，&lt;a class="article" href="http://www.baidu.com/baidu?tn=enet&amp;amp;q6=site:%28enet.com.cn%29&amp;amp;cl=3&amp;amp;rn=10&amp;amp;ct=0&amp;amp;lm=0&amp;amp;word=site:%28enet.com.cn%29++%E8%BD%AF%E4%BB%B6%20%E8%B5%84%E8%AE%AF%E4%B8%AD%E5%BF%83" target="_blank"&gt;软件&lt;/a&gt;政府采购应当采购本国软件和服务，但最近公布的《软件政府采购实施办法（征求意见稿）》（《办法》）的部分条款，如不加以修改，有可能为“优先采购”跨国公司软件敞开大门。 &lt;br /&gt;&lt;br /&gt;　
　《办法》在软件政府采购中引入了一个新的类别，即“优先采购的非本国软件”。这样，《办法》就将软件分成三类：“本国软件”、“优先采购的非本国软件”
和“非本国软件”。但《政府采购法》只有“本国”和“非本国”之分，只有“应当采购”本国货物、工程和服务的规定，没有“优先采购”非本国货物、工程和服
务的规定。因此，《办法》的“优先采购的非本国软件”类别缺乏法律依据，世界上其他国家的政府采购法中也没有类似的规定。 &lt;br /&gt;&lt;br /&gt;　　而且，
《办法》关于界定“优先采购的非本国软件”的那些条件，即第十九条列出的三款条件，包括在中国境内投资的要求，在中国境内的研发投入、外包出口、纳税的要
求，以及在中国境内设有软件研发机构，培养软件人才的要求，对跨国公司来说是很容易满足的，而其他中小软件企业却很难满足。如果按照这样的条件，“跨国公
司软件”大多都可以界定为“优先采购的非本国软件”，从而使“优先采购的非本国软件”实际上变成“优先采购的跨国公司软件”。 &lt;br /&gt;&lt;br /&gt;　　世界各国的政府采购都是向中小企业倾斜的，因为中小企业最具创新活力，政府采购扶持中小企业有利于创新，有利于产业发展。但《办法》的“优先采购的非本国软件”类别及其界定条件却向跨国公司倾斜，这显然不符合国际惯例，不利于软件业的创新。 &lt;br /&gt;&lt;br /&gt;　
　我们欢迎外国公司在中国境内投资，增加研发投入、外包出口、纳税，以及设软件研发机构，培养软件人才等等，但这一定是建立在互利的基础上，即既对中国有
利，也对外国公司自身有利。不应将外国公司在中国的投入看成是某种“施舍”，而用政府采购市场去“答谢”。“市场换技术”已被实践证明是行不通的，想用政
府采购市场去换取外资的投入，其结果将使本国企业丧失政府采购的支持，从而对我国软件产业的发展造成重大损失。 &lt;br /&gt;&lt;br /&gt;　　总之，《办法》引入“优先采购的非本国软件”的类别和界定条款，不符合《政府采购法》的精神，也不符合世界各国的政府采购向中小企业倾斜的惯例，希望能予修改，以使《政府采购法》得到真正贯彻。
            </content>
            <author>
                <name>yunza80</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-07-28T08:44:26+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/yunza80/blog/archive/2006/07/12/sp2" />
            <title>sp2什么时候能出来，我们都关心呢</title>
            <id>tag:www.opendesktop.net,2006-07-12:2bad1fedb8fa10647ef8e80af0383741</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;&lt;/h2&gt;
                &lt;p&gt;能透露个消息么？&lt;/p&gt;
            </content>
            <author>
                <name>yunza80</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-07-12T07:07:29+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/yunza80/blog/archive/2006/07/12/weblogentry-9" />
            <title>是不是可以把登陆计数器放出来,也把登陆信息调出来分析</title>
            <id>tag:www.opendesktop.net,2006-07-12:0bbba7a6dd0b415632de657ee4a6c8bb</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;&lt;/h2&gt;
                &lt;p&gt;For such a new website,maybe adding a access counter is a good idea,especially when we could collect the information of the access.when we have it ,we could analyze the data and apply it to our future work.&lt;/p&gt;
            </content>
            <author>
                <name>yunza80</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-07-12T06:16:45+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/liyu/blog/archive/2006/05/30/weblogentry-6" />
            <title>实现“单身”程序</title>
            <id>tag:www.opendesktop.net,2006-05-30:5ab6e2a2529332350897b82dd489dafd</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;就是同时只允许一个程序实例运行喽。提供可用于C和Python使用的代码片断。&lt;/h2&gt;
                &lt;p&gt;        这种需求似乎很常见。而简单的方法往往不尽人意，比如如果我们简单地使用一个普通文件作为“锁介质”的话，如果程序因为bug（我也不喜欢它，但这东东总是层出不穷，唉）什么的异常退出的话，如果不手动删除这个文件程序就永远也启动不起来了。虽然使用普通文件的方法有一些变通的技巧：比如定时写入一些数字，然后新程序启动时检查这种变化，如果没有这个数字变化，就说明原实例已经异常退出了，但这些技巧终究是难登大雅之堂的。&lt;/p&gt;&lt;p&gt;       我的实现方法是基于unixdomain socket的，但第一发明都肯定不是俺了，俺最早就是发现thunderbird使用这个方式。前些天修改程序遇到了这样的需求，于是兴起实现了一个，代码如下：&lt;/p&gt;/* oneinst.c */&lt;br /&gt;&lt;br /&gt;&lt;p&gt;#include &amp;lt;sys/socket.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/un.h&amp;gt;&lt;br /&gt;#include &amp;lt;time.h&amp;gt;&lt;br /&gt;#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;#include &amp;lt;string.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;#include &amp;lt;sched.h&amp;gt;&lt;br /&gt;#include &amp;lt;glib.h&amp;gt;&lt;br /&gt;&lt;br /&gt;struct check_param {&lt;br /&gt;    int singleton;    &lt;br /&gt;    char *lockname;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int&lt;br /&gt;create_instance_lock(int *singleton, char *lockname)&lt;br /&gt;{&lt;br /&gt;    int unsock, connfd;&lt;br /&gt;    struct sockaddr_un addr, cliaddr;&lt;br /&gt;    int clilen;&lt;br /&gt;&lt;br /&gt;    unlink(lockname);&lt;br /&gt;    addr.sun_family = AF_LOCAL;&lt;br /&gt;    strcpy(addr.sun_path, lockname);&lt;br /&gt;    unsock = socket(AF_LOCAL, SOCK_STREAM, 0);&lt;br /&gt;    if (unsock&amp;lt;0)    return -1;&lt;br /&gt;    if (bind(unsock, (struct sockaddr*)&amp;amp;addr, sizeof(addr)) &amp;lt; 0)&lt;br /&gt;        return -2;    &lt;br /&gt;    if (listen(unsock, 10)&amp;lt;0)&lt;br /&gt;        return -3;&lt;br /&gt;    fprintf(stderr, "I am running ...\n");&lt;br /&gt;    *singleton = 0;&lt;br /&gt;    for ( ; ; ) {&lt;br /&gt;        clilen = sizeof(cliaddr);&lt;br /&gt;        if ( (connfd = accept(unsock, (struct sockaddr*) &amp;amp;cliaddr, &amp;amp;clilen)) &amp;lt; 0) {&lt;br /&gt;            continue;&lt;br /&gt;        }&lt;br /&gt;        close(connfd);&lt;br /&gt;    }&lt;br /&gt;    close(unsock);&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*  &lt;br /&gt;    there is other instance running, return value more than 0,&lt;br /&gt;    elsewise I am first instance,  return 0,&lt;br /&gt;    return value less than 0, when any error occurs.&lt;br /&gt;*/&lt;br /&gt;int&lt;br /&gt;query_existing_instance(int retried, char *lockname)&lt;br /&gt;{&lt;br /&gt;    int unsock;&lt;br /&gt;    struct sockaddr_un addr;&lt;br /&gt;    const struct timespec req = {0, 500000};&lt;br /&gt;    struct timespec res;&lt;br /&gt;    &lt;br /&gt;    addr.sun_family = AF_LOCAL;&lt;br /&gt;    strcpy(addr.sun_path, lockname);&lt;br /&gt;    unsock = socket(AF_LOCAL, SOCK_STREAM, 0);&lt;br /&gt;    if (!unsock)    return -1;&lt;br /&gt;    if (retried &amp;lt;= 0)    retried = 5;&lt;br /&gt;    while (retried--) {&lt;br /&gt;        if (connect(unsock, (struct sockaddr*)&amp;amp;addr, sizeof(addr))&amp;lt;0 ) {&lt;br /&gt;            if (errno == ECONNREFUSED) {&lt;br /&gt;                perror("failed to connect other instance");&lt;br /&gt;                nanosleep(&amp;amp;req, &amp;amp;res);&lt;br /&gt;                continue;&lt;br /&gt;            }&lt;br /&gt;        } else {&lt;br /&gt;            return 1;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    close(unsock);&lt;br /&gt;    return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;gpointer&lt;br /&gt;detect_other_instance(struct check_param *p)&lt;br /&gt;{&lt;br /&gt;    int ret;&lt;br /&gt;&lt;br /&gt;    if (!p)    return NULL;&lt;br /&gt;    ret = query_existing_instance(3, p-&amp;gt;lockname);&lt;br /&gt;    if (0 == ret) {&lt;br /&gt;        create_instance_lock(&amp;amp;p-&amp;gt;singleton, p-&amp;gt;lockname);/* it should block */&lt;br /&gt;        fprintf(stderr, "failed to create singleton lock.\n");&lt;br /&gt;        p-&amp;gt;singleton = -2;&lt;br /&gt;        g_thread_exit(NULL);&lt;br /&gt;    } else if (ret&amp;gt;0) {&lt;br /&gt;        fprintf(stderr, "There is another instance running, quiting now.\n");&lt;br /&gt;        p-&amp;gt;singleton = 1;&lt;br /&gt;        g_thread_exit(NULL);&lt;br /&gt;    } else {&lt;br /&gt;        p-&amp;gt;singleton = -2;&lt;br /&gt;        fprintf(stderr, "We failed  on some errors.\n");&lt;br /&gt;    }&lt;br /&gt;    g_thread_exit(NULL);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int&lt;br /&gt;other_instance_running(char *lockname)&lt;br /&gt;{&lt;br /&gt;    GThread *thread;&lt;br /&gt;    GError *error=NULL;&lt;br /&gt;    struct check_param parm;&lt;br /&gt;        &lt;br /&gt;    if (!g_thread_supported ()) &lt;br /&gt;        g_thread_init(NULL);    &lt;br /&gt;     parm.singleton = -1;&lt;br /&gt;    parm.lockname = lockname;&lt;br /&gt;    thread = g_thread_create_full((GThreadFunc)detect_other_instance, &lt;br /&gt;                    &amp;amp;parm, &lt;br /&gt;                    0,&lt;br /&gt;                    FALSE,&lt;br /&gt;                    TRUE,&lt;br /&gt;                    G_THREAD_PRIORITY_LOW,&lt;br /&gt;                    &amp;amp;error);&lt;br /&gt;    if (!thread) {&lt;br /&gt;        fprintf(stderr, "failed to create new gthread : %s\n", error-&amp;gt;message);&lt;br /&gt;        g_error_free(error);&lt;br /&gt;        return -3;&lt;br /&gt;    }&lt;br /&gt;    while (parm.singleton == -1) sched_yield();&lt;br /&gt;    return parm.singleton;&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;嗯，难度不大，是不是？我这是使用的GLIB线程库，如果你愿意当然可以改成pthread的什么的。&lt;/p&gt;&lt;p&gt;下面是可以让python程序也可以使用这个功能所需的代码：&lt;/p&gt;&lt;br /&gt;&lt;p&gt;/* oneinst.h */&lt;/p&gt;&lt;br /&gt;&lt;p&gt;#ifndef ONEINST_H__&lt;br /&gt;#define ONEINST_H__&lt;br /&gt;extern other_instance_running(char *lockname);&lt;br /&gt;#endif&lt;br /&gt;&lt;/p&gt;&lt;p&gt;/* pyoneint.c */&lt;/p&gt;&lt;br /&gt;#include &amp;lt;Python.h&amp;gt;&lt;br /&gt;#include "oneinst.h"&lt;br /&gt;&lt;br /&gt;static PyObject*&lt;br /&gt;mice_other_instance_running(PyObject *self, PyObject *args)&lt;br /&gt;{&lt;br /&gt;    char *lockname;&lt;br /&gt;    PyObject *retobj=NULL;&lt;br /&gt;    int ret;&lt;br /&gt;&lt;br /&gt;    if (!PyArg_ParseTuple(args, "s", &amp;amp;lockname)) &lt;br /&gt;    goto OUT;&lt;br /&gt;&lt;br /&gt;    ret = other_instance_running(lockname);&lt;br /&gt;    if (ret&amp;gt;=0)&lt;br /&gt;        retobj = PyBool_FromLong(ret);&lt;br /&gt;    else&lt;br /&gt;        PyErr_SetString(PyExc_RuntimeError, "failed to check other instance");&lt;br /&gt;OUT:&lt;br /&gt;    return retobj;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static PyMethodDef PyMiceMethods[] = {&lt;br /&gt;    {"other_instance_running",  mice_other_instance_running, METH_VARARGS,&lt;br /&gt;     ""},&lt;br /&gt;    {NULL, NULL, 0, NULL}        /* Sentinel */&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PyMODINIT_FUNC&lt;br /&gt;initpyoneinst(void)&lt;br /&gt;{&lt;br /&gt;    Py_InitModule("pyoneinst", PyMiceMethods);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/* setup.py */&lt;br /&gt;&lt;br /&gt;#! /usr/bin/python2&lt;br /&gt;&lt;br /&gt;from distutils.core import setup, Extension&lt;br /&gt;import pipes&lt;br /&gt;import string&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;p1 = pipes.Template()&lt;br /&gt;p1.prepend("pkg-config gthread-2.0 --cflags", ".-")&lt;br /&gt;cflags = p1.open("/tmp/1", "r").read().strip()&lt;br /&gt;p2 = pipes.Template()&lt;br /&gt;p2.prepend("pkg-config gthread-2.0 --libs", ".-")&lt;br /&gt;loptions = p2.open("/tmp/2", "r").read().strip()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;def get_cflags_list(cflags):&lt;br /&gt;        cflags_list = string.split(cflags, " ")&lt;br /&gt;        ret = []&lt;br /&gt;        for one_flag in  cflags_list:&lt;br /&gt;                ret.append(one_flag[2:])&lt;br /&gt;        return ret&lt;br /&gt;&lt;br /&gt;def get_linkflags_list(loptions):&lt;br /&gt;    print loptions&lt;br /&gt;        all_options = string.split(loptions, " ")&lt;br /&gt;        libs = []&lt;br /&gt;        lib_dirs = []&lt;br /&gt;        for one_option in all_options:&lt;br /&gt;                if not one_option:&lt;br /&gt;                        continue&lt;br /&gt;                if one_option.startswith("-L"):&lt;br /&gt;                        lib_dirs.append(one_option[2:])&lt;br /&gt;                elif one_option.startswith("-l"):&lt;br /&gt;                        libs.append(one_option[2:])&lt;br /&gt;        else:&lt;br /&gt;                        libs.append(one_option[1:])   &lt;br /&gt;        return libs,lib_dirs&lt;br /&gt;&lt;br /&gt;cflags_list = get_cflags_list(cflags)&lt;br /&gt;cflags_list.append("../../..")&lt;br /&gt;libs, lib_dirs = get_linkflags_list(loptions)&lt;br /&gt;m = Extension('pyoneinst',&lt;br /&gt;                include_dirs = cflags_list,&lt;br /&gt;                libraries = libs,&lt;br /&gt;                library_dirs = lib_dirs,&lt;br /&gt;                sources = ['oneinst.c', 'pyoneinst.c'])&lt;br /&gt;&lt;br /&gt;setup (name='pyoneinst', version='0.1', description='oneinst module', ext_modules=[m])&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;还有一个毛坯版的Makefile.am，如果你不知道Makefile.am是什么东西的话，就忽略它吧：&lt;/p&gt;&lt;p&gt;EXTRA_DIST = oneinst.c oneinst.h pyoneinst.c setup.py testoneinst.py&lt;br /&gt;&lt;br /&gt;all-local:&lt;br /&gt;    python setup.py build&lt;br /&gt;    cp  build/lib*/pyoneinst.so .&lt;br /&gt;    rm build -fr&lt;br /&gt;    &lt;br /&gt;install-exec-local:&lt;br /&gt;    install -m 644 pyoneinst.so ${pkgdatadir}/netconfpkg&lt;br /&gt;    &lt;br /&gt;CLEANFILES := $(notdir $(wildcard *~)) $(notdir $(wildcard *\#)) $(notdir $(wildcard \.\#*)) build&lt;br /&gt;&lt;br /&gt;嘿！这下程序可以单身了! 不知你的程序会唱“单身情歌”否？嘿嘿&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Enjoy it.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
            </content>
            <author>
                <name>liyu</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-05-30T14:30:23+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/yunza80/blog/archive/2006/05/21/weblogentry-8" />
            <title>麦片和牛奶</title>
            <id>tag:www.opendesktop.net,2006-05-21:6b444c6c702dcadf0ef4aa749df5a69c</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;&lt;/h2&gt;
                &lt;p&gt;有次中午，我吃的就是这个，大家纷纷很奇怪的看着我，说这东西怎么能当正餐，还说是大补的东西，不利减肥。我笑笑，谁说减肥的人一定不能吃有营养的东西，谁说麦片和牛奶就比米饭炒菜要差，当然，午餐还是营养全面的好，但我就是好这口儿，没办法。&lt;/p&gt;
            </content>
            <author>
                <name>yunza80</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-05-21T21:35:27+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/yunza80/blog/archive/2006/05/21/weblogentry-7" />
            <title>现在该干什么呢，有个步骤才能继续阿</title>
            <id>tag:www.opendesktop.net,2006-05-21:4a5288f1ca86d55c357070288ad23d71</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;总觉得只要花上1个小时，可能半个小时就能搞明白我下一步的计划，只是自己头脑发晕，故意懒，不去思考这些，不行，该思考还是要继续的。&lt;/h2&gt;
                &lt;p&gt;&lt;br /&gt;不说别的了，该开始就要开始啊，别拖着，已经让某人很辛苦了，不能再让人家百白辛苦哦&lt;/p&gt;
            </content>
            <author>
                <name>yunza80</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-05-21T21:15:13+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/yunza80/blog/archive/2006/05/21/od" />
            <title>挺惭愧的，要把这个OD负责到底</title>
            <id>tag:www.opendesktop.net,2006-05-21:e2ac5c147e8eed92dd729f8e22227b4a</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;居然搁置了这么多天，再忙也不能做到一半就放手。&lt;/h2&gt;
                &lt;p&gt;&lt;br /&gt;居然搁置了这么多天，再忙也不能做到一半就放手。&lt;/p&gt;&lt;p&gt;这几天的确忙，一到周末就不想干事情，但是也不能把作了一半的东西就这么放手，对不起别人，也对不起自己。&lt;/p&gt;
            </content>
            <author>
                <name>yunza80</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-05-21T21:06:57+00:00</updated>
        </entry>
    
    
        <entry>
            <link rel="self"
                  href="http://www.opendesktop.net/Members/liyu/blog/archive/2006/05/15/understanding-linux-network-internals" />
            <title>Understanding Linux Network Internals</title>
            <id>tag:www.opendesktop.net,2006-05-15:60a016fe5ec0dfcb358cf99a9927ff7b</id>
            <content type="html"
                     xml:base="http://www.opendesktop.net"
                     xml:lang="en-US" xml:space="preserve">
                 &lt;h2&gt;&lt;/h2&gt;
                    早就听说，有一本叫&amp;lt;&amp;lt;Understanding Linux Network Internals&amp;gt;&amp;gt;的书。我非常想了解一下Linux是如何处理网络协议栈的，故而期待己久。这不，从eMule下载了好长时间才搞到。&lt;br /&gt;&lt;br /&gt;    果然，这本书没有令我失望。&lt;br /&gt;&lt;br /&gt;    (以下超链接的目标是无效的！它们是从CHM文件中复制出来的)&lt;br /&gt;&lt;br /&gt;           Copyright&lt;br /&gt;            Preface&lt;br /&gt;                  The Audience for This Book&lt;br /&gt;                  Background Information&lt;br /&gt;                  Organization of the Material&lt;br /&gt;                  Conventions Used in This Book&lt;br /&gt;                  Using Code Examples&lt;br /&gt;                  We'd Like to Hear from You&lt;br /&gt;                  Safari Enabled&lt;br /&gt;                  Acknowledgments&lt;br /&gt;            Part I:  General Background&lt;br /&gt;                     Chapter 1.  Introduction&lt;br /&gt;                  Section 1.1.  Basic Terminology&lt;br /&gt;                  Section 1.2.  Common Coding Patterns&lt;br /&gt;                  Section 1.3.  User-Space Tools&lt;br /&gt;                  Section 1.4.  Browsing the Source Code&lt;br /&gt;                  Section 1.5.  When a Feature Is Offered as a Patch&lt;br /&gt;                     Chapter 2.  Critical Data Structures&lt;br /&gt;                  Section 2.1.  The Socket Buffer: sk_buff Structure&lt;br /&gt;                  Section 2.2.  net_device Structure&lt;br /&gt;                  Section 2.3.  Files Mentioned in This Chapter&lt;br /&gt;                     Chapter 3.  User-Space-to-Kernel Interface&lt;br /&gt;                  Section 3.1.  Overview&lt;br /&gt;                  Section 3.2.  procfs Versus sysctl&lt;br /&gt;                  Section 3.3.  ioctl&lt;br /&gt;                  Section 3.4.  Netlink&lt;br /&gt;                  Section 3.5.  Serializing Configuration Changes&lt;br /&gt;            Part II:  System Initialization&lt;br /&gt;                     Chapter 4.  Notification Chains&lt;br /&gt;                  Section 4.1.  Reasons for Notification Chains&lt;br /&gt;                  Section 4.2.  Overview&lt;br /&gt;                  Section 4.3.  Defining a Chain&lt;br /&gt;                  Section 4.4.  Registering with a Chain&lt;br /&gt;                  Section 4.5.  Notifying Events on a Chain&lt;br /&gt;                  Section 4.6.  Notification Chains for the Networking Subsystems&lt;br /&gt;                  Section 4.7.  Tuning via /proc Filesystem&lt;br /&gt;                  Section 4.8.  Functions and Variables Featured in This Chapter&lt;br /&gt;                  Section 4.9.  Files and Directories Featured in This Chapter&lt;br /&gt;                     Chapter 5.  Network Device Initialization&lt;br /&gt;                  Section 5.1.  System Initialization Overview&lt;br /&gt;                  Section 5.2.  Device Registration and Initialization&lt;br /&gt;                  Section 5.3.  Basic Goals of NIC Initialization&lt;br /&gt;                  Section 5.4.  Interaction Between Devices and Kernel&lt;br /&gt;                  Section 5.5.  Initialization Options&lt;br /&gt;                  Section 5.6.  Module Options&lt;br /&gt;                  Section 5.7.  Initializing the Device Handling Layer: net_dev_init&lt;br /&gt;                  Section 5.8.  User-Space Helpers&lt;br /&gt;                  Section 5.9.  Virtual Devices&lt;br /&gt;                  Section 5.10.  Tuning via /proc Filesystem&lt;br /&gt;                  Section 5.11.  Functions and Variables Featured in This Chapter&lt;br /&gt;                  Section 5.12.  Files and Directories Featured in This Chapter&lt;br /&gt;                     Chapter 6.  The PCI Layer and Network Interface Cards&lt;br /&gt;                  Section 6.1.  Data Structures Featured in This Chapter&lt;br /&gt;                  Section 6.2.  Registering a PCI NIC Device Driver&lt;br /&gt;                  Section 6.3.  Power Management and Wake-on-LAN&lt;br /&gt;                  Section 6.4.  Example of PCI NIC Driver Registration&lt;br /&gt;                  Section 6.5.  The Big Picture&lt;br /&gt;                  Section 6.6.  Tuning via /proc Filesystem&lt;br /&gt;                  Section 6.7.  Functions and Variables Featured in This Chapter&lt;br /&gt;                  Section 6.8.  Files and Directories Featured in This Chapter&lt;br /&gt;                     Chapter 7.  Kernel Infrastructure for Component Initialization&lt;br /&gt;                  Section 7.1.  Boot-Time Kernel Options&lt;br /&gt;                  Section 7.2.  Module Initialization Code&lt;br /&gt;                  Section 7.3.  Optimized Macro-Based Tagging&lt;br /&gt;                  Section 7.4.  Boot-Time Initialization Routines&lt;br /&gt;                  Section 7.5.  Memory Optimizations&lt;br /&gt;                  Section 7.6.  Tuning via /proc Filesystem&lt;br /&gt;                  Section 7.7.  Functions and Variables Featured in This Chapter&lt;br /&gt;                  Section 7.8.  Files and Directories Featured in This Chapter&lt;br /&gt;                     Chapter 8.  Device Registration and Initialization&lt;br /&gt;                  Section 8.1.  When a Device Is Registered&lt;br /&gt;                  Section 8.2.  When a Device Is Unregistered&lt;br /&gt;                  Section 8.3.  Allocating net_device Structures&lt;br /&gt;                  Section 8.4.  Skeleton of NIC Registration and Unregistration&lt;br /&gt;                  Section 8.5.  Device Initialization&lt;br /&gt;                  Section 8.6.  Organization of net_device Structures&lt;br /&gt;                  Section 8.7.  Device State&lt;br /&gt;                  Section 8.8.  Registering and Unregistering Devices&lt;br /&gt;                  Section 8.9.  Device Registration&lt;br /&gt;                  Section 8.10.  Device Unregistration&lt;br /&gt;                  Section 8.11.  Enabling and Disabling a Network Device&lt;br /&gt;                  Section 8.12.  Updating the Device Queuing Discipline State&lt;br /&gt;                  Section 8.13.  Configuring Device-Related Information from User Space&lt;br /&gt;                  Section 8.14.  Virtual Devices&lt;br /&gt;                  Section 8.15.  Locking&lt;br /&gt;                  Section 8.16.  Tuning via /proc Filesystem&lt;br /&gt;                  Section 8.17.  Functions and Variables Featured in This Chapter&lt;br /&gt;                  Section 8.18.  Files and Directories Featured in This Chapter&lt;br /&gt;            Part III:  Transmission and Reception&lt;br /&gt;                     Chapter 9.  Interrupts and Network Drivers&lt;br /&gt;                  Section 9.1.  Decisions and Traffic Direction&lt;br /&gt;                  Section 9.2.  Notifying Drivers When Frames Are Received&lt;br /&gt;                  Section 9.3.  Interrupt Handlers&lt;br /&gt;                  Section 9.4.  softnet_data Structure&lt;br /&gt;                     Chapter 10.  Frame Reception&lt;br /&gt;                  Section 10.1.  Interactions with Other Features&lt;br /&gt;                  Section 10.2.  Enabling and Disabling a Device&lt;br /&gt;                  Section 10.3.  Queues&lt;br /&gt;                  Section 10.4.  Notifying the Kernel of Frame Reception: NAPI and netif_rx&lt;br /&gt;                  Section 10.5.  Old Interface Between Device Drivers and Kernel: First Part of netif_rx&lt;br /&gt;                  Section 10.6.  Congestion Management&lt;br /&gt;                  Section 10.7.  Processing the NET_RX_SOFTIRQ: net_rx_action&lt;br /&gt;                     Chapter 11.  Frame Transmission&lt;br /&gt;                  Section 11.1.  Enabling and Disabling Transmissions&lt;br /&gt;                     Chapter 12.  General and Reference Material About Interrupts&lt;br /&gt;                  Section 12.1.  Statistics&lt;br /&gt;                  Section 12.2.  Tuning via /proc and sysfs Filesystems&lt;br /&gt;                  Section 12.3.  Functions and Variables Featured in This Part of the Book&lt;br /&gt;                  Section 12.4.  Files and Directories Featured in This Part of the Book&lt;br /&gt;                     Chapter 13.  Protocol Handlers&lt;br /&gt;                  Section 13.1.  Overview of Network Stack&lt;br /&gt;                  Section 13.2.  Executing the Right Protocol Handler&lt;br /&gt;                  Section 13.3.  Protocol Handler Organization&lt;br /&gt;                  Section 13.4.  Protocol Handler Registration&lt;br /&gt;                  Section 13.5.  Ethernet Versus IEEE 802.3 Frames&lt;br /&gt;                  Section 13.6.  Tuning via /proc Filesystem&lt;br /&gt;                  Section 13.7.  Functions and Variables Featured in This Chapter&lt;br /&gt;                  Section 13.8.  Files and Directories Featured in This Chapter&lt;br /&gt;            Part IV:  Bridging&lt;br /&gt;                     Chapter 14.  Bridging: Concepts&lt;br /&gt;                  Section 14.1.  Repeaters, Bridges, and Routers&lt;br /&gt;                  Section 14.2.  Bridges Versus Switches&lt;br /&gt;                  Section 14.3.  Hosts&lt;br /&gt;                  Section 14.4.  Merging LANs with Bridges&lt;br /&gt;                  Section 14.5.  Bridging Different LAN Technologies&lt;br /&gt;                  Section 14.6.  Address Learning&lt;br /&gt;                  Section 14.7.  Multiple Bridges&lt;br /&gt;                     Chapter 15.  Bridging: The Spanning Tree Protocol&lt;br /&gt;                  Section 15.1.  Basic Terminology&lt;br /&gt;                  Section 15.2.  Example of Hierarchical Switched L2 Topology&lt;br /&gt;                  Section 15.3.  Basic Elements of the Spanning Tree Protocol&lt;br /&gt;                  Section 15.4.  Bridge and Port IDs&lt;br /&gt;                  Section 15.5.  Bridge Protocol Data Units (BPDUs)&lt;br /&gt;                  Section 15.6.  Defining the Active Topology&lt;br /&gt;                  Section 15.7.  Timers&lt;br /&gt;                  Section 15.8.  Topology Changes&lt;br /&gt;                  Section 15.9.  BPDU Encapsulation&lt;br /&gt;                  Section 15.10.  Transmitting Configuration BPDUs&lt;br /&gt;                  Section 15.11.  Processing Ingress Frames&lt;br /&gt;                  Section 15.12.  Convergence Time&lt;br /&gt;                  Section 15.13.  Overview of Newer Spanning Tree Protocols&lt;br /&gt;                     Chapter 16.  Bridging: Linux Implementation&lt;br /&gt;                  Section 16.1.  Bridge Device Abstraction&lt;br /&gt;                  Section 16.2.  Important Data Structures&lt;br /&gt;                  Section 16.3.  Initialization of Bridging Code&lt;br /&gt;                  Section 16.4.  Creating Bridge Devices and Bridge Ports&lt;br /&gt;                  Section 16.5.  Creating a New Bridge Device&lt;br /&gt;                  Section 16.6.  Bridge Device Setup Routine&lt;br /&gt;                  Section 16.7.  Deleting a Bridge&lt;br /&gt;                  Section 16.8.  Adding Ports to a Bridge&lt;br /&gt;                  Section 16.9.  Enabling and Disabling a Bridge Device&lt;br /&gt;                  Section 16.10.  Enabling and Disabling a Bridge Port&lt;br /&gt;                  Section 16.11.  Changing State on a Bridge Port&lt;br /&gt;                  Section 16.12.  The Big Picture&lt;br /&gt;                  Section 16.13.  Forwarding Database&lt;br /&gt;                  Section 16.14.  Handling Ingress Traffic&lt;br /&gt;                  Section 16.15.  Transmitting on a Bridge Device&lt;br /&gt;                  Section 16.16.  Spanning Tree Protocol (STP)&lt;br /&gt;                  Section 16.17.  netdevice Notification Chain&lt;br /&gt;                     Chapter 17.  Bridging: Miscellaneous Topics&lt;br /&gt;                  Section 17.1.  User-Space Configuration Tools&lt;br /&gt;                  Section 17.2.  Tuning via /proc Filesystem&lt;br /&gt;                  Section 17.3.  Tuning via /sys Filesystem&lt;br /&gt;                  Section 17.4.  Statistics&lt;br /&gt;                  Section 17.5.  Data Structures Featured in This Part of the Book&lt;br /&gt;                  Section 17.6.  Functions and Variables Featured in This Part of the Book&lt;br /&gt;                  Section 17.7.  Files and Directories Featured in This Part of the Book&lt;br /&gt;            Part V:  Internet Protocol Version 4 (IPv4)&lt;br /&gt;                     Chapter 18.  Internet Protocol Version 4 (IPv4): Concepts&lt;br /&gt;                  Section 18.1.  IP Protocol: The Big Picture&lt;br /&gt;                  Section 18.2.  IP Header&lt;br /&gt;                  Section 18.3.  IP Options&lt;br /&gt;                  Section 18.4.  Packet Fragmentation/Defragmentation&lt;br /&gt;                  Section 18.5.  Checksums&lt;br /&gt;                     Chapter 19.  Internet Protocol Version 4 (IPv4): Linux Foundations and Features&lt;br /&gt;                  Section 19.1.  Main IPv4 Data Structures&lt;br /&gt;                  Section 19.2.  General Packet Handling&lt;br /&gt;                  Section 19.3.  IP Options&lt;br /&gt;                     Chapter 20.  Internet Protocol Version 4 (IPv4): Forwarding and Local Delivery&lt;br /&gt;                  Section 20.1.  Forwarding&lt;br /&gt;                  Section 20.2.  Local Delivery&lt;br /&gt;                     Chapter 21.  Internet Protocol Version 4 (IPv4): Transmission&lt;br /&gt;                  Section 21.1.  Key Functions That Perform Transmission&lt;br /&gt;                  Section 21.2.  Interface to the Neighboring Subsystem&lt;br /&gt;                     Chapter 22.  Internet Protocol Version 4 (IPv4): Handling Fragmentation&lt;br /&gt;                  Section 22.1.  IP Fragmentation&lt;br /&gt;                  Section 22.2.  IP Defragmentation&lt;br /&gt;                     Chapter 23.  Internet Protocol Version 4 (IPv4): Miscellaneous Topics&lt;br /&gt;                  Section 23.1.  Long-Living IP Peer Information&lt;br /&gt;                  Section 23.2.  Selecting the IP Header's ID Field&lt;br /&gt;                  Section 23.3.  IP Statistics&lt;br /&gt;                  Section 23.4.  IP Configuration&lt;br /&gt;                  Section 23.5.  IP-over-IP&lt;br /&gt;                  Section 23.6.  IPv4: What's Wrong with It?&lt;br /&gt;                  Section 23.7.  Tuning via /proc Filesystem&lt;br /&gt;                  Section 23.8.  Data Structures Featured in This Part of the Book&lt;br /&gt;                  Section 23.9.  Functions and Variables Featured in This Part of the Book&lt;br /&gt;                  Section 23.10.  Files and Directories Featured in This Part of the Book&lt;br /&gt;                     Chapter 24.  Layer Four Protocol and Raw IP Handling&lt;br /&gt;                  Section 24.1.  Available L4 Protocols&lt;br /&gt;                  Section 24.2.  L4 Protocol Registration&lt;br /&gt;                  Section 24.3.  L3 to L4 Delivery: ip_local_deliver_finish&lt;br /&gt;                  Section 24.4.  IPv4 Versus IPv6&lt;br /&gt;                  Section 24.5.  Tuning via /proc Filesystem&lt;br /&gt;                  Section 24.6.  Functions and Variables Featured in This Chapter&lt;br /&gt;                  Section 24.7.  Files and Directories Featured in This Chapter&lt;br /&gt;                     Chapter 25.  Internet Control Message Protocol (ICMPv4)&lt;br /&gt;                  Section 25.1.  ICMP Header&lt;br /&gt;                  Section 25.2.  ICMP Payload&lt;br /&gt;                  Section 25.3.  ICMP Types&lt;br /&gt;                  Section 25.4.  Applications of the ICMP Protocol&lt;br /&gt;                  Section 25.5.  The Big Picture&lt;br /&gt;                  Section 25.6.  Protocol Initialization&lt;br /&gt;                  Section 25.7.  Data Structures Featured in This Chapter&lt;br /&gt;                  Section 25.8.  Transmitting ICMP Messages&lt;br /&gt;                  Section 25.9.  ICMP Statistics&lt;br /&gt;                  Section 25.10.  Passing Error Notifications to the Transport Layer&lt;br /&gt;                  Section 25.11.  Tuning via /proc Filesystem&lt;br /&gt;                  Section 25.12.  Functions and Variables Featured in This Chapter&lt;br /&gt;                  Section 25.13.  Files and Directories Featured in This Chapter&lt;br /&gt;            Part VI:  Neighboring Subsystem&lt;br /&gt;                     Chapter 26.  Neighboring Subsystem: Concepts&lt;br /&gt;                  Section 26.1.  What Is a Neighbor?&lt;br /&gt;                  Section 26.2.  Reasons That Neighboring Protocols Are Needed&lt;br /&gt;                  Section 26.3.  Linux Implementation&lt;br /&gt;                  Section 26.4.  Proxying the Neighboring Protocol&lt;br /&gt;                  Section 26.5.  When Solicitation Requests Are Transmitted and Processed&lt;br /&gt;                  Section 26.6.  Neighbor States and Network Unreachability Detection (NUD)&lt;br /&gt;                     Chapter 27.  Neighboring Subsystem: Infrastructure&lt;br /&gt;                  Section 27.1.  Main Data Structures&lt;br /&gt;                  Section 27.2.  Common Interface Between L3 Protocols and Neighboring Protocols&lt;br /&gt;                  Section 27.3.  General Tasks of the Neighboring Infrastructure&lt;br /&gt;                  Section 27.4.  Reference Counts on neighbour Structures&lt;br /&gt;                  Section 27.5.  Creating a neighbour Entry&lt;br /&gt;                  Section 27.6.  Neighbor Deletion&lt;br /&gt;                  Section 27.7.  Acting As a Proxy&lt;br /&gt;                  Section 27.8.  L2 Header Caching&lt;br /&gt;                  Section 27.9.  Protocol Initialization and Cleanup&lt;br /&gt;                  Section 27.10.  Interaction with Other Subsystems&lt;br /&gt;                  Section 27.11.  Interaction Between Neighboring Protocols and L3 Transmission Functions&lt;br /&gt;                  Section 27.12.  Queuing&lt;br /&gt;                     Chapter 28.  Neighboring Subsystem: Address Resolution Protocol (ARP)&lt;br /&gt;                  Section 28.1.  ARP Packet Format&lt;br /&gt;                  Section 28.2.  Example of an ARP Transaction&lt;br /&gt;                  Section 28.3.  Gratuitous ARP&lt;br /&gt;                  Section 28.4.  Responding from Multiple Interfaces&lt;br /&gt;                  Section 28.5.  Tunable ARP Options&lt;br /&gt;                  Section 28.6.  ARP Protocol Initialization&lt;br /&gt;                  Section 28.7.  Initialization of a neighbour Structure&lt;br /&gt;                  Section 28.8.  Transmitting and Receiving ARP Packets&lt;br /&gt;                  Section 28.9.  Processing Ingress ARP Packets&lt;br /&gt;                  Section 28.10.  Proxy ARP&lt;br /&gt;                  Section 28.11.  Examples&lt;br /&gt;                  Section 28.12.  External Events&lt;br /&gt;                  Section 28.13.  ARPD&lt;br /&gt;                  Section 28.14.  Reverse Address Resolution Protocol (RARP)&lt;br /&gt;                  Section 28.15.  Improvements in ND (IPv6) over ARP (IPv4)&lt;br /&gt;                     Chapter 29.  Neighboring Subsystem: Miscellaneous Topics&lt;br /&gt;                  Section 29.1.  System Administration of Neighbors&lt;br /&gt;                  Section 29.2.  Tuning via /proc Filesystem&lt;br /&gt;                  Section 29.3.  Data Structures Featured in This Part of the Book&lt;br /&gt;                  Section 29.4.  Files and Directories Featured in This Part of the Book&lt;br /&gt;            Part VII:  Routing&lt;br /&gt;                     Chapter 30.  Routing: Concepts&lt;br /&gt;                  Section 30.1.  Routers, Routes, and Routing Tables&lt;br /&gt;                  Section 30.2.  Essential Elements of Routing&lt;br /&gt;                  Section 30.3.  Routing Table&lt;br /&gt;                  Section 30.4.  Lookups&lt;br /&gt;                  Section 30.5.  Packet Reception Versus Packet Transmission&lt;br /&gt;                     Chapter 31.  Routing: Advanced&lt;br /&gt;                  Section 31.1.  Concepts Behind Policy Routing&lt;br /&gt;                  Section 31.2.  Concepts Behind Multipath Routing&lt;br /&gt;                  Section 31.3.  Interactions with Other Kernel Subsystems&lt;br /&gt;                  Section 31.4.  Routing Protocol Daemons&lt;br /&gt;                  Section 31.5.  Verbose Monitoring&lt;br /&gt;                  Section 31.6.  ICMP_REDIRECT Messages&lt;br /&gt;                  Section 31.7.  Reverse Path Filtering&lt;br /&gt;                     Chapter 32.  Routing: Li nux Implementation&lt;br /&gt;                  Section 32.1.  Kernel Options&lt;br /&gt;                  Section 32.2.  Main Data Structures&lt;br /&gt;                  Section 32.3.  Route and Address Scopes&lt;br /&gt;                  Section 32.4.  Primary and Secondary IP Addresses&lt;br /&gt;                  Section 32.5.  Generic Helper Routines and Macros&lt;br /&gt;                  Section 32.6.  Global Locks&lt;br /&gt;                  Section 32.7.  Routing Subsystem Initialization&lt;br /&gt;                  Section 32.8.  External Events&lt;br /&gt;                  Section 32.9.  Interactions with Other Subsystems&lt;br /&gt;                     Chapter 33.  Routing: The Routing Cache&lt;br /&gt;                  Section 33.1.  Routing Cache Initialization&lt;br /&gt;                  Section 33.2.  Hash Table Organization&lt;br /&gt;                  Section 33.3.  Major Cache Operations&lt;br /&gt;                  Section 33.4.  Multipath Caching&lt;br /&gt;                  Section 33.5.  Interface Between the DST and Calling Protocols&lt;br /&gt;                  Section 33.6.  Flushing the Routing Cache&lt;br /&gt;                  Section 33.7.  Garbage Collection&lt;br /&gt;                  Section 33.8.  Egress ICMP REDIRECT Rate Limiting&lt;br /&gt;                     Chapter 34.  Routing: Routing Tables&lt;br /&gt;                  Section 34.1.  Organization of Routing Hash Tables&lt;br /&gt;                  Section 34.2.  Routing Table Initialization&lt;br /&gt;                  Section 34.3.  Adding and Removing Routes&lt;br /&gt;                  Section 34.4.  Policy Routing and Its Effects on Routing Table Definitions&lt;br /&gt;                     Chapter 35.  Routing: Lookups&lt;br /&gt;                  Section 35.1.  High-Level View of Lookup Functions&lt;br /&gt;                  Section 35.2.  Helper Routines&lt;br /&gt;                  Section 35.3.  The Table Lookup: fn_hash_lookup&lt;br /&gt;                  Section 35.4.  fib_lookup Function&lt;br /&gt;                  Section 35.5.  Setting Functions for Reception and Transmission&lt;br /&gt;                  Section 35.6.  General Structure of the Input and Output Routing Routines&lt;br /&gt;                  Section 35.7.  Input Routing&lt;br /&gt;                  Section 35.8.  Output Routing&lt;br /&gt;                  Section 35.9.  Effects of Multipath on Next Hop Selection&lt;br /&gt;                  Section 35.10.  Policy Routing&lt;br /&gt;                  Section 35.11.  Source Routing&lt;br /&gt;                  Section 35.12.  Policy Routing and Routing Table Based Classifier&lt;br /&gt;                     Chapter 36.  Routing: Miscellaneous Topics&lt;br /&gt;                  Section 36.1.  User-Space Configuration Tools&lt;br /&gt;                  Section 36.2.  Statistics&lt;br /&gt;                  Section 36.3.  Tuning via /proc Filesystem&lt;br /&gt;                  Section 36.4.  Enabling and Disabling Forwarding&lt;br /&gt;                  Section 36.5.  Data Structures Featured in This Part of the Book&lt;br /&gt;                  Section 36.6.  Functions and Variables Featured in This Part of the Book&lt;br /&gt;                  Section 36.7.  Files and Directories Featured in This Part of the Book&lt;br /&gt;            About the Authors&lt;br /&gt;            Colophon&lt;br /&gt;            Index     &lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    我已经看了20多个chapter，感觉这本书非常容易明白。相对于&amp;lt;&amp;lt;linux networking architecture&amp;gt;&amp;gt;，行文也易懂多了，而且内容也比较新。虽然书没讲是哪个2.6版本的内核，但从片言只语中也可以看出至少是2.6.8以后的版本，但是linux的变化如此之快，关于ingress queue的流量控制的介绍已经与最新的代码不同了。但是暇不掩玉。&lt;br /&gt;&lt;br /&gt;    建议看完&amp;lt;&amp;lt;Understanding Linux Kernel&amp;gt;&amp;gt;和&amp;lt;&amp;lt;Linux Device Driver&amp;gt;&amp;gt;，再看这个。因为它对一些内核的基础设施的介绍并不完整。关于驱动那一块，是我见过的讲的最详细的材料了。&lt;br /&gt;&lt;br /&gt;
            </content>
            <author>
                <name>liyu</name>
            </author>
<!--        <issued tal:content=" python: DateTime(item.EffectiveDate()).strftime('%Y-%m-%dT%H:%M+00:00')"> -->
<!--        </issued> -->
            <updated>2006-05-27T12:29:13+00:00</updated>
        </entry>
    
</feed>

