|
13870
|
1 #ifndef _QQ_QQ_SEND_FILE_H_
|
|
|
2 #define _QQ_QQ_SEND_FILE_H_
|
|
|
3
|
|
|
4 #include "ft.h"
|
|
|
5
|
|
|
6 typedef struct _ft_info {
|
|
|
7 guint32 to_uid;
|
|
|
8 guint16 send_seq;
|
|
|
9 guint8 file_session_key[16];
|
|
|
10 guint8 conn_method;
|
|
|
11 guint32 remote_internet_ip;
|
|
|
12 guint16 remote_internet_port;
|
|
|
13 guint16 remote_major_port;
|
|
|
14 guint32 remote_real_ip;
|
|
|
15 guint16 remote_minor_port;
|
|
|
16 guint32 local_internet_ip;
|
|
|
17 guint16 local_internet_port;
|
|
|
18 guint16 local_major_port;
|
|
|
19 guint32 local_real_ip;
|
|
|
20 guint16 local_minor_port;
|
|
|
21 /* we use these to control the packets sent or received */
|
|
|
22 guint32 fragment_num;
|
|
|
23 guint32 fragment_len;
|
|
|
24 /* The max index of sending/receiving fragment
|
|
|
25 * for sender, it is the lower bolder of a slide window for sending
|
|
|
26 * for receiver, it seems that packets having a fragment index lower
|
|
|
27 * than max_fragment_index have been received already
|
|
|
28 */
|
|
|
29 guint32 max_fragment_index;
|
|
|
30 guint32 window;
|
|
|
31
|
|
|
32 /* It seems that using xfer's function is not enough for our
|
|
|
33 * transfer module. So I will use our own structure instead
|
|
|
34 * of xfer provided
|
|
|
35 */
|
|
|
36 int major_fd;
|
|
|
37 int minor_fd;
|
|
|
38 int sender_fd;
|
|
|
39 int recv_fd;
|
|
|
40 union {
|
|
|
41 FILE *dest_fp;
|
|
|
42 guint8 *buffer;
|
|
|
43 };
|
|
|
44 gboolean use_major;
|
|
|
45 } ft_info;
|
|
|
46
|
|
|
47 void qq_process_recv_file_accept
|
|
|
48 (guint8 * data, guint8 ** cursor, gint data_len, guint32 sender_uid,
|
|
|
49 GaimConnection * gc);
|
|
|
50 void qq_process_recv_file_reject
|
|
|
51 (guint8 * data, guint8 ** cursor, gint data_len, guint32 sender_uid,
|
|
|
52 GaimConnection * gc);
|
|
|
53 void qq_process_recv_file_cancel
|
|
|
54 (guint8 * data, guint8 ** cursor, gint data_len, guint32 sender_uid,
|
|
|
55 GaimConnection * gc);
|
|
|
56 void qq_process_recv_file_request
|
|
|
57 (guint8 * data, guint8 ** cursor, gint data_len, guint32 sender_uid,
|
|
|
58 GaimConnection * gc);
|
|
|
59 void qq_process_recv_file_notify
|
|
|
60 (guint8 * data, guint8 ** cursor, gint data_len, guint32 sender_uid,
|
|
|
61 GaimConnection * gc);
|
|
|
62 gboolean qq_can_receive_file(GaimConnection *gc, const char *who);
|
|
|
63 void qq_send_file(GaimConnection *gc, const char *who, const char *file);
|
|
|
64 void qq_get_conn_info(guint8 *data, guint8 **cursor, gint data_len, ft_info *info);
|
|
|
65 gint qq_fill_conn_info(guint8 *data, guint8 **cursor, ft_info *info);
|
|
|
66 #endif
|