-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdolly.h
83 lines (62 loc) · 2.08 KB
/
dolly.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
#ifndef DOLLY_H
#define DOLLY_H
static const char version_string[] = "0.64.3, 26-APR-2022";
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/poll.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <netinet/tcp.h>
#include <assert.h>
#include <ctype.h>
#include <signal.h>
#include "dollytab.h"
#include "transmit.h"
#define DOLLY_NONBLOCK 1 /* Use nonblocking network sockets */
#define WRITE 1
#define READ 2
extern FILE *stdtty; /* file pointer to the standard terminal tty */
/* Clients need the ports before they can listen, so we use defaults. */
extern const unsigned int dataport;
extern const unsigned int ctrlport;
extern const char* host_delim;
/* File descriptors for file I/O */
extern int input, output;
/* Numbers for splitted input/output files */
extern unsigned int input_nr, output_nr;
/* size of buffers for TCP sockets (approx. 100KB, multiple of 4 KB) */
extern unsigned int buffer_size ;
#define SCKBUFSIZE buffer_size
/* Normal sockets for data transfer */
extern int datain[MAXFANOUT], dataout[MAXFANOUT];
extern int datasock;
/* Special sockets for control information */
extern int ctrlin, ctrlout[MAXFANOUT];
extern int ctrlsock;
extern unsigned long long maxbytes; /* max bytes to transfer */
extern unsigned long long maxcbytes;/* -- " -- in compressed mode */
extern int dosync; /* sync() after transfer */
extern int timeout; /* Timeout for startup */
extern int verbignoresignals; /* warn on ignore signal errors */
extern int max_retries;
extern char dollytab[256];
extern int flag_log;
extern char logfile[256];
/* Pipe descriptor in case data must be uncompressed before write */
extern int pd[2];
/* Pipe descriptor in case input data must be compressed */
extern int id[2];
/* PIDs of child processes */
extern int in_child_pid, out_child_pid;
#endif