Here is the good introduction for igmp iptv.

https://www.apac-juniper.net/juniper_public/campaign/pdf/iptv/sc/200188.pdf


horace papa 發表在 痞客邦 留言(0) 人氣()

Layout of SKB data area This first diagram illustrates the layout of the SKB data area and where in that area the various pointers in 'struct sk_buff' point.

The rest of this page will walk through what the SKB data area looks like in a newly allocated SKB. How to modify those pointers to add headers, add user data, and pop headers.

Also, we will discuss how page non-linear data areas are implemented. We will also discuss how to work with them.

 


        skb = alloc_skb(len, GFP_KERNEL);

Layout of freshly allocated SKB This is what a new SKB looks like right after you allocate it using alloc_skb()

As you can see, the head, data, and tail pointers all point to the beginning of the data buffer. And the end pointer points to the end of it. Note that all of the data area is considered tail room.

The length of this SKB is zero, it isn't very interesting since it doesn't contain any packet data at all. Let's reserve some space for protocol headers using skb_reserve()

 


        skb_reserve(skb, header_len);

Layout of SKB after skb_reserve() This is what a new SKB looks like right after the skb_reserve() call.

Typically, when building output packets, we reserve enough bytes for the maximum amount of header space we think we'll need. Most IPV4 protocols can do this by using the socket value sk->sk_prot->max_header.

When setting up receive packets that an ethernet device will DMA into, we typically call skb_reserve(skb, NET_IP_ALIGN). By default NET_IP_ALIGN is defined to '2'. This makes it so that, after the ethernet header, the protocol header will be aligned on at least a 4-byte boundary. Nearly all of the IPV4 and IPV6 protocol processing assumes that the headers are properly aligned.

Let's now add some user data to the packet.

 


    unsigned char *data = skb_put(skb, user_data_len);
        int err = 0;
        skb->csum = csum_and_copy_from_user(user_pointer, data,
                                            user_data_len, 0, &err);
        if (err)
                goto user_fault;

Layout of SKB after skb_reserve() This is what a new SKB looks like right after the user data is added.

skb_put() advances 'skb->tail' by the specified number of bytes, it also increments 'skb->len' by that number of bytes as well. This routine must not be called on a SKB that has any paged data. You must also be sure that there is enough tail room in the SKB for the amount of bytes you are trying to put. Both of these conditions are checked for by skb_put() and an assertion failure will trigger if either rule is violated.

The computed checksum is remembered in 'skb->csum'. Now, it's time to build the protocol headers. We'll build a UDP header, then one for IPV4.

 

horace papa 發表在 痞客邦 留言(0) 人氣()

 原文載於: 背包客棧自助旅行論壇 http://www.backpackers.com.tw/forum/showthread.php?p=2598034

 

對汽車空調
分享一下淺見
如有誤,請大家指正

在修車廠維修空調時,技師回達車主
狀況排行榜第一名永遠都是
壓縮機壞了….
管路有漏,沒有冷媒了….


但實際狀況是否真的是如此
有待車主需簡易的對自己車車輕微的小認知一下

在如此昂貴且重要的壓縮機,其實都有些保護元件,避免壓縮機太過於容易壞
原文載於: 背包客棧自助旅行論壇 http://www.backpackers.com.tw/forum/showthread.php?p=2598034
(但若車體有碰撞或事故,不在此文所涉及範圍內,畢竟我不是達人)

horace papa 發表在 痞客邦 留言(0) 人氣()

http://infocenter.arm.com/help/topic/com.arm.doc.dai0201a/index.html


horace papa 發表在 痞客邦 留言(0) 人氣()

sharesome link for porting MIPS driver to arm base suffering issue

 http://www.serverphorums.com/read.php?12,306199,309710

 


horace papa 發表在 痞客邦 留言(0) 人氣()

Porting WIFI driver suffers a problem that compile error message " error: implicit declaration of function 'dma_cache_maint' ".

I found the function "dma_map_single" can relace by "dma_cache_maint".


 


horace papa 發表在 痞客邦 留言(0) 人氣()

柚木(TEAK),马鞭草科,是世界公认的著名珍贵木材,其中以泰国、缅甸为最佳,因泰国已禁止砍伐,所以以缅甸进口的为上品。柚木从生长到成材最少经50年,生长期缓慢,其密度及硬度较高,不易磨损;柚木富含铁质和油质,这种铁质和油质使之保持不变形,防虫、防蚁、防酸碱,特别防潮、耐腐,且带有一种自然的醇香。优美的墨线、斑斓的油影,构成柚木独特的天然纹理;更为神奇的是,它的刨光面颜色能通过光合作用氧化而成金黄色,且颜色随时间的延长而更加美丽。

正因柚木有此优良特性,古今中外许多保存完好的古建筑,几乎都是采用柚木做装饰。在中国最繁华的上海滩上那些久远漂亮的建筑物(如汇丰银行、海关大楼、和平饭店等)都采用柚木装饰,虽历经百年沧桑,却依然完好如初,亮丽如新。在欧美,柚木不仅是一种装饰材料,也是一种保值商品,更成为富贵的象征。

随着人们对更高生活品质的追求,柚木地板走入寻常百姓家,成为了高档物业地板市场的主角。但却时常有消费者抱怨“如何买到正宗的缅甸柚木地板”是件很头疼的事情。

由于利益的驱使,市场上假冒的柚木地板可谓是前赴后继,因此要在市场上买到正宗的柚木地板确实不是件容易的事。花了大价钱买了假柚木地板,或贪一时小便宜买了假柚木地板屡见报端。森林之旅经营了二十多年的柚木,专做柚木地板也有九年时间,在这里给柚木地板消费者一些建议和教大家一些识别方法。

森林之旅建议消费者在购买柚木地板时一定要在销售凭证上注明“柚木实木地板”,最好是写上“缅甸柚木实木地板”字样。这能保证在发生纠纷时有证据来维护自己的权益,但还是不能从根本上解决问题。森林之旅认为最重要的是把工作做在前面,选择对的远比事后维权来的舒心。纵观整个柚木地板市场,森林之旅发现冒充缅甸柚木地板主要有三法:
柚木地板
一、自提身价法:以同一树种冒充缅甸柚木。市场上主要采用标有“印尼柚木”、“非洲柚木”、“南美柚木”、“巴西柚木”、“马来西亚柚木”、“尼日利亚柚木”、“圭亚那柚木”等名称的做法。实际上即使属于同一树种,因产地不同,其质地、价格也相差甚远、更有甚者,根本不是柚木树种,价格相差更远。这些非洲及美洲的柚木,因为种植地区气候不同,树木的生长周期短,树龄10年就能成材,油质相对下降很多,已失去柚木油质丰富的特性,材质干燥易裂。因此用"非洲柚木"或者"南美柚木"等加工的木地板实际上已经算不上真正的柚木地板了。

冠以泰柚叫卖的,殊不知因泰国禁止砍伐,天然原始林的泰柚在市场上几乎不存在。现在陆陆续续有部分从泰国进口的柚木,也基本就是泰国的人工林柚木。

二、冒充替代法:用相似或相近纹理、密度的树种冒充缅甸柚木。市场上最多的是黑心木莲冒充缅甸柚木,令外行人很难辨认。
 
三、臆造名法:主要有:金丝柚、金柚木、柚木王、柚木皇、紫金柚、柚檀、铁柚、美柚等,事实上这些树种世界上根本不存在,充其量不过是一些杂木而已。

费者了解了柚木地板假冒三法就能做到心中有数,但在购买的时候一样要注意分辨。以下是森林之旅教给大家一些鉴别真假柚木地板的方法,大部分分辨方法是建立在素板或背面不封漆的基础上的,如果全部封漆再加上在工艺上做一些手脚的话,就很难予以分辨。

horace papa 發表在 痞客邦 留言(0) 人氣()

copy from

http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html

Why libraries are used:

This methodology, also known as "shared components" or "archive libraries", groups together multiple compiled object code files into a single file known as a library. Typically C functions/C++ classes and methods which can be shared by more than one application are broken out of the application's source code, compiled and bundled into a library. The C standard libraries and C++ STL are examples of shared components which can be linked with your code. The benefit is that each and every object file need not be stated when linking because the developer can reference the individual library. This simplifies the multiple use and sharing of software components between applications. It also allows application vendors a way to simply release an API to interface with an application. Components which are large can be created for dynamic use, thus the library remain separate from the executable reducing it's size and thus disk space used. The library components are then called by various applications for use when needed.

 


Linux Library Types:

There are two Linux C/C++ library types which can be created:

  1. Static libraries (.a): Library of object code which is linked with, and becomes part of the application.
  2. Dynamically linked shared object libraries (.so): There is only one form of this library but it can be used in two ways.
    1. Dynamically linked at run time but statically aware. The libraries must be available during compile/link phase. The shared objects are not included into the executable component but are tied to the execution.
    2. Dynamically loaded/unloaded and linked during execution (i.e. browser plug-in) using the dynamic linking loader system functions.

 

Library naming conventions:

Libraries are typically names with the prefix "lib". This is true for all the C standard libraries. When linking, the command line reference to the library will not contain the library prefix or suffix.

Thus the following link command: gcc src-file.c -lm -lpthread
The libraries referenced in this example for inclusion during linking are the math library and the thread library. They are found in /usr/lib/libm.a and /usr/lib/libpthread.a.

 


Static Libraries: (.a)

How to generate a library:

  • Compile: cc -Wall -c ctest1.c ctest2.c
    Compiler options:
    • -Wall: include warnings. See man page for warnings specified.
  • Create library "libctest.a": ar -cvq libctest.a ctest1.o ctest2.o
  • List files in library: ar -t libctest.a
  • Linking with the library:
    • cc -o executable-name prog.c libctest.a
    • cc -o executable-name prog.c -L/path/to/library-directory -lctest
  • Example files:
    • ctest1.c
      void ctest1(int *i)
      {
      *i=5;
      }
    • ctest2.c
      void ctest2(int *i)

horace papa 發表在 痞客邦 留言(0) 人氣()


一.   arm-linux-objcopy被用来复制一个目标文件的内容到另一个文件中,可用于不同源文件的之间的格式转换
二.   示例:
Arm-linux-objcopy –o binary –S elf_file bin_file

三.   常用的选项:
input-file , outflie
输入和输出文件,如果没有outfile,则输出文件名为输入文件名

2.-l bfdname或—input-target=bfdname
用来指明源文件的格式,bfdname是BFD库中描述的标准格式名,如果没指明,则arm-linux-objcopy自己分析
3.-O bfdname 输出的格式
4.-F bfdname 同时指明源文件,目的文件的格式
5.-R sectionname 从输出文件中删除掉所有名为sectionname的段
6.-S 不从源文件中复制重定位信息和符号信息到目标文件中
7.-g 不从源文件中复制调试符号到目标文件中


horace papa 發表在 痞客邦 留言(0) 人氣()

所有文件在附件里
确保你已经安装了开发工具
1.使用新立得安装libusb
2.复制45-jlink.rules到/etc/udev/rules.d/下,重新启动
3.添加组plugdev,并且把当前用户添加到这个组里面
sudo groupadd plugdev
sudo usermod -a -G plugdev 用户名
4.解压openocd-0.4.0.tar.bz2
tar jxvf openocd-0.4.0.tar.bz2
5.编译openocd
cd openocd-0.4.0
./configure --prefix=/opt/openocd --enable-jlink
make && make install
6.修改/etc/environment在PATH添加/opt/openocd/bin路径
sudo gedit /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/openocd/bin"
7.拷贝配置文件到开发的目录
cp /opt/openocd/share/openocd/scripts/interface/jlink.cfg ./

horace papa 發表在 痞客邦 留言(0) 人氣()