Statistics
| Branch: | Tag: | Revision:

sssimulator / ed.h @ 659ba19d

History | View | Annotate | Download (1.01 KB)

1
/*
2
 * this is sssim: the simple & stupid simulator
3
 *
4
 *  copyright (c) 2015 luca baldesi
5
 *
6
 *  this is free software; see gpl-3.0.txt
7
 */
8

    
9
#ifndef __ED_H__
10
#define __ED_H__ 1
11

    
12
#include <stdlib.h>
13
#include <stdio.h>
14
#include <string.h>
15

    
16
#include <event_scheduler.h>
17

    
18
#include "core.h"
19
#include "sched.h"
20
#include "stats.h"
21
#include "td.h"
22
#include "peer_event.h"
23

    
24
#define RECEPTION_DELAY 1
25

    
26
struct ed_simulator;
27

    
28
struct chunk *ed_loop(struct peer *peers, int num_peers, int num_chunks, int ts);
29

    
30
void ed_simulator_send_chunk(struct ed_simulator * eds, int chunk, struct peer * dst, float dl);
31

    
32
int ed_simulator_num_chunks(struct ed_simulator *eds);
33

    
34
void ed_simulator_receive_chunk(struct ed_simulator *eds, struct peer *p, int chunk);
35

    
36
void ed_simulator_status_print(struct ed_simulator * eds);
37

    
38
double ed_simulator_time(const struct ed_simulator *eds);
39

    
40
int ed_simulator_server_period(const struct ed_simulator *eds);
41

    
42
void ed_simulator_schedule(struct ed_simulator * eds, struct action_event * ae, double interval);
43

    
44
#endif
45

    
46