-
Notifications
You must be signed in to change notification settings - Fork 0
/
websocket.h
43 lines (35 loc) · 890 Bytes
/
websocket.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
/*
* File: websocket.h
* Author: frans
*
* Created on 3 maart 2016, 17:38
*/
#ifndef WEBSOCKET_H
#define WEBSOCKET_H
#define WebSocketKeyLength 24
typedef union { //this can't be right?, TODO: investigate
unsigned char value;
struct {
unsigned char KEYFOUND : 1,
SOCKETCONNECT : 1,
ISCONNECTED : 1,
SPARE1 : 1,
SPARE2 : 1,
SPARE3 : 1,
SPARE4 : 1,
SPARE5 : 1;
};
} Flags;
static Flags flags;
typedef union {
unsigned int value;
unsigned char FIN : 1;
unsigned char RSV : 3;
unsigned char OPCODE : 4;
} WebSocketFrame;
void AnswerClient(unsigned char *);
void ResetFlags(void);
void ReadClient(unsigned char);
void GetClientKeyIdent(unsigned char);
void Handshake(void);
#endif /* WEBSOCKET_H */