File: dostraffic.c

package info (click to toggle)
ns2 2.35%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 78,796 kB
  • sloc: cpp: 172,923; tcl: 107,130; perl: 6,391; sh: 6,143; ansic: 5,846; makefile: 816; awk: 525; csh: 355
file content (46 lines) | stat: -rw-r--r-- 1,162 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

#include "dostraffic.h"

void CBRTrafficGen(int NetworkDia, double H, int NoAttackers, int Master, double rate, struct DDOS_Traffic *traffic){
  struct flow_list *listroot = NULL;

  int no_hops;
  double flow,delay,total_bw;
  int i,cntr;

  for(i=0;i<NoAttackers;i++){
    no_hops = Power_law_no_hops(NetworkDia,H);
    if(Master==1)
      no_hops+=Power_law_no_hops(NetworkDia,H);
    delay = (double) no_hops;
    flow = rate;
    flow_list_insert(delay,flow,&listroot);
    cntr++;    
  }

   traffic->Events = get_all_events(listroot);
   traffic->NoEvents = get_no_events(listroot);
}


void CBRTrafficInet(int NetworkDia, int NoAttackers, int Master, double rate, struct DDOS_Traffic *traffic){
  struct flow_list *listroot = NULL;
  
  int no_hops;
  double flow,delay,total_bw;
  int i,cntr;
  
  for(i=0;i<NoAttackers;i++){
    no_hops = Inet_default_no_hops(NetworkDia);
    if(Master==1)
      no_hops+=Inet_default_no_hops(NetworkDia);
    delay = (double) no_hops;
    flow = rate;
    flow_list_insert(delay,flow,&listroot);
    cntr++;    
  }

   traffic->Events = get_all_events(listroot);
   traffic->NoEvents = get_no_events(listroot);

}