PIXNET Logo登入

日常瑣碎事

跳到主文

紀錄生活點點滴滴

部落格全站分類:心情日記

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 12月 14 週三 201119:59
  • Control network interface using "ioctl" instead of "ifconfig"

"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) 人氣(229)

  • 個人分類:工作
▲top
  • 12月 14 週三 201110:05
  • The Network Traffic Path

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) 人氣(164)

  • 個人分類:工作
▲top
  • 12月 07 週三 201121:59
  • shell: awk command

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

(繼續閱讀...)
文章標籤

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

  • 個人分類:工作
▲top
  • 12月 06 週二 201119:31
  • static link & Dynamic Link & Load

Static link:
Compiler時,
library加入程式碼
(繼續閱讀...)
文章標籤

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

  • 個人分類:工作
▲top
  • 12月 02 週五 201112:19
  • Using GCC to create static and shared library .so

[轉貼]用GCC自製Library

引用: PTT看板: LinuxDev (作者: cole945)
(繼續閱讀...)
文章標籤

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

  • 個人分類:工作
▲top
  • 12月 01 週四 201122:23
  • MTK

MediaTek真的頗累  
或者說裡面的人還滿厲害的
也可以說我太弱了orz
希望可以趕快進入狀況
(繼續閱讀...)
文章標籤

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

  • 個人分類:工作
▲top
  • 12月 01 週四 201113:59
  • Callback Function

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

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

  • 個人分類:工作
▲top
1

個人資訊

phchiu
暱稱:
phchiu
分類:
心情日記
好友:
累積中
地區:

熱門文章

  • (13,994)cache miss types
  • (8,131)static link & Dynamic Link & Load
  • (147)Callback Function

文章分類

  • 工作 (7)
  • 課業 (15)
  • 未分類文章 (1)

最新文章

  • Control network interface using "ioctl" instead of "ifconfig"
  • The Network Traffic Path
  • shell: awk command
  • static link & Dynamic Link & Load
  • Using GCC to create static and shared library .so
  • MTK
  • Callback Function
  • Inter-Machine Communication(x86<->Cell<->PAC Duo)
  • Native C applications for Android
  • Compile Android kernel from the source

最新留言

  • [19/02/11] 訪客 於文章「shell: awk command...」留言:
    大師您好: 想請問一下, 如果我的資料每一行欄位都不固定,...

動態訂閱

文章精選

文章搜尋

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: