ekg2

plugins/rivchat/rivchat.h

Idź do dokumentacji tego pliku.
00001 /* some rivchat-magic-stuff based on protocol: http://akolacz.googlepages.com/RivChat-specyfikacja.PDF */
00002 
00003 #define RC_BROADCAST    0xFFFFFFFF
00004 
00005 #define RC_TIMEOUT      30      /* soft-timeout */
00006 #define RC_PING_TIMEOUT 60      /* hard-timeout */
00007 
00008 #define RC_MAGICSIZE     11
00009 #define RC_SIZE         328
00010 #define RC_DATASIZE     256
00011 #define RC_INFOSIZE     140
00012 
00013 #define RC_MESSAGE       0
00014 #define RC_INIT          1
00015 #define RC_NICKCHANGE    2
00016 #define RC_QUIT          3
00017 #define RC_ME            4
00018 #define RC_PING          5
00019 #define RC_NICKPROTEST   6
00020 #define RC_TOPIC         7
00021 #define RC_NEWTOPIC      8
00022 #define RC_AWAY          9
00023 #define RC_REAWAY       10
00024 #define RC_KICK         11
00025 #define RC_POP          12
00026 #define RC_REPOP        13
00027 #define RC_KICKED       14
00028 #define RC_IGNORE       15
00029 #define RC_NOIGNORE     16
00030 #define RC_REPOPIGNORED 17
00031 #define RC_ECHOMSG      18
00032 #define RC_PINGAWAY     19
00033 #define RC_FILEPROPOSE  20
00034 #define RC_FILEREQUEST  21
00035 #define RC_FILECANCEL   22
00036 #define RC_FILECANCEL2  23      /* XXX, nie w protokole */
00037 
00038 static const char rivchat_magic[RC_MAGICSIZE] = { 'R', 'i', 'v', 'C', 'h', 'a', 't' /* here NULs */};   /* RivChat\0\0\0\0 */
00039 
00040 #define RC_PACKED __attribute__ ((packed))
00041 
00042 typedef struct {
00043         char host[50];
00044         char os[20];
00045         char prog[18];
00046         uint8_t version[2];
00047         uint8_t away;
00048         uint8_t master;
00049         uint32_t slowa;
00050         char user[32];
00051         uint8_t kod;
00052         uint8_t plec;
00053         uint8_t __pad1[2];
00054         uint32_t online;
00055         uint8_t filetransfer;
00056         uint8_t pisze;
00057         uint8_t __pad2[2];
00058 } RC_PACKED rivchat_info_t;
00059 
00060 typedef struct {
00061         char header[RC_MAGICSIZE];              /* rivchat_magic */
00062         uint8_t __pad1;
00063         uint32_t size;
00064         uint32_t fromid;
00065         uint32_t toid;
00066         char nick[30];
00067         uint8_t __pad2[2];
00068         uint32_t type;
00069         char data[RC_DATASIZE];                 /* or RCINFO */
00070         uint8_t colors[3];                      /* colors RGB values */
00071         uint8_t seq;                            /* sequence */
00072 /* these 8bytes, can be uint64_t -> filesize */
00073         uint8_t gender;                         /* 1 - man, 2 - woman */
00074         uint8_t encrypted;                      /* we support encryption? */
00075         uint8_t bold;                           /* ? */
00076         uint8_t reserved[5];
00077 } RC_PACKED rivchat_header_t; 
00078 
00079 #define RC_FILETRANSFER 2
00080 // #define RC_FILETRANSFER 0
00081 #define RC_ENCRYPTED 0
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje