coal.h
Go to the documentation of this file.
1 /* Copyright (C) 2000-2006 Thomas Bopp, Thorsten Hampel, Ludger Merkens
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * $Id: coal.h,v 1.1 2008/03/31 13:39:57 exodusd Exp $
18  */
19 
20 /* COAL - Client object access layer */
21 #ifndef _COAL_H
22 #define _COAL_H
23 
24 #include "types.h"
25 
26 #define COAL_QUERY_COMMANDS 0
27 #define COAL_COMMAND 1
28 #define COAL_EVENT 2
29 #define COAL_LOGIN 3
30 #define COAL_LOGOUT 4
31 #define COAL_FILE_DOWNLOAD 5
32 #define COAL_FILE_UPLOAD 6
33 #define COAL_QUERY_PROGRAMS 7
34 #define COAL_ERROR 8
35 #define COAL_SET_CLIENT 9
36 #define COAL_UPLOAD_START 10
37 #define COAL_UPLOAD_PACKAGE 11
38 #define COAL_CRYPT 12
39 #define COAL_UPLOAD_FINISHED 13
40 #define COAL_PING 14
41 #define COAL_PONG 15
42 #define COAL_LOG 16
43 #define COAL_RETR_LOG 17
44 #define COAL_SUBSCRIBE 18
45 #define COAL_UNSUBSCRIBE 19
46 #define COAL_REG_SERVICE 20
47 #define COAL_RELOGIN 21
48 #define COAL_SERVERHELLO 22
49 #define COAL_GETOBJECT 23
50 #define COAL_SENDOBJECT 24
51 
52 #define COAL_TIMEOUT 600 // 10 minutes
53 
54 #define _COAL_OK 0
55 
56 #define SEND_ERROR(e, d, t, oid, cid, cmd, args, bt) send_message(coal_compose(t, COAL_ERROR, oid,cid, ({ e, d, cmd, args, bt }) ))
57 #define SEND_COAL(t, cmd, o, cid, a) send_message(coal_compose(t, cmd, o, cid, a ))
58 
59 #define HL_CMD 0
60 #define HL_ARGS 1
61 #define HL_REST 2
62 
63 #define COALLINE_TID 0
64 #define COALLINE_COMMAND 1
65 #define COALLINE_OBJECT 2
66 #define COALLINE_NAMESPACE 3
67 #define COALLINE_SERVER 4
68 
69 #define INT2BYTES(arg) str[1] = (arg & ( 255 << 24));\
70  str[2] = (arg & ( 255 << 16));\
71  str[3] = (arg & ( 255 << 8));\
72  str[4] = (arg & ( 255 ))
73 
74 #define COMMAND_BEGIN_MASK 255
75 #define COMMAND_RAW 127
76 
77 #define USE_LAST_TID -1
78 
79 #define LONG_INTEGER ((int)(1<<31)>0)
80 
81 #define COAL_TRANSFER_RCV 1
82 #define COAL_TRANSFER_SEND 2
83 #define COAL_TRANSFER_NONE 0
84 
85 #define CLIENT_CLASS_STEAM "steam"
86 #define CLIENT_CLASS_FTP "ftp"
87 #define CLIENT_CLASS_HTTP "http"
88 #define CLIENT_CLASS_SERVER "peer"
89 
90 #define CRYPT_KEY 512
91 #define CRYPT_WSIZE (CRYPT_KEY/16)
92 #define CRYPT_RSIZE (CRYPT_KEY/8)
93 
94 #define COAL_VERSION "1.0"
95 
96 #endif
97 
98 
99 
100 
101