当前位置: 技术问答>linux和unix
linux下原始套接字打印问题
来源: 互联网 发布时间:2016-06-01
本文导语: #include #include #include #include #include #include #define BUFFER_MAX 2048 int main(int argc,char *argv[]) { int sock,nread,proto; char buff[BUFFER_MAX]; char *ethheader,*ipheader; if((sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_IP)))
#include
#include
#include
#include
#include
#include
#define BUFFER_MAX 2048
int main(int argc,char *argv[])
{
int sock,nread,proto;
char buff[BUFFER_MAX];
char *ethheader,*ipheader;
if((sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_IP)))
#include
#include
#include
#include
#include
#define BUFFER_MAX 2048
int main(int argc,char *argv[])
{
int sock,nread,proto;
char buff[BUFFER_MAX];
char *ethheader,*ipheader;
if((sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_IP)))