"ifconfig [dev_name] up"
int interface_up(char * interface_name)
{
    int s;
    if((s = socket(PF_INET,SOCK_STREAM,0)) < 0)
    {
        perror("Socket");
        return -1;
    }
    struct ifreq ifr;
    strcpy(ifr.ifr_name,interface_name);
    short flag;
    flag = IFF_UP;
    if(ioctl(s,SIOCGIFFLAGS,&ifr) < 0)
    {
        perror("ioctl");
        return -1;
    }
    ifr.ifr_ifru.ifru_flags |= flag;
    if(ioctl(s,SIOCSIFFLAGS,&ifr) < 0)
    {
        perror("ioctl");
        return -1;
    }
    return 0;
}

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

o_path.gif
The Internet Protocol (IP) is the heart of the Linux messaging system. While Linux (more or less) strictly adheres to the layering concept - and it is possible to use a different protocol (like ATM) - IP is almost always the nexus through which packets flow. The IP implementation of the network layer performs routing and forwarding as well as encapsulating data. See Figure 2.1 for a simplified diagram of how network packets move through the Linux kernel.
 

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

Sited from Vbird
----------------------------------------------------
awk 則比較傾向於一行當中分成數個『欄位』來處理

phchiu 發表在 痞客邦 留言(1) 人氣()

Static link:
Compiler時,
library加入程式碼

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

[轉貼]用GCC自製Library

引用: PTT看板: LinuxDev (作者: cole945)

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

  • Dec 01 Thu 2011 22:23
  • MTK

MediaTek真的頗累  
或者說裡面的人還滿厲害的
也可以說我太弱了orz
希望可以趕快進入狀況

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

What is callback?
簡單的說,如果你使用了某個function,那麼你就是『call』了一個function。
如果系統或是函式是要求你給一個function pointer,
這個function pointer指到一個實際的函式(多半這個函式是你自己寫的)。
然後它會在適當的時間呼叫此function,則此function就是所謂的 callback function。
因為這個function是被『callback』了。

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

1
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。