This repository has been archived by the owner on May 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
udp-senderx.h
99 lines (77 loc) · 2.21 KB
/
udp-senderx.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef UDP_SENDER_H
#define UDP_SENDER_H
#include "udp-sender.h"
#include "udpcast.h"
#include "participants.h"
#include "statistics.h"
#include "socklib.h"
extern FILE *udpc_log;
struct fifo;
#define openFile udpc_openFile
#define openPipe udpcs_openPipe
#define localReader udpc_localReader
#define spawnNetSender udpc_spawnNetSender
#define startSender udpc_startSender
#define doSend udpc_doSend
int openFile(struct disk_config *config);
int openPipe(struct disk_config *config, int in, int *pid);
int localReader(struct disk_config *config, struct fifo *fifo, int in);
int spawnNetSender(struct fifo *fifo,
int sock,
struct net_config *config,
participantsDb_t db,
sender_stats_t stats);
int startSender(struct disk_config *disk_config,
struct net_config *net_config,
struct stat_config *stat_config,
const char *ifName);
#define BCAST_DATA(s, msg) \
doSend(s, &msg, sizeof(msg), &net_config->dataMcastAddr)
/**
* "switched network" mode: server already starts sending next slice before
* first one is acknowledged. Do not use on old coax networks
*/
#define FLAG_SN 0x0001
/**
* "not switched network" mode: network is known not to be switched
*/
#define FLAG_NOTSN 0x0002
/**
* Asynchronous mode: do not any confirmation at all from clients.
* Useful in situations where no return channel is available
*/
#define FLAG_ASYNC 0x0004
/**
* Point-to-point transmission mode: use unicast in the (frequent)
* special case where there is only one receiver.
*/
#define FLAG_POINTOPOINT 0x0008
/**
* Do automatic rate limitation by monitoring socket's send buffer
* size. Not very useful, as this still doesn't protect against the
* switch dropping packets because its queue (which might be slightly slower)
* overruns
*/
#ifndef WINDOWS
#define FLAG_AUTORATE 0x0008
#endif
#ifdef BB_FEATURE_UDPCAST_FEC
/**
* Forward error correction
*/
#define FLAG_FEC 0x0010
#endif
/**
* Use broadcast rather than multicast (useful for cards that don't support
* multicast correctly
*/
#define FLAG_BCAST 0x0020
/**
* Never use point-to-point, even if only one receiver
*/
#define FLAG_NOPOINTOPOINT 0x0040
/*
* Don't ask for keyboard input on sender end.
*/
#define FLAG_NOKBD 0x0080
#endif