ekg2  GIT master
rivchat.h
Idź do dokumentacji tego pliku.
1 /* some rivchat-magic-stuff based on protocol: http://akolacz.googlepages.com/RivChat-specyfikacja.PDF */
2 
3 #define RC_BROADCAST 0xFFFFFFFF
4 
5 #define RC_TIMEOUT 30 /* soft-timeout */
6 #define RC_PING_TIMEOUT 60 /* hard-timeout */
7 
8 #define RC_MAGICSIZE 11
9 #define RC_SIZE 328
10 #define RC_DATASIZE 256
11 #define RC_INFOSIZE 140
12 
13 #define RC_MESSAGE 0
14 #define RC_INIT 1
15 #define RC_NICKCHANGE 2
16 #define RC_QUIT 3
17 #define RC_ME 4
18 #define RC_PING 5
19 #define RC_NICKPROTEST 6
20 #define RC_TOPIC 7
21 #define RC_NEWTOPIC 8
22 #define RC_AWAY 9
23 #define RC_REAWAY 10
24 #define RC_KICK 11
25 #define RC_POP 12
26 #define RC_REPOP 13
27 #define RC_KICKED 14
28 #define RC_IGNORE 15
29 #define RC_NOIGNORE 16
30 #define RC_REPOPIGNORED 17
31 #define RC_ECHOMSG 18
32 #define RC_PINGAWAY 19
33 #define RC_FILEPROPOSE 20
34 #define RC_FILEREQUEST 21
35 #define RC_FILECANCEL 22
36 #define RC_FILECANCEL2 23 /* XXX, nie w protokole */
37 
38 static const char rivchat_magic[RC_MAGICSIZE] = { 'R', 'i', 'v', 'C', 'h', 'a', 't' /* here NULs */}; /* RivChat\0\0\0\0 */
39 
40 #define RC_PACKED __attribute__ ((packed))
41 
42 typedef struct {
43  char host[50];
44  char os[20];
45  char prog[18];
46  guint8 version[2];
47  guint8 away;
48  guint8 master;
49  guint32 slowa;
50  char user[32];
51  guint8 kod;
52  guint8 plec;
53  guint8 __pad1[2];
54  guint32 online;
55  guint8 filetransfer;
56  guint8 pisze;
57  guint8 __pad2[2];
58 } RC_PACKED rivchat_info_t;
59 
60 typedef struct {
61  char header[RC_MAGICSIZE]; /* rivchat_magic */
62  guint8 __pad1;
63  guint32 size;
64  guint32 fromid;
65  guint32 toid;
66  char nick[30];
67  guint8 __pad2[2];
68  guint32 type;
69  char data[RC_DATASIZE]; /* or RCINFO */
70  guint8 colors[3]; /* colors RGB values */
71  guint8 seq; /* sequence */
72 /* these 8bytes, can be uint64_t -> filesize */
73  guint8 gender; /* 1 - man, 2 - woman */
74  guint8 encrypted; /* we support encryption? */
75  guint8 bold; /* ? */
76  guint8 reserved[5];
77 } RC_PACKED rivchat_header_t;
78 
79 #define RC_FILETRANSFER 2
80 // #define RC_FILETRANSFER 0
81 #define RC_ENCRYPTED 0
#define RC_DATASIZE
Definition: rivchat.h:10
guint8 seq
Definition: rivchat.h:71
guint32 fromid
Definition: rivchat.h:64
static const char rivchat_magic[11]
Definition: rivchat.h:38
guint8 filetransfer
Definition: rivchat.h:55
guint8 bold
Definition: rivchat.h:75
guint8 away
Definition: rivchat.h:47
guint8 master
Definition: rivchat.h:48
guint8 kod
Definition: rivchat.h:51
guint32 toid
Definition: rivchat.h:65
guint8 gender
Definition: rivchat.h:73
guint8 encrypted
Definition: rivchat.h:74
#define RC_MAGICSIZE
Definition: rivchat.h:8
guint32 slowa
Definition: rivchat.h:49
#define RC_PACKED
Definition: rivchat.h:40
guint32 size
Definition: rivchat.h:63
guint8 pisze
Definition: rivchat.h:56
guint8 plec
Definition: rivchat.h:52
GdkColor colors[]
Definition: palette.c:63
guint32 online
Definition: rivchat.h:54
guint32 type
Definition: rivchat.h:68