// clang -o raw raw.c && ./raw
#include
#include
#include
#include
#include
#include
#include
#define BUFFER_SIZE 65536
int main(int argc, char *argv[])
{
printf("Starting raw socket\n");
int sockfd, n;
char buffer[BUFFER_SIZE];
struct sockaddr_in addr;
struct iphdr *ip_header;
// 创建 socket
sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
if (sockfd saddr));
}
return 0;
}