forked from nefarius/sm-ext-socket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Define.h
58 lines (51 loc) · 1.17 KB
/
Define.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
#ifndef INC_SEXT_DEFINE_H
#define INC_SEXT_DEFINE_H
enum SM_ErrorType {
SM_ErrorType_EMPTY_HOST = 1,
SM_ErrorType_NO_HOST,
SM_ErrorType_CONNECT_ERROR,
SM_ErrorType_SEND_ERROR,
SM_ErrorType_BIND_ERROR,
SM_ErrorType_RECV_ERROR,
SM_ErrorType_LISTEN_ERROR,
};
enum SM_SocketType {
SM_SocketType_Tcp = 1,
SM_SocketType_Udp,
//SM_SocketType_Icmp,
};
enum SM_SocketOption {
// SourceMod level options
SM_SO_ConcatenateCallbacks = 1,
SM_SO_ForceFrameLock,
SM_SO_CallbacksPerFrame,
// Socket level options,
SM_SO_SocketBroadcast,
SM_SO_SocketReuseAddr,
SM_SO_SocketKeepAlive,
SM_SO_SocketLinger,
SM_SO_SocketOOBInline,
SM_SO_SocketSendBuffer,
SM_SO_SocketReceiveBuffer,
SM_SO_SocketDontRoute,
SM_SO_SocketReceiveLowWatermark,
SM_SO_SocketReceiveTimeout,
SM_SO_SocketSendLowWatermark,
SM_SO_SocketSendTimeout,
// ext options
SM_SO_DebugMode
};
struct SocketOption {
SocketOption(SM_SocketOption so, int value) : option(so), value(value) {}
SM_SocketOption option;
int value;
};
enum CallbackEvent {
CallbackEvent_Connect = 0,
CallbackEvent_Disconnect,
CallbackEvent_Incoming,
CallbackEvent_Receive,
CallbackEvent_SendQueueEmpty,
CallbackEvent_Error,
};
#endif