-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfserveTypes.h
More file actions
99 lines (71 loc) · 1.58 KB
/
Copy pathfserveTypes.h
File metadata and controls
99 lines (71 loc) · 1.58 KB
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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: fserveTypes.h
* Author: osrec
*
* Created on 19 March 2018, 21:32
*/
#ifndef FSERVETYPES_H
#define FSERVETYPES_H
// Defines the various types of tasks we can perform
typedef enum
{
FS_EVT_NODE_ACCEPT = 1,
FS_EVT_NODE_COMM = 2
} FSEventType;
typedef enum
{
FS_TSK_STREAM_FILE = 1,
FS_TSK_DELETE_FILE = 2
} FSTaskType;
typedef enum
{
FS_CONN_CONNECTING = 0x1 << 0,
FS_CONN_AUTHENTICATING = 0x1 << 1,
FS_CONN_READY = 0x1 << 2,
FS_CONN_STREAMINGOUT = 0x1 << 3,
FS_CONN_STREAMINGIN = 0x1 << 4,
FS_CONN_RECEIVING_COMMAND = 0x1 << 5,
FS_CONN_AWAITING_RESPONSE = 0x1 << 6,
FS_CONN_DOING_TASK = 0x1 << 7
} FSConnectionState;
typedef enum
{
FS_CONN_TYPE_CLIENT = 0x1 << 0,
FS_CONN_TYPE_NODE = 0x1 << 1,
FS_CONN_TYPE_HTTP_CLIENT = 0x1 << 2,
FS_CONN_TYPE_LISTENER = 0x1 << 3,
FS_CONN_TYPE_DUMMY = 0x1 << 4
} FSConnectionType;
typedef struct FSEvent
{
FSEventType eventType;
void *params;
} FSEvent;
typedef struct FSNetworkEventParams
{
unsigned long connNumber;
} FSNetworkEventParams;
// Task related structs
typedef struct FSTask
{
unsigned long connNumber;
FSTaskType taskType;
void * data;
} FSTask;
typedef struct FSConnection
{
int fd;
FSConnectionType type;
FSConnectionState stateCode;
long offset;
long length;
char * buffer;
unsigned long id;
int workerNumber;
} FSConnection;
#endif /* FSERVETYPES_H */