Netlink in kernel(continue) 0.1. netlink介绍netlink是一种用于内核和用户空间进行数据交互的socket。关于netlink的具体介绍,google给出更好的解释。 1234netlink是socket的一种,其的family号是PF_NETLINK.netlink包括很多种proto,并且用户可以根据自己的需要进行扩展。每个netlinksocket都有一个pid,该pid在所属proto下是唯一的。在ne 2013-03-15 Netlink #netlink
netlink grab 对nl_table的操作:读操作: netlink_lock_table 和 netlink_unlock_table写操作netlink_table_grab 和 netlink_table_ungrab 原子变量nl_table_users 用来保存对nl_table的读者引用计数。 只要没有进行的写者,即使有n个写者在等待,m个读者也可以同时读。当没有任何读者时,写着才可以获得权限 2013-03-11 Netlink #netlink
netlink bulk dump 0.0.0.0.1. 需求有时候我们需要从内核输出大量的消息。 例如,dump interface, xfrm sa,sp(几千甚至几万条)等 这些信息显然无法放到一个skb里。 这是我们需要借助netlinkcallback机制。 原理: 0.0.0.1. DATA STRUCTURE0.0.0.1.1. netlink_callback1234567891011121314 93 struc 2013-03-07 Netlink #netlink
Netlink in kernel 1. netlink socket framework.1.1. netlink socket proto netlink socket is a kind of socket. There are many proto of netlink. There may have many groups under each proto. See example in following. Every 2013-02-16 Netlink #netlink
Socket Basic Framework 0.1. socket typesocket is a widely used in kernel/net. There are many kind of sockets with different ‘family/proto’. They can be divided by family, and under each family, there are many kind 2013-02-16 Socket #Socket
Install html2markdown in Ubuntu(12.10) 0.0.1. Edit source.listensure the universe components is enabled.martin@PC:~/git/blog/_posts$ cat /etc/apt/sources.listdeb http://ubuntu.cn99.com/ubuntu/ quantal mainde 2013-02-12 Tools #Tools
mmap in kernel 0.1. call trace1234567> vmalloc> > __vmalloc_node_flags> > > __vmalloc_node> > > > __vmalloc_node_range> > > > > get_vm_area_node> > > > > v 2013-01-23 Memory #memory
Add or Udpate Xfrm Policy xfrm policy add/del/update 是通过netlink消息进行的。 其中xfrm_add_policy 用来添加 xfrm policy。 2012-11-10 XFRM #XFRM
Get or Delete Xfrm Policy 0.1. summaryxfrm_get_policy first locate the xfrm policy by policy index(from user space) or policy selector. if get_policy, alloc a new skb, and encapsulate the xfrm policy to it, then sent it. if 2012-11-10 XFRM #XFRM
Add a Ip Address on a Interface 0.1. summaryWhen a ip addr is added, two unicat route entries are added to route table.ex: 10.10.2.9/24 dev eth0 a host route entry is added to local table. The packet to local host will be rou 2012-08-29 Route #address