使用PF_PACKET和SOCK_RAW發送自己定義type以太網數據包

本文介紹使用PF_PACKET和SOCK_RAW發送自己定義type以太網數據包,使用wireshare抓包能夠獲取到數據包,爲Linux內核添加網絡協議做鋪墊。 先上碼: #include <stdio.h> #include <stdlib.h> #include <unistd.h>           // close() #include <string.h>           //
相關文章
相關標籤/搜索